c c subroutine r5monb c c This subroutine was full of errors, c what follows is a complete re-write. B.YU c c This subroutine smoothes max 30-min rainfall data and computes c the R30/R ratio for each month. On return the ratio is stored in the c array wi(i), i=1,12. This subroutine will be called only once in the main c program to generate parameters for storm simulation c The subroutine was re-written by B. YU on June 30, 1999 c c include 'cbk3.inc' c read: ida c ida - Julian Day of Year. Used as a subscript to R. c include 'cbk4.inc' c read: mo c mo - The current month (1=Jan, 2=Feb...). c include 'cbk5.inc' c read: r c r - Daily Precipitation amount (inches of water) c include 'cbk7.inc' c read: k7 c k7 - Seed for random number generation. c include 'cbk9.inc' c read: wi,ab,ab1,rn1 c write: r1 c + + + LOCAL VARIABLES + + + real sm(12),smm(12) real r25, f, xm integer i c Smoothing 30-min rainfall data c 3-month running average sm(1)=(wi(12)+wi(1)+wi(2))/3.0 do 20 i=2,11 sm(i)=(wi(i-1)+wi(i)+wi(i+1))/3.0 20 continue sm(12)=(wi(11)+wi(12)+wi(1))/3.0 do 30 i=1,12 if(prw(2,i).eq.0.0) then smm(i) = 0.0006944 c ! = 1 min else c xm - no. of calender days for the month, c smm - no. of rain days xm=nc(i+1)-nc(i) c -- XXX -- The equation below is backwards from the one to compute c Historic Monthly Precip amount -- CRM -- 7/30/00. smm(i)=xm*prw(2,i)/(1.0-prw(1,i)+prw(2,i)) endif if(rst(i,1).eq.0.0) then r25 = 0.001 c so that it won't overflow = 1/1000 of an inch else r25 = rst(i,1) c rain per rain day for the month endif c See the paper for details. The idea was that c if there are n rain days, the max 30-min rain is c Rmax30, then the mean of the max 30-min rain for c the month will be R30 = - Rmax30/ln(F), where c F is the exceedance frequency for Rmax, which c is approximately 1/(n + 0.5). The original Hazen c formula or Weibull's formula were not used, although c what is used here is similar to Weibull's when c the number of rain days is large. B.YU f = 1./(smm(i)+0.5) f = -1./alog(f) if (f .gt. 1.) then c If no. raindays/month < 2.218, no adjustment to c max 30-min rain is made. wi(i) = sm(i) else wi(i) = f*sm(i) endif c sm(i) is the smoothed max 30-min rain for the month c wi(i) is the mean of the max 30-min rain wi(i) = wi(i)/r25 c alpha = R30/R 30 continue return end c c c ----------------------< End Bofu Yu's Corrections. >--------------------- c c