op952d.f
76 lines · 1 definitions · on GitHub (7be4133)
Python version: op952d.py, 70 lines, on the right (switch to Python above the code).
Variables on this page (13)
bd, bdd, bt, btt, cappae, jd, jt, lexh, lexth, lextl, rho_t63l, rho_t63ll, rlh
Purpose
Gets the OPAL95 opacity from the table pre-interpolated to the surface composition (MHP 7/98: "get OPAL95 opacity from table at surface X,Z"): a two-dimensional interpolation in $\log T$ and $\log R$, where $R = \rho/T_6^3$. It is the fastest of three routines; OP953D adds $X$ and OP954D adds $X$ and $Z$.
How it fits
- Inputs: the surface table
CAPPAE(70,19)of $\log\kappa$ inLLOT95E_MOD, built by OP95XTAB; the indices and the Lagrange weights prepared by GETOPAL95 inOP95INTERP_MOD(formerly/OP95INDX/,/OP95FACT/and/OP95EXT/), where $\log R$ is now namedRHO_T63L(formerlyRL) and its lowest table valueRHO_T63LL(formerlyRLL). - Who calls it: GETOPAL95, when the point's $Z$ matches the table's
ZTAB(to a relative $10^{-4}$) and its $X$ the surface table'sXTAB(to $10^{-4}$), and the acoustic depth is not being computed (LADONandLACOUT, which force OP954D). - Outputs: $\kappa$ (
O), $\log\kappa$ (OL),QOD$= \partial\log\kappa/\partial\log\rho$ andQOT$= \partial\log\kappa/\partial\log T$.
The method
At each of the four nearest temperatures $T_i$, four-point Lagrange interpolation in $\log R$ gives $\log\kappa$ and its slope:
$$C_i = \sum_k b^{(D)}_{ik}\,\log\kappa_{i,k},\qquad C'_i = \sum_k b^{(D')}_{ik}\,\log\kappa_{i,k}.$$
If $\log R$ lies below the table (LEXTL) or above it at some $T_i$ (LEXH(I)), the value at the edge is extrapolated linearly, $C_i \to C_i + (\log R - \log R_\mathrm{edge})\,C'_i$. Then, in $\log T$, $\log\kappa = \sum_i b^{(T)}_i C_i$, $\partial\log\kappa/\partial\log T|_R = \sum_i b^{(T')}_i C_i$ and $\partial\log\kappa/\partial\log R|_T = \sum_i b^{(T)}_i C'_i$. Since $\log R = \log\rho - 3\log T_6$,
$$\left(\frac{\partial\log\kappa}{\partial\log\rho}\right)_T = \left(\frac{\partial\log\kappa}{\partial\log R}\right)_T,\qquad \left(\frac{\partial\log\kappa}{\partial\log T}\right)_\rho = \left(\frac{\partial\log\kappa}{\partial\log T}\right)_R - 3\left(\frac{\partial\log\kappa}{\partial\log R}\right)_T .$$
Design
The table dimensions are fixed (70 temperatures, 19 values of $\log R$), now as private parameters of LLOT95E_MOD; the routine itself no longer declares them.
Definitions
subroutineOP952D
Uses modules LLOT95E_MOD, OP95INTERP_MOD
Called by GETOPAL95
Change log
The changes since rp_1
Changed since rp_1. Declarations only: COMMON blocks to modules (the three interpolation blocks merged into OP95INTERP_MOD, with RL, RLL renamed RHO_T63L, RHO_T63LL so as not to clash with the radius RL), the dimension parameters moved into LLOT95E_MOD, IMPLICIT NONE.