ice_ocean_sw_flux_add_impl Subroutine

private 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.

Arguments

Type IntentOptional 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

Called by

proc~~ice_ocean_sw_flux_add_impl~~CalledByGraph proc~ice_ocean_sw_flux_add_impl ice_ocean_sw_flux_add_impl proc~ice_ocean_sw_flux ice_ocean_sw_flux proc~ice_ocean_sw_flux->proc~ice_ocean_sw_flux_add_impl proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_ocean_sw_flux proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step_ice proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step_ice proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j

Source Code

   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