<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Kyle,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I took a quick look at your script, and yes, you are correct that order matters, *if* you are using "setvalues" with one resource setting at a time. If, inside a single call to a setvalues block, you are setting a bunch of resources, then order doesn't matter. Order also doesn't matter when you set resources via the usual way of creating a "res" variable and then passing that to gsn_csm_xxxx.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I understand why you coded it this way, because there's no way to pass an arbitrary list of resources to "setvalues".<br>
</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, there's another way you can do this, and that is via the "attsetvalues" procedure:</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/attsetvalues.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/attsetvalues.shtml</a></div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So, instead of this code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style>
<div class="gmail_default" style><font face="courier new, monospace"> do jj=0,dimsizes(vresource)-1</font></div><div class="gmail_default" style><font face="courier new, monospace"> setvalues plot</font></div><div class="gmail_default" style>
<font face="courier new, monospace"> vresource(jj) : vresvalue(jj)</font></div><div class="gmail_default" style><font face="courier new, monospace"> end setvalues</font></div><div class="gmail_default" style><font face="courier new, monospace"> end do</font></div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">you could do something like this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">
<font face="courier new, monospace"> res = True</font></div><div class="gmail_default" style><div class="gmail_default" style><font face="courier new, monospace"> do jj=0,dimsizes(vresource)-1</font></div><div class="gmail_default" style>
<font face="courier new, monospace"> res@$vresource(jj)$ = vresvalue(jj)</font></div><div class="gmail_default" style><font face="courier new, monospace"> end do<br></font></div><div class="gmail_default" style="font-size:small">
<font face="courier new, monospace"> attsetvalues(plot,res)</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small">
<font face="arial, helvetica, sans-serif">--Mary</font></div><div class="gmail_default" style="font-size:small"><font face="courier new, monospace"><br></font></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Aug 26, 2014 at 8:26 AM, Kyle Griffin <span dir="ltr"><<a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</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">Hi all,<div><br></div><div>I solved this problem this morning. While the biggest issue with my example was the lack of a statement to convert the input from string to a numeric type, I did have such provisions in my actual code of interest.</div>
<div><br></div><div>It turns out that the order with which contour resources are set *does* matter. If cnLevels or cnMinLevelValF, cnMaxLevelValF, and cnLevelSpacingF (depending on selection mode) are set before the cnLevelSelectionMode is set, the previously-set limits are essentially ignored (or perhaps partially reset?). I can't quite say what was happening as I didn't look into it, but just wanted to clarify that it is crucial to set cnLevelSelectionMode ***before*** setting any other related resources with the 'setvalues' command.</div>
<div><br></div><div><br></div><div><div class="">Kyle<br clear="all"><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div>
<div>Room 1421</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div>
<br><br></div><div><div class="h5"><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Kyle Griffin</b> <span dir="ltr"><<a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a>></span><br>
Date: Mon, Aug 25, 2014 at 6:29 PM<br>Subject: Setting contour levels with setvalues<br>To: ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br><br><br><div dir="ltr">Hi all,<div>
<br></div><div>I have either found a bug or am missing other resources that need setting. My problem stems from not being able to properly limit the min and max levels with cnMinLevelValF/cnMaxLevelValF in ManualLevels mode and cnLevels with ExplicitLevels mode. While this doesn't seem to always occur, I've attached a script which duplicates this problem. There might be a few unnecessary lines in the script as well, as I've been testing quite a bit of the object-oriented setvalues/getvalues commands. You can test each mode by commenting/uncommenting the pair of vresources/vresvalue variables just inside the begin statement. I think this is all self-contained (aside from the two gsm load statements), but let me know if anything doesn't work when the script is run. This is on a 64-bit linux system with 6.1.2. Thanks,</div>
<div><br></div><div><br></div><div>Kyle</div><div><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div>
<div>Room 1421</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div>
</div></div>
</div><br></div></div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>