<div dir="ltr"><div>Thanks for your help Jeff. <span style="font-size:12.8000001907349px">Unfortunately, I get the same error by using t=t-0. I really meant to just put t and not t=t but that wouldn't matter. It seems that it doesn't like the max function. It says </span><font color="#ff0000" style="font-size:12.8000001907349px">Function not found: max</font><font color="#000000" style="font-size:12.8000001907349px">. </font></div><div><span style="font-size:12.8000001907349px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8000001907349px"><font color="#000000">Is there an alternate way to create a file with only the max temperatures? </font></span></div><div><span style="font-size:12.8000001907349px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8000001907349px"><font color="#000000">Thanks, Renée</font></span></div><span style="font-size:12.8000001907349px"><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div>Message: 2</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Date: Fri, 23 Jan 2015 17:40:11 -0600</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">From: Jeff Duda <</span><a href="mailto:jeffduda319@gmail.com" style="font-size:12.8000001907349px">jeffduda319@gmail.com</a><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Subject: Re: [gradsusr] Problem calculating max temp in loop</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">To: GrADS Users Forum <</span><a href="mailto:gradsusr@gradsusr.org" style="font-size:12.8000001907349px">gradsusr@gradsusr.org</a><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Message-ID:</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"> <CAAig09Be-</span><span style="font-size:12.8000001907349px">eiSWYPYaMdqgpMh5HqKH6oXZ2k=</span><a href="mailto:qcBL0Pn7o0GSfQ@mail.gmail.com" style="font-size:12.8000001907349px">qcBL0Pn7o0GSfQ@mail.gmail.com</a><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Content-Type: text/plain; charset="utf-8"</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Replace t=t with t=t-0 in your max function.</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Jeff Duda</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">On Fri, Jan 23, 2015 at 4:55 PM, Ren?e C. Elder <</span><a href="mailto:renee.c.elder@gmail.com" style="font-size:12.8000001907349px">renee.c.elder@gmail.com</a><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">wrote:</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Hello grads users,</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> I'm trying to create a file that has the daily maximum values from my</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> hourly wrf output. I'm using grads2.0.a8.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Below is the script that I've written and the error messages I get after</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> running the script. I'm not certain if there is a particular maximum value</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> function necessary when using a script but hopefully someone can help.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> In this script I did not put the line: define tmax=max(t2, t=t, t+23) in</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> quotes and there seems to be an issue with the 'max' function. In the</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> second script, I put that line in quotes resulting in a couple syntax</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> errors so I'm not certain if the quotes are necessary.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'open Piarco_may1_hrly.ctl'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'set gxout fwrite'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'set fwrite tmaxtest.dat'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> t=1</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> while (t<=25)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'set t ' t</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> say t</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> define tmax=max(t2, t=t, t+23)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'd tmax'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> t = t+24</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> endwhile</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'disable fwrite'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> ERROR MESSAGE FOR ABOVE SCRIPT</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Function not found: max</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Error occurred on line 11</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> In file </span><a href="http://tmax.gs/" target="_blank" style="font-size:12.8000001907349px">tmax.gs</a><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'open Piarco_may1_hrly.ctl'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'set gxout fwrite'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'set fwrite tmaxtest.dat'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> t=1</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> while (t<=25)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'set t ' t</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> say t</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'define tmax=max(t2, t=t, t+23)'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'd tmax'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> t = t+24</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> endwhile</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'disable fwrite'</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> ERROR MESSAGE FOR ABOVE SCRIPT</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Syntax Error: Invalid dimension expression</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Dimension value missing or invalid</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Error from MAX: 1st dimension expression invalid</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Operation Error: Error from max function</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Error ocurred at column 1</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> DEFINE error: Invalid expression.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Syntax Error: Invalid Operand</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'tmax' not a variable or function name</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Error ocurred at column 1</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> DISPLAY error: Invalid expression</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Expression = tmax</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 25</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Syntax Error: Invalid dimension expression</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Dimension value missing or invalid</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Error from MAX: 1st dimension expression invalid</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Operation Error: Error from max function</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Error ocurred at column 1</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> DEFINE error: Invalid expression.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Syntax Error: Invalid Operand</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 'tmax' not a variable or function name</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Error ocurred at column 1</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> DISPLAY error: Invalid expression</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Expression = tmax</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Ren?e C. Elder</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> PhD Student</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Geography (Meteorology-Climatology)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> Arizona State University</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> ______________________________</span><span style="font-size:12.8000001907349px">_________________</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> gradsusr mailing list</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> </span><a href="mailto:gradsusr@gradsusr.org" style="font-size:12.8000001907349px">gradsusr@gradsusr.org</a><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> </span><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank" style="font-size:12.8000001907349px">http://gradsusr.org/mailman/listinfo/gradsusr</a><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">></span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">--</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Jeff Duda</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Graduate research assistant</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">University of Oklahoma School of Meteorology</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Center for Analysis and Prediction of Storms</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">-------------- next part --------------</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">An HTML attachment was scrubbed...</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">URL: </span><a href="http://gradsusr.org/pipermail/gradsusr/attachments/20150123/3067bda9/attachment-0001.html" target="_blank" style="font-size:12.8000001907349px">http://gradsusr.org/pipermail/gradsusr/attachments/20150123/3067bda9/attachment-0001.html</a><div><br clear="all"><div><div class="gmail_signature"><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></div>