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. No-op when either S or T is unregistered.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(eos_t), | intent(in) | :: | eos | |||
| type(multilayer_state_t), | intent(inout) | :: | ms | |||
| real(kind=wp), | intent(inout) | :: | frazil_heat(:,:) |
Persistent supercooling bank (J/m²) on the ice slot —
|
||
| real(kind=wp), | intent(inout) | :: | heat_budget_frazil(:,:,:) |
Heat-budget contributor accumulator (K·m per cell) —
|
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | idx_S | ||||
| integer, | private | :: | idx_T |
pure subroutine ice_frazil_accumulate(grid, eos, ms, frazil_heat, & heat_budget_frazil) !! 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. No-op when either S or T is unregistered. type(hgrid_t), intent(in) :: grid type(eos_t), intent(in) :: eos type(multilayer_state_t), intent(inout) :: ms real(wp), intent(inout) :: frazil_heat(:, :) !! Persistent supercooling bank (J/m²) on the ice slot — !! `ocean_sea_ice_t%frazil_heat`, device-mapped by the slot's !! `enter_data`. real(wp), intent(inout) :: heat_budget_frazil(:, :, :) !! Heat-budget contributor accumulator (K·m per cell) — !! `ocean_sea_ice_t%heat_budget_frazil`. integer :: idx_T, idx_S idx_T = ms%idx_temperature idx_S = ms%idx_salinity if (idx_T <= 0 .or. idx_S <= 0) return call ice_frazil_accumulate_impl(ms%tracers(idx_T)%hTr, & ms%tracers(idx_S)%hTr, & ms%h_layer, ms%wet_mask, & frazil_heat, heat_budget_frazil, & eos, grid%nghost, & ms%nz_ml, grid%nx_total, grid%ny_total) end subroutine ice_frazil_accumulate