use notok.nc
*** NOTE:
*** NOTE: Could not adjust grid for variable mask_T
**ERROR: inconsistent data grids: File needs axis attributes on coordinate variables indicating correct directions
$ ncdump notok.nc
netcdf notok {
dimensions:
y_grid_T = 1 ;
x_grid_T = 1 ;
nvertex_grid_T = 4 ;
variables:
double bounds_lat_grid_T(y_grid_T, x_grid_T, nvertex_grid_T) ;
double bounds_lon_grid_T(y_grid_T, x_grid_T, nvertex_grid_T) ;
byte mask_T(y_grid_T, x_grid_T) ;
mask_T:cell_measures = "area: area_grid_T" ;
mask_T:coordinates = "nav_lat_grid_T nav_lon_grid_T" ;
double nav_lat_grid_T(y_grid_T, x_grid_T) ;
nav_lat_grid_T:standard_name = "latitude" ;
nav_lat_grid_T:long_name = "Latitude" ;
nav_lat_grid_T:units = "degrees_north" ;
nav_lat_grid_T:bounds = "bounds_lat_grid_T" ;
double nav_lon_grid_T(y_grid_T, x_grid_T) ;
nav_lon_grid_T:standard_name = "longitude" ;
nav_lon_grid_T:long_name = "Longitude" ;
nav_lon_grid_T:units = "degrees_east" ;
nav_lon_grid_T:bounds = "bounds_lon_grid_T" ;
data:
bounds_lat_grid_T =
-29.5895932339965, -29.5895932339965, -27.835621888657, -27.835621888657 ;
bounds_lon_grid_T =
156.999148343641, 158.999201071309, 158.999201071309, 156.999148343641 ;
mask_T =
1 ;
nav_lat_grid_T =
-28.7162844516478 ;
nav_lon_grid_T =
157.999608915878 ;
}
If I remove _grid_T suffix then the file is read correctly.
$ ncgen -o notok.nc notok.cdl
$ sed -e 's/_grid_T//g' notok.cdl > ok.cdl
$ ncgen -o ok.nc ok.cdl
Any idea on why there is the unexpected behaviour (test on names of dimensions) ?
Attachment:
notok.nc
Description: Cdf file