<div dir="ltr">tobyte(0.5) does the trick...</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 8, 2017 at 11:51 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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">So, then I need to convert 0.5 and 0.33 to byte values, I assume -- regarding my last question.<div><br></div><div>Thank you for clarifying.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 8, 2017 at 11:48 AM, Guido Cioni <span dir="ltr"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@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 style="word-wrap:break-word">dbz is byte type -> wrap_around thus is byte type.<div><br></div><div>256. will be a floating point variable. In fortran, and thus NCL, if you write 256 you will get an integer variable, 256. (with the point) a float variable.</div><div><br></div><div>Thus when making wrap_around=256. you are forcing an assignment between byte and float type, which NCL cannot do without spitting out a warning or and error. Imagine if this would happen without noticing...it could lead to all sort of weird errors.</div><div><br></div><div>You have to convert wrap_around to float (for example with the function tofloat) before attempting that.</div><div>Cheers </div><div><br><div><blockquote type="cite"><div><div class="m_3148295094233172091h5"><div>On 8. Sep 2017, at 10:11, Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:</div><br class="m_3148295094233172091m_-6885759330790536323Apple-interchange-newline"></div></div><div><div><div class="m_3148295094233172091h5"><div dir="ltr">Hi:<div><br></div><div>I have some simple code, copied below.</div><div><br></div><div>I cannot add the value of 256 to dbz or the value of wrap_around after</div><div>setting it to 256.</div><div><br></div><div><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>wrap_around = </span><span class="m_3148295094233172091m_-6885759330790536323gmail-s2">dbz</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>wrap_around = 256.</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p2"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"></span><br></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>do j = 0,dims2d(0)-1</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>do i = 0,dims2d(1)-1</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>check = ismissing(</span><span class="m_3148295094233172091m_-6885759330790536323gmail-s2">dbz</span><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">(j,i))</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>if (check.eq.False)then</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>if (</span><span class="m_3148295094233172091m_-6885759330790536323gmail-s2">dbz</span><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">(j,i).lt.0)then</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"> </span><span class="m_3148295094233172091m_-6885759330790536323gmail-s2">dbz</span><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">(j,i) = </span><span class="m_3148295094233172091m_-6885759330790536323gmail-s2">dbz</span><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">(j,i) + wrap_around(j,i)</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>end if</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>end if</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>end do</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>end do</span></p></div><div><br></div><div><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">fatal:["NclVar.c":1390]:Assign<wbr>ment type mismatch, right hand side can't be coerced to type of left hand side</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">fatal:["Execute.c":8575]:Execu<wbr>te: Error occurred at or near line 35 in file ./ra</span></p><div>PrintVarSummary gives:</div><div><br></div><div><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">Variable: dbz</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">Type: byte</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">Total Size: 480960 bytes</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>480960 values</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">Number of Dimensions: 2</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">Dimensions and sizes:<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>[radialR | 360] x [gateR | 1336]</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">Coordinates:<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span></span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1">Number Of Attributes: 14</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>units :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>dBz</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>long_name :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>Reflectivity</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>missing_value :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>0</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>signal_below_threshold :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>0</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>scale_factor :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>0.5</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>add_offset :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>-33</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>_Unsigned :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>true</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>range_folding_threshold :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>50</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>_CoordinateAxes :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>timeR elevationR azimuthR distanceR</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>scale_factor_metadata :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>0.5</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>add_offset_metadata :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>-33</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>range_folded_value_packed :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>1</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>range_folded_value :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>-32.5</span></p><p class="m_3148295094233172091m_-6885759330790536323gmail-p1"><span class="m_3148295094233172091m_-6885759330790536323gmail-s1"><span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-converted-space"> </span>_FillValue :<span class="m_3148295094233172091m_-6885759330790536323gmail-Apple-tab-span"> </span>0</span></p></div>-- <br><div class="m_3148295094233172091m_-6885759330790536323gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com/" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div></div></div></div>
______________________________<wbr>_________________<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" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><span class="m_3148295094233172091HOEnZb"><font color="#888888"><br></font></span></div></blockquote></div><span class="m_3148295094233172091HOEnZb"><font color="#888888"><br><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br class="m_3148295094233172091m_-6885759330790536323Apple-interchange-newline">Guido Cioni</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://guidocioni.altervista" target="_blank">http://guidocioni.altervista</a>.o<wbr>rg</div>
</div>
<br></font></span></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_3148295094233172091gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>