subroutine stmtim(rain,stmdur,hour,wnttim,rans, 1 hrrain,hrsnow,hrtemp,snodpt, 2 rnhrs,snohrs) c +++ PURPOSE +++ c This subroutine handles winter storm time and duration calculations. c It was originally incorporated into WINTER, but was split out c by Charles R. Meyer 6/6/96 to reduce code complexity. c c +++ ARGUMENT DECLARATIONS +++ integer hour,rnhrs,snohrs real rain,stmdur,wnttim,hrrain,hrsnow,hrtemp,snodpt real rans c c +++ ARGUMENT DEFINITIONS +++ c c +++ END SPECIFICATIONS +++ c c c -- Now, we calculate hourly precipitation amount and type. c -- We start with rain. c hrrain = 0.0 hrsnow = 0.0 c c -------------------------- c -- Winter storm time and duration calculations... c -------------------------- c if (rain .gt. 0.0001) then c c -- First, we need to round the duration to the nearest hour. c c C wntdur = aint(stmdur/3600) tmpvr3 = stmdur * 0.00027778 wntdur = aint(tmpvr3) c if ((wnttim + wntdur) .gt. 24.0) wnttim = 24.0 - wntdur C if (((stmdur/3600) - wntdur) .ge. 0.5) wntdur = wntdur + 1.0 if ((tmpvr3 - wntdur) .ge. 0.5) wntdur = wntdur + 1.0 c c -- What if the storm is only 1/2 hour long? c if (wntdur .lt. 0.0001) wntdur = 1.0 c if ((hour.ge.wnttim) .and. (hour.lt.(wnttim+wntdur))) then if (hrtemp .gt. 0.0) then c c -- In this case, we convert units of precip to meters. c hrrain = rain / wntdur hrsnow = 0.0 c if (snodpt .gt. 0.001)then c krs=krs+1 c ras=ras+hrrain c else c krns=krns+1 c rans=rans+hrrain c endif if (snodpt .le. 0.001) rans = rans + hrrain else c c -- Otherwise, we're talking snowfall... c -- Note that 10.0 is a conversion factor from rain to snow. hrsnow = rain / wntdur * 10.0 hrrain = 0.0 c if (snodpt .gt. 0.001)then c kss=kss+1 c snsn=snsn+hrsnow c else c ksns=ksns+1 c sns=sns+hrsnow c endif endif endif c if (hrrain .gt. 0.00001) rnhrs = rnhrs + 1 if (hrsnow .gt. 0.00001) snohrs = snohrs + 1 c endif c return end