Last modified: Tue, 03/14/2017 - 00:19
What is hybrid-z grid, and why addXML doesn't give you all that you need.
Data on a Hybrid-z grid has depths which vary at different xy locations. The data is on a grid which just has indices, 1, 2, 3, ... and a separate variable contains Layer Thicknesses, which may be different at different locations and even, potentially, at different times. The layer-thickness variable must be read for each xyt location, and integrated to get the depth represented by each layer.
An ncdump of such data might start like this:
netcdf hybrid_temp {
dimensions:
LONGITUDE = 500 ;
LATITUDE = 413 ;
LAYER = 32 ;
variables:
double LONGITUDE(LONGITUDE) ;
LONGITUDE:units = "degrees_east" ;
LONGITUDE:point_spacing = "even" ;
LONGITUDE:axis = "X" ;
double LATITUDE(LATITUDE) ;
LATITUDE:units = "degrees_north" ;
LATITUDE:point_spacing = "even" ;
LATITUDE:axis = "Y" ;
double LAYER(LAYER) ;
LAYER:units = "layer" ;
LAYER:positive = "down" ;
LAYER:point_spacing = "even" ;
LAYER:axis = "Z" ;
float TEMP(LAYER, LATITUDE, LONGITUDE) ;
TEMP:missing_value = -1.e+34f ;
TEMP:_FillValue = -1.e+34f ;
TEMP:units = "degC" ;
TEMP:long_name = "seawater_potential_temperature" ;
float LTHK(LAYER, LATITUDE, LONGITUDE) ;
LTHK:missing_value = -1.e+34f ;
LTHK:_FillValue = -1.e+34f ;
LTHK:units = "m" ;
LTHK:long_name = "layer_thickness" ;
Or, the thickness variable may be in a separate file.
With the Z axis that appears in the dataset, you can run AddXML, but the layer numbers 1, 2, ... do not represent depths. You will need to edit the xml file that AddXML produces.