~ ~ ~ PURPOSE ~ ~ ~
this subroutine initializes the HRU weather generator parameters from the
.wgn file
~ ~ ~ INCOMING VARIABLES ~ ~ ~
name |units |definition
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
i |none |HRU number
ndays(:) |julian date |julian date for last day of preceding
|month (where the array location is the
|number of the month) The dates are for
|leap years
rndseed(:,:)|none |random number generator seeds
rnmd1 |none |random number between 0.0 and 1.0
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ ~ ~ OUTGOING VARIABLES ~ ~ ~
name |units |definition
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
daylmn(:) |hr |shortest daylength occurring during the year
dewpt(:,:) |deg C |average dew point temperature for the month
iregion(:) |none |precipitation category:
| 1 precipitation <= 508 mm/yr
| 2 precipitation > 508 and <= 1016 mm/yr
| 3 precipitation > 1016 mm/yr
latcos(:) |none |Cos(Latitude)
latsin(:) |none |Sin(Latitude)
phutot(:) |heat unit |total potential heat units for year (used
|when no crop is growing)
pr_w(1,:,:) |none |probability of wet day after dry day in month
pr_w(2,:,:) |none |probability of wet day after wet day in month
pr_w(3,:,:) |none |proportion of wet days in the month
tmp_an(:) |deg C |average annual air temperature
tmpmn(:,:) |deg C |avg monthly minimum air temperature
tmpmx(:,:) |deg C |avg monthly maximum air temperature
tmpstdmn(:,:)|deg C |standard deviation for avg monthly minimum air
|temperature
tmpstdmx(:,:)|deg C |standard deviation for avg monthly maximum air
|temperature
welev(:) |m |elevation of weather station used to compile
|data
wlat(:) |degrees |latitude of weather station used to compile
|data
wndav(:,:) |m/s |average wind speed for the month
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
name |units |definition
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
pcpmm(:) |mm |amount of precipitation in month
pcpd(:) |days |average number of days of precipitation
|in the month
rainhhmx(:) |mm |maximum 0.5 hour rainfall in month
|for entire period of record
rain_yrs |none |number of years of recorded maximum 0.5h
|rainfall used to calculate values for
|rainhhmx(:)
titldum |NA |title line of .wgn file (not used elsewhere)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ ~ ~ SUBROUTINES/FUNCTIONS CALLED ~ ~ ~
Intrinsic: Sin, Cos, Tan, Abs, Acos, Log, Exp, MaxVal
SWAT: Aunif, Dstn1
~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~
convert degrees to radians (2pi/360=1/57.296) calculate minimum daylength -> daylength=2acos(-tan(sd)tan(lat))/omega where solar declination, sd, = -23.5 degrees for minimum daylength in northern hemisphere and -tan(sd) = .4348 absolute value is taken of tan(lat) to convert southern hemisphere values to northern hemisphere the angular velocity of the earth's rotation, omega, = 15 deg/hr or 0.2618 rad/hr and 2/0.2618 = 7.6394 calculate day length threshold for dormancy calculate smoothed maximum 0.5hr rainfall amounts calculate missing values and additional parameters calculate total potential heat units calculate values for pr_w if missing or bad if pr_w values good, use calculated pcpd based on these values using first order Markov chain calculate precipitation-related values compute potential et with Preistley-Taylor Method idewpt=0 if dew point or 1 if relative humidity initialize arrays for precip divided by pet moving sum initialize my next element array for the linked list use average monthly precip and pet from wgn calculate initial temperature of soil layers calculate precipitation correction factor for pcp generator calculate or estimate amp_r values determine precipitation category (ireg initialized to category 1)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | iwgn |