[gradsusr] displaying data from ascii file

Ricardo Hallak hallak at model.iag.usp.br
Sat Jul 21 03:16:51 EDT 2012


Hi Jeff,

you have to write a fortran code to read your data and write them as a simple binary file. With an appropriate .ctl you will be able to display it in  GrADS.
Take a look at the GrADS Documentation Index entry for "binary data sets". Isn't it what you are looking for?

For example:

If you have a z(lon,lat) list of data, this excerpt below (fortran 77 code) tell you how to write a regular field in binary (it will also work for an "almost" regular field, with some few displacements of the data from their real position):

This simple example write out one variable:

 REAL Z(72,46)

c .... read your data here

  OPEN(8,FILE='grads.bin',FORM='UNFORMATTED',
& ACCESS='DIRECT',RECL=72*46)
WRITE (8,REC=1) ((Z(I,J),I=1,72),J=1,46)

 CLOSE (8)

and the .ctl:
DSET ^grads.bin 
TITLE Some Data 
UNDEF -9999.90 
XDEF 72 linear -80 2.5 
YDEF 46 linear 30 2.0 
ZDEF 1 levels 1000
TDEF 1 linear 00z01apr2012 6hr
VARS 1 
Z 1 99 Some variable 
ENDVARS
If your data is really almost rectangular, you can approximate the xdef and ydef intervals appropriately.

Forgive me if it is not exactly what you are looking for.
Regards,
Ricardo

On Fri, 20 Jul 2012 16:56:31 -0500, Jeff Duda wrote
> Hello,
> I have some text data that I would like to display as a gridded field.  Basically it's already a rectangular array of values, but only in text form.  Is it possible to do this?  If so, how?
> Jeff Duda
> 
> -- 
> Jeff Duda
> Graduate research assistant
> University of Oklahoma School of Meteorology
> Center for Analysis and Prediction of Storms

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120721/0950c577/attachment-0003.html 


More information about the gradsusr mailing list