cavity_fill_p_ice_ref Subroutine

public pure subroutine cavity_fill_p_ice_ref(p_ice_ref, z_draft, rho_g, nx, ny)

p_ice_ref = (rho_ref*GRAVITY) * z_draft (Pa).

rho_g is passed as ONE pre-multiplied scalar on purpose: the FV_MOM6 surface BC forms rho_ref*GRAVITY*eta_geo with the same product, so building the load this way makes pa(nz+1) = rho_ref*g*(-z_draft) + p_ice_ref cancel to bit-zero at rest instead of merely to a small number. Splitting it into two multiplies would give up that exactness for nothing.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(out) :: p_ice_ref(nx,ny)
real(kind=wp), intent(in) :: z_draft(nx,ny)
real(kind=wp), intent(in) :: rho_g

rho_ref*GRAVITY (kg m^-2 s^-2), pre-multiplied by the caller.

integer, intent(in) :: nx
integer, intent(in) :: ny

Called by

proc~~cavity_fill_p_ice_ref~~CalledByGraph proc~cavity_fill_p_ice_ref cavity_fill_p_ice_ref proc~configure_ocean_cavity configure_ocean_cavity proc~configure_ocean_cavity->proc~cavity_fill_p_ice_ref proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_cavity proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean 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

Source Code

   pure subroutine cavity_fill_p_ice_ref(p_ice_ref, z_draft, rho_g, nx, ny)
      !! `p_ice_ref = (rho_ref*GRAVITY) * z_draft` (Pa).
      !!
      !! `rho_g` is passed as ONE pre-multiplied scalar on purpose: the
      !! FV_MOM6 surface BC forms `rho_ref*GRAVITY*eta_geo` with the same
      !! product, so building the load this way makes
      !! `pa(nz+1) = rho_ref*g*(-z_draft) + p_ice_ref` cancel to bit-zero
      !! at rest instead of merely to a small number.  Splitting it into
      !! two multiplies would give up that exactness for nothing.
      integer, intent(in) :: nx, ny
      real(wp), intent(out) :: p_ice_ref(nx, ny)
      real(wp), intent(in) :: z_draft(nx, ny)
      real(wp), intent(in) :: rho_g
         !! `rho_ref*GRAVITY` (kg m^-2 s^-2), pre-multiplied by the caller.
      integer :: i, j
      do j = 1, ny
         do i = 1, nx
            p_ice_ref(i, j) = rho_g*z_draft(i, j)
         end do
      end do
   end subroutine cavity_fill_p_ice_ref