[ncl-talk] possible bug gc_latlon function nan

Devries, Andries a.devries at mpic.de
Tue Sep 27 09:26:11 MDT 2016


Dear NCL team,

I just came across a possible bug in the gc_latlon function. Two points that are located very nearby can result in a "nan", see below. In a previous post a similar bug was reported (see link below) for two points with the exact same location. A solution was found for this issue, but possibly two points that are located very nearby each other may still suffer the same issue. Further I noticed that a slight change in any of the four coordinate values can result in a 0 value instead of a nan. A possible way to work around this could be using the "replace_ieeenan" function, but fixing the bug might be preferable.

Looking forward to your response. Thanks!
Cheers,
Andries
--------------------------------------------------------------------------------------------------------------------------------------

 Copyright (C) 1995-2015 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.3.0
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
ncl 0> print(gc_latlon(88.67137908935547,-179.9999847412109,88.67137908935547,180,0,4))


Variable: unnamed (return)
Type: float
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:    [1]
Coordinates:
Number Of Attributes: 4
  units :    kilometers
  gclon :    ( 180, 180 )
  gclat :    ( 88.67138, 88.67138 )
  spacing :    nan
(0)    nan

--------------------------------------------------------------------------------------------------------------------------------------
link to previously reported bug:
https://www.ncl.ucar.edu/Support/talk_archives/2011/0317.html
--------------------------------------------------------------------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160927/aab808dd/attachment.html 


More information about the ncl-talk mailing list