Skip to content

Commit 98b85cf

Browse files
authored
Merge pull request #1506 from CliMA/js/phasenonequil
use PhaseNonEquil instead of PhaseEquil
2 parents cd623bf + ccd71ea commit 98b85cf

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ClimaCoupler.jl Release Notes
66

77
### ClimaCoupler features
88

9+
#### Replace `TD.PhaseEquil_ρTq` with `TD.PhaseNonEquil_ρTq` PR[#1506](https://github.com/CliMA/ClimaCoupler.jl/pull/1506)
10+
This should be more physically correct.
11+
912
#### Use individual surface model temperatures to compute turbulent fluxes PR[#1498](https://github.com/CliMA/ClimaCoupler.jl/pull/1498)
1013
We use a partitioned approach to computing turbulent fluxes, so we should be using
1114
the individual surface temperature (and humidity, air density, etc) for each component

src/FluxCalculator.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ All fields should be on the exchange grid.
218218
- `thermo_params`: [TD.Parameters.ThermodynamicsParameters] the thermodynamic parameters.
219219
"""
220220
function compute_surface_humidity!(q_sfc, T_atmos, q_atmos, ρ_atmos, T_sfc, thermo_params)
221-
thermo_state_atmos = TD.PhaseEquil_ρTq.(thermo_params, ρ_atmos, T_atmos, q_atmos)
221+
thermo_state_atmos =
222+
TD.PhaseNonEquil_ρTq.(thermo_params, ρ_atmos, T_atmos, TD.PhasePartition.(q_atmos))
222223
ρ_sfc = FluxCalculator.extrapolate_ρ_to_sfc.(thermo_params, thermo_state_atmos, T_sfc)
223224

224225
T_freeze = TDP.T_freeze(thermo_params)
@@ -279,7 +280,12 @@ function compute_surface_fluxes!(
279280

280281
# construct the atmospheric thermo state
281282
thermo_state_atmos =
282-
TD.PhaseEquil_ρTq.(thermo_params, csf.ρ_atmos, csf.T_atmos, csf.q_atmos)
283+
TD.PhaseNonEquil_ρTq.(
284+
thermo_params,
285+
csf.ρ_atmos,
286+
csf.T_atmos,
287+
TD.PhasePartition.(csf.q_atmos),
288+
)
283289

284290
# compute surface humidity from the surface temperature, surface density, and phase
285291
Interfacer.get_field!(csf.scalar_temp1, sim, Val(:surface_temperature))
@@ -299,7 +305,8 @@ function compute_surface_fluxes!(
299305

300306
# construct the surface thermo state
301307
# after this we can reuse `scalar_temp1` and `scalar_temp2` again
302-
thermo_state_sfc = TD.PhaseEquil_ρTq.(thermo_params, ρ_sfc, T_sfc, q_sfc)
308+
thermo_state_sfc =
309+
TD.PhaseNonEquil_ρTq.(thermo_params, ρ_sfc, T_sfc, TD.PhasePartition.(q_sfc))
303310

304311
# get area fraction (min = 0, max = 1)
305312
Interfacer.get_field!(csf.scalar_temp1, sim, Val(:area_fraction))

test/flux_calculator_tests.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ for FT in (Float32, Float64)
191191
Interfacer.get_field(atmos_sim, Val(:v_int)),
192192
)
193193
thermo_state_atmos =
194-
TD.PhaseEquil_ρTq.(
194+
TD.PhaseNonEquil_ρTq.(
195195
thermo_params,
196196
atmos_sim.integrator.ρ,
197197
atmos_sim.integrator.T,
198-
atmos_sim.integrator.q,
198+
TD.PhasePartition.(atmos_sim.integrator.q),
199199
)
200200

201201
# Get surface properties
@@ -217,7 +217,8 @@ for FT in (Float32, Float64)
217217
)
218218
ρ_sfc =
219219
FluxCalculator.extrapolate_ρ_to_sfc.(thermo_params, thermo_state_atmos, T_sfc)
220-
thermo_state_sfc = TD.PhaseEquil_ρTq.(thermo_params, ρ_sfc, T_sfc, q_sfc)
220+
thermo_state_sfc =
221+
TD.PhaseNonEquil_ρTq.(thermo_params, ρ_sfc, T_sfc, TD.PhasePartition.(q_sfc))
221222

222223
# Use SurfaceFluxes.jl to compute the expected fluxes
223224
inputs = @. SF.ValuesOnly(

0 commit comments

Comments
 (0)