Outer shim (outer-shim + flat-impl pattern): dereference the
tracer registry (ms%tracers(idx)%hTr) on the HOST and forward
bare arrays to the device kernel — NVHPC stdpar cannot follow
the array-of-derived-types indirection inside a do-concurrent
body (same rule as ice_frazil_accumulate). No-op when either
S or T is unregistered.
PR 4a dispatch (module docstring two-mode convention): ncat==1
calls the EXISTING ice_frazil_uptake_impl byte-for-byte
UNCHANGED (bit-identity with PR 3c); ncat>1 calls the new
ice_frazil_uptake_multicat_impl. The branch lives ONLY here —
never inside a kernel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(eos_t), | intent(in) | :: | eos | |||
| type(multilayer_state_t), | intent(in) | :: | ms |
ocean-side effect of the uptake (brine rejection) arrives
only via |
||
| type(ocean_sea_ice_t), | intent(inout) | :: | ice | |||
| real(kind=wp), | intent(in) | :: | dt_therm |
Effective thermo timestep (s) — |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | idx_S | ||||
| integer, | private | :: | idx_T |
pure subroutine ice_frazil_uptake(grid, eos, ms, ice, dt_therm) !! Outer shim (outer-shim + flat-impl pattern): dereference the !! tracer registry (`ms%tracers(idx)%hTr`) on the HOST and forward !! bare arrays to the device kernel — NVHPC stdpar cannot follow !! the array-of-derived-types indirection inside a do-concurrent !! body (same rule as `ice_frazil_accumulate`). No-op when either !! S or T is unregistered. !! !! PR 4a dispatch (module docstring two-mode convention): `ncat==1` !! calls the EXISTING `ice_frazil_uptake_impl` byte-for-byte !! UNCHANGED (bit-identity with PR 3c); `ncat>1` calls the new !! `ice_frazil_uptake_multicat_impl`. The branch lives ONLY here — !! never inside a kernel. type(hgrid_t), intent(in) :: grid type(eos_t), intent(in) :: eos type(multilayer_state_t), intent(in) :: ms !! READ-ONLY: SST/SSS are SAMPLED here, never written — the !! ocean-side effect of the uptake (brine rejection) arrives !! only via `Q_salt` on the NEXT thermo window, through !! `ice_ocean_brine_flux` + `ocean_surface_flux_apply_tracers`. type(ocean_sea_ice_t), intent(inout) :: ice real(wp), intent(in) :: dt_therm !! Effective thermo timestep (s) — `ocean_dyn_t%therm_dt(dt)`. integer :: idx_T, idx_S idx_T = ms%idx_temperature idx_S = ms%idx_salinity if (idx_T <= 0 .or. idx_S <= 0) return if (ice%ncat == 1) then call ice_frazil_uptake_impl(ms%tracers(idx_T)%hTr, ms%tracers(idx_S)%hTr, & ms%h_layer, ms%wet_mask, eos, & ice%frazil_heat, ice%m_ice, ice%m_snow, & ice%enth_ice, ice%sal_ice, & ice%m_frozen_diag, ice%salt_flux_diag, & dt_therm, grid%nghost, ice%ncat, ice%nk_ice, & ms%nz_ml, grid%nx_total, grid%ny_total) else call ice_frazil_uptake_multicat_impl(ms%tracers(idx_T)%hTr, ms%tracers(idx_S)%hTr, & ms%h_layer, ms%wet_mask, eos, & ice%frazil_heat, ice%part_size, ice%m_ice, & ice%m_snow, ice%enth_ice, ice%sal_ice, & ice%m_frozen_diag, ice%salt_flux_diag, & dt_therm, grid%nghost, ice%ncat, ice%nk_ice, & ms%nz_ml, grid%nx_total, grid%ny_total) end if end subroutine ice_frazil_uptake