<div>Chuck,</div>  <div>I tried that, nothing changes. Thanks for your time</div>  <div>Zilore<BR><BR><B><I>Charles Seman &lt;Charles.Seman@NOAA.GOV&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Zilore,<BR><BR>Have you tried using CHARACTER(len=8) for STID? Not sure, but<BR>http://grads.iges.org/grads/gadoc/aboutstationdata.html#station C and<BR>DEC Fortran example programs show use of 8 for length of variable "STID"...<BR><BR>I hope this helps,<BR>Chuck<BR><BR>zilore mumba wrote:<BR>&gt; Help needed with the station data problem which I met more than five<BR>&gt; years ago and, as far as I remember, many other grads users also<BR>&gt; faced. I have gone through the archives, I do not find the solution.<BR>&gt; *The problem:*<BR>&gt; I want to write station rainfall to binary to display. I used the<BR>&gt; example of rainfall in the grads documentation. When I run stnmap I<BR>&gt; get the error
 below. I wrote the data with acess='direct', in which<BR>&gt; case the time group terminator is padded with zeros since it has six<BR>&gt; items as opposed to 7 for the data group. I thought this was the<BR>&gt; Invalid station hdr found in station binary file.<BR>&gt; I then wrote the data with access='sequential (now no zeros padded).<BR>&gt; The program re-reads and re-writes the data and it appears ok (though<BR>&gt; I do not understand the 10-digit number as flag = 1123457434 in the<BR>&gt; error message below).<BR>&gt; I have attached the fortran program, ctl file and data, below.<BR>&gt;<BR>&gt; Will appreciate anybody with a fix for my problem<BR>&gt; Zilore Mumba<BR>&gt;<BR>&gt; Name of binary data set: rainout.dat<BR>&gt; Number of times in the data set: 2<BR>&gt; Number of surface variables: 1<BR>&gt; Number of level dependent variables: 0<BR>&gt; Starting scan of station data binary file.<BR>&gt; Binary data file open: rainout.dat<BR>&gt; Processing time =
 1<BR>&gt; Invalid station hdr found in station binary file<BR>&gt; Possible causes: Invalid level count in hdr<BR>&gt; Descriptor file mismatch<BR>&gt; File not station data<BR>&gt; Invalid relative time<BR>&gt; levs = 1 flag = 1123457434 time = 1.4013e-45<BR>&gt; Open Error: Can't open description file<BR>&gt; File name is: rain<BR>&gt; Open Error: Can't open description file<BR>&gt; File name is: rain<BR>&gt; Open Error: Can't open description file<BR>&gt; File name is: rain<BR>&gt; Open Error: Can't open description file<BR>&gt; File name is: rain<BR>&gt; Open Error: Can't open description file<BR>&gt; File name is: rain<BR>&gt; $debug<BR>&gt; program stndata<BR>&gt; implicit none<BR>&gt; integer :: i<BR>&gt; integer :: IYEAR,IMONTH,IYROLD,IMNOLD<BR>&gt; integer :: NFLAG,IFLAG,NLEV<BR>&gt;<BR>&gt; real :: LAT,LON,RVAL,tim<BR>&gt;<BR>&gt; CHARACTER(len=4) :: STID<BR>&gt;<BR>&gt; OPEN (8,NAME='rainin.dat',status='old')<BR>&gt; OPEN
 (12,file='rainout.dat',FORM='BINARY',ACCESS='SEQUENTIAL')<BR>&gt; !OPEN<BR>&gt; (12,file='rainout.dat',form='unformatted',access='direct',recl=8*7)<BR>&gt;<BR>&gt; IFLAG = 0<BR>&gt; ! Read and Write<BR>&gt; 10 READ (8,9000,END=90) IYEAR,IMONTH,STID,LAT,LON,RVAL<BR>&gt; 9000 FORMAT (1x,I4,2X,I1,2X,A3,3(2x,F5.1))<BR>&gt; IF (IFLAG.EQ.0) THEN<BR>&gt; IFLAG = 1<BR>&gt; IYROLD = IYEAR<BR>&gt; IMNOLD = IMONTH<BR>&gt; ENDIF<BR>&gt; ! If new time group, write time group terminator.<BR>&gt; ! Assuming no empty time groups.<BR>&gt;<BR>&gt; IF (IYROLD.NE.IYEAR.OR.IMNOLD.NE.IMONTH) THEN<BR>&gt; NLEV = 0<BR>&gt; write(12)stid,lat,lon,tim,nlev,nflag<BR>&gt; ENDIF<BR>&gt;<BR>&gt; IYROLD = IYEAR<BR>&gt; IMNOLD = IMONTH<BR>&gt; ! Write this report<BR>&gt; tim = 0.0<BR>&gt; NLEV = 1<BR>&gt; NFLAG = 1<BR>&gt;<BR>&gt; write(12)stid,lat,lon,tim,nlev,nflag,rval<BR>&gt; GOTO 10<BR>&gt;<BR>&gt; ! On end of file write last time group terminator.<BR>&gt; 90 CONTINUE<BR>&gt; NLEV = 0<BR>&gt;<BR>&gt;
 write(12)stid,lat,lon,tim,nlev,nflag<BR>&gt; close(12)<BR>&gt;<BR>&gt; !****open output file to check how data was written *************<BR>&gt; open(10,file='rainout.dat',FORM='BINARY',ACCESS='SEQUENTIAL')<BR>&gt;<BR>&gt; do i=1,4<BR>&gt; read(10) stid,lat,lon,tim,nlev,nflag,rval !*** read and print<BR>&gt; the ***<BR>&gt; print*, stid,lat,lon,tim,nlev,nflag,rval !** four stations at<BR>&gt; t=1***<BR>&gt; enddo<BR>&gt; read(10) stid,lat,lon,tim,nlev,nflag !*** read and print the***<BR>&gt; print*,stid,lat,lon,tim,nlev,nflag !**time group terminator*<BR>&gt;<BR>&gt; do i=1,4<BR>&gt; read(10) stid,lat,lon,tim,nlev,nflag,rval<BR>&gt; print*, stid,lat,lon,tim,nlev,nflag,rval<BR>&gt; enddo<BR>&gt; read(10) stid,lat,lon,tim,nlev,nflag<BR>&gt; print*,stid,lat,lon,tim,nlev,nflag<BR>&gt;<BR>&gt; END program stndata<BR>&gt; DSET ^rainout.dat<BR>&gt; DTYPE station<BR>&gt; STNMAP ^rainout.map<BR>&gt; UNDEF -99<BR>&gt; TITLE Station Data Sample<BR>&gt; TDEF 2 linear 06z01Mar2007
 6hr<BR>&gt; VARS 1<BR>&gt; r 0 99 rainfall<BR>&gt; ENDVARS<BR>&gt; 1980 1 QQQ 8.3 05.5 123.3<BR>&gt; 1980 1 RRR 14.2 10.5 87.1<BR>&gt; 1980 1 SSS 10.4 -03.5 412.8<BR>&gt; 1980 1 TTT 06.4 01.5 23.3<BR>&gt; 1980 2 QQQ 8.3 05.5 145.1<BR>&gt; 1980 2 RRR 14.2 10.5 871.4<BR>&gt; 1980 2 SSS 10.4 -03.5 223.1<BR>&gt; 1980 2 TTT 06.4 01.5 45.5<BR>&gt;<BR>&gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try<BR>&gt; it now.<BR>&gt; <HTTP: evt="51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20" us.rd.yahoo.com><BR><BR><BR>--<BR><BR>Please note that Charles.Seman@noaa.gov should be considered my NOAA<BR>email address, not cjs@gfdl.noaa.gov.<BR><BR>********************************************************************<BR>Charles Seman Charles.Seman@noaa.gov<BR>U.S. Department of Commerce / NOAA / OAR<BR>Geophysical Fluid Dynamics Laboratory voice: (609)
 452-6547<BR>201 Forrestal Road fax: (609) 987-5063<BR>Princeton, NJ 08540-6649 http://www.gfdl.noaa.gov/~cjs/<BR>********************************************************************<BR><BR>"The contents of this message are mine personally and do not reflect<BR>any position of the Government or NOAA."<BR></BLOCKQUOTE><BR><BR><BR><p>&#32;
      <hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>