<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.6.2">
</HEAD>
<BODY>
mmm ... your ctl seems correct, but:<BR>
1) avoid blanks at beginning of a line (e.g.: '<FONT COLOR="#0000ff"> p 0 99 rainfall</FONT>' -> '<FONT COLOR="#0000ff">p 0 99 rainfall</FONT>')<BR>
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 ...<BR>
<BR>
No other ideas ...<BR>
Bye bye<BR>
Davide<BR>
<BR>
On Tue, 2005-06-28 at 15:59 +0200, Boyin Huang wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I used an example of grads manual and some knowledge from browsing</FONT>
<FONT COLOR="#000000">previous posters, but ended with an error requiring your help:</FONT>
<FONT COLOR="#000000">---------------------------------------------</FONT>
<FONT COLOR="#000000">stmap error:</FONT>
<FONT COLOR="#000000">stnmap -i rain.ctl</FONT>
<FONT COLOR="#000000">Open Error: Unexpected ENDVARS record</FONT>
<FONT COLOR="#000000">Was expecting 1 records. Found 0.</FONT>
<FONT COLOR="#000000"> --> The invalid description file record is:</FONT>
<FONT COLOR="#000000"> --> endvars</FONT>
<FONT COLOR="#000000"> The data file was not opened.</FONT>
<FONT COLOR="#000000">File name is: rain.ctl</FONT>
<FONT COLOR="#000000">-----------------------------------------</FONT>
<FONT COLOR="#000000">rain.ctl file</FONT>
<FONT COLOR="#000000">DSET rain.dat</FONT>
<FONT COLOR="#000000">DTYPE station</FONT>
<FONT COLOR="#000000">STNMAP rain.map</FONT>
<FONT COLOR="#000000">UNDEF -999.0</FONT>
<FONT COLOR="#000000">options sequential</FONT>
<FONT COLOR="#000000">TITLE rainfall</FONT>
<FONT COLOR="#000000">TDEF 2 linear jan1980 1mo</FONT>
<FONT COLOR="#000000">VARS 1</FONT>
<FONT COLOR="#000000"> p 0 99 rainfall</FONT>
<FONT COLOR="#000000">ENDVARS</FONT>
<FONT COLOR="#000000">------------------------------------------------</FONT>
<FONT COLOR="#000000">ASCII data: rain.ch</FONT>
<FONT COLOR="#000000">1980 1 QQQ 34.3 -85.5 123.3</FONT>
<FONT COLOR="#000000">1980 1 RRR 44.2 -84.5 87.1</FONT>
<FONT COLOR="#000000">1980 1 SSS 22.4 -83.5 412.8</FONT>
<FONT COLOR="#000000">1980 1 TTT 33.4 -82.5 23.3</FONT>
<FONT COLOR="#000000">1980 2 QQQ 34.3 -85.5 145.1</FONT>
<FONT COLOR="#000000">1980 2 RRR 44.2 -84.5 871.4</FONT>
<FONT COLOR="#000000">1980 2 SSS 22.4 -83.5 223.1</FONT>
<FONT COLOR="#000000">1980 2 TTT 33.4 -82.5 45.5</FONT>
<FONT COLOR="#000000">--------------------------------------------</FONT>
<FONT COLOR="#000000">FORTRAN (sequential)</FONT>
<FONT COLOR="#000000"> CHARACTER*8 STID</FONT>
<FONT COLOR="#000000"> OPEN (8,NAME='rain.ch')</FONT>
<FONT COLOR="#000000"> OPEN (10,NAME='rain.dat',FORM='UNFORMATTED')</FONT>
<FONT COLOR="#000000"> IFLAG = 0</FONT>
<FONT COLOR="#000000">C Read and Write</FONT>
<FONT COLOR="#000000">10 READ (8,9000,END=90) IYEAR,IMONTH,STID,RLAT,RLON,RVAL</FONT>
<FONT COLOR="#000000">9000 FORMAT (I4,3X,I2,2X,A8,3F8.1)</FONT>
<FONT COLOR="#000000"> IF (IFLAG.EQ.0) THEN</FONT>
<FONT COLOR="#000000"> IFLAG = 1</FONT>
<FONT COLOR="#000000"> IYROLD = IYEAR</FONT>
<FONT COLOR="#000000"> IMNOLD = IMONTH</FONT>
<FONT COLOR="#000000"> ENDIF</FONT>
<FONT COLOR="#000000">C If new time group, write time group terminator.</FONT>
<FONT COLOR="#000000">C Assuming no empty time groups.</FONT>
<FONT COLOR="#000000"> IF (IYROLD.NE.IYEAR.OR.IMNOLD.NE.IMONTH) THEN</FONT>
<FONT COLOR="#000000"> NLEV = 0</FONT>
<FONT COLOR="#000000"> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG</FONT>
<FONT COLOR="#000000"> ENDIF</FONT>
<FONT COLOR="#000000"> IYROLD = IYEAR</FONT>
<FONT COLOR="#000000"> IMNOLD = IMONTH</FONT>
<FONT COLOR="#000000">C Write this report</FONT>
<FONT COLOR="#000000"> TIM = 0.0</FONT>
<FONT COLOR="#000000"> NLEV = 1</FONT>
<FONT COLOR="#000000"> NFLAG = 1</FONT>
<FONT COLOR="#000000"> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG</FONT>
<FONT COLOR="#000000"> WRITE (10) RVAL</FONT>
<FONT COLOR="#000000"> GO TO 10</FONT>
<FONT COLOR="#000000">C On end of file write last time group terminator.</FONT>
<FONT COLOR="#000000">90 CONTINUE</FONT>
<FONT COLOR="#000000"> NLEV = 0</FONT>
<FONT COLOR="#000000"> WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG</FONT>
<FONT COLOR="#000000"> STOP</FONT>
<FONT COLOR="#000000"> END</FONT>
<FONT COLOR="#000000">FORTAN file reading rain.ch and writing rain.dat (sequestial)</FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
--
Sacchetti Davide
ARPAL UO3 Centro Meteo Idrologico Regione Liguria - Dir. Scientifica
P.za Vittoria 15 16121 Genova (I)
tel: +39 010 5761479
mail: <A HREF="mailto:davide.sacchetti@arpal.org">davide.sacchetti@arpal.org</A> web: <A HREF="http://www.meteoliguria.it">www.meteoliguria.it</A>
</PRE>
</TD>
</TR>
</TABLE>
<BR><PRE>
______________________________________
For your security, this mail has been scanned and protected by Inflex
</pre><BR></BODY>
</HTML>