Closed aekiss closed 5 years ago
Should be K
not degrees K
, surely?
udunits agrees with you @russfiedler
https://github.com/Unidata/UDUNITS-2/blob/master/lib/udunits2-base.xml#L37-L42
Sorry to confuse the story, but CMIP6 has degrees C as the preferred temperature unit. I originally had K for CMIP5, to be consistent with the atmosphere. But the ocean community rebelled since no oceanographer thinks of temperature in K. Hence the switch to deg C for CMIP6.
K or C are fine by me for MOM5, so long as everything is self-consistent.
hmmm, sounds like we need another namelist variable cmipn
to specify which cmip...
https://github.com/mom-ocean/MOM5/commit/fe3906f0eeb875f9d1cb82f959dcbf30e5db730a shows what I had in mind. Comments welcome. I'm yet to check that it compiles.
There's a new namelist variable cmip_version
. With cmip_units=.true.
the temperature is in K if cmip_version<=5
, otherwise in degrees C - @StephenGriffies does this look OK?
I've used the CF standard name sea_water_conservative_temperature
but had to invent sea_surface_conservative_temperature
and square_of_sea_surface_conservative_temperature
A brief looks and all seems OK @aekiss . Thanks for this; I approve.
@russfiedler what do you think?
I'd suggest make a PR and discuss implementation details there.
a404d1d fixes this
When
temperature_variable = 'conservative_temp'
the netcdf diagnostic output fortemp
has values in K but the incorrect unitsdeg_C
. Examples (for those on NCI):/g/data/hh5/tmp/cosima/access-om2-025/025deg_jra55v13_iaf_gmredi6/output150/ocean/ocean.nc
and/g/data/hh5/tmp/cosima/access-om2-01/01deg_jra55v13_ryf9091/output000/ocean/ocean.nc
Note thatpottemp_equal_contemp
is irrelevant (it is true in the first example and defaults to false in the second). Thepot_temp
variable units are correct in both cases.When
temperature_variable = 'potential_temp'
both units and values are given correctly indegrees K
. For example:/g/data/hh5/tmp/cosima/access-om2-01/01deg_jra55v13_ryf8485_spinup6/output470/ocean/ocean.nc
These runs all use
cmip_units=.true.
, which should settemp_units='degrees K'
https://github.com/mom-ocean/MOM5/blob/master/src/mom5/ocean_tracers/ocean_tracer.F90#L605 but this is not being picked up and the old unit'degC'
(NB: not'degrees C'
as forcmip_units=.false.
) is used instead.I'm guessing
ocean_prog_tracer_init
needs aelseif(T_prog(n)%longname=='Conservative temperature') then
clause here https://github.com/mom-ocean/MOM5/blob/50dc61e9d77c181e6ad0047925fafdcead64d87a/src/mom5/ocean_tracers/ocean_tracer.F90#L1252 like this one inocean_diag_tracer_init
: https://github.com/mom-ocean/MOM5/blob/50dc61e9d77c181e6ad0047925fafdcead64d87a/src/mom5/ocean_tracers/ocean_tracer.F90#L1988 It looks like this clause is also needed here in the case of blobs: https://github.com/mom-ocean/MOM5/blob/50dc61e9d77c181e6ad0047925fafdcead64d87a/src/mom5/ocean_tracers/ocean_tracer.F90#L1454Thanks to Ruth for spotting this.