Old station data problem

Mark gemark at GEORGE2.AS.NTU.EDU.TW
Mon Jan 28 01:45:20 EST 2008


Hi

I had written a program for plotting station-data by GrADS.
It works OK on a DEC Alpha machine with F77 compiler.
The 'open' line in my program is:

       open(13,file=file(3),status="unknown",form="unformatted",
     +        recordtype='stream')

And I also declared the "station id" as:
       character*8 sta1(1:stnn),sta2

Mark Wang



  ----- Original Message ----- 
  From: zilore mumba 


   program stndata
   implicit none
      integer          :: i
      integer          :: IYEAR,IMONTH,IYROLD,IMNOLD
      integer          :: NFLAG,IFLAG,NLEV
     
      real              :: LAT,LON,RVAL,tim
       
      CHARACTER(len=4) :: STID
       
         OPEN (8,NAME='rainin.dat',status='old') 
         OPEN (12,file='rainout.dat',FORM='BINARY',ACCESS='SEQUENTIAL')
         !OPEN (12,file='rainout.dat',form='unformatted',access='direct',recl=8*7)
         
      IFLAG = 0 
  !  Read and Write
  10     READ (8,9000,END=90) IYEAR,IMONTH,STID,LAT,LON,RVAL 
  9000   FORMAT (1x,I4,2X,I1,2X,A3,3(2x,F5.1))
         IF (IFLAG.EQ.0) THEN
            IFLAG = 1 
            IYROLD = IYEAR
            IMNOLD = IMONTH 
         ENDIF 
  !  If new time group, write time group terminator. 
  !  Assuming no empty time groups. 
   
         IF (IYROLD.NE.IYEAR.OR.IMNOLD.NE.IMONTH) THEN 
            NLEV = 0
            write(12)stid,lat,lon,tim,nlev,nflag
         ENDIF
       
         IYROLD = IYEAR 
         IMNOLD = IMONTH 
  !  Write this report 
         tim = 0.0 
         NLEV = 1 
         NFLAG = 1
   
         write(12)stid,lat,lon,tim,nlev,nflag,rval
         GOTO 10
      
  !  On end of file write last time group terminator. 
  90    CONTINUE 
         NLEV = 0
         
      write(12)stid,lat,lon,tim,nlev,nflag
      close(12)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080128/001e2a27/attachment.html 


More information about the gradsusr mailing list