[gradsusr] define a array time series of multiple files

Jeff Duda jeffduda319 at gmail.com
Thu Jan 5 17:42:25 EST 2017


Isilda,
You cannot define piecewise fields in Grads. So, for one thing, the syntax
"(t='i')" is going to throw an error. However, you seem to want to take the
average of TMP2m over several data files. If you simply define ll to be
TMP2m in each file, that will also not work because each 'define' command
will overwrite the previous field created with that name.

The best thing to do would be to create a sum field by adding each TMP2m
field from each file to that sum. Then simply divide by 124 at the end.

Jeff Duda

On Thu, Jan 5, 2017 at 4:36 PM, Isilda Menezes <isilda at uevora.pt> wrote:

> Hello, I want created a ave in a gs script with multiple open files with
> the same time=1.
>
> I made a loop like this,
>
> i=1
> while (i<124)
> 'set dfile 'i
> 'define ll(t='i')=TMP2m'
> i=i+1
> endwhile
> 'd ave(ll,t=1,t=124)'
>
> But a have this error:
>
> DEFINE error:  Name too long; missing '='
> Syntax Error:  Invalid Operand
>   'll' not a variable or function name
> Operation Error:  Error from ave function
>   Error ocurred at column 1
> DISPLAY error:  Invalid expression
>   Expression = ave(ll,t=1,t=124)
> Error opening script file: cbarn.gs
>
> I've been trying to do it in other ways but I always get errors. Can
> someone give me some advice how to solve this problem.
>
> Thanks,
> Isilda
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Post-doctoral research fellow
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20170105/26e6819d/attachment-0001.html 


More information about the gradsusr mailing list