BROOK90 - AXX - AUXILIARY ROUTINES

September 23, 2013

Subroutine ACCUM (Module AXX.BAS) adds variable An to variable Bn for n = 1 to 5.

Subroutine ACCUMI (Module AXX.BAS) adds array value An(i) to array value Bn(i) for n = 1 to 5 and i = 1 to N.

Function ASIN (Module AXX.BAS) returns the arc sine in radians from - /2 to + /2. Function ACOS returns the arc cosine in radians from 0 to . These are not intrinsic functions in Visual Basic.

Function FNLEAP (Module B90V4.BAS) is the adjustment of February for leap year.

Module GLBLDECL.BAS declares all global variables. Most integer and string variables have % and $ as their final characters as residuals from QuickBasic; these characters are omitted in this documentation. The dimension of soil layer arrays is given as 1 to ML ML is currently set to 25; this can be increased up to 50 if the program is recompiled.

Function INTERP (Module INTERP.BAS) interpolates linearly between ten x-y pairs of values, where x changes monotonically. For an array FUNCT(20) in the form (x1, y1, x2, y2, ..., x10, y10), function INTERP(10, FUNCT(), XVALUE) returns the value of y interpolated at x = XVALUE. In BROOK90, INTERP is called by CANOPY to obtain values of RELHIT and relative LAI for the day of the year, using RELHT and RELLAI parameter arrays.

Subroutines IOUTPUT, POUTPUT, DOUTPUT, MOUTPUT, and YOUTPUT (Module B90V4.BAS). These files produce selected output at the end of an iteration, a precipitation interval, a day, a month, or a year, respectively. Output files are opened and a header line written on the first pass through.

Subroutines PACCUM, DACCUM, MACCUM, and YACCUM. (Module B90V4.BAS) PACCUM is used at the end of each iteration interval to integrate subsurface flow rates to amounts over a precipitation interval. These amounts are accumulated over a day by DACCUM, a month by MACCUM, and a year by YACCUM. Above-ground flow rates are integrated in DACCUM at the end of each precipitation interval, and are accumulated in MACCUM and YACCUM. Subroutines ACCUM and ACCUMI are called to do the accumulations for several variables or layer arrays at a time.

Subroutines PSUM, DSUM, MSUM, and YSUM (Module B90V4.BAS) .  Certain output variables are summed from their components by PSUM, DSUM, MSUM, and YSUM at the end of each precipitation interval, day, month, and year, respectively.

Functions RMAX and RMIN (Module AXX.BAS) take the maximum and the minimum, respectively, of a pair of real values. These are not intrinsic functions in Visual Basic.

Subroutine SUBGETMMDOM (Module GLBLSUBS.BAS) uses the YEAR and day of the year (DOY) to calculate the initial MONTH and day of the month (DOM).

Subroutine SUMI (Module AXX.BAS) sums all N values in array An into variable Bn for n = 1 to 6.

Subroutine SWCHEK  (Module B90V4). At the end of each iteration, each soil water storage (SWATI) is checked to see that it is within the range of 0 to SWATMX. If not, an error message is printed and the program terminates.

Subroutine ZERO (Module AXX.BAS) sets each of six variables to zero.

Subroutine ZEROA (Module AXX.BAS) sets all values in four equal-sized arrays to zero.

Subroutines ZPINT, ZDAY, ZMONTH, ZYEAR (Module B90V4.BAS) call ZERO and ZEROA to initialize variables and arrays that must be accumulated over a precipitation interval, day, month, and year, respectively.

[Compass Brook logo]

COMPASS BROOK