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.
| Type | Intent | Optional | 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 |
|
||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
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