<HTML>
<HEAD>
<TITLE>Re: [gradsusr] Script errors</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Jeff,<BR>
<BR>
Changing the value from 0 to 0.0 didn’t change the results.<BR>
<BR>
I’ve updated the script with some changes in reference to Austin and your suggestions. However, I still have the issue of entering the minval>0 if statement with a value <0, and an error for clevs.<BR>
<BR>
Thanks,<BR>
Darren<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 /Users/Darren/Desktop/output/MaxT_2x2x1dy_NormByMeanSTD_Afg_1979to2009_1to365_EOF_eof.ctl'<BR>
<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>
<BR>
* These are the 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>
* These are the 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>
<BR>
if ('minval' > 0.0)<BR>
'minval = 0.0'<BR>
prompt 'minval greater than 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.0)<BR>
prompt 'maxval less than 0 '<BR>
'maxval = 0.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/cbarm.gs'<BR>
<BR>
'close 1'<BR>
<BR>
<BR>
On 1/10/11 9:48 AM, "Jeffrey Duda" <<a href="jdduda@iastate.edu">jdduda@iastate.edu</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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>
On Mon, Jan 10, 2011 at 10:38 AM, Murphy, Darren W <<a href="dwmurphy@nps.edu">dwmurphy@nps.edu</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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>
<BR>
<BR>
>> if (minval > 0)<BR>
>> prompt 'minval greater than 0'<BR>
<BR>
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="Austin.L.Conaty@nasa.gov">Austin.L.Conaty@nasa.gov</a>> wrote:<BR>
<BR>
> Darren,<BR>
><BR>
> if (minval <= 0)<BR>
> prompt 'minval greater than 0'<BR>
><BR>
> 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>
><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/cbarm.gs <<a href="http://cbarm.gs">http://cbarm.gs</a>> '<BR>
>><BR>
>><BR>
>> 'close 1'<BR>
>><BR>
><BR>
<BR>
<BR>
_______________________________________________<BR>
gradsusr mailing list<BR>
<a href="gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><BR>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>