TEOS-10 / GSW-C

C implementation of the Thermodynamic Equation Of Seawater - 2010 (TEOS-10)
Other
18 stars 17 forks source link

BUG: need to wrap longitudes to 0-360 #46

Closed efiring closed 2 years ago

efiring commented 2 years ago

https://github.com/TEOS-10/GibbsSeaWater.jl/issues/18#issuecomment-1001223033 and https://discourse.julialang.org/t/a-weird-issue-with-julia-1-7-1-on-ubuntu-gibbsseawater-jl-package/73632 show the error for lon > 360. The gsw_saar function is only handling negative longitudes, not longitudes beyond 360. Likely fix: change

        if (lon  <  0.0)
            lon += 360.0;

to

        lon = fmod(lon, 360);
        if (lon  <  0.0)
            lon += 360.0;

I would be inclined to fix it first in Python and then propagate it back to here, since testing is so much easier in Python.

efiring commented 2 years ago

Closed by #47.