simplest station data and stnmap
Boyin Huang
Boyin.Huang at NOAA.GOV
Tue Jun 28 14:21:28 EDT 2005
Thanks. It works, but strange! (There is always spaces in grads doc)
Davide Sacchetti wrote:
> mmm ... your ctl seems correct, but:
> 1) avoid blanks at beginning of a line (e.g.: ' p 0 99 rainfall' ->
> 'p 0 99 rainfall')
> 2) aren't you using a rain.ctl written on a different system? I mean:
> if your ctl has been written in the Windows environment and it has
> been transferred via ftp without "ascii settings" on a unix system ...
> also if many editors, as vi, "understand" this, grads does not ...
>
> No other ideas ...
> Bye bye
> Davide
>
> On Tue, 2005-06-28 at 15:59 +0200, Boyin Huang wrote:
>
>>I used an example of grads manual and some knowledge from browsing
>>previous posters, but ended with an error requiring your help:
>>
>>---------------------------------------------
>>stmap error:
>>stnmap -i rain.ctl
>>Open Error: Unexpected ENDVARS record
>>Was expecting 1 records. Found 0.
>> --> The invalid description file record is:
>> --> endvars
>>
>> The data file was not opened.
>>File name is: rain.ctl
>>
>>-----------------------------------------
>>rain.ctl file
>>DSET rain.dat
>>DTYPE station
>>STNMAP rain.map
>>UNDEF -999.0
>>options sequential
>>TITLE rainfall
>>TDEF 2 linear jan1980 1mo
>>VARS 1
>> p 0 99 rainfall
>>ENDVARS
>>
>>------------------------------------------------
>>ASCII data: rain.ch
>>
>>1980 1 QQQ 34.3 -85.5 123.3
>>1980 1 RRR 44.2 -84.5 87.1
>>1980 1 SSS 22.4 -83.5 412.8
>>1980 1 TTT 33.4 -82.5 23.3
>>1980 2 QQQ 34.3 -85.5 145.1
>>1980 2 RRR 44.2 -84.5 871.4
>>1980 2 SSS 22.4 -83.5 223.1
>>1980 2 TTT 33.4 -82.5 45.5
>>
>>--------------------------------------------
>>FORTRAN (sequential)
>>
>> CHARACTER*8 STID
>> OPEN (8,NAME='rain.ch')
>> OPEN (10,NAME='rain.dat',FORM='UNFORMATTED')
>> IFLAG = 0
>>C Read and Write
>>10 READ (8,9000,END=90) IYEAR,IMONTH,STID,RLAT,RLON,RVAL
>>9000 FORMAT (I4,3X,I2,2X,A8,3F8.1)
>> IF (IFLAG.EQ.0) THEN
>> IFLAG = 1
>> IYROLD = IYEAR
>> IMNOLD = IMONTH
>> ENDIF
>>C If new time group, write time group terminator.
>>C Assuming no empty time groups.
>> IF (IYROLD.NE.IYEAR.OR.IMNOLD.NE.IMONTH) THEN
>> NLEV = 0
>> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
>> ENDIF
>> IYROLD = IYEAR
>> IMNOLD = IMONTH
>>C Write this report
>> TIM = 0.0
>> NLEV = 1
>> NFLAG = 1
>> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
>> WRITE (10) RVAL
>> GO TO 10
>>C On end of file write last time group terminator.
>>90 CONTINUE
>> NLEV = 0
>> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
>> STOP
>> END
>>
>>FORTAN file reading rain.ch and writing rain.dat (sequestial)
>>
>>
>--
>Sacchetti Davide
>ARPAL UO3 Centro Meteo Idrologico Regione Liguria - Dir. Scientifica
>P.za Vittoria 15 16121 Genova (I)
>tel: +39 010 5761479
>mail: davide.sacchetti at arpal.org <mailto:davide.sacchetti at arpal.org> web: www.meteoliguria.it <http://www.meteoliguria.it>
>
>
>
>______________________________________
>For your security, this mail has been scanned and protected by Inflex
>
>
>
--
Boyin Huang, Oceanographer
RSIS/NOAA CPC
Room 605-A, WWB
5200 Auth Rd
Camp Springs, MD 20746
Phone: 301-763-8000 ext 7575
Fax: 301-763-8395
Email: boyin.huang at noaa.gov
More information about the gradsusr
mailing list