<div dir="ltr"><div><div><div>Hi Rick,<br><br></div>It made sense to me now. Thank you!<br><br></div>I am sending you the script that plots the colored markers and black circles, but with no legend. When I run it in NCL, it does not give me the mismatch error.<br><br></div>Carlos <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 21, 2015 at 2:44 PM, Rick Brownrigg <span dir="ltr"><<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.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"><div><div><div><div><div><div><div><div>Hi Carlos,<br><br></div>I don't recall the before and after state of your script. But in general, NCL is what I would call "loosely typed": you don't have to declare the type of a variable in advance, but once you make an assignment to a variable name, the variable assumes the type of the right-hand-side. If the RHS is an array, the variable further assumes the shape of the array. <br><br>Attempts to reassign the variable to a RHS of a different type/shape will lead to the "assignment type mismatch" error. The exception is if the RHS can be cast to a type of the variable. So for example:<br><br></div>a = 10.5<br></div>a = 10 ; OK -- int is cast to a float<br><br></div>b = 10<br></div>b = 10.5 ; error -- can't cast a float to an int <br><br></div>If you need/want to reuse a variable name, you "delete()" it first.<br><br></div>Make sense?<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Rick<br><div><div><div><div><div><br></div></div></div></div></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 21, 2015 at 10:58 AM, Carlos J. Valle-Diaz <span dir="ltr"><<a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@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"><div><div>Hi Rick,<br><br></div>Related to your 3rd suggestion: when I ran the script before I incorportated the codes to create the legend, I did not have a mismatch error. The script generated the colored markers with the black circles as you showed me in a previous conversation. Why would it present a mismatch error after adding the codes creating the legend?<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Carlos<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 21, 2015 at 1:37 PM, Carlos J. Valle-Diaz <span dir="ltr"><<a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@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"><div><div>I'll check these right now and will let you know. Thank you very much.<br><br></div>I apologize for writing multiple emails on the same topic. Won't happen again!<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Carlos<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 21, 2015 at 12:45 PM, Rick Brownrigg <span dir="ltr"><<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.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"><div><div><div><div><div>The script you attached to your original posting has numerous bugs, and will not even run as is. The do-loop at around line 82 is missing an "end do". Fixing that problem allows the script to run, but there are 3 other errors that are likely causing your problem:<br><br></div>i) the variable "R" is undefined (around line 34)<br><br></div>ii) xleg (and other related arrays) contain only 8 values, whereas you are looping over "num_distinct_makers", which is equal to 17 (around line 90)<br><br></div>iii) the "assignment type mismatch" at around line 103 arises because in a previous loop, you set gsMarkerColor to an integer value, and then at 103, you are setting it to a value from the colortable, which is either a 3 or 4-tuple of floats. You'll want to "delete(gsres@gsMarkerColor)" between the two do-loops.<br><br></div>Hope that helps...<span><font color="#888888"><br></font></span></div><span><font color="#888888">Rick<br><br></font></span></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Dec 21, 2015 at 8:39 AM, Carlos J. Valle-Diaz <span dir="ltr"><<a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div><div>Hello,<br><br></div>I'm writing to ask if somebody from NCL-talk has read my email and/or currently is answering it. I'm kind of in a rush to have these plots ready before Christmas. I apologize for my insistence.<br><br></div>Best Regards,<br><br></div>Carlos<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 18, 2015 at 4:52 PM, Carlos J. Valle-Diaz <span dir="ltr"><<a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@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"><div>Hello,<br><br></div>I've been running WRF simulations to
observe 24hr precipitation in Puerto Rico from (July 12, 2011 12UTC to
July 13, 2011 12UTC). I want to compare the model runs with the observed
from the National Weather Service. I have their hourly shapefiles, see
link to access them: <a href="http://www.srh.noaa.gov/ridge2/Precip/qpehourlyshape/2011/201107/20110712/" target="_blank">http://www.srh.noaa.gov/ridge2/Precip/qpehourlyshape/2011/201107/20110712/</a>). In the shapefiles, Globvalue refers to precipitation.<br><br>I've been trying all day to add a legend to my plot, but haven't been successful. I've been using example #7 in the legends section of NCL as a reference. See leg_7.ncl at <a href="http://ncl.ucar.edu/Applications/legend.shtml" target="_blank">http://ncl.ucar.edu/Applications/legend.shtml</a><br clear="all"><div><div><br></div><div>I have attached the script I have at the moment. It plots fine when you take out the lines that codes for the legend and text. What am I missing and/or doing wrong?<br><br></div><div>Thanks beforehand for the help,<br><br></div><div>P.S. I set up the array(arr) data for 16 values because I'm using a color map that displays 17 colors.<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div>-- <br><div><div dir="ltr"><div><div dir="ltr">Carlos J. Valle Diaz<br>Ph.D. Chemistry Student<br>University of Puerto Rico Rio Piedras Campus<div>Department of Graduate Chemistry and Environmental Sciences<br><a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@gmail.com</a></div><div>Tel. <a href="tel:787-764-0000%20x88192" value="+17877640000" target="_blank">787-764-0000 x88192</a><br></div></div></div></div></div>
</div></font></span></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr">Carlos J. Valle Diaz<br>Ph.D. Chemistry Student<br>University of Puerto Rico Rio Piedras Campus<div>Department of Graduate Chemistry and Environmental Sciences<br><a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@gmail.com</a></div><div>Tel. <a href="tel:787-764-0000%20x88192" value="+17877640000" target="_blank">787-764-0000 x88192</a><br></div></div></div></div></div>
</div>
</div></div><br></div></div><span>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr">Carlos J. Valle Diaz<br>Ph.D. Chemistry Student<br>University of Puerto Rico Rio Piedras Campus<div>Department of Graduate Chemistry and Environmental Sciences<br><a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@gmail.com</a></div><div>Tel. <a href="tel:787-764-0000%20x88192" value="+17877640000" target="_blank">787-764-0000 x88192</a><br></div></div></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr">Carlos J. Valle Diaz<br>Ph.D. Chemistry Student<br>University of Puerto Rico Rio Piedras Campus<div>Department of Graduate Chemistry and Environmental Sciences<br><a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@gmail.com</a></div><div>Tel. <a href="tel:787-764-0000%20x88192" value="+17877640000" target="_blank">787-764-0000 x88192</a><br></div></div></div></div></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Carlos J. Valle Diaz<br>Ph.D. Chemistry Student<br>University of Puerto Rico Rio Piedras Campus<div>Department of Graduate Chemistry and Environmental Sciences<br><a href="mailto:cj.vallediaz@gmail.com" target="_blank">cj.vallediaz@gmail.com</a></div><div>Tel. 787-764-0000 x88192<br></div></div></div></div></div>
</div>