1C
2C
3C$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
4C GALOT06_MOD
5C$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
6C 10/14/26 MHP via Claude
7C code changed to convert COMMON/GALOT06/ into this module.
8C
9C Imported with a blanket USE, the convention for the conversion.
10C All 3 files declared this block identically, so the USE imports
11C exactly the names the declaration already made global in each
12C scoping unit and cannot change meaning.
13C
14C The types restate what the implicit rules supplied: L is
15C LOGICAL*4, I/J/K/M/N are INTEGER*4, everything else REAL*8.
16C SAVE is explicit rather than relying on module variables being
17C implicitly saved, which holds only from Fortran 2008 while
18C ifort Classic predates it. That matches COMMON's semantics.
19C
20C 4 of the 4 members carry an initializer, migrated
21C from parmin.f's DATA statements because DATA on a USE-associated
22C name is rejected. The literal text is copied verbatim: these
23C are namelist variables whose DATA supplied a default the
24C namelist read could override, and a module initializer is
25C applied once at load time, before PARMIN runs, which is the
26C same thing. Rewriting a literal such as 0.9828 as 0.9828D0
27C would change its stored value, so that is deliberately not
28C done here; see KNOWN_ISSUES.md issue 23.
29 MODULE GALOT06_MOD
30
31 IMPLICIT NONE
32 SAVE
33
34 INTEGER*4, PARAMETER, PRIVATE :: NUMD = 19
35 INTEGER*4, PARAMETER, PRIVATE :: NUMT = 85
36 INTEGER*4, PARAMETER, PRIVATE :: NUMX = 9
37 INTEGER*4, PARAMETER, PRIVATE :: NUMZ = 16
38
39 REAL*8 :: TGR06(NUMT) = (/2.70D0, 2.75D0, 2.80D0, 2.85D0, 2.90D0, 2.91D0, 2.92D0, 2.93D0, 2.94D0, 2.95D0, 2.96D0, 2.97D0,
40 * * 2.98D0, 2.99D0, 3.00D0, 3.01D0, 3.02D0, 3.03D0, 3.04D0, 3.05D0, 3.06D0, 3.07D0, 3.08D0, 3.09D0, 3.10D0, 3.11D0, 3.12D0,
41 * * 3.13D0, 3.14D0, 3.15D0, 3.16D0, 3.17D0, 3.18D0, 3.19D0, 3.20D0, 3.21D0, 3.22D0, 3.23D0, 3.24D0, 3.25D0, 3.26D0, 3.27D0,
42 * * 3.28D0, 3.29D0, 3.30D0, 3.31D0, 3.32D0, 3.33D0, 3.34D0, 3.35D0, 3.36D0, 3.37D0, 3.38D0, 3.39D0, 3.40D0, 3.41D0, 3.42D0,
43 * * 3.43D0, 3.44D0, 3.45D0, 3.46D0, 3.47D0, 3.48D0, 3.49D0, 3.50D0, 3.55D0, 3.60D0, 3.65D0, 3.70D0, 3.75D0, 3.80D0, 3.85D0,
44 * * 3.90D0, 3.95D0, 4.00D0, 4.05D0, 4.10D0, 4.15D0, 4.20D0, 4.25D0, 4.30D0, 4.35D0, 4.40D0, 4.45D0, 4.50D0/)
45 REAL*8 :: XXG06(NUMX) = (/0.0D0, 0.1D0, 0.2D0, 0.35D0, 0.5D0, 0.7D0, 0.8D0, 0.9D0, 1.0D0/)
46 REAL*8 :: R0GR06(NUMD) = (/-8.0D0, -7.5D0, -7.0D0, -6.5D0, -6.0D0, -5.5D0, -5.0D0, -4.5D0, -4.0D0, -3.5D0, -3.0D0, -2.5D0,
47 * * -2.0D0, -1.5D0, -1.0D0, -0.5D0, 0.0D0, 0.5D0, 1.0D0/)
48 REAL*8 :: ZZG06(NUMZ) = (/0.0D0, 0.00001D0, 0.00003D0, 0.0001D0, 0.0003D0, 0.001D0, 0.002D0, 0.004D0, 0.01D0, 0.02D0, 0.03D0,
49 * * 0.04D0, 0.05D0, 0.06D0, 0.08D0, 0.10D0/)
50
51 END MODULE GALOT06_MOD
1"""Python version of galot06_mod.f (YREC 7be4133): the grids of the
2Alexander et al. 2006 opacity tables, formerly COMMON/GALOT06/.
3
4Translates: galot06_mod.f#GALOT06_MOD (7be4133)
5
6Routines that USE GALOT06_MOD import this module and write
7``galot06_mod.<name>``. Arrays have index 0 unused.
8"""
9
10import numpy as np
11
12# Table dimensions (PRIVATE in the Fortran) (Fortran lines 34–37).
13_NUMD = 19
14_NUMT = 85
15_NUMX = 9
16_NUMZ = 16
17
18# log T grid (initializer) (Fortran lines 39–44).
19tgr06 = np.array([0.0] + [
20 2.70, 2.75, 2.80, 2.85, 2.90, 2.91, 2.92, 2.93, 2.94, 2.95, 2.96, 2.97,
21 2.98, 2.99, 3.00, 3.01, 3.02, 3.03, 3.04, 3.05, 3.06, 3.07, 3.08, 3.09,
22 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, 3.16, 3.17, 3.18, 3.19, 3.20, 3.21,
23 3.22, 3.23, 3.24, 3.25, 3.26, 3.27, 3.28, 3.29, 3.30, 3.31, 3.32, 3.33,
24 3.34, 3.35, 3.36, 3.37, 3.38, 3.39, 3.40, 3.41, 3.42, 3.43, 3.44, 3.45,
25 3.46, 3.47, 3.48, 3.49, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85,
26 3.90, 3.95, 4.00, 4.05, 4.10, 4.15, 4.20, 4.25, 4.30, 4.35, 4.40, 4.45,
27 4.50])
28
29# X values of the tables (Fortran line 45).
30xxg06 = np.array([0.0, 0.0, 0.1, 0.2, 0.35, 0.5, 0.7, 0.8, 0.9, 1.0])
31
32# log R grid (Fortran lines 46–47).
33r0gr06 = np.array([0.0, -8.0, -7.5, -7.0, -6.5, -6.0, -5.5, -5.0, -4.5,
34 -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5,
35 1.0])
36
37# Z values of the tables (Fortran lines 48–49).
38zzg06 = np.array([0.0, 0.0, 0.00001, 0.00003, 0.0001, 0.0003, 0.001, 0.002,
39 0.004, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08, 0.10])
40
41assert len(tgr06) == _NUMT + 1 and len(xxg06) == _NUMX + 1
42assert len(r0gr06) == _NUMD + 1 and len(zzg06) == _NUMZ + 1