From what I can ascertain, CMOR will only accept real (float32) and integer (int32) type arguments, with no ability to more granularly use the space-saving data types of byte/int8, ubyte/uint8 (a quarter of the size), short/int16, and ushort/uint16 (half the size) vs the default real/float32 type.
We should change this to expose all valid netcdf4 types - netCDF4 Data Types which map directly from numpy data types
Current CMOR tables have two data types, real and integer which are both Fortran data types, equivalent to float types in the netCDF-C data type library. It would be useful to map to modern C/Python types, most often being float (32-bit), as numpyand other Python-based software are most often being used to call CMOR these days.
e.g.
|
"tas": { |
|
"frequency": "mon", |
|
"modeling_realm": "atmos", |
|
"standard_name": "air_temperature", |
|
"units": "K", |
|
"cell_methods": "area: time: mean", |
|
"cell_measures": "area: areacella", |
|
"long_name": "Near-Surface Air Temperature", |
|
"comment": "near-surface (usually, 2 meter) air temperature", |
|
"dimensions": "longitude latitude time height2m", |
|
"out_name": "tas", |
|
"type": "real", |
|
"positive": "", |
|
"nsigma": { |
|
"units": "", |
|
"long_name": "vertical coordinate formula term: nsigma", |
|
"type": "integer", |
|
"dimensions": "" |
|
}, |
I've also seen
double used for dimension types, not sure if this maps to a
float64 type?
@mauzey1 it would be great if you can chime in on this query - how hard-coded are the data types in CMOR, and do we have the ability of using uint8 and other netCDF4 data types currently in CMOR?
From what I can ascertain, CMOR will only accept
real(float32) andinteger(int32) type arguments, with no ability to more granularly use the space-saving data types ofbyte/int8,ubyte/uint8(a quarter of the size),short/int16, andushort/uint16(half the size) vs the defaultreal/float32type.We should change this to expose all valid netcdf4 types - netCDF4 Data Types which map directly from numpy data types
Current CMOR tables have two data types,
realandintegerwhich are both Fortran data types, equivalent tofloattypes in the netCDF-C data type library. It would be useful to map to modern C/Python types, most often beingfloat(32-bit), asnumpyand other Python-based software are most often being used to call CMOR these days.e.g.
cmor/TestTables/CMIP6_Amon.json
Lines 17 to 29 in c83e67e
cmor/TestTables/CMIP6_Amon_json_hfls
Lines 204 to 209 in c83e67e
I've also seen
doubleused for dimension types, not sure if this maps to afloat64type?@mauzey1 it would be great if you can chime in on this query - how hard-coded are the data types in CMOR, and do we have the ability of using uint8 and other netCDF4 data types currently in CMOR?