stnmap utility

Rochelle Balmori rtfbalmori at GMAIL.COM
Sun Sep 4 19:14:47 EDT 2005


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   104.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



More information about the gradsusr mailing list