Copy the accumulator into output_buffer. Called at
cadence-fire BEFORE log / NetCDF emission consumes
output_buffer.
MEAN -> accumulator / dt_accum (dt-weighted time mean)
INTEGRAL -> accumulator (raw cumulative integral)
MAX/MIN -> accumulator (running extremum)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(diag_var_t), | intent(inout) | :: | v |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private, | parameter | :: | TINY_DT | = | 1.0e-12_wp |
subroutine finalise_accumulator(v) !! Copy the accumulator into `output_buffer`. Called at !! cadence-fire BEFORE log / NetCDF emission consumes !! `output_buffer`. !! !! MEAN -> `accumulator / dt_accum` (dt-weighted time mean) !! INTEGRAL -> `accumulator` (raw cumulative integral) !! MAX/MIN -> `accumulator` (running extremum) type(diag_var_t), intent(inout) :: v real(wp), parameter :: TINY_DT = 1.0e-12_wp if (.not. allocated(v%accumulator)) return if (v%n_accum == 0) return select case (v%time_op) case (DIAG_OP_MEAN) if (v%dt_accum < TINY_DT) return call finalise_scale_impl(v%output_buffer, v%accumulator, & 1.0_wp/v%dt_accum) case (DIAG_OP_INTEGRAL, DIAG_OP_MAX, DIAG_OP_MIN) call finalise_copy_impl(v%output_buffer, v%accumulator) case default return end select end subroutine finalise_accumulator