Presentation is loading. Please wait.

Presentation is loading. Please wait.

Running the Operational Codes for the Brahmaputra

Similar presentations


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

1 Running the Operational Codes for the Brahmaputra
Tom Hopson

2 Schematic of the 1-10day discharge forecasting sequence for the Brahmaputra and Ganges rivers (which was fully-automated in 2004). Boxes with circles done using CRON. Describe CRON next and how to download NASA TRMM data.

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 .

4 Note: you may need to specify full paths of programs since SHELL
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: Entry Description Equivalent To @reboot Run once, at startup. None @yearly Run once a year * @annually (same * @monthly Run once a month * * @weekly Run once a week 0 0 * * 0 @daily Run once a day 0 0 * * * @midnight (same 0 0 * * * @hourly Run once an hour 0 * * * * 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:
Some examples …

6 First steps using Linux commands:
Go to the directory cd /home/hp/Desktop/CRONtalk

7 CRON file example: Create a file called, say, “cron_ex”, with: * * * * * echo "trying this out!" >> /home/hp/Desktop/CRONtalk/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)

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

9 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.

10

11 To run the forecasting codes:
Go to the Desktop/practical cd /home/hp/Desktop/practical 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

12


Download ppt "Running the Operational Codes for the Brahmaputra"

Similar presentations


Ads by Google