ocean_surface_stress_apply_tendencies Subroutine

public subroutine ocean_surface_stress_apply_tendencies(this, ms, dt, no_wait)

Outer-shim — flattens the derived-type derefs before the do concurrent body sees them. Explicit-shape dimensions derived from ms and passed to the impl as scalar args. no_wait (optional, default .false.): forwarded to the impl — when .true. the apply DC loops run on OpenACC queue 1 without a trailing sync, so the batched velocity-apply chain in run_stage_split !$acc wait(1)s ONCE. Default ⇒ blocking. Not pure because of the async/wait directives.

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_stress_t), intent(in) :: this
type(multilayer_state_t), intent(inout) :: ms
real(kind=wp), intent(in) :: dt
logical, intent(in), optional :: no_wait

Calls

proc~~ocean_surface_stress_apply_tendencies~~CallsGraph proc~ocean_surface_stress_apply_tendencies ocean_surface_stress_apply_tendencies proc~surfstress_apply_impl surfstress_apply_impl proc~ocean_surface_stress_apply_tendencies->proc~surfstress_apply_impl

Called by

proc~~ocean_surface_stress_apply_tendencies~~CalledByGraph proc~ocean_surface_stress_apply_tendencies ocean_surface_stress_apply_tendencies proc~run_stage run_stage proc~run_stage->proc~ocean_surface_stress_apply_tendencies proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_surface_stress_apply_tendencies proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
logical, private :: lwait
integer, private :: nx_cells
integer, private :: ny_cells
integer, private :: nz

Source Code

   subroutine ocean_surface_stress_apply_tendencies(this, ms, dt, no_wait)
      !! Outer-shim — flattens the derived-type derefs before the
      !! `do concurrent` body sees them.  Explicit-shape dimensions
      !! derived from `ms` and passed to the impl as scalar args.
      !! `no_wait` (optional, default .false.): forwarded to the impl —
      !! when .true. the apply DC loops run on OpenACC queue 1 without a
      !! trailing sync, so the batched velocity-apply chain in
      !! `run_stage_split` `!$acc wait(1)`s ONCE.  Default ⇒ blocking.
      !! Not `pure` because of the async/wait directives.
      type(ocean_surface_stress_t), intent(in) :: this
      type(multilayer_state_t), intent(inout) :: ms
      real(wp), intent(in) :: dt
      logical, intent(in), optional :: no_wait
      integer :: nx_cells, ny_cells, nz
      logical :: lwait
      lwait = .true.
      if (present(no_wait)) lwait = .not. no_wait
      nx_cells = size(ms%u_face_x_layer, 1) - 1
      ny_cells = size(ms%v_face_y_layer, 2) - 1
      nz = ms%nz_ml
      call surfstress_apply_impl(ms%u_face_x_layer, ms%v_face_y_layer, &
                                 this%du_stress%data, this%dv_stress%data, &
                                 dt, nx_cells, ny_cells, nz, lwait)
   end subroutine ocean_surface_stress_apply_tendencies