Field-over-dt diagnostic
Divides any input field by the model timestep dt = t_current − t_start_of_step.
This is useful for converting accumulated differences into per-second rates.
Configuration
Append _over_dt to any field name X:
field_names:
- X_over_dt
The output field has the same layout and grid as X, with units [X_units / s].
Behavior
- At the start of each timestep (
init_timestep), the start-of-step timestamp is saved internally. - At evaluation time (
compute_diagnostic),dtis computed as the difference between the field's current timestamp and the saved start timestamp (in seconds). - The output is
X / dtelement-wise. - On the very first evaluation — before
init_timestephas been called — the output is filled with the standard EAMxx fill value (constants::fill_value<Real>).
Example: atmospheric backward tendency
field_names:
- T_mid_minus_T_mid_prev_over_dt
This composes three diagnostics:
T_mid_prev—FieldPrevDiag: value ofT_midat the start of the stepT_mid_minus_T_mid_prev—BinaryOpsDiag: differenceT_mid_minus_T_mid_prev_over_dt—FieldOverDtDiag: rate
The shorthand T_mid_atm_backtend expands to the same expression via the
built-in alias system (see Built-in aliases).
Caveats
dtmust be strictly positive; a zero or negative timestep triggers a runtime error.- Only fields with
Realdata type are supported. - The suffix
_over_dtis matched before binary-op patterns, soA_minus_B_over_dtparses asFieldOverDtDiag(A_minus_B), notBinaryOpsDiag(A_minus_B, over, dt). See Parsing precedence for details.