1C Subroutine ALSURFP
2
3C PURPOSE
4C To obtain the desired properties of stellar and sub-stellar atmospheres from atmospheric
5C tables developed by France Allard, et al. Given Log(Teff) and GL, ASURFP returns Log(P) at
6C this Teff and GL, as well as Log(P) and Log(T) at Tau = 100 for this Teff and GL.
7
8C Currently supported input formats include the old Allard, et al, circa 1999 NextGen format,
9C to which we are adding the newer 2007 NextGen format. As other formats become available, we
10C anticipate being able to handle those also.
11
12C Results are obtained by doing 4-point Lagrange interpolation in two dimensions, in TeffL and
13C GL. This means we will be interpolating (or extrapolating) over sixteen points in four rows
14C of four. We require that the desired Teff and GL are within the limits of the extended range
15C of the table. The extended range for GL is from one column's width past the lowest GL on the
16C left to one column's width past the highest GL on the right for the current row. The extended
17C range for TeffL is defined in the same manner as for the columns. Note that the limits are on
18C a row by row and column by column basis. If the request TeffL, GL point is outside the table,
19C the progam is terminated with a definitive error message.
20
21C ARGUMENTS OF TABLE LOOKUP SUBROUTINE
22
23C TeffL - Input argument. Value of TL at which the results are desired.
24C GL - Input argument. Value of GL at which the results are desired.
25C AP - Output argument to COMMON /ATMPRT/. Value of Log(Pressure) for the
26C associated input TeffL and GL If LATMTPTau100 is .FALSE. it is PL
27C at TEFFL,GL. If .TRUE. it is PL at TAU=100 for the starting TEFFL,GL.
28C AT - Output argument to COMMON /ATMPRT/. Value of Log(Temperature) for the
29C associated input TeffL and GL If LATMTPTau100 is .FALSE. it is TEFFL.
30C If .TRUE. it is TL at TAU=100 for the starting TEFFL,GL.
31C LPRT Input argument: If .TRUE. print Log(P) at the associated Log(Teff) to ISHORT and IMODPT.
32C LAlFail Output argument. If .TRUE. the specified TeffL/GL is outside the Allard tables. The
33C calling routine should set KTTAU to 0 to change to a gray atmosphere, or KTTAU to 3 for
34C aKurucz atmosphere.
35C
36C Internal Arrays
37C TEFFLs 1-D Array of T=TeffL table elements - one for each TeffL. (Columns)
38C GLs 1-D Array of G = GL table elements - one for each GL. (Rows)
39C PLs 2-D array of assoiated PL's for the matching T in TEFFLs and the matching G in GLA.
40C - One for each TeffL by One for each GL
41C P100Ls 2-D array of assoiated P100L's for the matching T in TEFFLs and the matching G in GLA.
42C - One for each TeffL by One for each GL
43C T100Ls 2-D array of assoiated T100L's for the matching T in TEFFLs and the matching G in GLA.
44C - One for each TeffL by One for each GL
45
46C In addition, we define the following auxiliarry arrays
47
48C For each row (or GL):
49C GLmin Minimum acceptable GL (including extrapolation) for this row. - One for each TeffL
50C GLmax Maximum acceptable GL (including extrapolation) for this row. - One for each TeffL
51C IGLmin Row index of first acceptable GL in table (excludes extrapolation) - One for each TeffL
52C IGLmax Row index of first acceptable GL in table (excludes extrapolation) - One for each TeffL
53
54C For teh Table
55C TEFFLmin Minimum acceptable TeffL (Including extrapolation) for the table
56C TEFFLmax Maximum acceptable TeffL (including extrapolation) for the table.
57
58C OVERALL LOGIC
59
60C I Determine if TeffL and GL are within overall limits of the table. If TEFFL is greater than the
61C max of all table TL's or less than the minimum, or GL is of the same nature, the program has
62C failed. To fail, write diagnostic message and go to error exit.
63
64C II Locate TL and GL in table. This gives us a column index, iGL, and a row index, iTL. The subtable
65C used for Lagrange interpolation will have four rows of four elements. Find indices such that
66C each row is in the table. Start with TeffL. If it is out of the table, adjust the TeffL index
67C such that all four rows are in the table. Then for each row asjust the GL index such that the
68C row is in the table. If this is not possible, the program has failed. To fail, write diagnostic
69C message and go to error exit.
70
71C III Next we do four-point-Lagrange-interpolation in GL in the first row, then the second, then the
72C third, then the fourth rows. We obtain, for each row, the associated Log(P), Log(P100) and
73C Log(T100) for each row's specific TL.
74
75C IV To get our desired results, we interpolate the results from III. PL is the result of 4-point
76C Lagrange interpolation in TL using the four Log(P)'s obtained in III above. Likewist P100L and
77C T100L.
78
79C If LPRT is .TRUE. print Log(P) at the associated Log(Teff) to ISHORT and IMODPT.
80
81 SUBROUTINE ALSURFP(TEFFL,GL,LPRT,LAlFail)
82C 10/14/26 MHP via Claude
83C code changed to convert COMMON/ATMPRT/ into ATMPRT_MOD.
84 USE ATMPRT_MOD
85C 10/14/26 MHP via Claude
86C code changed to convert COMMON/ALATM02/ into ALATM02_MOD.
87 USE ALATM02_MOD
88C 10/14/26 MHP via Claude
89C code changed to convert COMMON/ALATM01/ into ALATM01_MOD.
90 USE ALATM01_MOD
91C 10/14/26 MHP via Claude
92C code changed to convert COMMON/NMLPAR/ into NMLPAR_MOD.
93 USE NMLPAR_MOD
94C 10/14/26 MHP via Claude
95C code changed to convert COMMON/IOUNITS/ into IOUNITS_MOD.
96 USE IOUNITS_MOD
97C 10/20/26 MHP via Claude
98C code changed to replace implicit typing with IMPLICIT NONE and
99C explicit declarations.
100 IMPLICIT NONE
101 REAL*8 DY,GL,P100L1,P100L2,PL1,PL2,T100L1,T100L2,TEFFL
102 INTEGER I,I1,IGL,ITEFFL,J,J1,J2,J3,N
103 LOGICAL*4 LALFAIL,LBADPOINT,LPRT
104
105C 10/14/26 MHP via Claude
106C code changed to drop the redundant LOGICAL*4 LALTPTau100 declaration.
107C LALTPTau100 is a COMMON/NMLPAR/ member, and explicitly typing a COMMON
108C member is legal while doing the same to a USE-associated name is
109C rejected, so it has to go before NMLPAR becomes a module. Removing it
110C changes nothing: IMPLICIT LOGICAL*4(L) already gives that type.
111C 9/25/26 MHP via Claude
112C code changed to consolidate all I/O logical unit numbers, previously
113C scattered across COMMON/LUOUT/, COMMON/LUNUM/, COMMON/ALEX06/,
114C COMMON/ACDPTH/, COMMON/NEWOPAC/, COMMON/LOPAL95/, COMMON/ATMOS2/,
115C COMMON/ALATM03/, COMMON/OPALEOS/, and COMMON/SCV2/, into a single
116C COMMON/IOUNITS/
117C 10/12/26 MHP via Claude
118C code changed to extend COMMON/NMLPAR/ to 234 members, adding the
119C namelist variables that the physics routines read from 27 COMMON
120C blocks which also held derived or working members. Those blocks keep
121C only their non-namelist members; five of them -- NEWMX, VMULT,
122C PMMWIND, CCOUT1 and ENVGEN -- had nothing left and are gone.
123C Derivation-only namelist variables from the same blocks went to
124C COMMON/NMLBYPASS/ instead, not here.
125C
126C Declared identically in all 121 files that hold any of these members.
127C Generated from one member list, so every copy is byte-identical; the
128C linker's 'size of symbol changed' warning is the check that they are.
129C MHP 8/25 Removed character file names from common block
130C 10/13/26 MHP via Claude
131C code changed to remove COMMON/ALATM04/: its four members DUMMY1..DUMMY4
132C are placeholders that no file references in executable code. Removing
133C it also retires the hazard behind the earlier alfilein.f fix, where a
134C mis-indented EXTERNAL was absorbed into this declaration and renamed
135C DUMMY4.
136
137 Dimension iGL(4),PL1(4),P100L1(4),
138 x x T100L1(4),PL2(4),P100L2(4),T100L2(4)
139
140 SAVE
141
142C Determine if TeffL and GL are within overall limits of the table. If TEFFL is greater than the
143C max of all table TL's or GL is greater than the max or less than the min. Under these
144C circumstances we want to switch to another kind of atmosphere by changing KTTAU. Most likely
145C the calling routine should set KTTAU to 0, to specify a gray atmosphere.
146
147 LBadPoint = .false. ! presume we have started at a good point
148
149 if(TEFFL .ge. TEFFLmax) then
150 LBadPoint = .true.
151 write(ISHORT,*)
152 write(ISHORT,*)'ALSURFP: TEFFL greater than TeffLmax: '
153 write(ISHORT,*)' TEFFLmin,TEFFL,TEFFLmax; ',
154 x x TEFFLmin,TEFFL,TEFFLmax
155 Write(*,*)
156 write(*,*)'ALSURFP: TEFFL greater than TeffLmax: '
157 write(*,*)' TEFFLmin,TEFFL,TEFFLmax; ',
158 x x TEFFLmin,TEFFL,TEFFLmax
159 endif
160
161
162 if((GL .ge. GLXmax) .or. (GL .le. GLXmin)) then
163 LBadPoint = .true.
164 write(ISHORT,*)
165 Write(*,*)
166 write(ISHORT,*)'ALSURFP: GL out of max range: '
167 write(ISHORT,*)' GLXmin,GL,GLXmax; ',
168 x x GLXmin,GL,GLXmax
169 write(*,*)'ALSURFP: GL out of max range: '
170 write(*,*)' GLXmin,GL,GLXmax; ',
171 x x GLXmin,GL,GLXmax
172 endif
173
174 if(LBadPoint) then
175 LAlFail = .TRUE. ! We are above the table in Teffl, or outside the table in GL
176 ! Set LAlFail so calling routine can take appropiate action
177 return
178 else
179 LAlFail = .FALSE. ! We are not above the table in Teffl, and inside the table in GL
180 endif
181
182C If TeffL is less than TeffLmin, the program has failed. We write a diagnostic message and go
183C to the error exit.
184
185 if(TEFFL .le. TEFFLmin) then
186 write(ISHORT,*)
187 write(ISHORT,*)'ALSURFP: TEFFL less than TEFFLmin: '
188 write(ISHORT,*)' TEFFLmin,TEFFL,TEFFLmax; ',
189 x x TEFFLmin,TEFFL,TEFFLmax
190 Write(*,*)
191 write(*,*)'ALSURFP: TEFFL less than TEFFLmin: '
192 write(*,*)' TEFFLmin,TEFFL,TEFFLmax; ',
193 x x TEFFLmin,TEFFL,TEFFLmax
194 go to 9999 ! End program at Error Exit
195 endif
196
197C II Locate TEFFL and GL in table. This gives us a column index, iGL, and a row index, iTEFFL. The
198C subtable used for Lagrange interpolation will have four rows of four elements. Find indices such
199C that each row is in the table. Start with TeffL. If it is out of the table, adjust the TeffL
200C index such that all four rows are in the table. Then for each row asjust the GL index such that the
201C row is in the table. If this is not possible, the program has failed. To fail, write diagnostic
202C message and go to error exit.
203
204C First locate TEFFL
205 CALL LOCATE(TEFFLs,nTEFF,TEFFL,iTEFFL) ! returns row 2 in Teffs for 4x4 Lagrange
206 iTEFFL = iTEFFL-1 ! Change to row 1 of 4x4 square in TEFFLs
207 if(iTEFFL .lt. 1) iTEFFL = 1 ! Be sure it is safe to do 4-point Lagrange interpolation
208 if(iTEFFL .gt. (nTEFF - 3)) iTEFFL = nTEFF - 3
209
210C Now find the right index for each row.
211 do i = 1, 4 ! Start with iTEFFL and go up to iTEFFL=3
212 i1 = iTEFFL+i-1 ! current row pointer - index in TEFFLs aray (0 to 3)
213 j1 = iGLmin(i1) ! lowest valid entry in this row
214 j2 = iGLmax(i1) ! higest valid entry in this row
215 n = j2-j1+1 ! number of OK columns
216 call locate(GLs(j1),n,GL,j3) ! Returns offset in GLs such that GL is >= GLs(jl1+j3-1)
217 ! and GL,GLs(JL1+j3)
218 iGL(i) = j1+j3-1 ! Save the offset
219 iGL(i) = iGL(i)-1 ! Change from col 2 to column 1 in GLs direction of 4x4 square
220C FIrst make sure it is safe to do 4-point Lagrange interpolaltion
221 if(iGL(i) .lt. j1) iGL(i) = j1
222 if(iGL(i) .gt. (j2 - 3)) iGL(i) = j2 - 3
223
224C Next, make sue that GL is in range in the current row. If not, set out of table flag
225 if((GL .lt. GLmin(i1)) .or. (GL .gt. GLmax(i1))) then ! and exit
226 LBadPoint = .true.
227 write(ISHORT,*)
228 write(ISHORT,*)'ALSURFP: GL out of extended range: '
229 write(ISHORT,*)' GLmin,GL,GLmax; ',
230 x x GLmin(i1),GL,GLmax(i1)
231 write(*,*)
232 write(*,*)'ALSURFP: GL out of extended range: '
233 write(*,*)' GLmin,GL,GLmax; ',
234 x x GLmin(i1),GL,GLmax(i1)
235 LAlFail = .TRUE.
236 return
237 endif
238 enddo
239
240
241C III Next we do four-point-Lagrange-interpolation in GL in the first row, then the second, then the
242C third, then the fourth rows. We obtain, for each row, the associated Log(P), Log(P100) and
243C Log(T100) for each row's specific TL.
244
245C Do the Lagrange interpolation in GL
246 do i = 1, 4 ! Start with iTEFFL and go up to iTEFFL=3, a row at a time
247 i1 = iTEFFL + i -1 ! Index in TEFFL array (0 to 3)
248 do j= 1, 4
249 j1 = iGL(i) + j -1 ! Index in GL array - from iGL(i) to iGL(i)+3
250 PL1(j) = PLs(i1,j1) ! Get this row's four working PL's
251 P100L1(j) = P100Ls(i1,j1) ! Get this row's four working P100L's
252 T100L1(j) = T100Ls(i1,j1) ! Get this row's four working T100L's
253 enddo
254 j1 = iGL(i)
255 CALL POLINT(GLs(j1),PL1,4,GL,PL2(i),dy)
256 CALL POLINT(GLs(j1),P100L1,4,GL,P100L2(i),dy)
257 CALL POLINT(GLs(j1),T100L1,4,GL,T100L2(i),dy)
258 enddo
259C Now do final 4-point Lagrange inerpolations in TEFFL
260 IF(.NOT. LALTPTau100) THEN
261C Current standard alternative. PL for TEFFL,GL, TL=TEFFL
262 CALL POLINT(TEFFLs(iTEFFL),PL2,4,TEFFL,AP,dy)
263 AT = TEFFL
264 ELSE
265 CALL POLINT(TEFFLs(iTEFFL),P100L2,4,TEFFL,AP,dy)
266 CALL POLINT(TEFFLs(iTEFFL),T100L2,4,TEFFL,AT,dy)
267 ENDIF
268
269C We now have obtained the needed temparatures and pressures
270
271C If requested, WRITE OUT INFORMATION TO THE MODEL FILE.
272 IF (LPRT) THEN
273 IF(LALTPTau100) then
274 WRITE(ISHORT,70)
275 WRITE(ISTOR,70)
27670 70 FORMAT('********PL,TL at Tau=100 INTERPOLATED'
277 * * , ' FROM ALLARD TABULATED VALUES********')
278 ELSE
279 WRITE(ISHORT,71)
280 WRITE(ISTOR,71)
28171 71 FORMAT('********PL,TL at T=TEFF,GL INTERPOLATED '
282 * * , 'FROM ALLARD TABULATED VALUES********')
283 ENDIF
284 WRITE(ISHORT,72) TEFFL,GL,AT,AP
285 WRITE(ISTOR,72) TEFFL,GL,AT,AP
28672 72 FORMAT(' ',20X,'LOG(Teffl) =',F10.5,' ,LOG(G) =' ,F10.5,
287 x x ', LOG(T) =',F10.5,', Log(P) =', F10.5)
288 ENDIF
289
290C If not requested via LPRT, WRITE OUT INFORMATION TO THE SHORT FILE.
291 IF (.not. LPRT) THEN
292 IF(LALTPTau100) then
293 WRITE(ISHORT,73)
29473 73 FORMAT('ALSURFP: PL,TL at Tau=100 INTERPOLATED'
295 * * , ' FROM ALLARD TABULATED VALUES:')
296 ELSE
297 WRITE(ISHORT,74)
29874 74 FORMAT('ALSURFP: PL,TL at T=TEFF,GL INTERPOLATED '
299 * * , 'FROM ALLARD TABULATED VALUES:')
300 ENDIF
301 WRITE(ISHORT,75) TEFFL,GL,AT,AP
30275 75 FORMAT(' ',10X,'LOG(Teffl) =',F10.5,', LOG(G) =',F10.5,
303 x x ', LOG(T) =',F10.5,', Log(P) =',F10.5)
304 ENDIF
305
306
307
308
309
310 RETURN
311
312 9999 9999 continue
313 write(*,*)
314 write(*,*)'******** ALSURFP: Program Terminated ********'
315 write(*,*)
316 write(ISHORT,*)
317 write(ISHORT,*)'******** ALSURF: Program Terminated ********'
318 write(ISHORT,*)
319 STOP ! eliminate for testing
320
321 END
322
323C End if inputs are valid
324
325
326
3271"""Python version of alsurfp.f (YREC 7be4133): the outer boundary
2condition from the Allard model atmospheres, by 4x4 Lagrange interpolation
3in log g and log Teff."""
4
5import numpy as np
6
7from pyrec import alatm01_mod
8from pyrec import alatm02_mod
9from pyrec import atmprt_mod
10from pyrec import iounits_mod
11from pyrec import nmlpar_mod
12from pyrec.locate import locate
13from pyrec.polint import polint
14
15# SAVE: the work arrays keep their values between calls (Fortran lines
16# 137–140).
17igl = np.zeros(5, dtype=int)
18pl1 = np.zeros(5)
19p100l1 = np.zeros(5)
20t100l1 = np.zeros(5)
21pl2 = np.zeros(5)
22p100l2 = np.zeros(5)
23t100l2 = np.zeros(5)
24
25
26def _both(text):
27 """The same list-directed line to ISHORT and to the screen."""
28
29 iounits_mod.write(iounits_mod.ishort, text)
30 print(text)
31
32
33def alsurfp(teffl: float, gl: float, lprt: bool, lalfail: bool) -> bool:
34 """Interpolate the Allard table at (log Teff, log g): log P at
35 T = Teff (AT = log Teff), or, with LALTPTau100, log P and log T at
36 tau = 100, into AP and AT of ATMPRT_MOD. Sets LAlFail above the table
37 in Teff or outside it in log g; stops the run below it in Teff.
38
39 Translates: alsurfp.f#ALSURFP (7be4133)
40
41 Arguments: teffl (log Teff), gl (log g), lprt (print to ISTOR too) and
42 lalfail (set here). Returns lalfail.
43
44 """
45
46 a1 = alatm01_mod
47 a2 = alatm02_mod
48 at = atmprt_mod
49 ltau100 = nmlpar_mod.laltptau100
50 ishort = iounits_mod.ishort
51 istor = iounits_mod.istor
52
53 # Above the table in Teff, or outside it in log g (Fortran lines
54 # 142–180).
55 lbadpoint = False # presume we have started at a good point
56 if teffl >= a2.tefflmax:
57 lbadpoint = True
58 for show in (lambda t: iounits_mod.write(ishort, t), print):
59 show("")
60 show(" ALSURFP: TEFFL greater than TeffLmax: ")
61 show(f" TEFFLmin,TEFFL,TEFFLmax; {a2.tefflmin} {teffl}"
62 f" {a2.tefflmax}")
63 if gl >= a2.glxmax or gl <= a2.glxmin:
64 lbadpoint = True
65 iounits_mod.write(ishort, "")
66 print("")
67 for show in (lambda t: iounits_mod.write(ishort, t), print):
68 show(" ALSURFP: GL out of max range: ")
69 show(f" GLXmin,GL,GLXmax; {a2.glxmin} {gl} {a2.glxmax}")
70 if lbadpoint:
71 # Above the table in Teff, or outside it in log g: the caller
72 # takes action.
73 return True
74 lalfail = False
75
76 # Question (see the page): below the table in Teff the run stops
77 # (Fortran lines 182–195).
78 if teffl <= a2.tefflmin:
79 for show in (lambda t: iounits_mod.write(ishort, t), print):
80 show("")
81 show(" ALSURFP: TEFFL less than TEFFLmin: ")
82 show(f" TEFFLmin,TEFFL,TEFFLmax; {a2.tefflmin} {teffl}"
83 f" {a2.tefflmax}")
84 _error_exit()
85
86 # The first of the 4 rows in log Teff, kept inside the table (Fortran
87 # lines 204–208).
88 iteffl = locate(a1.teffls, a1.nteff, teffl, 0)
89 iteffl = iteffl - 1
90 if iteffl < 1:
91 iteffl = 1
92 if iteffl > a1.nteff - 3:
93 iteffl = a1.nteff - 3
94
95 # The first of the 4 columns in log g, in each row's valid range
96 # (Fortran lines 210–238).
97 for i in range(1, 5):
98 i1 = iteffl + i - 1
99 j1 = a2.iglmin[i1]
100 j2 = a2.iglmax[i1]
101 n = j2 - j1 + 1
102 # GLs(j1) passed as an array: the section whose index 1 is GLs(j1).
103 j3 = locate(a1.gls[j1 - 1:], n, gl, 0)
104 igl[i] = j1 + j3 - 1
105 igl[i] = igl[i] - 1
106 if igl[i] < j1:
107 igl[i] = j1
108 if igl[i] > j2 - 3:
109 igl[i] = j2 - 3
110 if gl < a2.glmin[i1] or gl > a2.glmax[i1]:
111 for show in (lambda t: iounits_mod.write(ishort, t), print):
112 show("")
113 show(" ALSURFP: GL out of extended range: ")
114 show(f" GLmin,GL,GLmax; {a2.glmin[i1]} {gl}"
115 f" {a2.glmax[i1]}")
116 return True
117
118 # Interpolate each row in log g (Fortran lines 241–258).
119 for i in range(1, 5):
120 i1 = iteffl + i - 1
121 for j in range(1, 5):
122 j1 = igl[i] + j - 1
123 pl1[j] = a1.pls[i1, j1]
124 p100l1[j] = a1.p100ls[i1, j1]
125 t100l1[j] = a1.t100ls[i1, j1]
126 j1 = igl[i]
127 xa = a1.gls[j1 - 1:]
128 pl2[i], dy = polint(xa, pl1, 4, gl, pl2[i], 0.0)
129 p100l2[i], dy = polint(xa, p100l1, 4, gl, p100l2[i], dy)
130 t100l2[i], dy = polint(xa, t100l1, 4, gl, t100l2[i], dy)
131
132 # Then the 4 row values in log Teff (Fortran lines 259–267).
133 xa = a1.teffls[iteffl - 1:]
134 if not ltau100:
135 at.ap, dy = polint(xa, pl2, 4, teffl, at.ap, dy)
136 at.at = teffl
137 else:
138 at.ap, dy = polint(xa, p100l2, 4, teffl, at.ap, dy)
139 at.at, dy = polint(xa, t100l2, 4, teffl, at.at, dy)
140
141 # Print to ISHORT and ISTOR if requested (Fortran lines 271–288).
142 if lprt:
143 if ltau100:
144 text = ("********PL,TL at Tau=100 INTERPOLATED"
145 " FROM ALLARD TABULATED VALUES********") # 70
146 else:
147 text = ("********PL,TL at T=TEFF,GL INTERPOLATED "
148 "FROM ALLARD TABULATED VALUES********") # 71
149 iounits_mod.write(ishort, text)
150 iounits_mod.write(istor, text)
151 line = (f" {'':20s}LOG(Teffl) ={teffl:10.5f} ,LOG(G) ={gl:10.5f}"
152 f", LOG(T) ={at.at:10.5f}, Log(P) ={at.ap:10.5f}") # 72
153 iounits_mod.write(ishort, line)
154 iounits_mod.write(istor, line)
155
156 # Question (see the page): two lines to ISHORT at every call (Fortran
157 # lines 290–304).
158 if not lprt:
159 if ltau100:
160 text = ("ALSURFP: PL,TL at Tau=100 INTERPOLATED"
161 " FROM ALLARD TABULATED VALUES:") # 73
162 else:
163 text = ("ALSURFP: PL,TL at T=TEFF,GL INTERPOLATED "
164 "FROM ALLARD TABULATED VALUES:") # 74
165 iounits_mod.write(ishort, text)
166 iounits_mod.write(ishort,
167 f" {'':10s}LOG(Teffl) ={teffl:10.5f}, LOG(G) ="
168 f"{gl:10.5f}, LOG(T) ={at.at:10.5f}, Log(P) ="
169 f"{at.ap:10.5f}") # 75
170
171 return lalfail
172
173
174def _error_exit():
175 """label 9999: the error exit (STOP)."""
176
177 # Fortran lines 312–319.
178 print("")
179 print(" ******** ALSURFP: Program Terminated ********")
180 print("")
181 iounits_mod.write(iounits_mod.ishort, "")
182 iounits_mod.write(iounits_mod.ishort,
183 " ******** ALSURF: Program Terminated ********")
184 iounits_mod.write(iounits_mod.ishort, "")
185 raise SystemExit