Presentation is loading. Please wait.

Presentation is loading. Please wait.

Running the Operational Codes for the Brahmaputra Tom Hopson.

Similar presentations


Presentation on theme: "Running the Operational Codes for the Brahmaputra Tom Hopson."— Presentation transcript:

1 Running the Operational Codes for the Brahmaputra Tom Hopson

2 Daily Operational Flood Forecasting Sequence

3 Automatic (background) Job Processing: CRON Cron is a time-base job scheduler in Unix-like computer operating systems. 'cron' is short for 'chronograph’. Cron enables users to schedule jobs (commands or shell scripts) to run automatically at a certain time or date. It is commonly used to perform system maintenance or administration, though its general purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email.

4 Crontab file:.---------------- minute (0 - 59) |.------------- hour (0 - 23) | |.---------- day of month (1 - 31) | | |.------- month (1 - 12) OR jan,feb,mar,apr... | | | |.---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat | | | | | * * * * * command to be executed There are several special entries, most of which are just shortcuts, that can be used instead of specifying the full cron entry: EntryDescriptionEquivalent To @rebootRun once, at startup.None @yearlyRun once a year0 0 1 1 * @annually(same as @yearly)0 0 1 1 * @monthlyRun once a month0 0 1 * * @weeklyRun once a week0 0 * * 0 @dailyRun once a day0 0 * * * @midnight(same as @daily)0 0 * * * @hourlyRun once an hour0 * * * * Note: you may need to specify full paths of programs since SHELL (“dot” files) are not used by CRON

5 More on crontab file execution timing … There are several ways of specifying multiple date/time values in a field: The comma (',') operator specifies a list of values, for example: "1,3,4,7,8" (space inside the list must not be used) The dash ('-') operator specifies a range of values, for example: "1-6", which is equivalent to "1,2,3,4,5,6" The asterisk ('*') operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to 'every hour' (subject to matching other specified fields). There is also an operator which some extended versions of cron support, the slash ('/') operator (called "step"), which can be used to skip a given number of values. For example, "*/3" in the hour time field is equivalent to "0,3,6,9,12,15,18,21". So "*" specifies 'every hour' but the "*/3" means only those hours divisible by 3. The meaning of '/' specifier, however, means "when the modulo is zero" rather than "every". For example, "*/61" in the minute will in fact be executed hourly, not every 61 minutes.

6 CRON file example: Create a file called, say, “cron_ex”, with: * * * * * echo "trying this out!" > cron_test Then type: >crontab cron_ex (to install the CRON job) >crontab -l (to see if it is working in the CRON environment >date (to make sure a minute has passed) After a minute in your directory, you should see a file “cron_test” >cat cron_test (to see the output) Then type >crontab -r (to remove)

7 CRON IDL example: Create a file called, say, “cron_idl”, with: * * * * * /tools/itt/idl/bin/idl</home/”user”/infile_IDL Then create infile_IDL with:.rnew /home/”user”/testcron.pro testcron exit And create testcron.pro with PRO testcron spawn,"echo 'trying this out!' > cron_test2" openw,1,'cron_test3' printf,1,'trying this out!' close,1 end And do as before to install … (then type >crontab -r to remove when finished)

8 CRON IDL example 2: Now do as before with the file getRT.pro, and do as before to install … … and you’re now downloading NASA TRMM satellite precipitation data automatically! (then type >crontab -r to remove when finished) Note about the “wget” command: GNU Wget is a computer program that retrieves content from web servers, and is part of the GNU Project. Its name is derived from World Wide Web and get, connotative of its primary function. It currently supports downloading via HTTP, HTTPS, and FTP protocols, the most popular TCP/IP-based protocols used for web browsing.

9 Daily Operational Flood Forecasting Sequence

10 To run the forecasting codes: Type the following in the “Practical directory” >tar xspjSlf tarForecast.tbz2 Then go to the created Training/ directory Modify line 20 of the program se_fcstwkarma_w2s.pro to specify the working directory of the codes Start up IDL, then type >se_fcstwkarma_w2s,1 … and off it goes When finished, look at the plots in the “scratch” directory

11


Download ppt "Running the Operational Codes for the Brahmaputra Tom Hopson."

Similar presentations


Ads by Google