<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">dbz is byte type -> wrap_around thus is byte type.<div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">You have to convert wrap_around to float (for example with the function tofloat) before attempting that.</div><div class="">Cheers </div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 8. Sep 2017, at 10:11, Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" class="">barry.h.lynn@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi:<div class=""><br class=""></div><div class="">I have some simple code, copied below.</div><div class=""><br class=""></div><div class="">I cannot add the value of 256 to dbz or the value of wrap_around after</div><div class="">setting it to 256.</div><div class=""><br class=""></div><div class=""><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>wrap_around = </span><span class="gmail-s2">dbz</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>wrap_around = 256.</span></p><p class="gmail-p2"><span class="gmail-s1"></span><br class=""></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>do j = 0,dims2d(0)-1</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>do i = 0,dims2d(1)-1</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>check = ismissing(</span><span class="gmail-s2">dbz</span><span class="gmail-s1">(j,i))</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">   </span>if (check.eq.False)then</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">   </span>if (</span><span class="gmail-s2">dbz</span><span class="gmail-s1">(j,i).lt.0)then</span></p><p class="gmail-p1"><span class="gmail-s1">    </span><span class="gmail-s2">dbz</span><span class="gmail-s1">(j,i) = </span><span class="gmail-s2">dbz</span><span class="gmail-s1">(j,i) + wrap_around(j,i)</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">   </span>end if</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">   </span>end if</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>end do</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>end do</span></p></div><div class=""><br class=""></div><div class=""><p class="gmail-p1"><span class="gmail-s1">fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be coerced to type of left hand side</span></p><p class="gmail-p1"><span class="gmail-s1">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 35 in file ./ra</span></p><div class="">PrintVarSummary gives:</div><div class=""><br class=""></div><div class=""><p class="gmail-p1"><span class="gmail-s1">Variable: dbz</span></p><p class="gmail-p1"><span class="gmail-s1">Type: byte</span></p><p class="gmail-p1"><span class="gmail-s1">Total Size: 480960 bytes</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">            </span>480960 values</span></p><p class="gmail-p1"><span class="gmail-s1">Number of Dimensions: 2</span></p><p class="gmail-p1"><span class="gmail-s1">Dimensions and sizes:<span class="gmail-Apple-tab-span">   </span>[radialR | 360] x [gateR | 1336]</span></p><p class="gmail-p1"><span class="gmail-s1">Coordinates:<span class="gmail-Apple-converted-space"> </span></span></p><p class="gmail-p1"><span class="gmail-s1">Number Of Attributes: 14</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>units :<span class="gmail-Apple-tab-span">    </span>dBz</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>long_name :<span class="gmail-Apple-tab-span">  </span>Reflectivity</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>missing_value :<span class="gmail-Apple-tab-span">     </span>0</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>signal_below_threshold :<span class="gmail-Apple-tab-span">       </span>0</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>scale_factor :<span class="gmail-Apple-tab-span"> </span>0.5</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>add_offset :<span class="gmail-Apple-tab-span"> </span>-33</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>_Unsigned :<span class="gmail-Apple-tab-span">  </span>true</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>range_folding_threshold :<span class="gmail-Apple-tab-span">   </span>50</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>_CoordinateAxes :<span class="gmail-Apple-tab-span">     </span>timeR elevationR azimuthR distanceR</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>scale_factor_metadata :<span class="gmail-Apple-tab-span">      </span>0.5</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>add_offset_metadata :<span class="gmail-Apple-tab-span">        </span>-33</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>range_folded_value_packed :<span class="gmail-Apple-tab-span">  </span>1</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>range_folded_value :<span class="gmail-Apple-tab-span">   </span>-32.5</span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space">  </span>_FillValue :<span class="gmail-Apple-tab-span">       </span>0</span></p></div>-- <br class=""><div class="gmail_signature"><div dir="ltr" class="">Barry H. Lynn, Ph.D<div class=""><div class="">Senior Lecturer,</div><div class=""><div class=""><span style="color:rgb(136,136,136)" class="">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)" class=""><span style="color:rgb(136,136,136)" class="">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)" class=""><span style="color:rgb(136,136,136)" class="">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)" class=""></div><span style="color:rgb(136,136,136)" class="">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)" class=""><span style="color:rgb(136,136,136)" class="">Fax: (972)-25662581</span></div></div><div class=""><span style="color:rgb(136,136,136)" class=""><br class=""></span></div><div class="">C.E.O, Weather It Is, LTD<br class="">Weather and Climate Focus<br class=""><a href="http://weather-it-is.com/" target="_blank" class="">http://weather-it-is.com</a><br class="">Jerusalem, Israel<br class="">Local: 02 930 9525<br class="">Cell: 054 7 231 170<br class="">Int-IS: x972 2 930 9525<br class="">US 914 432 3108<br class=""></div></div></div>
</div></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""><div class="">
<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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://guidocioni.altervista" class="">http://guidocioni.altervista</a>.org</div>

</div>
<br class=""></div></body></html>