[gradsusr] Problem calculating max temp in loop

Jeff Duda jeffduda319 at gmail.com
Fri Jan 23 18:40:11 EST 2015


Replace t=t with t=t-0 in your max function.

Jeff Duda

On Fri, Jan 23, 2015 at 4:55 PM, Renée C. Elder <renee.c.elder at gmail.com>
wrote:

> Hello grads users,
>
> I'm trying to create a file that has the daily maximum values from my
> hourly wrf output. I'm using grads2.0.a8.
>
> Below is the script that I've written and the error messages I get after
> running the script. I'm not certain if there is a particular maximum value
> function necessary when using a script but hopefully someone can help.
>
> In this script I did not put the line: define tmax=max(t2, t=t, t+23) in
> quotes and there seems to be an issue with the 'max' function. In the
> second script, I put that line in quotes resulting in a couple syntax
> errors so I'm not certain if the quotes are necessary.
>
> 'open Piarco_may1_hrly.ctl'
>
> 'set gxout fwrite'
> 'set fwrite tmaxtest.dat'
>
> t=1
> while (t<=25)
>     'set t ' t
>
>     say t
>
>     define tmax=max(t2, t=t, t+23)
>
>     'd tmax'
>     t = t+24
> endwhile
> 'disable fwrite'
>
> ERROR MESSAGE FOR ABOVE SCRIPT
> Function not found: max
>   Error occurred on line 11
>   In file tmax.gs
>
> 'open Piarco_may1_hrly.ctl'
>
> 'set gxout fwrite'
> 'set fwrite tmaxtest.dat'
>
> t=1
> while (t<=25)
>     'set t ' t
>
>     say t
>
>     'define tmax=max(t2, t=t, t+23)'
>
>     'd tmax'
>     t = t+24
> endwhile
> 'disable fwrite'
>
> ERROR MESSAGE FOR ABOVE SCRIPT
> Syntax Error:  Invalid dimension expression
>   Dimension value missing or invalid
> Error from MAX:  1st dimension expression invalid
> Operation Error:  Error from max function
>   Error ocurred at column 1
> DEFINE error:  Invalid expression.
> Syntax Error:  Invalid Operand
>   'tmax' not a variable or function name
>   Error ocurred at column 1
> DISPLAY error:  Invalid expression
>   Expression = tmax
> 25
> Syntax Error:  Invalid dimension expression
>   Dimension value missing or invalid
> Error from MAX:  1st dimension expression invalid
> Operation Error:  Error from max function
>   Error ocurred at column 1
> DEFINE error:  Invalid expression.
> Syntax Error:  Invalid Operand
>   'tmax' not a variable or function name
>   Error ocurred at column 1
> DISPLAY error:  Invalid expression
>   Expression = tmax
>
>
> Renée C. Elder
> PhD Student
> Geography (Meteorology-Climatology)
> Arizona State University
>
> _______________________________________________
> 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/20150123/3067bda9/attachment.html 


More information about the gradsusr mailing list