Skip to content

CMOR data types - what is exposed from netCDF4 to write data #781

@durack1

Description

@durack1

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions