Skip to content

Commit

Permalink
remove T_freeze overwrite, fix surface sat vap pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Oct 19, 2021
1 parent 9955202 commit a83e281
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integration_tests/GATE_III.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(joinpath("utils", "generate_namelist.jl"))
include(joinpath("utils", "compute_mse.jl"))
using .NameList

# Note: temperatures in this case become extremely low.
# TODO - waiting for a better root solver
CLIMAParameters.Planet.T_freeze(::EarthParameterSet) = 100.0

@testset "GATE_III" begin
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/TRMM_LBA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include(joinpath("utils", "compute_mse.jl"))
include(joinpath("utils", "mse_tables.jl"))
using .NameList

# Note: temperatures in this case become extremely low.
# TODO - waiting for a better root solver
CLIMAParameters.Planet.T_freeze(::EarthParameterSet) = 100.0

best_mse = all_best_mse["TRMM_LBA"]
Expand Down
1 change: 1 addition & 0 deletions integration_tests/utils/mse_tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ all_best_mse["GABLS"]["temperature_mean"] = 4.5792345667472772e-28
all_best_mse["GABLS"]["thetal_mean"] = 1.8614222141315004e-29
all_best_mse["GABLS"]["Hvar_mean"] = 1.4044154227442627e-23
all_best_mse["GABLS"]["QTvar_mean"] = 1.3021453164786422e-24
all_best_mse["GABLS"]["qt_mean"] = 0.04290066515065224
#
all_best_mse["life_cycle_Tan2018"] = OrderedCollections.OrderedDict()
all_best_mse["life_cycle_Tan2018"]["qt_mean"] = 0.0
Expand Down
2 changes: 0 additions & 2 deletions integration_tests/utils/parameter_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CLIMAParameters.Planet.cp_v(ps::EarthParameterSet) = ps.nt.cp_v
CLIMAParameters.Planet.R_d(ps::EarthParameterSet) = ps.nt.R_d
CLIMAParameters.Planet.R_v(ps::EarthParameterSet) = ps.nt.R_v
CLIMAParameters.Planet.molmass_ratio(ps::EarthParameterSet) = ps.nt.molmass_ratio
CLIMAParameters.Planet.T_freeze(ps::EarthParameterSet) = ps.nt.T_freeze
# microphysics 0-moment parameters
CLIMAParameters.Atmos.Microphysics_0M.τ_precip(ps::EarthParameterSet) = ps.nt.τ_precip
# microphysics 1-moment parameters
Expand Down Expand Up @@ -48,7 +47,6 @@ function create_parameter_set(namelist)
R_d = 287.1,
R_v = 461.5,
molmass_ratio = 461.5/287.1,
T_freeze = 0.0, # TODO: no ice until it is properly added to the model
τ_precip = TC.parse_namelist(namelist, "microphysics", "τ_precip"; default = 1000.0),
τ_acnv = TC.parse_namelist(namelist, "microphysics", "τ_acnv"; default = 1000.0),
c_ε = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "entrainment_factor"),
Expand Down
6 changes: 3 additions & 3 deletions src/Surface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function update(surf::SurfaceBase{SurfaceMoninObukhov}, grid, state, gm::GridMea
T_gm_surf = aux_gm.T[kc_surf]
Pg = surf.ref_params.Pg

pvg = TD.saturation_vapor_pressure(param_set, surf.Tsurface, TD.Liquid())
pvg = TD.saturation_vapor_pressure(param_set, TD.PhaseEquil, surf.Tsurface)
surf.qsurface = TD.q_vap_saturation_from_density(param_set, surf.Tsurface, ρ0_f_surf, pvg)
lv = TD.latent_heat_vapor(param_set, T_gm_surf)

Expand Down Expand Up @@ -201,7 +201,7 @@ function update(surf::SurfaceBase{SurfaceMoninObukhovDry}, grid, state, gm::Grid
T_gm_surf = aux_gm.T[kc_surf]
Pg = surf.ref_params.Pg

pvg = TD.saturation_vapor_pressure(param_set, surf.Tsurface, TD.Liquid())
pvg = TD.saturation_vapor_pressure(param_set, TD.PhaseEquil, surf.Tsurface)
surf.qsurface = TD.q_vap_saturation_from_density(param_set, surf.Tsurface, ρ0_f_surf, pvg)
lv = TD.latent_heat_vapor(param_set, T_gm_surf)

Expand Down Expand Up @@ -262,7 +262,7 @@ function update(surf::SurfaceBase{SurfaceSullivanPatton}, grid, state, gm::GridM
phase_part = TD.PhasePartition(q_tot_gm_surf, 0.0, 0.0)
Π = TD.exner_given_pressure(param_set, p0_f_surf, phase_part)
surf.bflux = g * θ_flux * Π / T0
pvg = TD.saturation_vapor_pressure(param_set, surf.Tsurface, TD.Liquid())
pvg = TD.saturation_vapor_pressure(param_set, TD.PhaseEquil, surf.Tsurface)
surf.qsurface = TD.q_vap_saturation_from_density(param_set, surf.Tsurface, ρ0_f_surf, pvg)
h_star = TD.liquid_ice_pottemp_given_pressure(param_set, surf.Tsurface, Pg, phase_part)

Expand Down

0 comments on commit a83e281

Please sign in to comment.