I think that your problem is when you read the next line, make sure
that the dat file is generated correctly use one line of rain.prn file
and try again running stnmap an ctl.<br>
<br><br><div><span class="gmail_quote">On 9/4/05, <b class="gmail_sendername">Rochelle Balmori</b> <<a href="mailto:rtfbalmori@gmail.com">rtfbalmori@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I'm trying to use the stnmap utility but I always get this error message:<br><br>Open Error: Data file type invalid<br> --> The invalid description file record is:<br> --> options sequential<br><br>
The data file was not opened.<br>File name is: rain.ctl<br><br>OR (if i interchange the 2nd and 3rd line of my descriptor file)<br><br>[balmori@methost7 mo]$ stnmap -i rain.ctl<br>Open Error: Data file type invalid<br>
--> The invalid description file record is:<br> --> dtype station<br><br> The data file was not opened.<br>File name is: rain.ctl<br><br><br>I've used and read almost all the archived messages regarding stnmap but was
<br>still unsuccessful.<br><br>I used rain.prn (an example) as my data file<br><br>4.23 93.13 17.21<br>-5.25 105.18 26.43<br>3.80 98.70 24.39<br>3.57 98.68 17.30<br>1.55 98.88 47.72<br>1.23
97.63 20.18<br>1.12 104.12 124.57<br>0.92 104.53 27.68<br>0.47 101.45 11.30<br>3.20 106.25 61.65<br>3.95 108.38 90.12<br>-0.47 102.32 9.37<br>-1.63 103.65 10.96<br>-2.90 104.70 37.96
<br>-2.17 106.13 21.86<br>-3.88 102.33 5.71<br>-4.45 105.18 28.49<br><br>Then I used stngrads.f to convert this to the binary file<br><br> program stngrads<br>c<br> real rlat, rlon, rval, tim
<br> integer iyear, imonth, iflag, nlev, nflag, year, month<br> character outfile*72,infile*72, stid*4<br><br> print *, 'Enter input file name: '<br> read (*,'(a)') infile<br><br> print *, 'Enter output file name: '
<br> read (*,'(a)') outfile<br><br>c size = 17*3<br> open (8, file=infile)<br> open (55,file=outfile,form='unformatted',access='sequential')<br>c open c(55,file=outfile,form='unformatted',access='direct',recl=4*17*3)
<br>c size = 17*4<br>c<br>C Read and Write<br> do i = 1, 17<br> READ (8, *) RLAT,RLON,RVAL<br> TIM = 0.0<br> STID = char(i+64)//'XXX'<br> NLEV = 1<br> NFLAG = 1<br> WRITE (55) STID,RLAT,RLON,TIM,NLEV,NFLAG
<br>c write (*,*) STID,RLAT,RLON,TIM,NLEV,NFLAG<br> WRITE (55) RVAL<br>c write (*,*) RVAL<br> enddo<br>c<br>C On end of file write last time group terminator.<br> NLEV = 0<br> write (10)
<br> WRITE (55) STID,RLAT,RLON,TIM,NLEV,NFLAG<br>close (55)<br>close (8)<br><br> STOP<br> END<br><br>I was not able to use RECORDTYPE='STREAM' because pgf90 (fortran compiler)<br>did not recognize it so I used the 'sequential' option as suggested by some
<br>in the archive. I was able to produce the binary file (rain.out).Then I used<br>this descriptor file to create a station map:<br><br>DSET ^rain.out<br>OPTIONS sequential<br>DTYPE station<br>STNMAP rain.map<br>UNDEF -
999.0<br>TITLE stations<br>TDEF 1 linear jan1979 1hr<br>VARS 1<br> f 0 99 data<br>ENDVARS<br><br>I've also experimented on changing the value for NLEV and NFLAG to either 1<br>or 0 (but I always use 1 because I have surface data) but still it did not
<br>work. I'm compiling it in a linux machine (redhat 7.2) using a portland<br>group compiler (pgf90).<br><br>Could somebody suggest what I should do?<br><br>Thanks very much.<br><br>Rochelle<br>San Jose State University<br>
</blockquote></div><br>