[gradsusr] Averaging function in GrADS.

Jeffrey Duda jdduda at iastate.edu
Tue May 3 01:25:07 EDT 2011


Sal,
I think to do this the way you want to, you're going to have to write a
script and put that line inside a while loop.  Something like:

sum = 0
n = 1
while (n <= #_of_days)
 sum = sum + ave(t2,n*t+3,n*t+15,1)
 n = n +1
endwhile

average = sum/(n-1)

Obviously, watch where your quotation marks go.

Hope this helps.

Jeff Duda

On Mon, May 2, 2011 at 10:19 PM, Salvador Salazar <sal.salazar1 at gmail.com>wrote:

> Hi everyone,
>
> I have a beginner question regarding the GrADS 'ave' (average) function.
> I'm trying to simply take the average temperature for a domain over several
> days, but only for night time hours. So, once I set up my domain in GrADS, I
> use the following command:
>
> d ave(t2,t+3,t+15,24)
>
> Where t2 is temperature at 2 meters, t+3 increments the UTC time to make it
> 8 o'clock at night, t+15 makes it 8 o'clock in the morning, and the
> 24 increments the time daily once the night's temperatures have been
> averaged. So far, this is giving me garbage plots. I saw the users guide
> section for the 'ave' function, but I can't find any similar problem. Do you
> guys know how to make this work?
>
> Any help would be greatly appreciated,
> Sal
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Iowa State University
Meteorology Graduate Student
3134 Agronomy Hall
www.meteor.iastate.edu/~jdduda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110503/c43abb44/attachment-0003.html 


More information about the gradsusr mailing list