NOAA-PMEL / Ferret

The Ferret program from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
55 stars 20 forks source link

grid weirdness in JPL SSH NetCDF dataset, starting in v7.3 #1894

Closed AndrewWittenberg closed 6 years ago

AndrewWittenberg commented 6 years ago

Starting in v7.3 (dated 12/4/17), some NetCDF datasets are no longer read in properly. E.g. a satellite altimetry dataset, downloaded from JPL:

% wget ftp://podaac-ftp.jpl.nasa.gov/allData/merged_alt/L4/cdr_grid/ssh_grids_v1609_1992100212.nc

This worked just fine in v7.21 (dated 8/31/17):

    NOAA/PMEL TMAP
    FERRET v7.21 (optimized)
    Linux 2.6.32-696.6.3.el6.x86_64 64-bit - 08/31/17
    13-Sep-18 20:30     

yes? use ssh_grids_v1609_1992100212.nc
yes? sho dat/ful
     currently SET data sets:
    1> ./ssh_grids_v1609_1992100212.nc  (default)
     Sea Level Anormaly Estimate based on Altimeter Data
 name     title                             I         J         K         L
 SLA_ERR  Sea Level Anomaly Error Estimat  1:2160    1:960     ...       1:1
             m on grid GPY1 with 9.96921E+36 for missing data
             X=0E(0):0E(360)  Y=80S:80N  
 SLA      Sea Level Anomaly Estimate       1:2160    1:960     ...       1:1
             m on grid GPY1 with 9.96921E+36 for missing data
             X=0E(0):0E(360)  Y=80S:80N  

  time range: 02-OCT-1992 12:00

yes? shade/l=1 sla
yes? frame/file=v7p21.gif

v7p21

But from v7.3 (dated 12/4/17) onward, we now get weirdness with the grid, and can no longer make the plot at all. E.g. in the latest v7.41 (dated 8/27/18):

    NOAA/PMEL TMAP
    FERRET v7.421 (optimized)
    Linux 2.6.32-696.30.1.el6.x86_64 64-bit - 08/27/18
    13-Sep-18 20:35     

yes? use ssh_grids_v1609_1992100212.nc
yes? sho dat/ful
     currently SET data sets:
    1> ./ssh_grids_v1609_1992100212.nc  (default)
     Sea Level Anormaly Estimate based on Altimeter Data
 name     title                             I         J         K         L
 SLA_ERR  Sea Level Anomaly Error Estimat  1:2160    1:960     ...       1:1
             m on grid GPY1 with -1.E+34 for missing data
             X=*:*  Y=80S:80N  
 SLA      Sea Level Anomaly Estimate       1:2160    1:960     ...       1:1
             m on grid GPY1 with -1.E+34 for missing data
             X=*:*  Y=80S:80N  

  time range: 02-OCT-1992 12:00

yes? shade sla
 **ERROR: illegal limits: SLA is not in the range X=*:*
          Axis extremes are X=*:*

What's going on? We actually get different errors in v7.3 and other versions -- e.g. axes do have numeric limits, but they're wrong.

AnsleyManke commented 6 years ago

The coordinates are perhaps a bit over-specified; having coordinate bounds, and also the attribute point_spacing = "even". This is really a valid description, and could in fact describe a case where the coordinates are evenly spaced but not centered in the grid cells.

Ferret has a logic error, where the longitude axis gets marked as evenly spaced, but then in the process of analyzing its properties, including the coordinates and bounds, the coordinates are detected as being irregularly spaced, and neither the coordinates nor the the start-and-delta which are all that's needed to describe an axis with even spacing and grid points get stored. This occurred in the change to using dynamic storage rather than fixed block of storage for coordinate data.

I think the right thing to do here is to handle such an axis as irregular, even though that may not have been the intent of the writers of the file. Then we won't lose possibly-important information stored in the bounds. This is what the earlier Ferret versions did.

This is fixed, in cd_get_1_axis.F, and a new benchmark test included.