Attached is the station data I am trying to use to convert to grads format. It looks like the script to turn into grads binary is a problem or the options sequential needs to be something else in the .ctl file, but what should it be?<br>
<br>This is the fortran script to convert data:<br><br> CHARACTER*8 STID <br> REAL TD, TT,RH,WSP,WDIR,PP<br> OPEN (8,file='stns_new.txt') <br> OPEN (10,file='stn.dat',FORM='UNFORMATTED'<br>
+ ,status='unknown')<br><br> IFLAG = 0 <br><br>10 READ (8,9000,END=90) ITIME, STID, RLAT, RLON, TT,Td,rh,WSP, <br> + wdir, pp<br><br>9000 FORMAT( I2, 1X, A4, 1X, F7.4,1X,F8.3,1X, <br> + F4.1,1X,F5.1,1X,F3.0,1x,F4.1,1X,F3.0,1X,F4.1)<br>
!<br> IF (IFLAG.EQ.0) THEN<br> IFLAG = 1 <br>! IYROLD = IYEAR<br> ITIMEOLD = ITIME<br> ENDIF <br><br>! print*,IYEAR,IMONTH,STID,RLAT,RLON,RVAL,TD,UU,VV<br>! If new time group, write time group terminator. <br>
! Assuming no empty time groups. <br>!<br> IF (ITIMEOLD.NE.ITIME) THEN <br> NLEV = 0 <br> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG <br> ENDIF <br>! IYROLD = IYEAR <br> ITIMEOLD = ITIME<br>
! Write this report <br> TIM = 0.0 <br> NLEV = 1 <br> NFLAG = 1<br> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG <br><br>!print*,ITIME,STID,RLAT,RLON,TT,TD,UU,VV<br>! print*,STID,RLAT,RLON,TIM,NLEV,NFLAG<br>
WRITE (10) TT,TD,RH,WSP,WDIR,PP<br> print*, TT ,TD, RH,WSP, WDIR, PP<br> GO TO 10<br>! On end of file write last time group terminator. <br>90 CONTINUE <br><br> NLEV = 0 <br> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG <br>
print*,STID,RLAT,RLON,TIM,NLEV,NFLAG<br> STOP<br> END<br><br>Here is the .ctl file:<br clear="all"><br>DSET ^stn.dat<br>DTYPE station<br>STNMAP station.map<br>OPTIONS sequential<br>UNDEF -999.00<br>
TITLE Station Data Sample<br>TDEF 24 linear 07Z30Nov2007 60mn<br>VARS 6<br>ts 0 99 Surface Temperature<br>td 0 99 Surface Dewpoint Temperature<br>rh 0 99 Relative Humidity<br>wsp 0 99 Wind speed<br>wdir 0 99 wind dir<br>
pp 0 99 accumulated precipitation<br>ENDVARS<br><br><br>-- <br>Andre Pattantyus, Graduate Student Research Assistant<br>Marine and Environmental Systems, Florida Institute of Technology<br>150 W. University Blvd, Melbourne, FL 32901<br>
<br>Phone: (321) 674-8330 | Fax: (321) 674-7212 | Email: <a href="mailto:apattantyus2008@fit.edu">apattantyus2008@fit.edu</a><br>