Multi-level Station Data

M. Mahakur mmahakur at MAIL.TROPMET.RES.IN
Mon Aug 22 04:05:15 EDT 2005


Hello Random:

Once I had plotted the station data having several (21) pressure levels
(plevel) using GrADS. Below is a part of the FORTRAN code, which works.

       nlevel=1
        nflag=0
        time=0.0
        plevel=levs(jlev)
        do k=1,ns             ! No. of Stations
           write(99)stn_name,slt(k),sln(k),time,nlevel,nflag
           write(99)plevel,var(1),var(2),...
        end do



       nlevel=0
       write(99)stn_name,slt(ns),sln(ns),time,nlevel,nflag

And in the ctl :

zdef 21 levels 1000 950 900 850 800 750 700 650 600 550 500 450 400 350
300 250 200 175 150 125 100

Hope it will serve your purpose. I also did not found online
documentations or in the listerv at that time.

With Regards,

Mahakur

Random Person wrote:

>GrADS Users,
>I cannot seem to figure out how to properly use
>multi-level station data in GrADS.  I've read all I
>can find in the listserv archive and have not yet
>found something that seems to solve my problem.  I'm
>able to create single-level station files and interact
>with them in GrADS.  I can also create station files
>with both single-level and multi-level variables and
>interact with any of the single-level variables but I
>cannot interact with the multi-level variables. I'm
>not sure if my problem is that I'm not properly
>interacting with the multi-level variables or if I'm
>not properly writing the multi-level variables to the
>data file in the first place.
>
>Based on an example I found in the listserv archive,
>to test if the multi-level variables are recognized by
>GrADS I issue the following commands:
>set gxout stat
>set stnprint on
>d a
>where 'a' is the name of the multilevel variable.
>This results in the following output:
>
>Data Type = station
>Dimensions = 0 1
>I Dimension = 0 to 360
>J Dimension = -90 to 90
>Stn count = 0
>Undef value = -999
>Undef count = 0  Valid count = 0
>Min, Max = -999 -999
>Cmin, cmax, cint = -1004 -994 1
>Stats[sum,sumsqr,root(sumsqr),n]:     0 0 0 0
>Stats[(sum,sumsqr,root(sumsqr))/n)]:     0 0 0
>Stats[(sum,sumsqr,root(sumsqr))/(n-1))]: 0 0 0
>Stats[(sigma,var)(n)]:     0 0
>Stats[(sigma,var)(n-1)]:   0 0
>Printing station values:  #obs = 1
>OB    ID       LON      LAT      LEV      VAL
>
>I assume this means that it cannot 'see' the
>multi-level data since when I issue
>a similar set a commands for a single-level variable
>it lists output that ends with the ob ID's, lon, lat,
>level, and value.  Assuming that this is a valid
>way to test that a multi-level variable is 'seen' by
>GrADS, it would seem that I have not correctly created
>the data file or ctl file.
>
>The version of GrADS I'm using is v1.9b4 (the
>Intel/LinuxRHE3 binaries).
>
>I created the data file with the following Fortran 90
>code:
>*******************************************
>PROGRAM TESTCASE
>   IMPLICIT NONE
>   integer :: outunit = 12 !Output file unit
>   character(len=8) :: stationid !Station identifier
>for grads file
>   real :: lat,lon !Latitude, longitude
>   real :: timeshift !Time shift of this ob
>   integer :: nlev !Number of vertical layers (+1 if
>flag==1)
>   integer :: flag !Is there sfc-only data
>   real :: height !Height of ob
>   real :: ob !Observed value
>
>
>   !Open the output file
>
>open(outunit,file='testcase.dat',status='replace',action='write',&
>    form='unformatted',access='sequential')
>
>   write(stationid,'I8'),1
>   lat = 45.0
>   lon = 35.0
>   timeshift = 0.0
>   nlev = 2
>   flag = 0
>
>   !Write header
>
>write(outunit),stationid,lat,lon,timeshift,nlev,flag
>
>
>   !Write data for first layer
>   height = 15.0
>   ob = 12.0
>   write(outunit),height,ob
>
>   !Write data for second layer
>   height = 25.0
>   ob = 22.0
>   write(outunit),height,ob
>
>   !Write time terminator
>   write(outunit),'TIMETERM',0.0,0.0,0.0,0,0
>
>   close(outunit)
>
>END PROGRAM TESTCASE
>*******************************************
>
>My ctl file is as follows:
>*******************************************
>DSET   ^testcase.dat
>DTYPE  station
>STNMAP testcase.map
>UNDEF  -999.0
>TITLE  Test Data
>OPTIONS sequential
>TDEF    1 linear 00:00Z01may2002 01mn
>VARS    1
>a 1 99 no description
>ENDVARS
>*******************************************
>
>For simplicity, this test case is basically a single
>variable at a single time with two levels.
>Running stnmap I get the following result:
>*******************************************
>  Name of binary data set: testcase.dat
>  Number of times in the data set: 1
>  Number of surface variables: 0
>  Number of level dependent variables: 1
>
>Starting scan of station data binary file.
>Binary data file open: testcase.dat
>Processing time = 1
>  ID,LON,LAT,T,NLEV,FLAG:        1 35 45 0 2 0  SIZE =
>44
>  ID,LON,LAT,T,NLEV,FLAG: TIMETERM 0 0 0 0 0  SIZE =
>28
>     Time = 1 has stn count = 1
>  Max reports per time:  1 reports at t = 1
>  Max data elements in largest report: 4
>
>Version 2 Station map file created: testcase.map
>
>stnmap: WARNING!!  This stnmap file can only be
>accessed by GrADS Version 1.9b4
>stnmap: WARNING!!  However, GrADS Version 1.9b4 can
>read both versions
>
>stnmap: COMMENT  -- use the -1 command line option to
>create a map for older GrADS versions
>
>stnmap: COMMENT  -- use the -q command line option to
>disable the station header listing
>*******************************************
>
>I have run other test cases that vary the number of
>times, the number of stations, and the number of
>variables and invariably I obtain the same results.
>All of the single-level variables appear correct while
>I am unable to get themulti-level data to show up.
>Perhaps this means that the process I'm using to check
>if the multi-level data is there is incorrect?
>
>I would appreciate any help anyone could offer.
>
>Thanks,
>Brian Reen
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>
>
>



More information about the gradsusr mailing list