Look up canonical diagnostic name in the parsed specs and apply
its overrides: skip=.true. if the entry is :off; otherwise
time_op / dt_out / coord are overwritten when the entry sets
them. No matching entry (or absent specs) leaves the caller’s
defaults untouched.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(diag_spec_t), | intent(in), | optional | :: | specs(:) | ||
| character(len=*), | intent(in) | :: | name | |||
| integer, | intent(inout) | :: | time_op | |||
| real(kind=wp), | intent(inout) | :: | dt_out | |||
| integer, | intent(inout) | :: | coord | |||
| logical, | intent(out) | :: | skip |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i |
pure subroutine resolve_canonical_spec(specs, name, time_op, dt_out, coord, skip) !! Look up canonical diagnostic `name` in the parsed `specs` and apply !! its overrides: `skip=.true.` if the entry is `:off`; otherwise !! `time_op` / `dt_out` / `coord` are overwritten when the entry sets !! them. No matching entry (or absent `specs`) leaves the caller's !! defaults untouched. type(diag_spec_t), intent(in), optional :: specs(:) character(len=*), intent(in) :: name integer, intent(inout) :: time_op real(wp), intent(inout) :: dt_out integer, intent(inout) :: coord logical, intent(out) :: skip integer :: i skip = .false. if (.not. present(specs)) return do i = 1, size(specs) if (trim(specs(i)%name) == trim(name)) then if (specs(i)%off) then skip = .true. return end if if (specs(i)%time_op /= DIAG_OP_UNSET) time_op = specs(i)%time_op if (specs(i)%dt_out > 0.0_wp) dt_out = specs(i)%dt_out if (specs(i)%coord /= DIAG_COORD_UNSET) coord = specs(i)%coord return end if end do end subroutine resolve_canonical_spec