FILE: ReadMe.1st

Programs to generate Cligen station (.PAR) files from online GDS daily inter-
national precipitation and temperature data are available in this directory.
Generating such a file permits the user to make Cligen runs producing daily 
climate outputs to drive simulation models such as WEPP or WEPS.  The required
file is produced by generating monthly parameters from the available daily
temperature and precipitation data, and substituting those that are not 
available from a matching existing U. S. station.

**************************************************************************
*** NOTE: Always check the "Updates.txt" file in this directory to see ***
***       whether there have been any changes since the last time you  ***
***       visited this site.  Also check the bottom of _this_ file.    ***
**************************************************************************

These programs and the associated files are intended to be accessed from within 
the same DOS window within Windows.  Using the source code provided in the 
"Source Code" folder on this webpage, they may also be compiled to run in a 
single directory under Linux or Unix.

##################################################################################
     FILES IN THIS FOLDER:

ReadMe.1st -- This file.

.GDS files -- The daily international data taken from Arlin Nicks' computer 
              after his death.  Some of the data, for example China, could 
              not be recovered.  These files are available through a link on
              the Cligen website or at 
                  ftp://hydrolab.arsusda.gov/pub/nicks/countries 

GenStPar.exe -- Program to generate the top 12 lines of the station .par file.
              The file produced has the same "basename" as the original .gds file,
              but has a .top extension.  Values generated include means and
              standard deviations for precip and temp, skewness for precip,
              and transition probabilities for precip.  Note: tp5 and tp6 
              values (which cannot be computed from the daily temp & precip 
              data) are set to zero.  They will need to be replaced later, 
              using the values from the surrogate station.

WEPP_CountryCodes.txt -- File containing country names, and corresponding
              3-character country codes used by the WEPP soil erosion model
              graphic user interface.  If program GenStPar can find a match, 
              it will use it -- swapping the order of the city and country 
              (putting the city first).  If not, it will leave this as it was 
              in the .GDS file.

.TOP files -- Top 12 lines of a .par file (station file) generated by 
              GenStPar.exe from the daily temp & precip data in the .GDS file.

FindMatch.exe -- Program to find the ten best-matching stations for use as a 
              surrogate station, from the several thousand U. S. station files.
              The program builds a .par file using the .top file produced in
              the previous step, and substitutes the remaining parameters
              (for which there is no data) from the best-matching surrogate 
              station.  Name of the surrogate station is appended to the 
              bottom of the file.  If another surrogate is preferred, simply 
              use a text editor to replace the top 12 lines of the new 
              surrogate with the .top file, and replace tp5 & tp6 with the new 
              surrogate's values.

AllStations.par -- All the thousands of U. S. Cligen station files provided
              by the U. S. Forest Service, concatenated into one large file.
              The program FindMatch uses this file to find a match (surrogate
              station) to provide the parameters that cannot be generated from
              the daily tmeperature and precip data in the GDS files.

AllStations.zip -- A zipped version of AllStations.par for faster downloads.

.PAR files -- Complete Cligen station file, permitting Cligen runs of any
              length the user chooses.  Name of surrogate U. S. station is 
              appended to the end, if generated by FindMatch.


##################################################################################
   INPUT (GDS) DATA FORMATS:

Unfortunately, the formats listed on the site from which I downloaded
the GDS data (http://hydrolab.arsusda.gov/nicks/nicks.htm) are wrong -- 
as are the .PAR files that I examined there.  I have notified the webmaster.  
Also, be aware that there is missing data (denoted by -999), and there may 
be incorrect or inconsistent data.  For example, I noticed a station with 
more than 60 minutes in a coordinate.  A minute is a 60th of a degree, so 
this does not make sense.  But overall, the data seems to be usable, and 
it's the best we have....

The formats I listed are are in the style of the FORTRAN programming
language.  So "i2" means a 2-digit integer; "a46" means a 46-digit
ASCII string; "2x" means skip two spaces; and "f5.1" is a 5-digit floating
point number with one decimal place.  When a number with preceeding spaces 
is read, the spaces are interpreted as zeros. 

Here is a sample from the first few lines of the file 06235.GDS. 

06400 BELGIUM              KOKSIJDE                 5108  35735     5 
771001  13018  12018 -99932M-R-O-R-R 0 0              
771002  13017  11018 -99932M-O-ORO-O 0 0              
771003  14018   6018 -99932M-O-O-OOO 0 0              
771004  150 9  10017    032T-R-ORO-O 0 0              
771005  140 0  100 0    032TOOOORROR 0 0              
771006  170 0  110 8   9032 RRLRRRRR 0 0              
771007  140 0  120 0   2032 FOOOLROO 0 0              
771008  170 0   90 1    032TF-FFOORO 0 0              
....

 First Line: 
  (i2,i3,a46,i3,i2,2x,i3,i2,i6) 
   ID_sta, ID_cty, StationName, Lat(deg), Lat(min), Lon(deg), Lon(min), Elev(m)

ID_sta = 06
ID_cty = 235
StationName = " BELGIUM              KOKSIJDE                "
Lat(deg) = 051
Lat(min) = 08
Lon(deg) = 357
Lon(min) = 35
Elev(m) = 000005

 and Following Lines:
  (3i2,2(f5.1,2x),f5.1) --- it is  4 cols
   Year, Month, Day, Max-Temp(C), Min-Temp(C), Precip(0.1mm)

771001  13018  12018 -99932M-R-O-R-R 0 0

Year = 77
Month = 10
Day = 01
Max-Temp(C) = 13.0
Min-Temp(C) = 12.0
Precip (0.1mm) = -99.9  (that is, the precip data is missing for that day)



              


