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

Testing TD with CLIMAParameters v0.9 #196

Closed
wants to merge 1 commit into from
Closed
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 Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ KernelAbstractions = "0.9"
Random = "1"
RootSolvers = "0.4"
julia = "1.6"
CLIMAParameters = "0.8"
CLIMAParameters = "0.9"
2 changes: 1 addition & 1 deletion gpuenv/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
CLIMAParameters = "0.8"
CLIMAParameters = "0.9"
CUDA = "3.5, 4, 5"
KernelAbstractions = "0.9"
RootSolvers = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion perf/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
CLIMAParameters = "0.8"
CLIMAParameters = "0.9"
KernelAbstractions = "0.9"
RootSolvers = "0.4"
julia = "1.7"
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
CLIMAParameters = "0.8"
CLIMAParameters = "0.9"
KernelAbstractions = "0.9"
RootSolvers = "0.4"
julia = "1.7"
28 changes: 14 additions & 14 deletions test/relations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1040,15 +1040,13 @@ end
internal_energy.(param_set, ts),
)


ts = PhaseDry_ρp.(param_set, ρ, p)
@test all(air_density.(param_set, ts) .≈ ρ)
@test all(air_pressure.(param_set, ts) .≈ p)
e_tot_proposed =
TD.total_energy_given_ρp.(param_set, ρ, p, e_kin, e_pot)
@test all(total_energy.(param_set, ts, e_kin, e_pot) .≈ e_tot_proposed)


profiles = TestedProfiles.PhaseEquilProfiles(param_set, ArrayType)
(; T, p, e_int, h, ρ, θ_liq_ice, phase_type) = profiles
(; q_tot, q_liq, q_ice, q_pt, RH, e_kin, e_pot) = profiles
Expand Down Expand Up @@ -1252,18 +1250,21 @@ end
TD.total_energy_given_ρp.(param_set, ρ, p, e_kin, e_pot, q_pt)
@test all(total_energy.(param_set, ts, e_kin, e_pot) .≈ e_tot_proposed)

# TODO - waiting for #193
# PhaseNonEquil_ρθq
ts = PhaseNonEquil_ρθq.(param_set, ρ, θ_liq_ice, q_pt, 5, FT(1e-3))
@test all(
isapprox.(
θ_liq_ice,
liquid_ice_pottemp.(param_set, ts),
rtol = rtol_temperature,
),
)
@test all(air_density.(param_set, ts) .≈ ρ)
@test all(compare_moisture.(param_set, ts, q_pt))

#ts = PhaseNonEquil_ρθq.(param_set, ρ, θ_liq_ice, q_pt, 5, FT(1e-3))

#@info("AQQ")
#@test all(
# isapprox.(
# θ_liq_ice,
# liquid_ice_pottemp.(param_set, ts),
# rtol = rtol_temperature,
# ),
#)
#@info("BQQ")
#@test all(air_density.(param_set, ts) .≈ ρ)
#@test all(compare_moisture.(param_set, ts, q_pt))
profiles = TestedProfiles.PhaseEquilProfiles(param_set, ArrayType)
(; T, p, e_int, ρ, θ_liq_ice, phase_type) = profiles
(; q_tot, q_liq, q_ice, q_pt, RH, e_kin, e_pot) = profiles
Expand Down Expand Up @@ -1296,7 +1297,6 @@ end
relative_humidity.(param_set, T, p_dry, Ref(phase_type), q_pt_dry)
@test all(RH_dry .≈ 0)


# Test virtual temperature and inverse functions:
_R_d = FT(TP.R_d(param_set))
T_virt = virtual_temperature.(param_set, T, q_pt)
Expand Down
Loading