t_of_theta_rhod_qv Function

public pure elemental function t_of_theta_rhod_qv(constant_cpd, constant_p0, constant_rd, constant_rv, theta, rhod, qv) result(t)

Uses

  • proc~~t_of_theta_rhod_qv~~UsesGraph proc~t_of_theta_rhod_qv t_of_theta_rhod_qv iso_fortran_env iso_fortran_env proc~t_of_theta_rhod_qv->iso_fortran_env

Compute the temperature t as a function of the potential temperature theta, the dry air density rhod, and the water vapor mixing ratio qv. Essentially, . The formulation comes from Poisson equation with equation of state plugged in and arranging for temperature. This function is the exact inverse of theta_of_t_rhod_qv, which means that: t == t_of_theta_rhod_qv(..., theta_of_t_rhod_qv(..., t, rhod, qv), rhod, qv). (KCW, 2024-09-13)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: constant_cpd
real(kind=real64), intent(in) :: constant_p0
real(kind=real64), intent(in) :: constant_rd
real(kind=real64), intent(in) :: constant_rv
real(kind=real64), intent(in) :: theta
real(kind=real64), intent(in) :: rhod
real(kind=real64), intent(in) :: qv

Return Value real(kind=real64)


Called by

proc~~t_of_theta_rhod_qv~~CalledByGraph proc~t_of_theta_rhod_qv t_of_theta_rhod_qv none~set_mpas_physics_tendency_rtheta set_mpas_physics_tendency_rtheta none~set_mpas_physics_tendency_rtheta->proc~t_of_theta_rhod_qv proc~physics_to_dynamics_coupling physics_to_dynamics_coupling proc~physics_to_dynamics_coupling->none~set_mpas_physics_tendency_rtheta interface~physics_to_dynamics_coupling physics_to_dynamics_coupling interface~physics_to_dynamics_coupling->proc~physics_to_dynamics_coupling proc~stepon_run2 stepon_run2 proc~stepon_run2->interface~physics_to_dynamics_coupling

Variables

Type Visibility Attributes Name Initial
real(kind=real64), private :: constant_cvd

Source Code

    pure elemental function t_of_theta_rhod_qv(constant_cpd, constant_p0, constant_rd, constant_rv, theta, rhod, qv) result(t)
        use, intrinsic :: iso_fortran_env, only: real64

        real(real64), intent(in) :: constant_cpd, constant_p0, constant_rd, constant_rv, theta, rhod, qv
        real(real64) :: t

        real(real64) :: constant_cvd ! Specific heat of dry air at constant volume.

        ! Mayer's relation.
        constant_cvd = constant_cpd - constant_rd

        ! Poisson equation with equation of state plugged in and arranging for temperature. For equation of state,
        ! it can be shown that the effect of water vapor can be passed on to the temperature term entirely such that
        ! dry air density and dry air gas constant can be used at all times. This modified "moist" temperature is
        ! 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 all, 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_{pd}}} \\
        !         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_real64 + constant_rv / constant_rd * qv)) / constant_p0) ** &
            (constant_rd / constant_cvd))
    end function t_of_theta_rhod_qv