<div dir="ltr"><div><div>Hey, L.B., glad to see you are back in the game! Hope all is well.<br><br></div>If you remove the quotes around the commands within each if statement, I think that will solve your problem. As you have written the code, you are telling grads to define a new field with a constant value of 1, 2, 3,... rather than defining a script variable, which is what you appear to want.<br><br></div>Jeff<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 2:32 PM, L.B. <span dir="ltr"><<a href="mailto:bcbass2989@gmail.com" target="_blank">bcbass2989@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 all,<div><br></div><div>I am attempting to set the z level from a set of if statements. Basically I am finding the lowest pressure level of a variable, then using if statements to match it to the closest level available in the model output and setting the z level based on that value. I am getting a SET error when I try to do this. Can I not do it this way? I have posted my script below:</div><div><br></div><div><div>'minHgt=max(max(PRES0C,lon='lonmin',lon='lonmax'),lat='latmin',lat='latmax')'</div><div>'minHgt=minHgt/100'</div><div><br></div><div><div>if (minHgt > 1011.63)</div><div>'botzlev = 1'</div><div>endif</div><div>if (minHgt <= 1011.63 & minHgt > 1005)</div><div>'botzlev = 2'</div><div>endif</div><div>if (minHgt <= 1005 & minHgt > 995)</div><div>'botzlev = 3'</div><div>endif</div><div>if (minHgt <= 995 & minHgt > 985)</div><div>'botzlev = 4'</div><div>endif</div><div>if (minHgt <= 985 & minHgt > 977.5)</div><div>'botzlev = 5'</div><div>endif</div><div>if (minHgt <= 977.5 & minHgt > 972.5)</div><div>'botzlev = 6'</div><div>endif</div></div><div><br></div><div>.</div><div>.</div><div>.</div><div>.</div><div><br></div><div><br></div><div>'set z 'botzlev<br></div><div><br></div><div><br></div><div>Any help would be appreciated. Thank You!</div><div><div><div dir="ltr"><div><b>-------</b></div><b>William (L.B.) LaForce<br></b>Meteorologist<div><a href="http://www.tornadoinsanity.com" target="_blank">www.tornadoinsanity.com</a></div></div></div></div>
</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" rel="noreferrer" 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>