p_surf_update_seam Subroutine

public subroutine p_surf_update_seam(this, p_surf, g_bt, eta_tide)

Refresh the combined seam field eta_seam for the current outer step from the assembled total surface pressure p_surf (read-only; see the module header for where the assembly happens): fold eta_ib = -p_surf/(rho0 g_bt) into eta_seam = eta_ib [+ eta_tide]. g_bt is the barotropic-substep gravity (bt_work%g_bt), passed in at call time so the seam scales with the ocean’s own dynamics. eta_tide (optional) is the equilibrium-tide + scalar-SAL seam, added when the tide is on. Host does one reciprocal; the fill is a single explicit-shape do concurrent. p_surf is the device-resident ocean_surface_flux_t%p_surf component array.

Arguments

Type IntentOptional Attributes Name
class(ocean_p_surf_t), intent(inout) :: this
real(kind=wp), intent(in) :: p_surf(:,:)
real(kind=wp), intent(in) :: g_bt
real(kind=wp), intent(in), optional :: eta_tide(:,:)

Calls

proc~~p_surf_update_seam~~CallsGraph proc~p_surf_update_seam p_surf_update_seam proc~p_surf_update_seam_impl p_surf_update_seam_impl proc~p_surf_update_seam->proc~p_surf_update_seam_impl

Called by

proc~~p_surf_update_seam~~CalledByGraph proc~p_surf_update_seam p_surf_update_seam proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~p_surf_update_seam proc~engine_step engine_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
real(kind=wp), private :: i_rho0_g
integer, private :: nx
integer, private :: ny

Source Code

   subroutine p_surf_update_seam(this, p_surf, g_bt, eta_tide)
      !! Refresh the combined seam field `eta_seam` for the current outer
      !! step from the assembled total surface pressure `p_surf` (read-only;
      !! see the module header for where the assembly happens): fold
      !! `eta_ib = -p_surf/(rho0 g_bt)` into `eta_seam = eta_ib [+ eta_tide]`.
      !! `g_bt` is the barotropic-substep gravity (`bt_work%g_bt`), passed in
      !! at call time so the seam scales with the ocean's own dynamics.
      !! `eta_tide` (optional) is the equilibrium-tide + scalar-SAL seam,
      !! added when the tide is on.  Host does one reciprocal; the fill is a
      !! single explicit-shape `do concurrent`.  `p_surf` is the
      !! device-resident `ocean_surface_flux_t%p_surf` component array.
      class(ocean_p_surf_t), intent(inout) :: this
      real(wp), intent(in) :: p_surf(:, :)
      real(wp), intent(in) :: g_bt
      real(wp), intent(in), optional :: eta_tide(:, :)
      real(wp) :: i_rho0_g
      integer :: nx, ny

      nx = size(this%eta_ib, 1)
      ny = size(this%eta_ib, 2)
      i_rho0_g = 1.0_wp/(this%rho0*g_bt)
      if (present(eta_tide)) then
         call p_surf_update_seam_impl(nx, ny, i_rho0_g, p_surf, &
                                      this%eta_ib, this%eta_seam, &
                                      use_tide=.true., eta_tide=eta_tide)
      else
         call p_surf_update_seam_impl(nx, ny, i_rho0_g, p_surf, &
                                      this%eta_ib, this%eta_seam, &
                                      use_tide=.false.)
      end if
   end subroutine p_surf_update_seam