[gradsusr] Hello to all users of Grads

Muhammad Yunus Ahmad Mazuki ukm.yunus at gmail.com
Sun Mar 31 22:25:44 EDT 2013


The average function itself has what you needed. ave(var1,t=1,t=360,*12*),
this means it will average values from t=1,t=13,t=25 ... until
t=360.Example of point value extraction.

'sdfopen foo.nc'
lonvalue=90
latvalue=0
levvalue=850
tvalue=1
'set lon 'lonvalue
'set lat 'latvalue
'set t 'tvalue
'set lev 'levvalue
'd variable1'
catch=sublin(result,4)
'set gxout fwrite'
'set fwrite point.dat'
'd 'catch
'disable fwrite'

This is a basic one, modify it as your need requires. I'm not sure about
excel, but this will create a binary file, which can be opened by GrADS
(using a controller file) and Scilab (which I use for further analysis).

Yunus.


On Sun, Mar 31, 2013 at 2:25 PM, avi kojokro <kojokroavi at gmail.com> wrote:

> I'm trying to do a script of averages like this example :
>
>
> 'set t 1 '
> 'define varav=ave(t850-273.16,t=1,t=1,1)'
> 'd varav'
> cc=subwrd(result,4)
> 'draw string 0.5 8 jan='cc
>
> I want my script calculates every 12 months, how do I create a loop script
> that calculates every 12 month average of the same month.
> I will give an example of what I mean: I want to begin to calculate average
> of January 1979 and then later to calculate directly the January 1980 and
> so on.
> Is it possible that the result will write directly to the Excel file, then how
> to write the command to it.
>
> Please note that I first started Grads.
>
> Thank you so much.
>
> avi
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130401/2f6a63d3/attachment-0003.html 


More information about the gradsusr mailing list