hra.f
34 lines · 1 definitions · on GitHub (7be4133)
Python version: hra.py, 40 lines, on the right (switch to Python above the code).
Purpose
HRA evaluates a polynomial fit to the temperature–optical-depth relation of the Harvard Reference Atmosphere: it takes $\tau$ and returns $\log_{10} T$.
How it fits
Called by ENVINT, QATM and SETUPS, where the run uses this $T(\tau)$ relation for the atmosphere. SETUPS stores HRAS = HRA(2/3) (in ATMOS_MOD, formerly COMMON ATMOS), and ENVINT and QATM use $\log T = \log T_\mathrm{eff} + \mathrm{HRA}(\tau) - \texttt{HRAS}$, so the relation is normalised to $T = T_\mathrm{eff}$ at $\tau = 2/3$. No modules, no calls.
The method
With $t = \log_{10}\tau$,
$$\log_{10} T = \sum_{k=0}^{9} a_k\, t^k,$$
with $a_0 = 3.8115$, $a_1 = 0.14613$, … , $a_9 = 1.587\times10^{-6}$ (the constants in the code).
Definitions
functionHRA
The polynomial above. The comment "speed this up by putting constants in variables" is an old note. The code sums explicit powers (TL2, TL3, …), not Horner's scheme; either is cheap.
Change log
The changes since rp_1
Changed since rp_1. Declarations only: IMPLICIT NONE.