gm_h_frac Function

private pure function gm_h_frac(h_avail_k, rsum_k) result(hf)

Donor mass fraction h_avail(k)/rsum_above(k) (0 when no mass is available above). rsum_above(k) is the cumulative availability from the surface down to and including layer k, so hf in [0,1].

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: h_avail_k
real(kind=wp), intent(in) :: rsum_k

Return Value real(kind=wp)


Called by

proc~~gm_h_frac~~CalledByGraph proc~gm_h_frac gm_h_frac proc~gm_column_x gm_column_x proc~gm_column_x->proc~gm_h_frac proc~gm_column_y gm_column_y proc~gm_column_y->proc~gm_h_frac proc~gm_compute_impl gm_compute_impl proc~gm_compute_impl->proc~gm_column_x proc~gm_compute_impl->proc~gm_column_y proc~gm_compute_transports gm_compute_transports proc~gm_compute_transports->proc~gm_compute_impl proc~run_gm_step run_gm_step proc~run_gm_step->proc~gm_compute_transports proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_gm_step

Source Code

   pure function gm_h_frac(h_avail_k, rsum_k) result(hf)
      !$acc routine seq
      !! Donor mass fraction `h_avail(k)/rsum_above(k)` (0 when no mass is
      !! available above).  `rsum_above(k)` is the cumulative availability
      !! from the surface down to and including layer k, so `hf in [0,1]`.
      real(wp), intent(in) :: h_avail_k, rsum_k
      real(wp) :: hf
      hf = 0.0_wp
      if (h_avail_k > 0.0_wp) hf = h_avail_k/(rsum_k + H_DIV_EPS)
   end function gm_h_frac