-
Notifications
You must be signed in to change notification settings - Fork 36
Description
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.
cmor/TestTables/CMIP6_Amon.json
Lines 17 to 29 in c83e67e
| "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": "", |
cmor/TestTables/CMIP6_Amon_json_hfls
Lines 204 to 209 in c83e67e
| "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?