<div dir="ltr"><div><div>I don't think the use of  '<b>num</b>' is correct.<br><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/num.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/num.shtml</a><br><br><pre>function num (
                val  : <b>logical</b>   <=== 
        )<br><br></pre></div><div><br></div><div><span><wbr>pastregimecorrs is a variible of type 'float' not 'logical'<br><br></span></div><div><span>The error message <br></span><span><br>
</span><p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">warning:Argument
 0 of the current function or procedure was coerced to the appropriate 
type and thus will not change if the function or procedure modifies its 
value</span></p>

<p style="margin-top:0px;margin-bottom:0px"><br>
</p></div><div><span>is occurring within the '<b>random_uniform</b>' call BUT it refers to the '<b>num'</b> function usage. It is informing you that NCL is trying to convert 'floats' to logicals' under-the-hood.<br><br><br></span></div><div>Should not <br><span>   randomcorrs = random_uniform(min(<wbr>pastregimecorrs),max(<wbr>pastregimecorrs),<b>num</b>(<wbr>pastregimecorrs))<br></span></div><span>be<br>   </span><span>randomcorrs = random_uniform(min(<wbr>pastregimecorrs),max(<wbr>pastregimecorrs),<b>dimsizes</b>(<wbr>pastregimecorrs))<br></span><br><br></div><br><br><div><span></span><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 18, 2017 at 9:00 AM, Bassill, Nicholas <span dir="ltr"><<a href="mailto:nbassill@albany.edu" target="_blank">nbassill@albany.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 id="m_3061904447727639129divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi All,<br>
    I have a variable with a list of values (they're correlations) in it. I'm creating a new variable with an equally sized list of synthetic values spanning the "range" of values in the original variable, like so:<br>
<br>
<span>randomcorrs = random_uniform(min(<wbr>pastregimecorrs),max(<wbr>pastregimecorrs),num(<wbr>pastregimecorrs))<br>
</span><br>
a printVarSummary on "<span style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">pastregimecorrs" yields:<br>
</span><br>
</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">Variable: pastregimecorrs</span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">Type: float</span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">Total Size: 308 bytes</span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures"><span class="m_3061904447727639129Apple-converted-space">           
</span>77 values</span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span style="white-space:pre-wrap">
</span>[77]</span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">Coordinates:<span class="m_3061904447727639129Apple-converted-space"> </span></span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 1</span></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures"><span class="m_3061904447727639129Apple-converted-space"> 
</span>_FillValue :<span style="white-space:pre-wrap"> </span>9.96921e+36</span></p>
<br>
Although this always seems to work as expected, I get the following warning:<br>
<br>
<p style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(215,201,167);background-color:rgb(142,53,40)">
<span style="font-variant-ligatures:no-common-ligatures">warning:Argument 0 of the current function or procedure was coerced to the appropriate type and thus will not change if the function or procedure modifies its value</span></p>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">This isn't the biggest deal, other than I loop through this 1000x20x11 times, so it creates a lot of warning text which is making it difficult to debug other portions of my code. "randomcorrs" has not been previously
 defined. </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">My question is, am I doing something wrong here? It's not clear to me that I'm doing anything other than what <span style="font-size:12pt">random_uniform (or min, max, or num) expect. I've spent an inordinate amount
 of time trying to figure this out, so either I'm missing something exceptionally obvious (very possible) or this is a gratuitous warning. I'm using NCL 6.3.</span></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="m_3061904447727639129Signature">
<div id="m_3061904447727639129divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Nick Bassill, PhD</span></p>
<p style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
Modeler & Meteorologist, New York State Mesonet</p>
<p style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
LC SB-28, 1400 Washington Ave.,</p>
<p style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
SUNY, University at Albany, NY 12222</p>
<a href="tel:(518)%20442-6375" value="+15184426375" target="_blank">(518) 442-6375</a>
<p></p>
<p><a href="http://nysmesonet.org/" target="_blank">http://nysmesonet.org/</a><br>
</p>
</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>