<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Alison,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The cnLineThicknesses resource is for when you need to use an array of line thicknesses to set different contour lines to different thicknesses.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you want to change all the thicknesses to the same value, use cnLineThicknessF:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  res@cnLineThicknessF = 3</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Second, I believe that in wrf_contour, if you set cnFillOn to True, it is internally setting cnLinesOn to False. So try adding:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  res@cnLinesOn = True</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">to force contour lines to be drawn as well as the fill.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thirdly, and this is just a suggestion: you don't need to use "new" in cases like this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">    grad = new((/71,41/),"float")</div><div class="gmail_default">    grad = grdx + grdy</div><div class="gmail_default"><br></div><div class="gmail_default">You can just have:</div><div class="gmail_default"><br></div><div class="gmail_default"><font face="monospace, monospace"><span style="color:rgb(34,34,34);font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    grad = grdx + grdy</span><br></font></div><div class="gmail_default"><br></div><div class="gmail_default">because NCL will automatically do the array arithmetic for you, and figure out the correct return size and type.</div><div class="gmail_default"><br></div><div class="gmail_default">If one of grdx or grdy is type double and you really need a float, then you can do:</div><div class="gmail_default"><br></div><div class="gmail_default"><font face="monospace, monospace">    grad = tofloat(grdx + grdy)</font></div><div class="gmail_default"><br></div><div class="gmail_default">Fourthly, double do loops can be slow in interpreted languages like NCL, Python, matlab, etc.  Where possible, let NCL do the array arithmetic for you.  </div><div class="gmail_default"><br></div><div class="gmail_default">In the double do loop below:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">    dzdy = new((/71,41/),"float")</font></div><div class="gmail_default"><font face="monospace, monospace">    grdy = new((/71,41/),"float")</font></div><div class="gmail_default"><font face="monospace, monospace">    do j = 50,120</font></div><div class="gmail_default"><font face="monospace, monospace">    do i = 120,160</font></div><div class="gmail_default"><font face="monospace, monospace">    dzdy(j-50,i-120) = ter(j,i) - ter(j,i-1)</font></div><div class="gmail_default"><font face="monospace, monospace">    dzdy(j-50,i-120) = dzdy(j-50,i-120) / 4000.</font></div><div class="gmail_default"><font face="monospace, monospace">    grdy(j-50,i-120) = dzdy(j-50,i-120) * va(6,j-50,i-120)</font></div><div class="gmail_default"><font face="monospace, monospace">    end do<br></font></div><div class="gmail_default"><font face="monospace, monospace">    end do</font></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div><div class="gmail_default">the "ter" calculation makes sense in a do loop, but the other two commands can be done outside the loop and you can get rid of the internal do loop. This means you can also get rid of the "new" line for grdy.</div><div class="gmail_default"><br></div><div class="gmail_default">Note that this code is untested, but hopefully you can follow what it's supposed to be doing:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">    dzdy = new((/71,41/),float)  ; The quotes are not needed around "float"</font></div><div class="gmail_default"><font face="monospace, monospace">    do j = 50,120<br></font></div><div class="gmail_default"><font face="monospace, monospace">      dzdy(j-50,:) = ter(j,120:160) - ter(j,119:159)</font></div><div class="gmail_default"><font face="monospace, monospace">    end do</font></div><div class="gmail_default"><div class="gmail_default" style="color:rgb(34,34,34);font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="monospace, monospace">    dzdy = dzdy / 4000.</font></div><div class="gmail_default" style="color:rgb(34,34,34);font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="monospace, monospace">    grdy = dzdy * va(6,:,:)</font></div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> <span> </span></div>--Mary</div><div class="gmail_default"><br></div></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 13, 2018 at 11:44 AM, Alison Bridger <span dir="ltr"><<a href="mailto:alison.bridger@sjsu.edu" target="_blank">alison.bridger@sjsu.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">

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi, This is a re-send with smaller files attached!</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I am working on a calculation and decided to start from the ground up (as opposed to using a pre-written ncl code).</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">slope4.ncl is attached (it's really simple!)</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I make 2 sets of plots in a loop: (1) the field I want ("grad" in wks1) to file zgrad_gradient_...ps (not attached).</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-weight:400">To make sure I know where I am geographically, the 2nd set of plots (wks2) is </span><b>terrain plus shoreline </b>(file zgrad_terrain_...ps attached)...this is the main focus of my question.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">After a certain amount of hacking, I was able to plot the shoreline (!) and terrain (!)<span> </span><b style="background-color:rgb(255,255,0)">BUT I cannot get the contour line colors (or thicknesses) to change</b>!</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I was under the impression that cnLineColor would fix the color - but no luck.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I also tried playing with cnLineThicknesses - no luck.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Any help?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Thanks, Alison</div>

<br clear="all"><div><br></div>-- <br><div class="m_-6728287709157991406gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><pre><font face="comic sans ms, sans-serif">                 Alison F.C. Bridger<br>                  Professor & Chair<br><br>    Department of Meteorology and Climate Science<br><br>    San Jose State University      tel  <a href="tel:(408)%20924-5206" value="+14089245206" target="_blank">408.924.5206</a><br>    One Washington Square          fax  <a href="tel:(408)%20924-5191" value="+14089245191" target="_blank">408.924.5191</a><br>    San Jose, CA 95192-0104<br><br>             email:   <a>Alison.Bridger@sjsu.edu</a></font></pre><pre><font face="comic sans ms, sans-serif">       <b>Global CO2 levels...400 ppm and still rising...happy?</b></font></pre><pre><font face="comic sans ms, sans-serif"><br>                 <a href="http://www.met.sjsu.edu" target="_blank">www.sjsu.edu/meteorology</a><br>       </font><br></pre></div></div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>