<div dir="ltr">Replace t=t with t=t-0 in your max function.<br><br>Jeff Duda<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 23, 2015 at 4:55 PM, Renée C. Elder <span dir="ltr"><<a href="mailto:renee.c.elder@gmail.com" target="_blank">renee.c.elder@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello grads users,<div><br></div><div>I'm trying to create a file that has the daily maximum values from my hourly wrf output. I'm using grads2.0.a8. </div><div><br></div><div>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. </div><div><br></div><div>In this script I did not put the line: <span style="color:rgb(0,0,255)">define tmax=max(t2, t=t, t+23) </span><font color="#000000">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. </font></div><div><br></div><div><div><font color="#0000ff">'open Piarco_may1_hrly.ctl'</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">'set gxout fwrite'</font></div><div><font color="#0000ff">'set fwrite tmaxtest.dat'</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">t=1</font></div><div><font color="#0000ff">while (t<=25)</font></div><div><font color="#0000ff"> 'set t ' t</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> say t</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> define tmax=max(t2, t=t, t+23)</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> 'd tmax'</font></div><div><font color="#0000ff"> t = t+24</font></div><div><font color="#0000ff">endwhile</font></div><div><font color="#0000ff">'disable fwrite'</font></div><div><br></div><div><div><div>ERROR MESSAGE FOR ABOVE SCRIPT</div><div>Function not found: max </div><div> Error occurred on line 11</div><div> In file <a href="http://tmax.gs" target="_blank">tmax.gs</a></div></div><div><br></div><div><div><font color="#0000ff">'open Piarco_may1_hrly.ctl'</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">'set gxout fwrite'</font></div><div><font color="#0000ff">'set fwrite tmaxtest.dat'</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">t=1</font></div><div><font color="#0000ff">while (t<=25)</font></div><div><font color="#0000ff"> 'set t ' t</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> say t</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> 'define tmax=max(t2, t=t, t+23)'</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> 'd tmax'</font></div><div><font color="#0000ff"> t = t+24</font></div><div><font color="#0000ff">endwhile</font></div><div><font color="#0000ff">'disable fwrite'</font></div></div><div><br></div><div><div>ERROR MESSAGE FOR ABOVE SCRIPT</div></div><div>Syntax Error: Invalid dimension expression<br></div><div> Dimension value missing or invalid</div><div>Error from MAX: 1st dimension expression invalid</div><div>Operation Error: Error from max function</div><div> Error ocurred at column 1</div><div>DEFINE error: Invalid expression. </div><div>Syntax Error: Invalid Operand </div><div> 'tmax' not a variable or function name</div><div> Error ocurred at column 1</div><div>DISPLAY error: Invalid expression </div><div> Expression = tmax</div><div>25</div><div>Syntax Error: Invalid dimension expression</div><div> Dimension value missing or invalid</div><div>Error from MAX: 1st dimension expression invalid</div><div>Operation Error: Error from max function</div><div> Error ocurred at column 1</div><div>DEFINE error: Invalid expression. </div><div>Syntax Error: Invalid Operand </div><div> 'tmax' not a variable or function name</div><div> Error ocurred at column 1</div><div>DISPLAY error: Invalid expression </div><div> Expression = tmax</div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br clear="all"><div><div><div dir="ltr">Renée C. Elder<br><div>PhD Student </div><div>Geography (Meteorology-Climatology)</div><div>Arizona State University </div></div></div></div>
</div></font></span></div></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br></div>
</div>