Writing to GrADS using Fortran

Charles Seman Charles.Seman at NOAA.GOV
Wed Apr 20 16:37:52 EDT 2005


Dear Eduardo,

Here is Example 3 from
http://grads.iges.org/grads/gadoc/aboutgriddeddata.html#structure

I hope this helps,
Chuck

-------------------------------------------------------------------------------------------------------------------------

Another simple sample might be:

   REAL X(100)
   DO 10 I=1,100
     X(I)=I
10 CONTINUE
   OPEN (8,FILE='samp.dat',FORM='UNFORMATTED',ACCESS='DIRECT',
  &RECL=100)
   WRITE (8,REC=1) X
   STOP
   END

The associated descriptor file:

DSET <http://grads.iges.org/grads/gadoc/descriptorfile.html#DSET>      samp.dat
TITLE <http://grads.iges.org/grads/gadoc/descriptorfile.html#TITLE>     Sample Data Set
UNDEF <http://grads.iges.org/grads/gadoc/descriptorfile.html#UNDEF>    -9.99E33
XDEF <http://grads.iges.org/grads/gadoc/descriptorfile.html#XDEF>     100 LINEAR 1 1
YDEF <http://grads.iges.org/grads/gadoc/descriptorfile.html#YDEF>     1 LINEAR 1 1
ZDEF <http://grads.iges.org/grads/gadoc/descriptorfile.html#ZDEF>      1 LINEAR 1 1
TDEF <http://grads.iges.org/grads/gadoc/descriptorfile.html#TDEF>      1 LINEAR 1JAN2000 1DY
VARS <http://grads.iges.org/grads/gadoc/descriptorfile.html#VARS>      1
x  0  99  100 Data Points
ENDVARS <http://grads.iges.org/grads/gadoc/descriptorfile.html#ENDVARS>

Once created, you can use this data set to experiment with GrADS data
functions, such as:

      display <http://grads.iges.org/grads/gadoc/gradcomddisplay.html>
      sin <http://grads.iges.org/grads/gadoc/gradfuncsin.html>(x/50)

-------------------------------------------------------------------------------------------------------------------------

Eduardo Blanchard wrote:

> Hello
>
> I am trying to write two different time series into a .grd file so I can
> view them and for example do a scatter plot of the two time series in
> Grads
>
> within the Fortran program, I do:
>
> open(14,file='scatter.grd',form='unformatted',access='direct',recl=4*109)
> write(14,rec=1)(IE(itime),itime=1,109)
> write(14,rec=2)(data1(3,it),it=392,500)
> close(14)
>
> but in Grads this just opens two time series, length 54 that take
> alternating values from one of my initial time vectors- in this case,
> IE(itime)
>
> My ctl file is:
> DSET scatter.grd
> TITLE   HGT
> UNDEF   -99
> TDEF 109 LINEAR 1aug90 1mo
> XDEF 1 LINEAR 1 1
> YDEF 1 LINEAR 1 1
> ZDEF 1 LINEAR 1 1
>
> VARS 2
> f1 1 99 HT data
> f2 1 99 HT data
> ENDVARS
>
> Any help is very much appreciated
>
> Ed


--

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08542                 http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20050420/be483ed0/attachment.html 


More information about the gradsusr mailing list