ocean_surfstress_derived_impl Subroutine

private pure subroutine ocean_surfstress_derived_impl(tau_x, tau_y, stress_mag, nx, ny)

stress_mag(i,j) = |tau| at cell centres — literal copy of the three lines this dedups from rdb_ocean_vmix.F90 (KPP, :575-577/:641-643, pre-PR-12) and rdb_ocean_epbl.F90 (:974-976, pre-PR-12): SAME face-average op order, so the substitution at each call site is bit-identical (PR-12 §7.5). Explicit-shape dummies, integer dims first (decl-order).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: tau_x(nx+1,ny)
real(kind=wp), intent(in) :: tau_y(nx,ny+1)
real(kind=wp), intent(inout) :: stress_mag(nx,ny)
integer, intent(in) :: nx
integer, intent(in) :: ny

Calls

proc~~ocean_surfstress_derived_impl~~CallsGraph proc~ocean_surfstress_derived_impl ocean_surfstress_derived_impl local local proc~ocean_surfstress_derived_impl->local

Called by

proc~~ocean_surfstress_derived_impl~~CalledByGraph proc~ocean_surfstress_derived_impl ocean_surfstress_derived_impl proc~ocean_surface_stress_refresh_mag ocean_surface_stress_refresh_mag proc~ocean_surface_stress_refresh_mag->proc~ocean_surfstress_derived_impl proc~ice_ocean_stress_flux ice_ocean_stress_flux proc~ice_ocean_stress_flux->proc~ocean_surface_stress_refresh_mag proc~ocean_seam_refresh_surface_stress ocean_seam_refresh_surface_stress proc~ice_ocean_stress_flux->proc~ocean_seam_refresh_surface_stress proc~ice_ocean_stress_resume_apply ice_ocean_stress_resume_apply proc~ice_ocean_stress_resume_apply->proc~ocean_surface_stress_refresh_mag proc~ocean_surface_stress_apply_cover ocean_surface_stress_apply_cover proc~ocean_surface_stress_apply_cover->proc~ocean_surface_stress_refresh_mag proc~ocean_surface_stress_set_derived ocean_surface_stress_set_derived proc~ocean_surface_stress_set_derived->proc~ocean_surface_stress_refresh_mag proc~ocean_surface_stress_set_derived->proc~ocean_surface_stress_apply_cover proc~ocean_surfstress_refresh_stress_mag ocean_surfstress_refresh_stress_mag proc~ocean_surfstress_refresh_stress_mag->proc~ocean_surface_stress_refresh_mag proc~configure_ocean_cavity configure_ocean_cavity proc~configure_ocean_cavity->proc~ocean_surface_stress_apply_cover proc~engine_setup engine_setup proc~engine_setup->proc~ice_ocean_stress_resume_apply proc~engine_setup->proc~configure_ocean_cavity proc~configure_ocean_forcing configure_ocean_forcing proc~engine_setup->proc~configure_ocean_forcing proc~ocean_data_forcing_configure ocean_data_forcing_configure proc~engine_setup->proc~ocean_data_forcing_configure proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_ocean_stress_flux proc~ocean_seam_refresh_surface_stress->proc~ocean_surface_stress_set_derived proc~ocean_surfstress_set_2gyre ocean_surface_stress_t%ocean_surfstress_set_2gyre proc~ocean_surfstress_set_2gyre->proc~ocean_surfstress_refresh_stress_mag proc~ocean_surfstress_set_const ocean_surface_stress_t%ocean_surfstress_set_const proc~ocean_surfstress_set_const->proc~ocean_surfstress_refresh_stress_mag proc~ocean_surfstress_set_neverworld2 ocean_surface_stress_t%ocean_surfstress_set_neverworld2 proc~ocean_surfstress_set_neverworld2->proc~ocean_surfstress_refresh_stress_mag proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~configure_ocean_forcing->proc~ocean_seam_refresh_surface_stress proc~configure_ocean_forcing->proc~ocean_surfstress_set_2gyre proc~configure_ocean_forcing->proc~ocean_surfstress_set_const proc~configure_ocean_forcing->proc~ocean_surfstress_set_neverworld2 proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_run_ocean->proc~engine_step_ice proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~ocean_data_forcing_apply ocean_data_forcing_apply proc~ocean_data_forcing_apply->proc~ocean_seam_refresh_surface_stress proc~ocean_data_forcing_configure->proc~ocean_seam_refresh_surface_stress 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 proc~engine_step engine_step proc~engine_step->proc~ocean_data_forcing_apply proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
real(kind=wp), private :: tau_x_cell
real(kind=wp), private :: tau_y_cell

Source Code

   pure subroutine ocean_surfstress_derived_impl(tau_x, tau_y, stress_mag, nx, ny)
      !! `stress_mag(i,j) = |tau|` at cell centres — literal copy of the
      !! three lines this dedups from `rdb_ocean_vmix.F90` (KPP,
      !! `:575-577`/`:641-643`, pre-PR-12) and `rdb_ocean_epbl.F90`
      !! (`:974-976`, pre-PR-12): SAME face-average op order, so the
      !! substitution at each call site is bit-identical (PR-12 §7.5).
      !! Explicit-shape dummies, integer dims first (decl-order).
      integer, intent(in)    :: nx, ny
      real(wp), intent(in)    :: tau_x(nx + 1, ny), tau_y(nx, ny + 1)
      real(wp), intent(inout) :: stress_mag(nx, ny)
      integer :: i, j
      real(wp) :: tau_x_cell, tau_y_cell
      do concurrent(j=1:ny, i=1:nx) local(tau_x_cell, tau_y_cell)
         tau_x_cell = 0.5_wp*(tau_x(i, j) + tau_x(i + 1, j))
         tau_y_cell = 0.5_wp*(tau_y(i, j) + tau_y(i, j + 1))
         stress_mag(i, j) = sqrt(tau_x_cell*tau_x_cell + tau_y_cell*tau_y_cell)
      end do
   end subroutine ocean_surfstress_derived_impl