In this section we will discuss installing HYSPLIT on a UNIX or Linux system. The Windows and Mac distributions come with all the executables precompiled. However for installation on a UNIX or Linux system the code must be compiled locally or precompiled binaries installed. If you're participating in a workshop, you may have the precompiled binaries provided to you. In this case you would install HYSPLIT in a manner similar to which was done for the Macintosh. You would have a tar file which you would then untar and generate the link in the working directory to the main executable in the GUI code directory.  

But for this example we are assuming that you have gotten the source code from the ARL NOAA web site and you downloaded it according to the instructions that was provided to you. In that situation you will have a directory, a HYSPLIT directory which should be composed of several subdirectories and some scripts.

Now when you do the download for the first time, you will not have this version.txt file. The version.txt file provides information as to the current version of the model.  So what I'm going to do is do another update. We did the instructions with SVN or WGET to get the source code and the subdirectories.  For now, I’m going to run an update, so we’re just going to run this script to get the latest version HYSPLIT. And it's going to be connected to a server.  You may have to modify the script to add the password. The script that's provided with the download may not have the password.  And we're going to export and the computer connects to the HYSPLIT SVN repository server and downloads the latest version of HYSPLIT.  You should probably do this periodically after you've installed HYSPLIT to ensure that that you keep up with the changes. The export command actually copies everything. You may want to switch to one of the version control commands rather than export. This way you would be only updating components that have changed. So now that you’ve done the update you should have the version.txt file which of course I had before and you can now see we have the latest version.

So the next step is the compilation. Before compiling we are assuming that you have installed the supplemental software on your PC, which means Tcl/Tk, Ghostscript, and ImageMagick.  I’m not going to go through these installations. But once you’ve done this, there are scripts that are provided for compilation. So we have to go to the trunk directory, change directory to trunk, and that's where the main code resides and where we have the compile script.

I’m going to delete the log file which actually for new downloads you will not have. And the default compiler is gfortran. I will show you how to change that in a moment. Let’s assume that you already have gfortran as the default compiler, which is pretty common on a Linux system. And at this point all you need to do is run the compile script.  And while this runs I'm going to review what actually is happening here. 

So let’s just do compile.sh.  And the first thing it did was to make sure that the carriage return and line feeds, the end of line characters, were correct. At times there is a mix between updates that are done on windows PC and Linux systems. It goes through and builds various libraries. Right now it's building all the subroutines that HYSPLIT requires. So if I look at this, what's happening here, you can see the different steps involved. And right now it's compiling the source library.  It uses the version information which is included in some of the programs, which is the version number.

Let's take a look at what's actually being run here. So if we if we go to the Library directory. So that’s where we’re going to go now just so you can see what's happening.  The HYSPLIT library, which is showing all the subroutines that are involved with HYSPLIT, and if I were to look at the Makefile, you can see here that the default  compiler is gfortran and it uses these command line options to do the compilation.

So for instance, if you have a different compiler, for instance, you're running Intel Fortran. You would comment out these lines and uncomment these lines and in this case you'd be using then the compiler flags for the Intel compiler.

As the compilation is proceeding, if you notice here, we are now building the executables.  So as this is going on, let's go back to trunk, to see what's going on. Let’s looks back in compile.sh, so we are in this step right now, and you can see that messages are going to a log file. So that if for some reason the script terminates here, because there was an error message, then you have to open up the compiled.log file to find out where it stopped and then take the appropriate corrective action.

Once this section is completed and then it goes into the auxiliary programs, for instance, now it is doing the ASCII to shape converters and now it's doing the …, and now it's not almost finished here. The last step was that it built these auxiliary components, one of which was the editors for shape, the auxiliary files, and the text information for shape files.  The decoder for WRF/ARW which uses netCDF libraries, so you have to have net CDF installed.  Here you need to make the change to point out which netCDF libraries you are using.  Also there's CMAQ decoders, the Community Air-Quality Model.  And then the last step, it generates a link so that you can run HYSPLIT from the working directory.

So if you were to go into working, you'll see the HYSPLIT4 link and it opens up HYSPLIT just like it would on the PC.  One of the things we recommend on the Linux machine, is that if you are compiling, it would be good to test to make sure that your compilation is correct.  So go to the testing directory and run a script called xrun.scr, which actually goes through multiple examples of HYSPLIT and generates output files.  I'm not going to let it complete, but I want to just stop it.

You can see we generated results here.  Open, results.ps. And you would generate a Postscript file with different examples to ensure that HYSPLIT is working correctly.

And that concludes how to set up HYSPLIT on a Linux system.