epbl_mixlen_shape Function

public pure function epbl_mixlen_shape(z_depth, mld_guess, translay_scale, mixlen_exponent, shaped) result(shape_val)

Mixing-length shape factor in [translay_scale, 1]: 1 at the surface, decaying to the transition-layer floor at the MLD. shaped = .false. (no MLD iteration) returns 1.

Arguments

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

Unconditional interface depth below the surface (m).

real(kind=wp), intent(in) :: mld_guess
real(kind=wp), intent(in) :: translay_scale
real(kind=wp), intent(in) :: mixlen_exponent
logical, intent(in) :: shaped

Return Value real(kind=wp)


Called by

proc~~epbl_mixlen_shape~~CalledByGraph proc~epbl_mixlen_shape epbl_mixlen_shape proc~epbl_column_kernel epbl_column_kernel proc~epbl_column_kernel->proc~epbl_mixlen_shape proc~epbl_compute epbl_compute proc~epbl_compute->proc~epbl_column_kernel proc~vmix_apply_in_stage vmix_apply_in_stage proc~vmix_apply_in_stage->proc~epbl_compute proc~run_stage run_stage proc~run_stage->proc~vmix_apply_in_stage proc~run_stage_split run_stage_split proc~run_stage_split->proc~vmix_apply_in_stage 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: fr

Source Code

   pure function epbl_mixlen_shape(z_depth, mld_guess, translay_scale, &
                                   mixlen_exponent, shaped) result(shape_val)
      !! Mixing-length shape factor in [translay_scale, 1]: 1 at the
      !! surface, decaying to the transition-layer floor at the MLD.
      !! `shaped = .false.` (no MLD iteration) returns 1.
      !$acc routine seq
      real(wp), intent(in) :: z_depth
         !! Unconditional interface depth below the surface (m).
      real(wp), intent(in) :: mld_guess, translay_scale, mixlen_exponent
      logical, intent(in) :: shaped
      real(wp) :: shape_val
      real(wp) :: fr

      if ((.not. shaped) .or. translay_scale >= 1.0_wp .or. &
          translay_scale < 0.0_wp .or. mld_guess <= 0.0_wp) then
         shape_val = 1.0_wp
      else
         fr = max(0.0_wp, (mld_guess - z_depth)/mld_guess)
         if (mixlen_exponent == 2.0_wp) then
            shape_val = translay_scale + (1.0_wp - translay_scale)*fr*fr
         else
            shape_val = translay_scale + (1.0_wp - translay_scale)*fr**mixlen_exponent
         end if
      end if
   end function epbl_mixlen_shape