ocean_surface_stress_compute_tendencies Subroutine

public subroutine ocean_surface_stress_compute_tendencies(grid, this, ms)

Fill du_stress / dv_stress with the surface stress acceleration tau / (rho_0 * h_top) at k = nz. Outer-shim: hoist the derived-type derefs (this%tau_x, this%du_stress%data, ms%h_layer, ms%wet_mask) to the host, dispatch to flat-impl.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(ocean_surface_stress_t), intent(inout) :: this
type(multilayer_state_t), intent(in) :: ms

Calls

proc~~ocean_surface_stress_compute_tendencies~~CallsGraph proc~ocean_surface_stress_compute_tendencies ocean_surface_stress_compute_tendencies proc~surfstress_compute_impl surfstress_compute_impl proc~ocean_surface_stress_compute_tendencies->proc~surfstress_compute_impl proc~surfstress_distributed_impl surfstress_distributed_impl proc~ocean_surface_stress_compute_tendencies->proc~surfstress_distributed_impl local local proc~surfstress_compute_impl->local proc~surfstress_distributed_impl->local

Called by

proc~~ocean_surface_stress_compute_tendencies~~CalledByGraph proc~ocean_surface_stress_compute_tendencies ocean_surface_stress_compute_tendencies proc~run_stage run_stage proc~run_stage->proc~ocean_surface_stress_compute_tendencies proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_surface_stress_compute_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

Source Code

   subroutine ocean_surface_stress_compute_tendencies(grid, this, ms)
      !! Fill `du_stress` / `dv_stress` with the surface stress
      !! acceleration `tau / (rho_0 * h_top)` at k = nz.  Outer-shim:
      !! hoist the derived-type derefs (`this%tau_x`, `this%du_stress%data`,
      !! `ms%h_layer`, `ms%wet_mask`) to the host, dispatch to flat-impl.
      type(hgrid_t), intent(in) :: grid
      type(ocean_surface_stress_t), intent(inout) :: this
      type(multilayer_state_t), intent(in) :: ms

      if (this%direct_stress .and. this%hmix_stress > 0.0_wp) then
         call surfstress_distributed_impl( &
            ms%h_layer, ms%wet_mask, &
            this%tau_x, this%tau_y, &
            this%du_stress%data, this%dv_stress%data, &
            this%rho0, this%h_min, this%hmix_stress, &
            grid%nx_total, grid%ny_total, ms%nz_ml)
      else
         call surfstress_compute_impl( &
            ms%h_layer, ms%wet_mask, &
            this%tau_x, this%tau_y, &
            this%du_stress%data, this%dv_stress%data, &
            this%rho0, this%h_min, &
            grid%nx_total, grid%ny_total, ms%nz_ml)
      end if
   end subroutine ocean_surface_stress_compute_tendencies