About the sation data

Chaoxia Yuan yuan at EPS.S.U-TOKYO.AC.JP
Mon May 7 03:28:38 EDT 2007


Dear all,

There days, I have trid to create a station data set through fortran but met some problems.  I have
checked the archive and found no similar question.  So I pose it here and hope anybody can give
me any advice.  the work I did as following

1, create the binary data set of station

2, create discription file of the station data

3, run the stnmap commad to get .map file

All the above look working well, but when I use grads to plot the station data that I have created,@
all the data come out to be the same as zero or sometimes plus or minus zero in all stations even
though all station data were set to 5 in fortran program as below.

      integer  nx, ny
      parameter (nx = 89, ny = 89)
      real lon(nx, ny), lat(nx, ny)
      real rain(nx, ny)
      integer  nflag, nlev, rec
      character * 8  stid
      integer i, j, k, m, n, recl
      real tim

      open (11, file = 'lon.dat', access = 'direct',
     $     recl = nx * ny * 4)
      open (22, file = 'lat.dat', access = 'direct',
     $     recl = nx * ny * 4)
      open (33, file = 'rain.dat', access = 'direct',
     $     recl = nx * ny * 4)
      read (11, rec = 1 ) lon
      read (22, rec = 1 ) lat
      read (33, rec = 1 ) rain
      close (11)
      close (22)
      close (33)

      open (111, file = 'test.dat', access = 'direct',
     $     form = 'unformatted',
     $     recl = 8 * 4)
      k = 0
      nflag = 1
      nlev = 1
      tim = 0.0
      do j = 1, ny
         do i = 1, nx
            k = k + 1
            write (stid, '(i8)') i + (j - 1) * 89
            write (111, rec = k) stid, lat(i, j), lon(i, j), tim,
     $           nlev, nflag, 5
C$$$               write (111, rec = k) stid, lat(i, j), lon(i, j), tim,
C$$$     $              nlev, nflag, rain (i, j)
          enddo
      enddo
      k = k + 1
      nlev = 0
      write (111, rec = k) stid, lat (i, j), lon(i, j), tim, nlev,
     $     nflag
      close (111)
      end

the control file test.ctl is

dset test.dat
dtype station
stnmap station.map
undef -999.0
title station data
tdef 1 linear jan1973 1mo
vars 1
v1 0 99 test
endvars

and the command as below was run

stnmap -i test.ctl

(no mistake when running stnmap command)

Thank you very much for any advice

Chaoxia Yuan
Earth and Planetary Scinece
School of Scinece
The University of Tokyo



More information about the gradsusr mailing list