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.
| Type | Intent | Optional | 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 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | fr |
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