Scientific Investigations Report 2006–5318
U.S. GEOLOGICAL SURVEY
Scientific Investigations Report 2006–5318
print_masbal_dpm.f
Prints annual, monthly, and daily summaries. Accumulates monthly and annual values for printing simulation-period averages.
Declares, initializes, and prints the daily, monthly, and annual water-budget (mass-balance) summary for the modeled area, and accumulates the monthly and annual water-budget items for outputting the simulation-period averages. The outputting of daily values for the modeled area is optional because of the potentially large size of the output file. The module is from Bauer and Vaccaro (1987).
July, 2004
mobdgt
Ending month for the annual water-budget summary, in months.
dsum
Check to determine if want daily water-budgets, no units. [masbal]
nbdgdys (calculated)
Total number of days for this water-budget period, no units.
kntmos (calculated)
Total number of months for water-budget, no units.
qblavyr
Average-annual water balance for the modeled area, in inches.
qblavmo
Mean-monthly water balance for modeled area, in inches.
mnthsall
Total number of months simulated, no units.
nym
Number of years that each month is simulated, no units.
qbaldy
Daily water balance for the modeled area, in inches. [masbal]
qbalmo
Monthly water balance for the modeled area, in inches. [masbal]
qbalyr
Annual water balance for the modeled area, in inches. [masbal]
In the initialization part of the module, the total number of months in the simulation (mnthsall) and the number of years each month is simulated (nym) are calculated. The water-budget arrays for the monthly (qblavmo) and annual (qblavyr) simulation-period averages are then set to zero.
The run part of the module first gets the current day, month, and year and the starting month and ending day of the simulation. After getting the time-step and julian day for the current day, the daily, monthly, and annual water-budget items are obtained from the module masbal_dpm.f where they are accumulated on a daily basis. If the parameter dsum is greater than zero, the daily values for the modeled area are outputted to a file. This outputting is optional because if there are many years of simulation the daily output file can be very large.
Next, if it is the last day in the month, the monthly values (qbalmo) are accumulated in the averaging array (qblavmo), outputted, and then set to zero. To preserve the zeroed variable qbalmo, a MMS function, putvar, is invoked to store the array in the module where it was declared, masbal_dpm.f.
The annual values are then outputted at the end of the year for the specified budget month (mobdgt) and or at the end of the simulation. The budget month (mobdgt) allows users to have annual values calculated for a year starting in any month. The annual calculations then proceed similiar to the monthly loop described above, except that the simulation-period averaging array (qblavyr) is not accumulated in this part of the module because it is directly calculated using the monthly averaging array.
If it is the end of the simulation period, the monthly budget items that have been accumulated in qblavmo are averaged and then stored in the annual array qblavyr. The annual values are then averaged. Last, the average monthly and annnual water-budget items are outputted. All output includes a mass-balance error term.
Bauer, H.H., and Vaccaro, J.J., 1987, Documentation of a deep percolation model for estimating ground-water recharge: U. S. Geological Survey Open-File Report 86-536, 180 p.
Henry H. Bauer and John J. Vaccaro
U.S. Geological Survey
Washington Water Science Center
934 Broadway, Suite 300
Tacoma, WA 98402
Modified by:
John J. Vaccaro
U.S. Geological Survey
Washington Water Science Center
934 Broadway, Suite 300
Tacoma, WA 98402
Telephone: 253-552-1620
Fax: 253-552-1581
Email: jvaccaro@usgs.gov