PROGRAM THETAFAO

     version 0.7: Last Modified 11/2022
     First created: 06/2013 v0.5
     WRITTEN FOR: EU FOCUS PRZM/VFSMOD tool 
     Written by: R. Munoz-Carpena (rmc)
                 University of Florida, carpena@ufl.edu
                 
1. Description:
Program to calculate soil moisture content between runoff events.
This is a necessary step for continuous simulation of the PRZM/VFSMOD
EU FOCUS tool. The result of the calculation will produce the initial
moisture content of the soil (OI) for the next VFSMOD run in the time
series. It follows FAO-56 adjusted ET calculations (Allen et al.,1998)
based on Dr. M. Quemada (U. Politecnica Madrid) spreadsheet calculations
and good results in the comparison with field measured soil moisture. 
To obtain a brief desription of the program use simply type the program
name at the command line. Full documentation is provided here,
http://abe.ufl.edu/carpena/vfsmod/FOCUSreports.shtml

2. Input parameters:
  a) File .IN
  isoiltype (USDA, S:Sand;L:Loam;s:Silt;C:Clay):-1:user,1:S,2:LS,3:SL,4:L,5:sL,6:s,7:sCL,8:sC,9:C
  OI(m3/m3): top soil initial water content (same as in VFSMOD *.iso file)
  Zr(m): maximum grass root zone depth (typical values (0.5-1.5 m)
  pfrac[-]: fraction of easily estractable water (typical 0.6 for Bermuda grass)
  Hm(m): height of vegetation (from VFSMOD *.igr file, H(cm)/100)
  FC,soil(isoiltype,1): top soil field capacity (m3/m3)
  WPsoil(isoiltype,2): top soil wilting point (m3/m3)
  
  b) File .MET
  Daily meteorological parameters. If selected by the user the crop coefficient (Kc) can also be read instead of the default Kc=1.0 for grass set internally.

3. Compiling for MS-Windows and Unix environments:
  1. The i/o for these operating systems is different.
  2. Select the lines with comments CUNIX or CDOS in the finput.f program to reflect
     your operating system.
Both Windows (thetafao.exe) and MacOS (>v10) (thetafao) binary executables are provided.

4. To run simply write in the command line:
	> thetafao filename   <return>
Where "filename" (max 8 characters) has no extension and corresponds with the input files filename.in and filename.met that MUST be present in the inputs directory. See documentation for more details on the structure of these files as well as the output files written in the output directory. 

5. Changes.
- (11/14/2022) v0.7. Added AET (mm) to last column of modified .MET output file and fix field length for printing date in the .MET output file that was short of 1 character on the output .MET file.
- (12/21/2019) New in v.06. Added new format flag (iFM) in the .in input file for the user to set the contents of the MET file. It allows to  estimate the mean relative humidity (RHmean) with daily Tmax and Tmin (C) values, and also provide other crop coefficient values (Kc,mid last column when present) when a plant other than the standard grass (Kc,mid=1.0) is used. Based on the iFM flag the number of columns the user must provide in the MET file after the date field changes as:  
     iFM= 0 (or not present, DEFAULT for EU FOCUS), 8 columns, last two columns Tmin,Tmax
     iFM= 1, 7 columns, last column is HRmean
     iFM= 2, 9 columns, last 3 columns are Tmin,Tmax, Kcmid for a crop other than grass
     iFM= 3, 8 columns, last 2 columns are HRmin, Kcmid for a crop other than grass 
