CMLS98B Program
Purpose | Processes
and Assumptions | Installation |
Use | Example |
References | Acknowledgements
Program Structure |
Platform Dependencies | File
Structures
OUTLINE OF MAJOR PROGRAM MODULES
The following sections outline the steps involved in the CMLS98B software. More details about the algorithms used are provided on disk files with the computer code.
The main program in CMSL98B carries out the following steps:
- Get input file name from the command line and open input file; exit on error
-
If a checkfile is specified
- Try to open checkfile for writing; if unable to do so print error message and exit
-
While more General/System blocks of data exist in the input file do the
following:
- Get input for current block, check for errors, and exit if errors are detected
- Prepare output file for results
- Perform simulations requested and store results in output file
- Close the output file
- Close the checkfile
-
End
The simulate module carries out the following steps:
- Display the number of simulations to be made (for user information)
-
For each simulation do the following:
- Select a planting date at random from the planting window
- Calculate the crop coefficient for each calendar day
-
For each soil-chemical combination specified in system block do the following:
- Generate weather if necessary
- Determine reference ET by method specified by user and store in memory
- Store rain (or actual infiltration) in memory
- Read system information for next soil-chemical system. If resampling is to be used, compute necessary parameters
- Select the application date from the application window (and planting date if "Relative" was specified)
- Calculate movement of chemical in current soil-chemical system saving data requested by user
-
Store results of interest in output file
The movement module carries out the following steps:
- Initialize working arrays and variables
- If curve number for soil is greater than zero calculate upper storage limit
- Calculate available water in each layer
- If amount is a desired output, calculate the degradation for a one-day time period; Otherwise set the degradation to zero
- Determine the day of year when simulation begins
- Calculate the initial depth of solute in mm
- Calculate the number of days between the beginning of simulation and the day the chemical is applied
- Calculate the maximum time and depth requested as output
- If actual irrigation is to be used, read the irrigation amount - time data into memory
-
For each day to be simulated do the following:
- Determine if critical depth and time have been passed. If so, terminate simulation
- Determine irrigation for this day
- Update soil layers for ET on this day
- If infiltration is estimated from rainfall, calculate rainfall infiltration using SCS curve number
- Calculate total infiltration for this day as sum of rainfall infiltration and irrigation
-
If the current day is before the day when the chemical was applied, replenish
water in the soil with infiltrating water on this day, layer by layer from
the top until all the water has been stored or passed through the
profile;Otherwise
- Update water content of soil layers for infiltration on this day. Replenish soil water layer by layer from the top until all infiltrating water is stored or layers above the current depth of the chemical are refilled.
-
While infiltrating water has not all been stored in the profile, do the
following:
- Calculate the amount of water needed to move the chemical to the bottom of the next soil layer.
-
If water available to move the chemical is sufficient to move the chemical
to the bottom of the next soil layer
- Update water content in next soil layer and calculate excess water leaving that layer
- Update depth of chemical to the bottom of the next soil layer and calculate the amount of water still available to move the chemical
-
Otherwise
- Calculate the new depth of the chemical within this next layer
- Update the water content in this layer and calculate excess water entering the next layer
- Recharge the layers below the new chemical depth until excess infiltrating water is stored or passes through the profile.
- If amount is to be calculated, calculate amount remaining on this day
- Save output information of interest
- Free memory allocated for actual irrigation
- End movement procedure