subroutine sta_parms i (stidd,station_code, m tp6,wgt, o ylt,yll,years,elev,itype,timpkd) c + + + PURPOSE + + + c Derive parameters for the desired climate station. c c ----- Split out from the CLIGEN main module 9/28/99 by C. R. Meyer. c c + + + ARGUMENT DECLARATIONS + + + character*41 stidd integer station_code,elev,years, itype real ylt,yll,tp6,wgt(3),timpkd(0:12) c c + + + ARGUMENT DEFINITIONS + + + c stidd - 41-character alphanumeric station name. c station_code - 4-digit Numeric Station Code c tp6 - maximum 6 hour precipitation depth (inches). c wgt(3) - 3 wind station weights used for triangulation -- weighting c factor for wind stations used for interpolation c ylt - Station Latitude. c yll - Station Longitude. c years - Years of Record. c elev - Station Elevation above Sea Level (whole number of meters) c itype - integer value [1..4] to set single storm parameters. c timpkd - The 12 interval time to peak accummulated distribution c parameters for the station. Cumulative distribution of c computed time to peak rainfall intensity values based on c NWS 15-minute rainfall data (section 2.1.4 WEPP tech 1995) c c + + + COMMON BLOCKS + + + include 'cbk1.inc' c modify: wvl,dir,rh,calm c wvl(i,j,k) - array of wind paramters where: c i - ith direction (1 - north - 16 nnw) c j - parameters (1 - 4) c 1 - % time from direction i c 2 - mean speed from direction i c 3 - standard deviation of speed from direction i c 4 - skew coeficient of speed from direction i c k - month (1=Jan, 2=Feb...) c c dir(i,j) - Cumulative % time (fraction) from dir1, dir1+dir2, ... c derived from wvl() c dim1: month c dim2: compass direction c rh - Dew Point Temp. c calm - % time air is calm (by month). c Calm is treated separately [from WVL] as direction 0, c speed 0. Only a % time value is need for calm generation. c include 'cbk7.inc' c modify: rst,prw,obmx,obmn,obsl,cvs,cvtx,cvtm,stdtx,stdtm,stdsl c rst(i,j) - Array Of Monthly precipitation stats. c dim1: month 1..12 c dim2: 1=mean of daily rainfall c mean liquid equivalent precipitation c depth (inches) for a day precipitation c occurs (by month) [=avg total precip c for month / # wet days in month] c 2=std deviation of daily rainfall c standard deviation of the daily precip c value (inches) (by month) c 3=skew coefficient of daily rainfall c c prw(1,12) - monthly probability of wet day after wet day c prw(2,12) - monthly probability of wet day after dry day c obmx - Maximum Temperature. c obmn - Minimum Temperature. c obsl - Observed mean daily solar radiation (Langleys) (by month) c cvs - Coefficient of Variation of Solar Radiation (by month) c cvtx - Coefficient of Variation of Maximum Temperature (by month) c cvtm - Coefficient of Variation of Minimum Temperature (by month) c stdmx - Standard Dev. Tmax. c stdmn - Standard Dev. Tmin. c stdsl - Standard Dev. Sol. c include 'cbk9.inc' c modify: wi c wi - Average Maximum .5 Hour Precip. c include 'cinterp.inc' c include 'command.inc' c c + + + LOCAL VARIABLES + + + character*1 yc character*19 site(3) real rst1(12),rst2(12),rst3(12),prw1(12),prw2(12) integer i, j, k c c + + + LOCAL DEFINITIONS + + + c yc - 1-character user response (y/n). c site(3) - 3 wind station names used for triangulation. Stations c from which wind data were interpolated. (Not used in c CLIGEN computations, but reported in the CLIGEN output.) c c + + + INPUT FORMATS + + + 1000 format(6x,f7.2,6x,f7.2,7x,i3,7x,i2/12x,i5,17x,f5.2) 1010 format(8x,12f6.2) 1020 format(8x,12f6.3) 1030 format(a19,f6.3,2(2x,a19,f6.3)) c c + + + OUTPUT FORMATS + + + 2000 format(/1x,'Do you want to view data found for station',//, 1 a41,2x,i4,' (y/n)?: ') 2010 format(1x,'Observed monthly ave max temperature (C)',/, 1 1x,12(f5.1,1x),/, 1 1x,'Observed monthly ave min temperature (C)',/, 1 1x,12(f5.1,1x)) 2020 format(1x,'Observed monthly ave solar radiation (Langleys/day)',/, 1 12(1x,f5.1)) 2030 format(/1x,'wet-dry state probabilities'/) 2040 format(1x,2f10.5) 2050 format(/1x,'mean,st.dev.,and skew coef. of daily rainfall'/) 2060 format(1x,3f10.5) 2070 format(/1x,'standard deviation for max and min temp,', 1 ' and solar radiation'/) 2080 format(1x,12f6.2) 2090 format(1x,12f6.1) 2100 format(/1x,'coefficient of variation for max, min temp,', 1 ' solar radiation, and max .5 hr rain'/) 2110 format(1x,'Average Monthly Dew Point Temperature',/1x,12f6.2) 2120 format(1x,'Wind Data Interpolated from', 1 /1x,a19,f6.3,2(2x,a19,f6.3)) 2130 format(1x,12f6.2) c c + + + EQUIVALENCES + + + equivalence(rst1,rst(1,1)) equivalence(rst2,rst(1,2)) equivalence(rst3,rst(1,3)) equivalence(prw1,prw(1,1)) equivalence(prw2,prw(1,2)) c c + + + END SPECIFICATIONS + + + c c Read Precipitation, Temperature, Radiation, etc. c read(10,1000)ylt,yll,years,itype,elev,tp6 read(10,1010)(rst(i,1),i=1,12),(rst(i,2),i=1,12),(rst(i,3), 1 i=1,12) read(10,1010)(prw(1,i),i=1,12),(prw(2,i),i=1,12) read(10,1010)(obmx(i),i=1,12) read(10,1010)(obmn(i),i=1,12) read(10,1010)(stdtx(i),i=1,12),(stdtm(i),i=1,12) read(10,1010)(obsl(i),i=1,12) read(10,1010)(stdsl(i),i=1,12) read(10,1010)(wi(i),i=1,12) c c --- Bofu Yu's code discovered & added 7/19/2000 -- CRM: c wi is input as max 30-min rainfall intenisty c now wi is converted into depth as it should be. c B.YU, 7/7/1999 c do 65 i=1,12 wi(i) = 0.5*wi(i) 65 continue c read(10,1010)(rh(i),i=1,12) read(10,1020)(timpkd(i),i=1,12) c c ----- Output the Max & Min Temp, Rad, and Precip values for testing CLIGEN. CC open(71,file='pop_nrs',status='unknown') CC write(71,1010)(obmx(i),i=1,12) CC write(71,1010)(stdtx(i),i=1,12) CC write(71,1010)(obmn(i),i=1,12) CC write(71,1010)(stdtm(i),i=1,12) CC write(71,1010)(obsl(i),i=1,12) CC write(71,1010)(stdsl(i),i=1,12) CC write(71,1010)(rst(i,1),i=1,12) CC write(71,1010)(rst(i,2),i=1,12) CC close (71) c c Compute Fourier Coefficients, if Needed. if(interp .eq. 2) then call fouri1(rst1,1) call fouri1(rst2,2) call fouri1(rst3,3) call fouri1(prw1,4) call fouri1(prw2,5) call fouri1(obmx,6) call fouri1(obmn,7) call fouri1(stdtx,8) call fouri1(stdtm,9) call fouri1(obsl,10) call fouri1(stdsl,11) call fouri1(wi,12) call fouri1(rh,13) call fouri1(timpkd,14) else if(interp .eq. 3) then call ryf1(rst1,1) call ryf1(rst2,2) call ryf1(rst3,3) call ryf1(prw1,4) call ryf1(prw2,5) call ryf1(obmx,6) call ryf1(obmn,7) call ryf1(stdtx,8) call ryf1(stdtm,9) call ryf1(obsl,10) call ryf1(stdsl,11) call ryf1(wi,12) call ryf1(rh,13) call ryf1(timpkd,14) C write(*,*) "EMV:", emv C write(*,*) C write(*,*) "PMT:", pmt C write(*,*) C write(*,*) "PMV:", pmv C write(*,*) C write(*,*) "XES:", xes C write(*,*) endif c c Wind Data read in here. c wvl(i,j,k) - array of wind paramters where c i - ith direction (1 - north - 16 nnw) c j - parameters (1 - 4) c 1 - % time from direction i c 2 - mean speed from direction i c 3 - standard deviation of speed from direction i c 4 - skew coeficient of speed from direction i c Calm is treated seperately as direction 0, speed 0 c Only a % time values is need for calm generation. c read(10,1010)(((wvl(i,j,k),k=1,12),j=1,4),i=1,16) read(10,1010)(calm(i),i=1,12) read(10,1030)site(1),wgt(1),site(2),wgt(2),site(3),wgt(3) c--- XXX -- Huh? ELEV is declared to be an *integer*, but in the c data file it is a floating-point!!! --- CRM -- 9/27/99 elev=elev*.3048 c c do 70 i=1,12 c -- XXX -- Huh??? -- CRM -- 9/14/99 c wi(i)=wi(i) cvtx(i)=stdtx(i)/obmx(i) cvtm(i)=stdtm(i)/obmn(i) if(obsl(i).le.0.0) then cvs(i)=0.0 else cvs(i)=stdsl(i)/obsl(i) endif 70 continue c c -- XXX -- Huh??? -- CRM -- 9/14/99 c do 80 i=1,12 c wi(i)=wi(i) c do 6000 i=1,12 6000 dir(i,1)=wvl(1,1,i) c do 7010 i=1,12 do 7000 j=2,16 dir(i,j) = dir(i,j-1)+wvl(j,1,i) 7000 continue j=17 dir(i,j)=100.0 7010 continue c do 7050 i=1,12 do 7049 j=1,17 dir(i,j)=dir(i,j)*.01 7049 continue 7050 continue c close (10) c Close the Parameter File and Write the Parameter if He Wants. c C if((istate.le.0 .or. index.le.0) .and. infile.eq."XXX") then if(interactive) then write(*,2000)stidd,station_code read(*,'(a1)')yc else yc = 'N' endif c c **** L1 IF **** if(yc.ne.'n'.and.yc.ne.'N') then write(*,2010)obmx,obmn write(*,2020)obsl write(*,2030) do 90 i=1,12 write(*,2040) prw(1,i),prw(2,i) 90 continue write(*,2050) do 100 i=1,12 write(*,2060)(rst(i,j),j=1,3) 100 continue write(*,2070) write(*,2080)(stdtx(i),i=1,12) write(*,2080)(stdtm(i),i=1,12) write(*,2090)(stdsl(i),i=1,12) write(*,2100) write(*,2080)(cvtx(i),i=1,12) write(*,2080)(cvtm(i),i=1,12) write(*,2080)(cvs(i),i=1,12) write(*,2080)(wi(i),i=1,12) write(*,2110)rh write(*,2080)tp6 write(*,2120)site(1),wgt(1),site(2),wgt(2),site(3),wgt(3) write(*,2130)(((wvl(i,j,k),k=1,12),j=1,4),i=1,16) write(*,2130)(calm(i),i=1,12) c **** L1 ENDIF **** endif return end