Fill stress_mag from the current tau_x/tau_y — the MOM6
set_derived_forcing_fields analogue (PR-12), and the public
entry point configure_ocean_forcing calls after the
wind_config dispatch. Host-side (the wind field is
configure-static in v1, so one fill at configure suffices — a
future time-varying wind reader re-calls this after each read).
Not pure: writes into ss. Call BEFORE enter_data, or
follow with !$acc update device(ss%stress_mag) if already
mapped. In practice this is a defensive re-fill only: every
set_wind_stress_* setter already refreshes stress_mag in
step (ocean_surfstress_refresh_stress_mag) so stress_mag is
never stale relative to tau_x/tau_y regardless of call site
(production driver OR a unit test that never reaches
configure_ocean_forcing).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid |
Kept in the public signature (PR-12 plan §5.2) though shape
is now taken from |
||
| type(ocean_surface_stress_t), | intent(inout) | :: | ss | |||
| real(kind=wp), | intent(in), | optional | :: | cover_frac(:,:) |
Ice-shelf cover fraction at cell centres
( |
subroutine ocean_surface_stress_set_derived(grid, ss, cover_frac) !! Fill `stress_mag` from the current `tau_x`/`tau_y` — the MOM6 !! `set_derived_forcing_fields` analogue (PR-12), and the public !! entry point `configure_ocean_forcing` calls after the !! `wind_config` dispatch. Host-side (the wind field is !! configure-static in v1, so one fill at configure suffices — a !! future time-varying wind reader re-calls this after each read). !! Not `pure`: writes into `ss`. Call BEFORE `enter_data`, or !! follow with `!$acc update device(ss%stress_mag)` if already !! mapped. In practice this is a defensive re-fill only: every !! `set_wind_stress_*` setter already refreshes `stress_mag` in !! step (`ocean_surfstress_refresh_stress_mag`) so `stress_mag` is !! never stale relative to `tau_x`/`tau_y` regardless of call site !! (production driver OR a unit test that never reaches !! `configure_ocean_forcing`). type(hgrid_t), intent(in) :: grid !! Kept in the public signature (PR-12 plan §5.2) though shape !! is now taken from `tau_x`/`tau_y` directly — see !! `ocean_surfstress_refresh_stress_mag`. type(ocean_surface_stress_t), intent(inout) :: ss real(wp), intent(in), optional :: cover_frac(:, :) !! Ice-shelf cover fraction at cell centres !! (`metrics%cover_frac`). Present ⇒ the `tau` pair is masked !! on every face touching a covered cell BEFORE `stress_mag` is !! rebuilt (`ocean_surface_stress_apply_cover`). Absent ⇒ the !! original refresh-only path, byte-identical. ! assumed-shape-ok: configure-time / per-forcing-bracket cadence. if (present(cover_frac)) then call ocean_surface_stress_apply_cover(ss, cover_frac) else call ocean_surface_stress_refresh_mag(ss) end if end subroutine ocean_surface_stress_set_derived