Ordering guard: update_2d/_3d must be called with the same
t update_all most recently refreshed this field’s bracket
with (skipped for STATIC — its bracket never changes, so
“freshness” is meaningless). Catches a consumer calling
update_2d/_3d before update_all has run this step, which
would otherwise silently blend a stale bracket.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| real(kind=wp), | intent(in) | :: | t |
subroutine check_fresh(this, id, t) !! Ordering guard: `update_2d/_3d` must be called with the same !! `t` `update_all` most recently refreshed this field's bracket !! with (skipped for STATIC — its bracket never changes, so !! "freshness" is meaningless). Catches a consumer calling !! `update_2d/_3d` before `update_all` has run this step, which !! would otherwise silently blend a stale bracket. class(ocean_data_input_t), intent(in) :: this integer, intent(in) :: id real(wp), intent(in) :: t if (this%fields(id)%time_mode == DATA_TIME_STATIC) return if (t /= this%fields(id)%t_last) then call logger%error("ocean_data_input: field id "//to_string(id)// & " queried at t = "//to_string(t)// & "s but its bracket was last refreshed at t = "// & to_string(this%fields(id)%t_last)// & "s — call ocean_data_input_update_all(this, t) first") error stop "ocean_data_input: stale bracket (update_all not called for this t)" end if end subroutine check_fresh