Darren,<br>Did you try putting in 0.0 instead of just 0? Perhaps there is a difference in how Grads is reading the precision of that number and in how your system is.<br><br>Jeff<br><br><div class="gmail_quote">On Mon, Jan 10, 2011 at 10:38 AM, Murphy, Darren W <span dir="ltr"><<a href="mailto:dwmurphy@nps.edu">dwmurphy@nps.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Austin,<br>
<br>
Thanks for checking out the script. I had been doing some testing of the<br>
script and changing the logic to check to see if it was by default entering<br>
the statement. I forgot to change it back. Those lines should read...<br>
<div class="im"><br>
<br>
>> if (minval > 0)<br>
>> prompt 'minval greater than 0'<br>
<br>
</div>The problem persists though. With minval of -0.52 it still enters the<br>
minval>0 statement.<br>
<br>
Thanks,<br>
Darren<br>
<br>
On 1/10/11 7:57 AM, "Austin Conaty" <<a href="mailto:Austin.L.Conaty@nasa.gov">Austin.L.Conaty@nasa.gov</a>> wrote:<br>
<br>
> Darren,<br>
<div class="im">><br>
> if (minval <= 0)<br>
> prompt 'minval greater than 0'<br>
><br>
</div>> I think this is where you have a logic problem<br>
><br>
> If minval less than or equal to zero<br>
> prompt minval greater than zero<br>
><br>
> Is this really what you mean to do?<br>
<div><div></div><div class="h5">><br>
> Murphy, Darren W wrote:<br>
>> All,<br>
>><br>
>> I¹m using Grads 2.0.a9.<br>
>><br>
>> The script below throws a couple of errors. Earlier I thought it was an<br>
>> string<br>
>> not compatible with numeric calculations. Following Jeff Duda¹s (Thank you<br>
>> Jeff) advice I found some errors in the script syntax. I can verify that the<br>
>> script is accepting the user input, and that that the ³maxval² and ³minval²<br>
>> values are correct.<br>
>><br>
>> The first issue is the if statements. I have a value of minval being -.52<br>
>> and<br>
>> still entering the if statement for minval greater than 0.<br>
>><br>
>> Second I am getting an error ³SET error: Missing or invalid arguments for<br>
>> CLEVS<br>
>> option². I can also verify that the cvals1 through cval8 are being<br>
>> calculated,<br>
>> but perhaps I have a syntax error on that line?<br>
>><br>
>> Thank you,<br>
>> Darren<br>
>><br>
>><br>
>><br>
>> prompt 'Enter EOF #: '<br>
>> pull EF<br>
>><br>
>> eofnum = EF<br>
>><br>
>> 'clear'<br>
>> 'set poli on'<br>
>> 'set ccolor 0'<br>
>><br>
>> 'open<br>
>> /Users/Darren/Desktop/output/MaxT_2x2x1dy_NormByMeanSTD_Afg_1979to2009_1to365<br>
>> _EOF_eof.ctl'<br>
>><br>
>> 'q dims'<br>
>> res2 = sublin(result,2)<br>
>> res3 = sublin(result,3)<br>
>> lon1 = subwrd(res2,6)<br>
>> lon2 = subwrd(res2,8)<br>
>> lat1 = subwrd(res3,6)<br>
>> lat2 = subwrd(res3,8)<br>
>><br>
>> 'set z 'eofnum<br>
>><br>
>> 'maxval = max(max(eof,lon='lon1',lon='lon2'),lat='lat1',lat='lat2')'<br>
>> 'minval = min(min(eof,lon='lon1',lon='lon2'),lat='lat1',lat='lat2')'<br>
>><br>
>> * BLUE shades<br>
>> 'set rgb 16 0 0 255'<br>
>> 'set rgb 17 55 55 255'<br>
>> 'set rgb 18 110 110 255'<br>
>> 'set rgb 19 165 165 255'<br>
>> 'set rgb 20 220 220 255'<br>
>><br>
>> * RED shades<br>
>> 'set rgb 21 255 220 220'<br>
>> 'set rgb 22 255 165 165'<br>
>> 'set rgb 23 255 110 110'<br>
>> 'set rgb 24 255 55 55'<br>
>> 'set rgb 25 255 0 0'<br>
>><br>
>> 'cval1 = 'minval'/5*4'<br>
>> 'cval2 = 'minval'/5*3'<br>
>> 'cval3 = 'minval'/5*2'<br>
>> 'cval4 = 'minval'/5*1'<br>
>><br>
>> 'cval5 = 'maxval'/5*1'<br>
>> 'cval6 = 'maxval'/5*2'<br>
>> 'cval7 = 'maxval'/5*3'<br>
>> 'cval8 = 'maxval'/5*4'<br>
>><br>
>> if (minval <= 0)<br>
>> prompt 'minval greater than 0'<br>
>> 'minval = 0'<br>
>> 'cval1 = 'maxval'/10*1'<br>
>> 'cval2 = 'maxval'/10*2'<br>
>> 'cval3 = 'maxval'/10*3'<br>
>> 'cval4 = 'maxval'/10*4'<br>
>> 'cval5 = 'maxval'/10*5'<br>
>> 'cval6 = 'maxval'/10*6'<br>
>> 'cval7 = 'maxval'/10*7'<br>
>> 'cval8 = 'maxval'/10*8'<br>
>><br>
>> endif<br>
>><br>
>> if (maxval < 0)<br>
>> prompt 'maxval less than 0 '<br>
>> 'maxval = 0'<br>
>> 'cval1 = 'minval'/10*8'<br>
>> 'cval2 = 'minval'/10*7'<br>
>> 'cval3 = 'minval'/10*6'<br>
>> 'cval4 = 'minval'/10*5'<br>
>> 'cval5 = 'minval'/10*4'<br>
>> 'cval6 = 'minval'/10*3'<br>
>> 'cval7 = 'minval'/10*2'<br>
>> 'cval8 = 'minval'/10*1'<br>
>><br>
>> endif<br>
>><br>
>> 'set gxout shaded'<br>
>> 'set clevs minval cval1 cval2 cval3 cval4 cval5 cval6 cval7 cval8 maxval'<br>
>> 'set ccols 16 17 18 19 20 1 21 22 23 24 25'<br>
>><br>
>> 'set mpt * off'<br>
>> 'set mpdset hires'<br>
>> 'set mpt 0 0 1 7'<br>
>> 'set mpt 1 0 1 7'<br>
>> 'draw map'<br>
>><br>
>> 'set background 1'<br>
>> 'set annot 0 5'<br>
>> 'd eof(z='eofnum')'<br>
>><br>
>> 'run /Users/Darren/Desktop/<a href="http://cbarm.gs" target="_blank">cbarm.gs</a>'<br>
>><br>
>><br>
>> 'close 1'<br>
>><br>
><br>
<br>
<br>
</div></div>_______________________________________________<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>
</blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/~jdduda">www.meteor.iastate.edu/~jdduda</a><br>