Hi ferreters,
A colleague has encountered a strange problem as he was trying to
nicely respect the netCDF CF conventions to describe a curvilinear grid (NEMO configuration).
ferret complains about some inconsistent data grid and missing axis attributes.
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
Stranger, if I change the name of the dimension, then the file
is read. I have not been able to fix this by adding a direction attribute as requested.
The file is simple as:
$ 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) ?
Patrick
--
Data Analytics and Visualization Engineer / Project Manager
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--sed -e 's/_grid_T//g' tyty.cdl > tyty1.cdl