c *** fortran code to read in and selectively write out data from c *** any of the NDP059 snowdepth data files. c integer year,mon,numdays,snowd(31) character*1 sf(31),qcf1(31),qcf2(31) character*2 units character*4 dattyp character*6 staid character*2 stcode c c *** open the input file (exact file name requires specification c *** by the user) open (unit=5, file='snowdpth.dat') c *** open the output file (exact file name requires specification c *** by the user) open (unit=7, file='snowdpth.out') c 1 continue read(5,100,end=99) staid,dattyp,units,year,mon,numdays, + (sf(i),snowd(i),qcf1(i),qcf2(i),i=1,31) 100 format(a6,1x,a4,a2,i4,i2,1x,i2,31(1x,a1,i4,2a1)) c c *** If individual state or station data are required, remove comments c from the executable statements in the block of code below and specify c the particular 2-character state code or 6-character station number c (removing the Xs) in the appropriate "if" statement, as required, c leaving the other "if" statement commented out. If selecting a c specific state or station, don't forget to remove the comment from the c "go to 1" statement. c ******************************************************************** c c *** strip off the 2-character state code from the station number c stcode=staid(1:2) c c *** only go to write out the data if the selected state or station c *** is found c if(stcode.eq.'XX') go to 2 c if(staid.eq.'XXXXXX') go to 2 c c go to 1 c ********************************************************************* 2 continue c write(7,200) staid,dattyp,units,year,mon,numdays, + (sf(i),snowd(i),qcf1(i),qcf2(i),i=1,31) 200 format(a6,1x,a4,a2,i4,i2.2,1x,i2.2,31(1x,a1,i4,2a1)) c go to 1 99 continue stop end