[gradsusr] define a array time series of multiple files

Isilda Menezes isilda at uevora.pt
Fri Jan 6 06:03:37 EST 2017


Hello Jennifer and Jeff, thank you very much, I solved the problem in the
plot of the figure. I had tried to do it in a similar way, but I did not
use the correct notation. It was very useful.

Isilda

2017-01-05 22:57 GMT+00:00 Jennifer M Adams <jadams21 at gmu.edu>:

> Hi, Isilda —
> With ‘define’, everything that comes before the = sign is the variable
> name, which must be alphanumeric. I believe the syntax you’re looking for
> might be something like this:
>
> nfiles=124
> i=1
> while (i<=nfiles)
>   if (i=1)
>     ‘sum=tmp2m.’i’(t=1)’
>   else
>      ‘sum=sum+’tmp2m.’i’(t=1)’
>   endif
>   i=i+1
> endwhile
> 'ave=sum/‘nfiles
>
> —Jennifer
>
> On Jan 5, 2017, at 5: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
>
>
> --
> Jennifer Miletta Adams
> Center for Ocean-Land-Atmosphere Studies (COLA)
> George Mason University
>
>
>
>
> _______________________________________________
> 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/20170106/d624ad94/attachment.html 


More information about the gradsusr mailing list