Fortran code to convert XYZ data to grads format ...?

Charles Seman Charles.Seman at NOAA.GOV
Thu May 7 15:57:18 EDT 2009


Mald,

Please find attached a Fortran 90 program, subroutines and output files
which I hope may help...

write_grads.f90 is the main program, and there is a parameter you can
adjust for your particular computer system via data_options (currently
set for "little_endian" which allows one to use the GrADS ctl file on
either a "little_endian" or "big_endian" computer;  without this option
in the GrADS ctl file, GrADS can only view the data correctly on a
computer system with "endianness" the same as that on which the data
were generated: e.g. http://en.wikipedia.org/wiki/Endianness ...to check
your computer on which you intend to generate the data, you can start-up
GrADS, and the "config" info will tell you how GrADS was configured for
your computer)...

To compile and run, if your system has "gfortran" you can compile using:
  gfortran write_grads.f90 write_grads_ieee.f90 write_grads_ctl.f90
then to run:
  a.out

For comparison, you can check your local results against those generated
here using attached grads_example.ctl and grads_example.ieee files.

Please let me know if you have any questions or problems with the codes.

Thanks,
Chuck

Mald MM5 wrote:
> Hi users,
>
> Am sure someone must have a fortran code to convert XYZ data (ASCII
> data) into grads format. Since I am not very good at fortran, is it
> possible to share such a code?
>
> Anyone ?
>
> Thanks
>

--

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 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  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: write_grads.f90
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20090507/da0355b0/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: write_grads_ieee.f90
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20090507/da0355b0/attachment-0001.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: write_grads_ctl.f90
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20090507/da0355b0/attachment-0002.pl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grads_example.ieee
Type: application/octet-stream
Size: 36000 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20090507/da0355b0/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: grads_example.ctl
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20090507/da0355b0/attachment-0003.pl 


More information about the gradsusr mailing list