evp_zero_stress_impl Subroutine

private pure subroutine evp_zero_stress_impl(fxoc, fyoc, nx, ny)

Zero the subcycle-averaged ice->ocean stress accumulators via an explicit do concurrent device kernel (F1): fxoc/fyoc are copyin-mapped device-resident arrays, so a host = 0.0_wp would zero only the HOST copy and leave the device copy carrying the prior call’s average (the accumulate below would then converge to S/(N-1) instead of S/N). Runs on the device-present arrays; inert no-op on host builds.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(out) :: fxoc(nx+1,ny)
real(kind=wp), intent(out) :: fyoc(nx,ny+1)
integer, intent(in) :: nx
integer, intent(in) :: ny

Called by

proc~~evp_zero_stress_impl~~CalledByGraph proc~evp_zero_stress_impl evp_zero_stress_impl proc~ice_evp_dynamics_impl ice_evp_dynamics_impl proc~ice_evp_dynamics_impl->proc~evp_zero_stress_impl proc~ice_evp_dynamics ice_evp_dynamics proc~ice_evp_dynamics->proc~ice_evp_dynamics_impl proc~ice_evp_step ice_evp_step proc~ice_evp_step->proc~ice_evp_dynamics proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_evp_step 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

Variables

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

Source Code

   pure subroutine evp_zero_stress_impl(fxoc, fyoc, nx, ny)
      !! Zero the subcycle-averaged ice->ocean stress accumulators via an
      !! explicit `do concurrent` device kernel (F1): `fxoc`/`fyoc` are
      !! copyin-mapped device-resident arrays, so a host `= 0.0_wp` would
      !! zero only the HOST copy and leave the device copy carrying the
      !! prior call's average (the accumulate below would then converge to
      !! S/(N-1) instead of S/N). Runs on the device-present arrays; inert
      !! no-op on host builds.
      integer, intent(in) :: nx, ny
      real(wp), intent(out) :: fxoc(nx + 1, ny)
      real(wp), intent(out) :: fyoc(nx, ny + 1)
      integer :: i, j

      do concurrent(j=1:ny, i=1:nx + 1)
         fxoc(i, j) = 0.0_wp
      end do
      do concurrent(j=1:ny + 1, i=1:nx)
         fyoc(i, j) = 0.0_wp
      end do
   end subroutine evp_zero_stress_impl