Compute the density rho
from the pressure p
and the temperature t
by equation of state. Essentially,
. Equation of state may take other forms, such as , ,
. Choose wisely which form to use.
(KCW, 2025-07-10)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | constant_r | |||
real(kind=real64), | intent(in) | :: | p | |||
real(kind=real64), | intent(in) | :: | t |
pure elemental function rho_by_equation_of_state(constant_r, p, t) result(rho) use, intrinsic :: iso_fortran_env, only: real64 real(real64), intent(in) :: constant_r, p, t real(real64) :: rho rho = p / (constant_r * t) end function rho_by_equation_of_state