Station data-Stnmap problem

Ioannis Koletsis koletsis at METEO.NOA.GR
Wed Apr 16 05:26:31 EDT 2008


Dear grads users,
following the example for the file of rain (http://www.iges.org/grads/gadoc/gadocindex.html), I created the following program for 2 variables u and v 

character*8 stid
       open (8,name='clear_data.txt')
       open (10,name='data.dat',form='unformatted',access='direct',
     + recl=4)
 10    read(8,9000,end=90) iyear,imonth,stid,rlat,rlon,rval,rval2
 9000  format(i4,1x,i1,1x,i2,1x,f9.5,1x,f9.5,1x,f7.2,1x,f7.2)
       if (iflag.eq.0) then
          iflag=1
          iyrold=iyear
          imnold=imonth
       endif
       if (iyrold.ne.iyear.or.imnold.ne.imonth) then
          nlev=0
       write(10) stid,rlat,rlon,tim,nlev,nflag,nflag2
       endif
       iyrold=iyear
       imnold=imonth
       tim=0.0
       nlev=1
       nflag=1
       nflag2=1
       write(10) stid,rlat,rlon,tim,nlev,nflag,nflag2
       write(10) rval,rval2
       goto 10
 90    continue
       nlev=0
       write(10) stid,rlat,rlon,tim,nlev,nflag,nflag2
       stop
       end

The compilation was completed successfully and a fortran_pr.e file was created. Afterwards running the file a data. dat file was created, also.
Then using the following station_data.ctl file

DSET   ^data.dat
DTYPE  station 
STNMAP station_data.map
UNDEF   -99999
TITLE  Station Data Sample
TDEF   1 linear 06z27jul2003 12hr
VARS 2
u     0  99  surface u-wind
v     0  99  surface v-wind  
ENDVARS

I execute the command stnmap -i station_data.ctl, I received the following 

Name of binary data set: data.dat
Number of times in the data set: 1
Number of surface variables: 2
Number of level dependent variables: 0

Starting scan of station data binary file.
Binary data file open: data.dat
Processing time=1
Invalid station hdr found in station binary file
Possible causes: Invalid level count in hdr
Descriptor file mismatch
File not station data
Invalid relative time
levs=-1073751116 flag=0 time=32.625


Do you have an idea for what is wrong?
Thanks in advance......





-----------------------------------------------------------              
Ioannis Koletsis
National Observatory of Athens
Institute for Environmental Research
Lofos Koufou
15236-Penteli
Athens-Greece
Tel: (+30) 210 8109140
e-mail: koletsis at meteo.noa.gr
           ikoletsis at gmail.com
-----------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080416/4cb4655d/attachment.html 


More information about the gradsusr mailing list