Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix surface sat vap pressure, remove T_freeze overwrite #416

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"))
import .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"))
import .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
69 changes: 35 additions & 34 deletions integration_tests/utils/mse_tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
all_best_mse = OrderedCollections.OrderedDict()
#
all_best_mse["ARM_SGP"] = OrderedCollections.OrderedDict()
all_best_mse["ARM_SGP"]["qt_mean"] = 0.26421363773114487
all_best_mse["ARM_SGP"]["updraft_area"] = 342.0522312617839
all_best_mse["ARM_SGP"]["updraft_w"] = 148.13571351377792
all_best_mse["ARM_SGP"]["updraft_qt"] = 28.944904740159764
all_best_mse["ARM_SGP"]["updraft_thetal"] = 170.98088348120865
all_best_mse["ARM_SGP"]["qt_mean"] = 0.26446718607725306
all_best_mse["ARM_SGP"]["updraft_area"] = 342.05657568721784
all_best_mse["ARM_SGP"]["updraft_w"] = 147.98545782669382
all_best_mse["ARM_SGP"]["updraft_qt"] = 28.294790221283453
all_best_mse["ARM_SGP"]["updraft_thetal"] = 170.9801640138966
all_best_mse["ARM_SGP"]["u_mean"] = 5.762470982857257e8
all_best_mse["ARM_SGP"]["tke_mean"] = 987.4335390129128
all_best_mse["ARM_SGP"]["temperature_mean"] = 0.00012055550990238811
all_best_mse["ARM_SGP"]["ql_mean"] = 205.76908838933457
all_best_mse["ARM_SGP"]["thetal_mean"] = 0.00011125982667316287
all_best_mse["ARM_SGP"]["Hvar_mean"] = 2842.0863157999497
all_best_mse["ARM_SGP"]["QTvar_mean"] = 1642.635677320087
all_best_mse["ARM_SGP"]["tke_mean"] = 986.3675515161622
all_best_mse["ARM_SGP"]["temperature_mean"] = 0.00012053009592043601
all_best_mse["ARM_SGP"]["ql_mean"] = 204.94997013272453
all_best_mse["ARM_SGP"]["thetal_mean"] = 0.00011122266036009708
all_best_mse["ARM_SGP"]["Hvar_mean"] = 2633.2221109819784
all_best_mse["ARM_SGP"]["QTvar_mean"] = 1559.544125199823
#
all_best_mse["Bomex"] = OrderedCollections.OrderedDict()
all_best_mse["Bomex"]["qt_mean"] = 0.11034670891224195
Expand Down Expand Up @@ -59,14 +59,15 @@ all_best_mse["DYCOMS_RF01"]["Hvar_mean"] = 1227.7967628483952
all_best_mse["DYCOMS_RF01"]["QTvar_mean"] = 478.07194167693547
#
all_best_mse["GABLS"] = OrderedCollections.OrderedDict()
all_best_mse["GABLS"]["updraft_thetal"] = 1.8270142002359255e-29
all_best_mse["GABLS"]["v_mean"] = 4.8401321395550119e-24
all_best_mse["GABLS"]["u_mean"] = 3.4264582147083595e-25
all_best_mse["GABLS"]["tke_mean"] = 1.0987828024717862e-23
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"]["updraft_thetal"] = 5.584864486190616e-9
all_best_mse["GABLS"]["v_mean"] = 0.0007865603279729375
all_best_mse["GABLS"]["u_mean"] = 6.285670403414794e-5
all_best_mse["GABLS"]["tke_mean"] = 0.0010760513032549105
all_best_mse["GABLS"]["temperature_mean"] = 5.535007975017039e-9
all_best_mse["GABLS"]["thetal_mean"] = 5.565410639688741e-9
all_best_mse["GABLS"]["Hvar_mean"] = 0.001721862347778764
all_best_mse["GABLS"]["QTvar_mean"] = 0.017318287479694217
all_best_mse["GABLS"]["qt_mean"] = 0.21092607675396896
#
all_best_mse["life_cycle_Tan2018"] = OrderedCollections.OrderedDict()
all_best_mse["life_cycle_Tan2018"]["qt_mean"] = 0.0
Expand Down Expand Up @@ -94,20 +95,20 @@ all_best_mse["Nieuwstadt"]["thetal_mean"] = 1.0097201478188357e-5
all_best_mse["Nieuwstadt"]["Hvar_mean"] = 1276.761018651613
#
all_best_mse["Rico"] = OrderedCollections.OrderedDict()
all_best_mse["Rico"]["qt_mean"] = 1.3555731445935
all_best_mse["Rico"]["updraft_area"] = 483.32286422287297
all_best_mse["Rico"]["updraft_w"] = 105.52859763855982
all_best_mse["Rico"]["updraft_qt"] = 11.010415512953134
all_best_mse["Rico"]["updraft_thetal"] = 132.8025143582224
all_best_mse["Rico"]["v_mean"] = 23894.515326897188
all_best_mse["Rico"]["u_mean"] = 167.0459537349562
all_best_mse["Rico"]["tke_mean"] = 82.63970448232206
all_best_mse["Rico"]["temperature_mean"] = 0.0006124686247224041
all_best_mse["Rico"]["ql_mean"] = 66.27501049837224
all_best_mse["Rico"]["qr_mean"] = 750.8319337001128
all_best_mse["Rico"]["thetal_mean"] = 0.000603816336530745
all_best_mse["Rico"]["Hvar_mean"] = 17628.475057132102
all_best_mse["Rico"]["QTvar_mean"] = 3811.409153613948
all_best_mse["Rico"]["qt_mean"] = 1.3562728436394182
all_best_mse["Rico"]["updraft_area"] = 483.4022083273521
all_best_mse["Rico"]["updraft_w"] = 105.6746441121623
all_best_mse["Rico"]["updraft_qt"] = 10.859715229316084
all_best_mse["Rico"]["updraft_thetal"] = 132.79730672922278
all_best_mse["Rico"]["v_mean"] = 23893.44384637507
all_best_mse["Rico"]["u_mean"] = 167.0481771976619
all_best_mse["Rico"]["tke_mean"] = 82.85087674864991
all_best_mse["Rico"]["temperature_mean"] = 0.0006129402538716675
all_best_mse["Rico"]["ql_mean"] = 67.02280413541271
all_best_mse["Rico"]["qr_mean"] = 750.8723638131503
all_best_mse["Rico"]["thetal_mean"] = 0.0006043563413443778
all_best_mse["Rico"]["Hvar_mean"] = 18654.16088756812
all_best_mse["Rico"]["QTvar_mean"] = 4036.079013508425
#
all_best_mse["Soares"] = OrderedCollections.OrderedDict()
all_best_mse["Soares"]["qt_mean"] = 0.12636886303765799
Expand All @@ -117,7 +118,7 @@ all_best_mse["Soares"]["updraft_qt"] = 23.119052296484572
all_best_mse["Soares"]["updraft_thetal"] = 65.25334973003676
all_best_mse["Soares"]["u_mean"] = 101.82502556650786
all_best_mse["Soares"]["tke_mean"] = 184.8671644305064
all_best_mse["Soares"]["temperature_mean"] = 1.1014401270120833e-5
all_best_mse["Soares"]["temperature_mean"] = 1.1031965842549474e-5
all_best_mse["Soares"]["thetal_mean"] = 1.0453842793106344e-5
all_best_mse["Soares"]["Hvar_mean"] = 1145.5445941618634
#
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
7 changes: 4 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,8 @@ 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