@@ -24,17 +24,23 @@ static void defineAllTracers() {
2424 "sea_water_potential_temperature", ///< [ in] CF standard Name
2525 -273.15, ///< [ in] min valid field value
2626 100.0, ///< [ in] max valid field value
27- 1.e33, ///< [ in] value for undef entries
27+ FillValueReal, ///< [ in] value for undef entries
2828 IndxTemp); ///< [ out] (optional) static index
2929
30- define ("Salt", "Salinity", "psu", "sea_water_salinity", 0.0, 50.0, 1.e33,
31- IndxSalt);
32- define ("Debug1", "Debug Tracer 1", "none", "none", 0.0, 100.0, 1.e33 );
33- define ("Debug2", "Debug Tracer 2", "none", "none", 0.0, 100.0, 1.e33 );
34- define ("Debug3", "Debug Tracer 3", "none", "none", 0.0, 100.0, 1.e33 );
30+ define ("Salt", "Salinity", "psu", "sea_water_salinity", 0.0, 50.0,
31+ FillValueReal, IndxSalt);
32+ define ("Debug1", "Debug Tracer 1", "none", "none", 0.0, 100.0, FillValueReal );
33+ define ("Debug2", "Debug Tracer 2", "none", "none", 0.0, 100.0, FillValueReal );
34+ define ("Debug3", "Debug Tracer 3", "none", "none", 0.0, 100.0, FillValueReal );
3535}
3636```
3737
38+ The ` FillValueReal ` constant is defined in ` FillValues.h ` and matches the
39+ NetCDF-C standard fill value (` NC_FILL_DOUBLE ` or ` NC_FILL_FLOAT ` depending on
40+ the build precision). It is automatically in scope in ` TracerDefs.inc ` via
41+ ` Field.h ` . New tracers should always use ` FillValueReal ` (or ` FillValueI4 ` /
42+ ` FillValueI8 ` for integer fields) rather than hardcoded literals.
43+
3844To add a new tracer, simply call the ` define ` function with the appropriate
3945arguments. Index argument is optional one that allows to access the tracer
4046data using the given tracer index variable.
0 commit comments