NOAA-PMEL / Ferret

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

erroneous netCDF time bounds should become a dependent variable #1418

Closed karlmsmith closed 6 years ago

karlmsmith commented 6 years ago

Reported by steven.c.hankin on 28 Feb 2014 01:19 UTC When Ferret encounters a coordinate axis that is disordered (or whatever) it substitutes a simple index variable as the coordinate and makes the (disordered) coordinates visible as a dependent variable. That way the user can often assess the nature of the problem, correct it using Ferret definitions and fix it in a Ferret session.

However, when Ferret encounters erroneous coordinate bounds, it reports the problem, but fails to make the values visible. So there is no way for the Ferret user to compute on the values.

Erroneous bounds should be promoted to a dependent variable, much as the coordinates are.

An example of problem is illustrated in this script refering to '''time_bnds'''

yes? use "http://data1.gfdl.noaa.gov:8380/thredds3/dodsC/clivar_Fef_ensemble"
           *** NOTE: Error in bounds "time_bnds" or bounds do not enclose point on axis time
           *** NOTE: Substituting coordinate midpoints
           *** NOTE: Units on axis "plev" are not recognized: Pa
           *** NOTE: They will not be convertible:
           *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis plev
           *** NOTE: unrepairable repeated axis coords on axis ensemble at subscript 2
           *** NOTE: A dummy axis of subscripts will be used
yes? show data 
     currently SET data sets:
    1> http://data1.gfdl.noaa.gov:8380/thredds3/dodsC/clivar_Fef_ensemble  (default)
 name     title                             I         J         K         L         M         N
 HEIGHT   height                           ...       ...       ...       ...       ...       ...
 ENSEMBLE Ensemble of Realizations         ...       ...       ...       ...       1:5       ...
       (invalid coordinate axis)
 LABELS   CLIVAR Fef                       ...       ...       ...       ...       1:5       ...
 RLS      Net surface longwave             1:144     1:90      ...       1:336     ...       ...
 RLT      Outgoing Longwave Radiation      1:144     1:90      ...       1:336     ...       ...
 RSS      Net surface solar                1:144     1:90      ...       1:336     ...       ...
 RST      Top net solar                    1:144     1:90      ...       1:336     ...       ...
 TAUV     Meridional Surface Wind Stress   1:144     1:90      ...       1:336     ...       ...
 UV       Meridional Wind Component        1:144     1:90      1:17      1:336     ...       ...
 TAS      Surface Air Temperature          1:144     1:90      ...       1:336     1:5       ...
 ZG       Geopotential Height              1:144     1:90      1:17      1:336     1:5       ...
 PR       Precipitation                    1:144     1:90      ...       1:336     1:5       ...
 RLUS     Surface Upwelling Longwave Radi  1:144     1:90      ...       1:336     1:5       ...
 RLUT     Outgoing Longwave Radiation      1:144     1:90      ...       1:336     1:5       ...
 RSDT     TOA Incident Shortwave Radiatio  1:144     1:90      ...       1:336     1:5       ...
 RSUS     Surface Upwelling Shortwave Rad  1:144     1:90      ...       1:336     1:5       ...
 RSUT     TOA Reflected Shortwave Radiati  1:144     1:90      ...       1:336     1:5       ...
 TASMIN   Minimum Daily Surface Air Tempe  1:144     1:90      ...       1:336     1:5       ...
 PSL      Sea Level Pressure               1:144     1:90      ...       1:336     1:5       ...
 CLT      Total Cloud Fraction             1:144     1:90      ...       1:336     1:5       ...
 HFSS     Surface Skin Temperature         1:144     1:90      ...       1:336     1:5       ...
 HUS      Specific Humidity                1:144     1:90      1:17      1:336     1:5       ...
 RLDS     Surface Downwelling Longwave Ra  1:144     1:90      ...       1:336     1:5       ...
 RSDS     Surface Downwelling Shortwave R  1:144     1:90      ...       1:336     1:5       ...
 TAUU     Zonal Surface Wind Stress        1:144     1:90      ...       1:336     1:5       ...
 TA       Temperature                      1:144     1:90      1:17      1:336     1:5       ...
 TASMAX   Maximum Daily Surface Air Tempe  1:144     1:90      ...       1:336     1:5       ...
 TS       Surface Skin Temperature         1:144     1:90      ...       1:336     1:5       ...
 UA       Zonal Wind Component             1:144     1:90      1:17      1:336     1:5       ...
 VA       Meridional Wind Component        1:144     1:90      1:17      1:336     1:5       ...
 UAS      Zonal Surface Wind Speed         1:144     1:90      ...       1:336     1:5       ...
 VAS      Meridional Surface Wind Speed    1:144     1:90      ...       1:336     1:5       ...

As netCDF the dataset looks like this:

/home/users/hankin/FERRET32/fer> ncdump -h   http://data1.gfdl.noaa.gov:8380/thredds3/dodsC/clivar_Fef_ensemble
netcdf clivar_Fef_ensemble {
dimensions:
        bnds = 2 ;
        ensemble = 5 ;
        lat = 90 ;
        lon = 144 ;
        maxStrlen64 = 64 ;
        plev = 17 ;
        time = 336 ;
variables:
        double lat(lat) ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:long_name = "latitude" ;
                lat:standard_name = "latitude" ;
                lat:_ChunkSize = 90 ;
        double lon(lon) ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
                lon:long_name = "longitude" ;
                lon:standard_name = "longitude" ;
                lon:_ChunkSize = 144 ;
        double height ;
                height:units = "m" ;
                height:axis = "Z" ;
                height:long_name = "height" ;
                height:standard_name = "height" ;
        float time(time) ;
                time:bounds = "time_bnds" ;
                time:units = "days since 1982-02-01 00:00:00" ;
                time:calendar = "JULIAN" ;
                time:axis = "T" ;
                time:long_name = "time" ;
                time:standard_name = "time" ;
                time:_ChunkSize = 1 ;
                time:_CoordinateAxisType = "Time" ;
        double time_bnds(time, bnds) ;
                time_bnds:_ChunkSize = 1, 2 ;
        double plev(plev) ;
                plev:units = "Pa" ;
                plev:axis = "Z" ;
                plev:long_name = "pressure" ;
                plev:standard_name = "air_pressure" ;
                plev:_ChunkSize = 17 ;
                plev:positive = "down" ;
...

Some of the values of time and time_bounds are here

Dataset {
    Float32 time[time = 31];
    Float64 time_bnds[time = 31][bnds = 2];
} clivar_Fef_ensemble;
---------------------------------------------
time[31]
15.0, 45.5, 76.0, 106.5, 137.0, 167.5, 198.0, 228.5, 259.0, 289.5, 320.0, 350.5, 381.0, 411.5, 442.0, 472.5, 503.0, 533.5, 564.0, 594.5, 625.0, 655.5, 686.0, 716.5, 747.0, 777.5, 808.0, 838.5, 869.0, 899.5, 930.0

time_bnds[31][2]
[0], 0.0, 28.0
[1], 28.0, 59.0
[2], 59.0, 89.0
[3], 89.0, 120.0
[4], 120.0, 150.0
[5], 150.0, 181.0
[6], 181.0, 212.0
[7], 212.0, 242.0
[8], 242.0, 273.0
[9], 273.0, 303.0
[10], 303.0, 334.0
[11], 334.0, 365.0
[12], 0.0, 28.0
[13], 28.0, 59.0
[14], 59.0, 89.0
[15], 89.0, 120.0
[16], 120.0, 150.0
[17], 150.0, 181.0
[18], 181.0, 212.0
[19], 212.0, 242.0
[20], 242.0, 273.0
[21], 273.0, 303.0
[22], 303.0, 334.0
[23], 334.0, 365.0
[24], 0.0, 29.0
[25], 29.0, 60.0
[26], 60.0, 90.0
[27], 90.0, 121.0
[28], 121.0, 151.0
[29], 151.0, 182.0
[30], 182.0, 213.0

Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/2146

karlmsmith commented 6 years ago

Comment by @AnsleyManke on 28 Mar 2014 19:19 UTC This is done. The above dataset now looks like this after being opened.

yes? use "http://data1.gfdl.noaa.gov:8380/thredds3/dodsC/clivar_Fef_ensemble"

 *** NOTE: Error in bounds "time_bnds" or bounds do not enclose point on axis time
 *** NOTE: Substituting coordinate midpoints
 *** NOTE: Units on axis "plev" are not recognized: Pa
 *** NOTE: They will not be convertible:
 *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis plev

yes? sh dat
     currently SET data sets:
    1> http://data1.gfdl.noaa.gov:8380/thredds3/dodsC/clivar_Fef_ensemble  (default)
 name     title                             I         J         K         L         M         N
 HEIGHT   height                           ...       ...       ...       ...       ...       ...
 TIME_BNDS
                                           1:2       ...       ...       1:336     ...       ...
       (invalid axis bounds)
 LABELS   CLIVAR Fef                       ...       ...       ...       ...       1:5       ...
 RLS      Net surface longwave             1:144     1:90      ...       1:336     ...       ...
 RLT      Outgoing Longwave Radiation      1:144     1:90      ...       1:336     ...       ...

...
yes? list time_bnds
             VARIABLE : TIME_BNDS
                        invalid axis bounds
             DATA SET : model output prepared for GFDL Seasonal-Interannual experimental forecasts - CM2.1U_CDAef_V1.0
             FILENAME : clivar_Fef_ensemble
             FILEPATH : http://data1.gfdl.noaa.gov:8380/thredds3/dodsC/
             SUBSET   : 2 by 336 points (X-TIME)
             CALENDAR : JULIAN
                       1      2    
                       1      2
 16-FEB-1982 /   1:    0.0   28.0
 18-MAR-1982 /   2:   28.0   59.0
 18-APR-1982 /   3:   59.0   89.0
 18-MAY-1982 /   4:   89.0  120.0
 18-JUN-1982 /   5:  120.0  150.0
 18-JUL-1982 /   6:  150.0  181.0
 18-AUG-1982 /   7:  181.0  212.0
 17-SEP-1982 /   8:  212.0  242.0
 18-OCT-1982 /   9:  242.0  273.0
 17-NOV-1982 /  10:  273.0  303.0
 18-DEC-1982 /  11:  303.0  334.0
 17-JAN-1983 /  12:  334.0  365.0
 17-FEB-1983 /  13:    0.0   28.0
 19-MAR-1983 /  14:   28.0   59.0
 19-APR-1983 /  15:   59.0   89.0
 19-MAY-1983 /  16:   89.0  120.0
 19-JUN-1983 /  17:  120.0  150.0
 19-JUL-1983 /  18:  150.0  181.0
 19-AUG-1983 /  19:  181.0  212.0
...