[gradsusr] Reading a text file in GrADS

Jeff Duda jeffduda319 at gmail.com
Sun Feb 19 13:45:54 EST 2012


Mubashar,
>From the description of intrinsic functions on the Grads scripting language
site <http://www.iges.org/grads/gadoc/script.html#intrinsic>:

*read (filename)*
This functions reads individual records from file *filename*. Repeated
calls must be made to read consecutive records. The result is a string
containing two lines: the first line is the return code, the 2nd line is
the record read from the file. The record may be a maximum of 80
characters. Use the sublin function to separate the result. Return codes
are:

   0 - ok
   1 - open error
   2 - end of file
   8 - file open for write
   9 - I/O error

Files are opened when the first call to read is made for a particular file
name. Files are closed when the execution of the script file terminates
(note that files remain open between function calls, etc).

This should be what you need.

Jeff Duda

On Sun, Feb 19, 2012 at 11:34 AM, Mubashar Dogar <mubashardogar at gmail.com>wrote:

> Dear GrADS users,
>
> Could some one guide me how can I read following data in GrADS. This
> is basically NAO index data which I wanted to plot in GrADS. Please
> suggest me. I am pasting down some part of my data:
>
> Hurrell Station-Based Monthly NAO Index
>       Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep   Oct   Nov   Dec
> 1865  -0.6  -1.2   0.2  -0.2  -0.4   0.0   0.5   1.5   1.8  -2.0  -0.9
> 0.8
> 1866   0.5   0.8  -0.6  -2.3  -2.0   0.9  -0.5  -0.2   2.4  -0.3  -0.5
> 0.2
> 1867  -3.5   1.1  -4.3   1.8  -4.2   0.1  -2.0   1.9   1.4   2.2  -3.5
>  -0.1
> 1868   0.7   3.0   3.6   1.7   2.3   3.1   0.4   1.5  -2.8   3.5  -1.8
>  -0.1
>
>
>
> Thanks,
>
> Mubashar
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>



-- 
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/20120219/36d40284/attachment-0003.html 


More information about the gradsusr mailing list