These files are the source code of CLIGEN V-4.2, recoded to conform to the "Water Erosion Prediction Project (WEPP) Fortran-77 Coding Convention". The work was performed by Charles R. Meyer, NSERL-USDA-ARS, from August to November 1999, in order to facilitate the maintenance, modification, and extension of the CLIGEN code. The extensive help of David Hall, USFS, Moscow, Idaho in providing many valuable definitions is gratefully acknowledged. C. R. Meyer may be contacted at: 1196 Bldg. SOIL, Purdue University, West Lafayette, IN 47907; ph: 765/494-8695; e-mail: meyerc@ecn.purdue.edu. Approach: Code complexity was reduced by breaking sections of the code out into eight additional modules. Common blocks were removed into "include" files, resulting in a single copy of each. Unused variables were removed -- 66 from the common blocks alone. The extremely unstructured condition of original code was greatly improved, largely through the addition of two varibles, MOVETO a global variable, and NDLOOP a local variable -- and though careful selection of code to be isolated as a module, based on its functional structure. This permitted removal of a large number of GOTO's that made spaghetti of the code. Where a GOTO seemed necessary, appropriate choice of module boundaries and use of the MOVETO variable was substituted. Results: The software metrics supplied by the McCabe software analysis tool indicate the number of unstructured constructs declined from 46 to 2. (The 2 are in the main module.) The complexity of the most complex module declined from 89 linearly independent paths, to 13. Additional Note: Code that seemed wrong was commented with the string "XXX". Meyer is not a climate/weather expert, so it is not obvious to him what should be done -- only that the code appears incorrect. The user is left to his/her own interpretation. Between the 11/15/99 and 12/15/99 posting: Some explanatory comments were added to the section where the daily climate outputs are generated. The logic remains the same. What's New: An error was discovered in function DSTG. It generates an arithmetic underflow in long runs. To correct the problem, add the following line to DSTG in your existing code: double precision xx,fu ----Charles. R. ("Chuck") Meyer, 1/06/2000.