recon_rho_surf Function

private pure function recon_rho_surf(pa_k, pa_kp1, h_surf, rho_ref) result(rho_surf)

Recover the layer-mean surface density from the reconstructed pressure-anomaly stack: dpa(nz) = pa(nz) - pa(nz+1) = (rho_surf - rho_ref)gh_surf, so rho_surf = rho_ref + dpa/(g*h). Used only by the gfs_scale Montgomery correction (Pass 5).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: pa_k
real(kind=wp), intent(in) :: pa_kp1
real(kind=wp), intent(in) :: h_surf
real(kind=wp), intent(in) :: rho_ref

Return Value real(kind=wp)


Called by

proc~~recon_rho_surf~~CalledByGraph proc~recon_rho_surf recon_rho_surf proc~compute_fv_mom6_insitu_pcm_impl compute_fv_mom6_insitu_pcm_impl proc~compute_fv_mom6_insitu_pcm_impl->proc~recon_rho_surf proc~compute_fv_mom6_reconstruct_impl compute_fv_mom6_reconstruct_impl proc~compute_fv_mom6_reconstruct_impl->proc~recon_rho_surf proc~ocean_pressure_force_compute ocean_pressure_force_compute proc~ocean_pressure_force_compute->proc~compute_fv_mom6_insitu_pcm_impl proc~ocean_pressure_force_compute->proc~compute_fv_mom6_reconstruct_impl proc~run_stage run_stage proc~run_stage->proc~ocean_pressure_force_compute proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_pressure_force_compute 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private, parameter :: H_FLOOR = 1.0e-10_wp
real(kind=wp), private :: hh

Source Code

   pure function recon_rho_surf(pa_k, pa_kp1, h_surf, rho_ref) result(rho_surf)
      !$acc routine seq
      !! Recover the layer-mean surface density from the reconstructed
      !! pressure-anomaly stack: dpa(nz) = pa(nz) - pa(nz+1) =
      !! (rho_surf - rho_ref)*g*h_surf, so rho_surf = rho_ref + dpa/(g*h).
      !! Used only by the gfs_scale Montgomery correction (Pass 5).
      real(wp), intent(in) :: pa_k, pa_kp1, h_surf, rho_ref
      real(wp) :: rho_surf
      real(wp), parameter :: H_FLOOR = 1.0e-10_wp
      real(wp) :: hh
      hh = max(h_surf, H_FLOOR)
      rho_surf = rho_ref + (pa_k - pa_kp1)/(GRAVITY*hh)
   end function recon_rho_surf