In these next few sections we will review some of the tools that are provided with HYSPLIT that can be used to analyze multiple trajectories.  The main difference between this section and the previous trajectory sections was that before we tended to work with one output file, if there were multiple trajectories that information was written in a single file. But in most of these cases, in fact all of these cases under the trajectory statistics section, we will be looking at multiple output files and how we can analyze those files.  And each file will only contain one trajectory.  So we're going to start with a simple approach of frequency analysis.

In the frequency analysis method, what we simply do is count trajectories.  We establish an arbitrary grid over the trajectory domain and we count the number of trajectories that intersect each grid point of that domain. In the simplest approach, a trajectory can only intersect a grid point once, so if we divide, we sum over all the trajectories, for each grid point divided by the total number of trajectories and multiply by a hundred, that essentially gives us a frequency.  So as an example, the source grid point, every single trajectory, so the I,J is at the source, every single trajectory will contribute to that location.  Therefore at the source, F will be 100, 100%.  

Now there is a residence time option.  And in that case a trajectory may intersect a grid cell more than one time.  If we're not, as I mentioned, if we’re not looking at residence time, and a trajectory can only intersect a grid cell once, then the total count can never exceed one.  But if we turn on the residence time option, then the total count, for any one trajectory, can be up to the number of end points that are along any one trajectory.  The default endpoint interval is one hour, so a 24 hour trajectory, in theory if it never moves off of a grid point, could have a contribution up to 24.  So that is the background of this approach.  So what we're going to do next is compute trajectories for a month and let's see what the likelihood is of say doing a tracer release.  I'm doing the month of September by looking at the average flow by using trajectory analysis.

So the first thing we need to do is, go to the trajectory setup run menu, and let's go ahead and retrieve the CONTROL file for the forward mid boundary layer trajectory.  Now we want to do calculations for the entire month, so we will start on September 1st at zero UTC, and we loaded the Dayton location, and we don't need to run for 68 hours, but let's just do a simple 48 hour trajectory in the forward direction, and let's give this a unique file name, let’s call it fdump, for instance. And let’s use a meteorological file that has the entire month of September, data for the entire month of September, and that would be the Global Reanalysis, but the one for the month of September, not just for CAPTEX.  That would be RP198309.gbl.  So let’s save this. 

Now we just configured, really just one trajectory, so what we have to do is go into special runs, and the menu is called daily, so instead of doing one trajectory, we want to invoke a script that will do multiple trajectories on a daily basis.  And as you can see we're going to start on September 1st, so this information was obtained from the set up run menu, and we want to start a calculation, let’s start a trajectory every six hours, leave that as a default.  Now if we’re doing a two day trajectory, we know that September only has 28 days so to have the last trajectory complete, we need to make this 28. If we wanted to go through September 30, then we would also need to include the October meteorological data, in this case we're only going to use September.  So now we can execute the script, and you can see as each trajectory calculation is completed, a message is written to the standard output.

And we've completed the calculation. So it didn't take very long. Now let's go to the next step, which would be under display, but we're not going to display a single trajectory, but we’re going to display the trajectory frequency. The first thing we need to do is create a file of trajectory filenames and the script will use a wild card to find all trajectory files that start with dump.  And this will create an output file, the frequency output file, and we're going to use a grid resolution, well we can use anything we like, but we're going to use a grid resolution of 1°,  and we're not going to use the residence time option yet, and we will look at all trajectories.  You can select trajectories based on the height, in this case we don't care, we’re looking at all trajectories, and the output file will be called freqplot.

So the first thing, let's create, this is step one, which is the file of trajectory filenames, and it creates a file called INFILE.  If we open up the working directory, and you really should do this, you'll see that here we have all the fdump files that we created, they are tagged with the starting time of the trajectory, and then we have the INFILE, which is the file of filenames. If we were to open this in Notepad, you can see the list of all the files.  Now there's one problem, there is a file called fdump, without any identification afterward.  This is a file that we have created earlier, in a previous section, so we know we do not want this file, so we delete that, and we do a save.  So now the INFILE file lists all the files that we want and so we can go ahead and execute display.  

And you can see the program called trajfreq with some different input options, like the grid and so on, and processed a 112 files, and there we have the trajectory frequency plot, and you can see the maximum here at the red point is 100%, so that is the trajectory starting location at Dayton.  And the bulk of the trajectories seem to be going along the, more than 10% if you will, along the Canadian US border.  If I were to redo this calculation, but this time set the residence time flag to yes, there's a much more, higher frequency of occurrence in the domain that was set up for doing the CAPTEX Experiment.  So the residence time is important, it all depends on the particular application that you are dealing with.  In terms of tracer analysis, we do care about the residence time, because the longer the tracer is in the grid cell, the greater the likelihood of capturing that sample.

The last point I want to make is that we did run this program called trajfreq, that analyzed the trajectories that we calculated.  If I were to look at the batch file, you can see the actual command that was used in this calculation. Many of the post-processing programs that are supplied with the HYSPLIT package have multiple options associated with them. 

So if I were to open up the command prompt and go to the hysplit4/exec directory, and if I were to type trajfreq,  without any command line options, the program lists all the options that are available. The point I'm making here is that what you can do through the graphical user interface is usually only a subset of the options that are available for any particular application.  So there are more than two options for residence time. There are different sorting options in terms of selecting which files that one can use, and this is true of many of the programs.

As an example the trajectory plotting program trajplot also has many more options then available through the graphical user interface, including setting colors and things like that. So if you have applications that you want to do that do not conform necessarily to something that’s within the graphical user interface, you can use these batch files as a starting point to develop more complex kinds of analyses.

And I would point out that the, for instance the batch file that's provided here to do the four frequency calculations is very similar to the script that is contained within the graphical user interface, except in this programming languages, the Windows batch file language, whereas in the graphical user interface, the run daily script and the frequency analysis scripts are written in TCL.

So this concludes the discussion of trajectory frequency analysis.  Do not delete any of these files they will be used in the next section.