Skip to content

Commit

Permalink
Add more detailed comments about equation derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanchihwang committed Nov 4, 2024
1 parent cf5ce82 commit 8133144
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/dynamics/mpas/dyn_coupling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,15 @@ pure elemental function t_of_theta_rhod_qv(theta, rhod, qv) result(t)
! described herein:
! The paragraph below equation 2.7 in doi:10.5065/1DFH-6P97.
! The paragraph below equation 2 in doi:10.1175/MWR-D-11-00215.1.
!
! In short, solve the below equation set for $T$ in terms of $\theta$, $\rho_d$ and $q_v$:
! \begin{equation*}
! \begin{cases}
! \theta &= T (\frac{P_0}{P})^{\frac{R_d}{C_p}} \\
! P &= \rho_d R_d T_m \\
! T_m &= T (1 + \frac{R_v}{R_d} q_v)
! \end{cases}
! \end{equation*}
t = (theta ** (constant_cpd / constant_cvd)) * &
(((rhod * constant_rd * (1.0_kind_r8 + constant_rv / constant_rd * qv)) / constant_p0) ** &
(constant_rd / constant_cvd))
Expand All @@ -624,6 +633,15 @@ pure elemental function theta_of_t_rhod_qv(t, rhod, qv) result(theta)
! described herein:
! The paragraph below equation 2.7 in doi:10.5065/1DFH-6P97.
! The paragraph below equation 2 in doi:10.1175/MWR-D-11-00215.1.
!
! In short, solve the below equation set for $\theta$ in terms of $T$, $\rho_d$ and $q_v$:
! \begin{equation*}
! \begin{cases}
! \theta &= T (\frac{P_0}{P})^{\frac{R_d}{C_p}} \\
! P &= \rho_d R_d T_m \\
! T_m &= T (1 + \frac{R_v}{R_d} q_v)
! \end{cases}
! \end{equation*}
theta = (t ** (constant_cvd / constant_cpd)) * &
((constant_p0 / (rhod * constant_rd * (1.0_kind_r8 + constant_rv / constant_rd * qv))) ** &
(constant_rd / constant_cpd))
Expand Down

0 comments on commit 8133144

Please sign in to comment.