# list daily AB format, ds512.0 # # QSUB -eo -q reg -lT 180 -s /bin/csh cd $TMPDIR cat << "ENDCAT" >! tsrc.f PROGRAM CACDLY DIMENSION WEA(8) CHARACTER IBUF*13000 c c write(6,*)' This code reads a basic CAC daily file ( AB format)' write(6,*)' either blocked or unblocked. If blocked set the ' write(6,*)' record lengths thru aug82 (laug82) and from sep82 ' write(6,*)' (lsep82) accordingly. If unblocked set both equal ' write(6,*)' or greater than the longest possible length (88). ' write(6,*)' It expects the input file as a directed input, ' write(6,*)' e.g a.out < data (uncompressed data file) ' write(6,*)' or zcat data.Z | a.out (compressed data file)' laug82=88 lsep82=88 print 1000 1000 format( * ' Variables numbered as in format ',//, * ' 1 2 3 4 5 6 7 8 9 10' * ' 11 12 13 14 15 16 17 18 19',/, * ' --------') NREC=0 1 NREC=NREC+1 READ(5,'(A)',ERR=50,END=100) IBUF ib=1 2 READ(IBUF(ib:), 9,ERR=50) IDATE 9 format(i6) IF(IDATE.LE.0) GO TO 1 c c*** set bad elevation to missing if(IBUF(ib+29:ib+33).eq.'*****') IBUF(ib+29:ib+33)=' 9999' c*** set bad 24-HR-PRECIP-FLAG to missing if(IBUF(ib+53:ib+54).eq.'*9') IBUF(ib+53:ib+54)='99' c IF(IDATE.GT. 820831) GO TO 15 READ(IBUF(ib:),10,ERR=50) iyr,imo,idy,idwmo,call,xlat,xlon,elev, *tmax,maxf,tmin,minf,pcpt,npcptf,pcptt,wea,nobs,nobspp 10 format(3i2,1x,i5,1x,a4,2f6.2,f5.0,f5.1,i2,f5.1,i2,f5.1, * i2,a1,8a1,2i2) print 11,iyr,imo,idy,idwmo,call,xlat,xlon,elev, *tmax,maxf,tmin,minf,pcpt,npcptf,pcptt,wea,nobs,nobspp 11 format(1x,3i3,1x,i5,1x,a4,2f7.2,f6.0,f6.1,i3,f6.1,i3,f6.1, * i3,1x,a1,1x,8a1,2i3) ib=ib+laug82 GO TO 2 15 CONTINUE READ(IBUF(ib:),20,ERR=50) iyr,imo,idy,idwmo,call,xlat,xlon,elev, *tmax,maxf,tmin,minf,pcpt,npcptf,pcptt,wea,nobs,nobspp,pcptr,pcpte, *nob6 20 format(3i2,1x,i5,1x,a4,2f6.2,f5.0,f5.1,i2,f5.1,i2,f5.1, * i2,a1,8a1,2i2,2f6.1,i2) print 21,iyr,imo,idy,idwmo,call,xlat,xlon,elev, *tmax,maxf,tmin,minf,pcpt,npcptf,pcptt,wea,nobs,nobspp,pcptr,pcpte, *nob6 21 format(1x,3i3,1x,i5,1x,a4,2f7.2,f6.0,f6.1,i3,f6.1,i3,f6.1, * i3,1x,a1,1x,8a1,2i3,2f7.1,i3) ib=ib+lsep82 GO TO 2 50 CONTINUE PRINT 51,NREC 51 FORMAT(' ERROR, REC',I10) GO TO 1 100 CONTINUE NREC=NREC-1 PRINT 101,NREC 101 FORMAT('0RECORDS READ',I10) END "ENDCAT" f90 -e0v tsrc.f -L /usr/local/lib -l ncarm,ncaro,mss # replace xxxxxx with vsn (filename) from MASTER file msread -fch input1 /DSS/xxxxxx ja a.out < input1 ja -cst