5
5
6
6
# KA.@print only accepts literal strings, so we must
7
7
# branch to print which method is being used.
8
- function print_numerical_method (
8
+ @inline function print_numerical_method (
9
9
:: Type{sat_adjust_method} ,
10
10
) where {sat_adjust_method}
11
11
if sat_adjust_method <: RS.NewtonsMethod
@@ -21,7 +21,7 @@ function print_numerical_method(
21
21
end
22
22
end
23
23
24
- function print_T_guess (
24
+ @inline function print_T_guess (
25
25
:: Type{sat_adjust_method} ,
26
26
T_guess:: Real ,
27
27
) where {sat_adjust_method}
@@ -32,7 +32,7 @@ function print_T_guess(
32
32
end
33
33
end
34
34
35
- function print_T_guess (
35
+ @inline function print_T_guess (
36
36
:: Type{sat_adjust_method} ,
37
37
T_guess:: Nothing ,
38
38
) where {sat_adjust_method}
46
46
# ####
47
47
# #### Thermodynamic variable inputs: ρ, e_int, q_tot
48
48
# ####
49
- function sa_numerical_method (
49
+ @inline function sa_numerical_method (
50
50
:: Type{NM} ,
51
51
param_set:: APS ,
52
52
ρ:: FT ,
@@ -64,7 +64,7 @@ function sa_numerical_method(
64
64
return RS. NewtonsMethod (T_init)
65
65
end
66
66
67
- function sa_numerical_method (
67
+ @inline function sa_numerical_method (
68
68
:: Type{NM} ,
69
69
param_set:: APS ,
70
70
ρ:: FT ,
@@ -82,7 +82,7 @@ function sa_numerical_method(
82
82
return RS. NewtonsMethodAD (T_init)
83
83
end
84
84
85
- function sa_numerical_method (
85
+ @inline function sa_numerical_method (
86
86
:: Type{NM} ,
87
87
param_set:: APS ,
88
88
ρ:: FT ,
@@ -99,7 +99,7 @@ function sa_numerical_method(
99
99
return RS. SecantMethod (T_1, T_2)
100
100
end
101
101
102
- function sa_numerical_method (
102
+ @inline function sa_numerical_method (
103
103
:: Type{NM} ,
104
104
param_set:: APS ,
105
105
ρ:: FT ,
120
120
# #### Thermodynamic variable inputs: ρ, p, q_tot
121
121
# ####
122
122
123
- function sa_numerical_method_ρpq (
123
+ @inline function sa_numerical_method_ρpq (
124
124
:: Type{NM} ,
125
125
param_set:: APS ,
126
126
ρ:: FT ,
@@ -138,7 +138,7 @@ function sa_numerical_method_ρpq(
138
138
return RS. NewtonsMethodAD (T_init)
139
139
end
140
140
141
- function sa_numerical_method_ρpq (
141
+ @inline function sa_numerical_method_ρpq (
142
142
:: Type{NM} ,
143
143
param_set:: APS ,
144
144
ρ:: FT ,
157
157
# #### Thermodynamic variable inputs: p, e_int, q_tot
158
158
# ####
159
159
160
- function sa_numerical_method_peq (
160
+ @inline function sa_numerical_method_peq (
161
161
:: Type{NM} ,
162
162
param_set:: APS ,
163
163
p:: FT ,
@@ -175,7 +175,7 @@ function sa_numerical_method_peq(
175
175
return RS. NewtonsMethodAD (T_init)
176
176
end
177
177
178
- function sa_numerical_method_peq (
178
+ @inline function sa_numerical_method_peq (
179
179
:: Type{NM} ,
180
180
param_set:: APS ,
181
181
p:: FT ,
196
196
# #### Thermodynamic variable inputs: p, h, q_tot
197
197
# ####
198
198
199
- function sa_numerical_method_phq (
199
+ @inline function sa_numerical_method_phq (
200
200
:: Type{NM} ,
201
201
param_set:: APS ,
202
202
p:: FT ,
@@ -217,7 +217,7 @@ function sa_numerical_method_phq(
217
217
return RS. NewtonsMethodAD (T_init)
218
218
end
219
219
220
- function sa_numerical_method_phq (
220
+ @inline function sa_numerical_method_phq (
221
221
:: Type{NM} ,
222
222
param_set:: APS ,
223
223
p:: FT ,
@@ -237,7 +237,7 @@ function sa_numerical_method_phq(
237
237
return RS. SecantMethod (T_1, T_2)
238
238
end
239
239
240
- function sa_numerical_method_phq (
240
+ @inline function sa_numerical_method_phq (
241
241
:: Type{NM} ,
242
242
param_set:: APS ,
243
243
p:: FT ,
261
261
# #### Thermodynamic variable inputs: p, θ_liq_ice, q_tot
262
262
# ####
263
263
264
- function sa_numerical_method_pθq (
264
+ @inline function sa_numerical_method_pθq (
265
265
:: Type{NM} ,
266
266
param_set:: APS ,
267
267
p:: FT ,
@@ -272,14 +272,14 @@ function sa_numerical_method_pθq(
272
272
) where {FT, NM <: RS.RegulaFalsiMethod , phase_type <: PhaseEquil }
273
273
_T_min:: FT = TP. T_min (param_set)
274
274
_T_max:: FT = TP. T_max (param_set)
275
- air_temp (q) = air_temperature_given_pθq (param_set, p, θ_liq_ice, q)
275
+ @inline air_temp (q) = air_temperature_given_pθq (param_set, p, θ_liq_ice, q)
276
276
T_1 = max (_T_min, air_temp (PhasePartition (q_tot))) # Assume all vapor
277
277
T_2 = T_1 + 10
278
278
T_1 = T_1 - 10
279
279
return RS. RegulaFalsiMethod (T_1, T_2)
280
280
end
281
281
282
- function sa_numerical_method_pθq (
282
+ @inline function sa_numerical_method_pθq (
283
283
:: Type{NM} ,
284
284
param_set:: APS ,
285
285
p:: FT ,
@@ -289,14 +289,14 @@ function sa_numerical_method_pθq(
289
289
T_guess:: Union{FT, Nothing} ,
290
290
) where {FT, NM <: RS.SecantMethod , phase_type <: PhaseEquil }
291
291
_T_min:: FT = TP. T_min (param_set)
292
- air_temp (q) = air_temperature_given_pθq (param_set, p, θ_liq_ice, q)
292
+ @inline air_temp (q) = air_temperature_given_pθq (param_set, p, θ_liq_ice, q)
293
293
T_1 = max (_T_min, air_temp (PhasePartition (q_tot))) # Assume all vapor
294
294
T_2 = air_temp (PhasePartition (q_tot, FT (0 ), q_tot)) # Assume all ice
295
295
T_2 = bound_upper_temperature (T_1, T_2)
296
296
return RS. SecantMethod (T_1, T_2)
297
297
end
298
298
299
- function sa_numerical_method_pθq (
299
+ @inline function sa_numerical_method_pθq (
300
300
:: Type{NM} ,
301
301
param_set:: APS ,
302
302
p:: FT ,
@@ -306,7 +306,7 @@ function sa_numerical_method_pθq(
306
306
T_guess:: Union{FT, Nothing} ,
307
307
) where {FT, NM <: RS.NewtonsMethodAD , phase_type <: PhaseEquil }
308
308
T_min:: FT = TP. T_min (param_set)
309
- air_temp (q) = air_temperature_given_pθq (param_set, p, θ_liq_ice, q)
309
+ @inline air_temp (q) = air_temperature_given_pθq (param_set, p, θ_liq_ice, q)
310
310
T_init = if T_guess isa Nothing
311
311
max (T_min, air_temp (PhasePartition (q_tot))) # Assume all vapor
312
312
else
0 commit comments