stnmap utility

Rochelle Balmori rtfbalmori at GMAIL.COM
Mon Sep 5 05:08:06 EDT 2005


Hi Zhao,

I implemented your suggestion but it still gave the same error =( It 
compiled and run ok though but the proble is when i ran the stnmap utility.

By the way, this is just a sample I'm trying to run but actually, i have 76 
stations with hourly data (7 days). Do you know what RECORDTYPE='STREAM' 
means and where/what kind of compiler is it used. In the manual, it said 
that it is used for DEC FORTRAN, sorry for my being naive but what the heck 
is DEC FORTRAN?

Thanks,
Rochelle

On 9/4/05, zhao yacang <zdr1168 at yahoo.com> wrote:
> 
> Rochelle
> Also, there is another error in your fortran code.
> character outfile*72,infile*72, *stid*8*
> If you use direct format.
> c open c(55,file=outfile,form='unformatted',access='direct'*,recl=4*8*)
> Because you have only one varible.
> 
> *Rochelle Balmori <rtfbalmori at GMAIL.COM>* wrote:
> 
> Hello,
> 
> I'm trying to use the stnmap utility but I always get this error message:
> 
> Open Error: Data file type invalid
> --> The invalid description file record is:
> --> options sequential
> 
> The data file was not opened.
> File name is: rain.ctl
> 
> OR (if i interchange the 2nd and 3rd line of my descriptor file)
> 
> [balmori at methost7 mo]$ stnmap -i rain.ctl
> Open Error: Data file type invalid
> --> The invalid description file record is:
> --> dtype station
> 
> The data file was not opened.
> File name is: rain.ctl
> 
> 
> I've used and read almost all the archived messages regarding stnmap but 
> was
> still unsuccessful.
> 
> I used rain.prn (an example) as my data file
> 
> 4.23 93.13 17.21
> -5.25 105.18 26.43
> 3.80 98.70 24.39
> 3.57 98.68 17.30
> 1.55 98.88 47.72
> 1.23 97.63 20.18
> 1.12 104.12 124.57
> 0.92 10 4.53 27.68
> 0.47 101.45 11.30
> 3.20 106.25 61.65
> 3.95 108.38 90.12
> -0.47 102.32 9.37
> -1.63 103.65 10.96
> -2.90 104.70 37.96
> -2.17 106.13 21.86
> -3.88 102.33 5.71
> -4.45 105.18 28.49
> 
> Then I used stngrads.f to convert this to the binary file
> 
> program stngrads
> c
> real rlat, rlon, rval, tim
> integer iyear, imonth, iflag, nlev, nflag, year, month
> character outfile*72,infile*72, stid*4
> 
> print *, 'Enter input file name: '
> read (*,'(a)') infile
> 
> print *, 'Enter output file name: '
> read (*,'(a)') outfile
> 
> c size = 17*3
> open (8, file=infile)
> open (55,file=outfile,form='unformatted',access='sequential')
> c open c(55,file=outfile,form='unformatted',access='direct',recl=4*17*3)
> c size = 17*4
> c
> C Read and Write
> do i = 1, 17
> READ (8, *) RLAT,RLON,RVAL
> TIM = 0.0
> STID = char(i+64)//'XXX'
> NLEV = 1
> NFLAG = 1
> WRITE (55) STID,RLAT,RLON,TIM,NLEV,NFLAG
> c write (*,*) STID,RLAT,RLON,TIM,NLEV,NFLAG
> WRITE (55) RVAL
> c write (*,*) RVAL
> enddo
> c
> C On end of file write last time group terminator.
> NLEV = 0
> write (10)
> WRITE (55) STID,RLAT,RLON,TIM,NLEV,NFLAG
> close (55)
> close (8)
> 
> STOP
> END
> 
> I was not able to use RECORDTYPE='STREAM' because pgf90 (fortran compiler)
> did not recognize it so I used the 'sequential' option as suggested by 
> some
> in the archive. I was able to produce the binary file (rain.out).Then I 
> used
> this descriptor file to create a station map:
> 
> DSET ^rain.out
> OPTIONS sequential
> DTYPE station
> STNMAP rain.map
> UNDEF -999.0
> TITLE stations
> TDEF 1 linear jan1979 1hr
> VARS 1
> f 0 99 data
> ENDVARS
> 
> I've also experimented on changing the value for NLEV and NFLAG to either 
> 1
> or 0 (but I always use 1 because I have surface data) but still it did not
> work. I'm compiling it in a linux machine (redhat 7.2) using a portland
> group compiler (pgf90).
> 
> Could somebody suggest what I should do?
> 
> Thanks very much.
> 
> Rochelle
> San Jose State University
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20050905/56ea8109/attachment.html 


More information about the gradsusr mailing list