<div dir="ltr"><div class="gmail_default" style="font-size:small">Yongli,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry, this is not a very informative error message!</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I believe this is coming from the "toint" function, and is caused if you try to convert a large float or double precision value to an integer that would cause you to lose precision.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">An example of this is:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">x = 3^31 ;</font> 6.176734e+14, too large for an integer variable</div>
<div class="gmail_default" style="font-size:small"><font face="monospace, monospace">print(x)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">i = toint(x)</font><span style="font-family:monospace,monospace"> ; triggers the "larger than INT_MAX" error</span></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">print(i) ; -2147483647 (integer missing value)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><br></font></div><div class="gmail_default" style="font-size:small">I would check if you are calling "toint" anywhere in your code, and then you will have to decide what to do with values that are too large. For example, you could try "tolong" instead:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">x = 3^31 ; 6.176734e+1</font></div><div class="gmail_default"><font face="monospace, monospace">print(x)</font></div><div class="gmail_default"><font face="monospace, monospace">i = tolong(x)</font></div><div class="gmail_default"><font face="monospace, monospace">print(i) ; 617673406808064</font></div><div class="gmail_default"><br></div><div class="gmail_default">You could also do something with these large values before you convert them:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> x@_FillValue = -999</font></div><div class="gmail_default"><font face="monospace, monospace"> x = where(x.ge.(2^31-1),x@_FillValue,x)</font></div><div class="gmail_default"><font face="monospace, monospace"> i = toint(x) ; Last value will be -999</font></div></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 16, 2016 at 8:30 AM, Sitan Heyl <span dir="ltr"><<a href="mailto:heylsitan@gmail.com" target="_blank">heylsitan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, all<div> I have an warning "there is 1 float larger than INT_MAX, which has been flagged missing". I need find where this warning occurs. Because this program need a long time to run, I wonder whether there is mode to debug the program or return an interactive mode and don't exit after running script. Any help is welcoming!</div><div><br></div><div>Bests,</div>YONGLI<div><br></div>
<br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>