[gradsusr] Creating a Station Data File from ASCII: stnmap error

Shawn Milrad shawn.milrad at gmail.com
Fri Jul 9 14:52:14 EDT 2010


 Hi,

I am trying to convert an ASCII file into a format GrADS can read.  My ASCII
file has 12 variables (it's sounding data) and looks like this:
   0 46     144    849.1   22.0  25  4.860   36.23   2.6  11  40.630  //////
   0 48     151    848.4   22.0  25  4.860   36.30   2.6  11  40.630  //////
   0 50     157    847.8   21.9  25  4.840   36.26   2.7  10  40.630  //////
   0 52     161    847.4   21.9  25  4.840   36.30   2.7  10  40.630  //////
   0 54     165    847.0   21.9  25  4.840   36.34   2.7  10  40.630  //////
   0 56     172    846.4   21.8  26  5.010   36.30   2.7  10  40.630  //////


My Fortran 90 program is below.  It compiles and creates the binary file
successfully but when I run the stnmap utility I get the following error.
*stnmap -i test.ctl
  Name of binary data set: testbin.dat
  Number of times in the data set: 1
  Number of surface variables: 0
  Number of level dependent variables: 12

Starting scan of station data binary file.
Binary data file open: testbin.dat

Processing time step 1
Sequential Read Error: Record size greater than one station report: 32 :: 28

*Has anyone seen this before/know how to fix it?
Thanks,
Shawn Milrad




      program fortrantest
       character*8 STID, RLON
       OPEN (8,FILE='10030000.txt')
       OPEN (10,FILE='testbin.dat',FORM='UNFORMATTED', &
       ACCESS='SEQUENTIAL')
       IFLAG = 0
       STID = 'WHEELER'
!  Read and Write
10     READ (8,9000,END=90) IMIN,ISEC,IHGHT,PRES,TMPC, &
       IRELH,RMIX,THETAC,SPED,IDIR,RLAT,RLON
9000   FORMAT (2x,I2,2X,I2,5X,I4,3X,F5.1,3X,F4.1,2X,I2,2X, &
       F5.3,3x,F5.2,1x,F4.1,1x,I3,2x,F6.3,2x,A6)
       IF (IFLAG.EQ.0) THEN
          IFLAG = 1
          IMINOLD = IMIN
          ISECOLD = ISEC
       ENDIF
!  If new time group, write time group terminator.
!  Assuming no empty time groups.
       IF (IMINOLD.NE.IMIN.OR.ISECOLD.NE.ISEC) THEN
          NLEV = 0
          WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
          ENDIF
          IMINOLD = IMIN
          ISECOLD = ISEC
!  Write this report
       TIM = 0.0
       NLEV = 1
       NFLAG = 1
       WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
       WRITE (10) IHGHT,PRES,TMPC,IRELH,RMIX,THETAC, &
       SPED,IDIR
       GO TO 10
!  On end of file write last time group terminator.
90     CONTINUE
       NLEV = 0
       WRITE (10) STID, RLAT, RLON, TIM,NLEV,NFLAG
       STOP
       END

 --
Shawn Milrad, Ph. D.
Staff Scientist
AER, Inc.




-- 
Shawn Milrad
Cell:  732-261-3594
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100709/9f2ea045/attachment-0003.html 


More information about the gradsusr mailing list