Skip to content

Commit

Permalink
icepack_atmo: compute Jordan stability function in psi_stable_jordan
Browse files Browse the repository at this point in the history
The computation of the Jordan stability function, used for the stable
case, is currently done in subroutine compute_stability_function,
whereas the computations for the unstable case are done in their own
functions, psi_scalar_unstable and psi_momentum_unstable.

Move the computation of the (stable) Jordan stability function to its
own function, psi_stable_jordan, and call it in
compute_stability_function. This will allow us to call psi_stable_jordan
directly in a following commit.
  • Loading branch information
phil-blain committed Sep 5, 2023
1 parent c0d355e commit 0efa792
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions columnphysics/icepack_atmo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1054,9 +1054,7 @@ subroutine compute_stability_function(qty, hol, stable, psi)

stable = p5 + sign(p5 , hol)

psi_stable = -(0.7_dbl_kind*hol &
+ 0.75_dbl_kind*(hol-14.3_dbl_kind) &
* exp(-0.35_dbl_kind*hol) + 10.7_dbl_kind)
psi_stable = psi_stable_jordan(hol)

if(trim(qty) == 'momentum') then
psi_unstable = psi_momentum_unstable(hol)
Expand Down Expand Up @@ -1104,6 +1102,18 @@ real(kind=dbl_kind) function psi_scalar_unstable(hol)

end function psi_scalar_unstable

!=======================================================================

real(kind=dbl_kind) function psi_stable_jordan(hol) result(psi_stable)

real(kind=dbl_kind), intent(in) :: hol

psi_stable = -(0.7_dbl_kind*hol &
+ 0.75_dbl_kind*(hol-14.3_dbl_kind) &
* exp(-0.35_dbl_kind*hol) + 10.7_dbl_kind)

end function psi_stable_jordan

!=======================================================================

real(kind=dbl_kind) function capital_X(hol)
Expand Down

0 comments on commit 0efa792

Please sign in to comment.