|
||||||||||||||||||||||||||||||||||||||||||||||||||||
In the previous two sections, as will be the case in many of the subsequent sections, the top navigation bar contained two links, one to a LINUX (or MacOS) script and the other to a WINDOWS batch file. Instead of following the step-by-step instructions to run the example through the GUI, it is possible to directly execute a series of commands that will accomplish the same task. Furthermore, the CONTROL file generated by these scripts can be Retrieved into the GUI to run the example again through the GUI. In this case, depending upon where you installed the Tutorial, the location of the meteorological files may have to be changed. Scripting will only be addressed indirectly in this tutorial to facilitate some of the examples and only a rudimentary knowledge of the commands is needed. However, the advanced topics tutorial is entirely devoted to scripted examples. In this section, we will review the steps contained in the previous batch file that was used to run the concentration example. If you are running LINUX scripts, you may first need to convert them from DOS format using the dos2unix command.
Open the main script test_conc.bat in notepad where you can see that it is composed of seven sections. The first section sets the batch file execution parameters. The second section sets the value of script variables relating to file locations. The third section creates the ASCDATA.CFG file which points to the directory that contains various default files used by HYSPLIT. The fourth section creates the main CONTROL file for HYSPLIT listing start times, locations, and other important parameters. The fifth section gives the command that actually runs the model. The sixth section creates the graphic label file and runs the concentration plotting program. The seventh, and last section, displays the concentration graphic, and deletes the label file before closing.
Each of these commands could be typed line-by-line on the command line, or you could just simply type the name of the test_conc.bat file and windows knows to execute the commands in the file. When a procedure is to be run multiple times, there are clear advantages to scripting. However, a hidden advantage is that scripts permit customization of certain procedures using program options that are not always available through the GUI. All HYSPLIT programs are in the \hysplit\exec directory. To see the options associated with concplot, type: \hysplit\exec\concplot without any arguments which yields a very long list of command line options. Only some of these are available through the GUI, but all of them could be implemented through the command line or script. Other scripting examples can be found in \hysplit\testing\xrun.bat, which runs through a series of different calculations. Example scripts for Windows, TCL, and UNIX, can be found in the HYSPLIT \examples and \scripts directories. Batch files to mimic other GUI applications, especially the programs called, and their command line options, can be determined by examining the relevant tcl script in the \hysplit\guicode directory. Batch file commands can be displayed from the command prompt by typing help. |