Diagnostics
ClimateMachine.Diagnostics
— ModuleDiagnostics
Accumulate mean fields and covariance statistics on the computational grid.
Types
ClimateMachine.Diagnostics.DiagnosticsGroup
— TypeDiagnosticsGroup
Holds a set of diagnostics that share a collection interval, a filename prefix, an output writer, an interpolation, and any extra parameters.
Diagnostics groups
A ClimateMachine
driver may use any number of the methods described below to create DiagnosticsGroup
s which must be specified to the ClimateMachine
in a DiagnosticsConfiguration
in order to be used.
ClimateMachine.Diagnostics.setup_atmos_default_diagnostics
— Functionsetup_atmos_default_diagnostics(
::AtmosLESConfigType,
interval::String,
out_prefix::String;
writer = NetCDFWriter(),
interpol = nothing,
)
Create the "AtmosLESDefault" DiagnosticsGroup
which contains the following diagnostic variables, all of which are density-averaged horizontal averages, variances and co-variances:
- u: x-velocity
- v: y-velocity
- w: z-velocity
- avgrho: air density (not_ density-averaged)
- rho: air density
- temp: air temperature
- pres: air pressure
- thd: dry potential temperature
- et: total specific energy
- ei: specific internal energy
- ht: specific enthalpy based on total energy
- hi: specific enthalpy based on internal energy
- whtsgs: vertical sgs flux of total specific enthalpy
- var_u: variance of x-velocity
- var_v: variance of y-velocity
- var_w: variance of z-velocity
- w3: third moment of z-velocity
- tke: turbulent kinetic energy
- var_ei: variance of specific internal energy
- covwu: vertical eddy flux of x-velocity
- covwv: vertical eddy flux of y-velocity
- covwrho: vertical eddy flux of density
- covwthd: vertical eddy flux of dry potential temperature
- covwei: vertical eddy flux of specific internal energy
When an EquilMoist
or a NonEquilMoist
moisture model is used, the following diagnostic variables are also output, also density-averaged horizontal averages, variances and co-variances:
- qt: mass fraction of total water in air
- ql: mass fraction of liquid water in air
- qv: mass fraction of water vapor in air
- qi: mass fraction of ice in air
- thv: virtual potential temperature
- thl: liquid-ice potential temperature
- wqtsgs: vertical sgs flux of total specific humidity
- var_qt: variance of total specific humidity
- var_thl: variance of liquid-ice potential temperature
- covwqt: vertical eddy flux of total specific humidity
- covwql: vertical eddy flux of liquid water specific humidity
- covwqi: vertical eddy flux of cloud ice specific humidity
- covwqv: vertical eddy flux of water vapor specific humidity
- covwthv: vertical eddy flux of virtual potential temperature
- covwthl: vertical eddy flux of liquid-ice potential temperature
- covqtthl: covariance of total specific humidity and liquid-ice potential temperature
- covqtei: covariance of total specific humidity and specific internal energy
All these variables are output with the z
dimension (x3id
) on the DG grid (interpol
may not be specified) as well as a (unlimited) time
dimension at the specified interval
.
setup_atmos_default_diagnostics(
::AtmosGCMConfigType,
interval::String,
out_prefix::String;
writer::AbstractWriter,
interpol = nothing,
)
Create the "AtmosGCMDefault" DiagnosticsGroup
which contains the following diagnostic variables:
- u: zonal wind
- v: meridional wind
- w: vertical wind
- rho: air density
- temp: air temperature
- pres: air pressure
- thd: dry potential temperature
- et: total specific energy
- ei: specific internal energy
- ht: specific enthalpy based on total energy
- hi: specific enthalpy based on internal energy
- vort: vertical component of relative vorticity
- vort2: vertical component of relative vorticity from DGModel kernels via a mini balance law
When an EquilMoist
moisture model is used, the following diagnostic variables are also output:
- qt: mass fraction of total water in air
- ql: mass fraction of liquid water in air
- qv: mass fraction of water vapor in air
- qi: mass fraction of ice in air
- thv: virtual potential temperature
- thl: liquid-ice potential temperature
All these variables are output with lat
, long
, and level
dimensions of an interpolated grid (interpol
must be specified) as well as a (unlimited) time
dimension at the specified interval
.
ClimateMachine.Diagnostics.setup_atmos_core_diagnostics
— Functionsetup_atmos_core_diagnostics(
::AtmosLESConfigType,
interval::String,
out_prefix::String;
writer::AbstractWriter,
interpol = nothing,
)
Create the "AtmosLESCore" DiagnosticsGroup
which contains the following diagnostic variables, all of which are density-averaged horizontal averages conditional upon q_liq > 0 && w > 0
except for core_frac
:
- core_frac: cloud core fraction
- u_core: cloud core x-velocity
- v_core: cloud core y-velocity
- w_core: cloud core z-velocity
- avgrhocore: cloud core air density (not density averaged)
- rho_core: cloud core air density
- qt_core: cloud core total specific humidity
- ql_core: cloud core liquid water specific humidity
- thv_core: cloud core virtual potential temperature
- thl_core: cloud core liquid-ice potential temperature
- ei_core: cloud core specific internal energy
- varucore: cloud core variance of x-velocity
- varvcore: cloud core variance of y-velocity
- varwcore: cloud core variance of z-velocity
- varqtcore: cloud core variance of total specific humidity
- varthlcore: cloud core variance of liquid-ice potential temperature
- vareicore: cloud core variance of specific internal energy
- covwrho_core: cloud core vertical eddy flux of density
- covwqt_core: cloud core vertical eddy flux of specific humidity
- covwthl_core: cloud core vertical eddy flux of liquid-ice potential temperature
- covwei_core: cloud core vertical eddy flux of specific internal energy
- covqtthl_core: cloud core covariance of total specific humidity and liquid-ice potential temperature
- covqtei_core: cloud core covariance of total specific humidity and specific internal energy
All these variables are output with the z
dimension (x3id
) on the DG grid (interpol
may not be specified) as well as a (unlimited) time
dimension at the specified interval
.
ClimateMachine.Diagnostics.setup_atmos_default_perturbations
— Functionsetup_atmos_default_perturbations(
::AtmosLESConfigType,
interval::String,
out_prefix::String;
writer::AbstractWriter,
interpol = nothing,
)
Create the "AtmosLESDefaultPerturbations" DiagnosticsGroup
which contains the following diagnostic variables, all of which are perturbations from the horizontal average of that variable.
- u_prime
- v_prime
- w_prime
- avgrhoprime
- temp_prime
- pres_prime
- thd_prime
- et_prime
- ei_prime
- ht_prime
- hi_prime
When an EquilMoist
moisture model is used, the following additional diagnostic variables are also output:
- qt_prime
- ql_prime
- qv_prime
- thv_prime
- thl_prime
The perturbations are output on x
, y
, z
dimensions of an interpolated grid (interpol
must be specified) and a (unlimited) time
dimension at the specified interval
.
ClimateMachine.Diagnostics.setup_atmos_refstate_perturbations
— Functionsetup_atmos_refstate_perturbations(
::ClimateMachineConfigType,
interval::String,
out_prefix::String;
writer = NetCDFWriter(),
interpol = nothing,
)
Create the "AtmosRefStatePerturbations" DiagnosticsGroup
which contains perturbations from the (hydrostatic) reference state for:
- rho: air density
- pres: air pressure
- temp: air temperature
- et: total specific energy
- qt: mass fraction of total water in air (NaN when not an
EquilMoist
moisture model)
The perturbations are computed from variables on an interpolated grid (interpol
must be specified) and output on x
, y
, z
or lat
, long
, level
dimensions as well as a (unlimited) time
dimension at the specified interval
.
ClimateMachine.Diagnostics.setup_atmos_turbulence_stats
— Functionsetup_atmos_turbulence_stats(
::ClimateMachineConfigType,
interval::String,
out_prefix::String,
nor::Float64,
iter::Float64;
writer = NetCDFWriter(),
interpol = nothing,
)
Create the "AtmosTurbulenceStats" DiagnosticsGroup
which contains the following diagnostic variables:
- E_k: volumetrically-averaged dimensionless kinetic energy
- dE: volumetrically-averaged kinetic energy dissipation
These are scalar variables computed on the DG grid (interpol
may not be specified), output on the (unlimited) time
dimension at the specified interval
.
ClimateMachine.Diagnostics.setup_atmos_mass_energy_loss
— Functionsetup_atmos_mass_energy_loss(
::ClimateMachineConfigType,
interval::String,
out_prefix::String,
writer = NetCDFWriter(),
interpol = nothing,
)
Create and return a DiagnosticsGroup
containing the "AtmosMassEnergyLoss" diagnostics for Atmos LES and GCM configurations. All the diagnostics in the group will run at the specified interval
, be interpolated to the specified boundaries and resolution, and written to files prefixed by out_prefix
using writer
.
ClimateMachine.Diagnostics.setup_atmos_spectra_diagnostics
— Functionsetup_atmos_spectra_diagnostics(
::AtmosLESConfigType,
interval::String,
out_prefix::String;
writer = NetCDFWriter(),
interpol = nothing,
nor = Inf,
)
Create the "AtmosLESSpectra" DiagnosticsGroup
which contains the following diagnostic variable:
- spectrum: power spectrum from 3D velocity fields
This variable is output with the k
dimension (wave number) on an interpolated grid (interpol
must be specified) as well as a (unlimited) time
dimension at the specified interval
.
setup_atmos_spectra_diagnostics(
::AtmosGCMConfigType,
interval::String,
out_prefix::String;
writer = NetCDFWriter(),
interpol = nothing,
nor = 1.0,
)
Create the "AtmosGCMSpectra" DiagnosticsGroup
which contains the following diagnostic variables:
- spectrum_1d: 1D power spectrum of kinetic energy ( 1/2u^2 + 1/2v^2)
- spectrum_2d: 2D power spectrum of kinetic energy ( 1/2u^2 + 1/2v^2)
These are output with m
, lat
, level
and m_t
, n
, level
dimensions, i.e. zonal wavenumber, latitude, level and (truncated) zonal wavenumber, total wavenumber, level, as well as a (unlimited) time
dimension at the specified interval
. The spectrum is computed after the velocity fields have been interpolated (interpol
must be specified).
ClimateMachine.Diagnostics.setup_dump_state_diagnostics
— Functionsetup_dump_state_diagnostics(
::ClimateMachineConfigType,
interval::String,
out_prefix::String;
writer = NetCDFWriter(),
interpol = nothing,
)
Create the "DumpState" DiagnosticsGroup
which contains all the prognostic state variables. These are output on x
, y
, z
or lat
, long
, level
dimensions of an interpolated grid (interpol
must be specified) as well as a time
dimension at the specified interval
.
ClimateMachine.Diagnostics.setup_dump_aux_diagnostics
— Functionsetup_dump_aux_diagnostics(
::ClimateMachineConfigType,
interval::String,
out_prefix::String;
writer = NetCDFWriter(),
interpol = nothing,
)
Create the "DumpAux" DiagnosticsGroup
which contains all the auxiliary state variables. These are output on x
, y
, z
or lat
, long
, level
dimensions of an interpolated grid (interpol
must be specified) as well as a time
dimension at the specified interval
.
ClimateMachine.Diagnostics.setup_dump_tendencies_diagnostics
— Functionsetup_dump_tendencies_diagnostics(
::ClimateMachineConfigType,
interval::String,
out_prefix::String;
writer = NetCDFWriter(),
interpol = nothing,
)
Create the "DumpTendencies" DiagnosticsGroup
which contains all the tendencies for the simulation's BalanceLaw
. These are collected on an interpolated grid (interpol
must be specified).
This diagnostics group can produce a lot of output and is very expensive.
These diagnostics are intended for physics-debugging, and not numerics debugging, because flux
and source
are called on interpolated data, which may not exactly match the non-interpolated evaluation of fluxes and sources that the solver uses.