Skip to content

Commit

Permalink
Testing TD with CLIMAParameters v0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Feb 13, 2024
1 parent 5d3b8e0 commit ba05058
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
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

0 comments on commit ba05058

Please sign in to comment.