Components-off branch: ADD the ice-transmitted shortwave into the
net Q_heat (including ghosts — they get +0, since the ice
column gates sw_thru = 0 off-ice and sw_thru_diag is
correspondingly 0 there). This is an ADD, not an overwrite, and
is well-defined precisely because ice_ocean_heat_flux ran first
this window and full-overwrote Q_heat — so Q_heat holds
Q_heat_const + heat_flux_diag (SW-free) when this kernel lands
on it, and the net is recomputed fresh every window. Explicit-
shape + decl-order. Both arrays device-resident.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | Q_heat(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | sw_thru_diag(nx,ny) | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
pure subroutine ice_ocean_sw_flux_add_impl(Q_heat, sw_thru_diag, nx, ny) !! Components-off branch: ADD the ice-transmitted shortwave into the !! net `Q_heat` (including ghosts — they get `+0`, since the ice !! column gates `sw_thru = 0` off-ice and `sw_thru_diag` is !! correspondingly 0 there). This is an ADD, not an overwrite, and !! is well-defined precisely because `ice_ocean_heat_flux` ran first !! this window and full-overwrote `Q_heat` — so `Q_heat` holds !! `Q_heat_const + heat_flux_diag` (SW-free) when this kernel lands !! on it, and the net is recomputed fresh every window. Explicit- !! shape + decl-order. Both arrays device-resident. integer, intent(in) :: nx, ny real(wp), intent(inout) :: Q_heat(nx, ny) real(wp), intent(in) :: sw_thru_diag(nx, ny) integer :: i, j do concurrent(j=1:ny, i=1:nx) Q_heat(i, j) = Q_heat(i, j) + sw_thru_diag(i, j) end do end subroutine ice_ocean_sw_flux_add_impl