Skip to content

Commit

Permalink
Update to ClimaParameters 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Jan 18, 2024
1 parent f38ee2f commit 4dfe3ff
Show file tree
Hide file tree
Showing 31 changed files with 48 additions and 73 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
CLIMAParameters = "0.7.15"
CLIMAParameters = "0.8"
DocStringExtensions = "0.8, 0.9"
ForwardDiff = "0.10"
RootSolvers = "0.3, 0.4"
Expand Down
5 changes: 4 additions & 1 deletion box/Alpert_Knopf_2016_backward.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import CairoMakie as MK
import Dierckx as DX
import Random as RD
import Distributions as DS

import CLIMAParameters
import Thermodynamics as TD
import CloudMicrophysics as CM
import CloudMicrophysics.Parameters as CMP
import CloudMicrophysics.Common as CMO
Expand Down Expand Up @@ -85,7 +88,7 @@ A_sum = similar(T)
compute_Asum!(A_sum, Aj_sorted, T)

# Compute the immersion freezing rate from CloudMicrophysics
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
aerosol = CMP.Illite(FT)
Δa = @. FT(1) - CMO.a_w_ice(tps, T)
J_immer = @. CMI_het.ABIFM_J(aerosol, Δa) # m^-2 s^-1
Expand Down
6 changes: 4 additions & 2 deletions box/Alpert_Knopf_2016_forward.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import CloudMicrophysics as CM
import CairoMakie as MK

import Thermodynamics as TD
import CloudMicrophysics as CM
import CloudMicrophysics.Parameters as CMP
import CloudMicrophysics.Common as CMO
import CloudMicrophysics.HetIceNucleation as CMI_het
Expand All @@ -25,7 +27,7 @@ N_ice = 0
T_initial = FT(256) # initial temperature, K
cooling_rate = FT(0.5 / 60) # prescribed cooling rate K s^-1
aerosol = CMP.Illite(FT) # aerosol free parameters
tps = CMP.ThermodynamicsParameters(FT) # thermodynamics free parameters
tps = TD.Parameters.ThermodynamicsParameters(FT) # thermodynamics free parameters
t_0 = 0
t_end = 3310
dt = 10
Expand Down
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
CLIMAParameters = "0.7.15"
Documenter = "1.1"
DocumenterCitations = "1.2"
1 change: 0 additions & 1 deletion docs/src/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ Parameters.TerminalVelocityType
Parameters.Precipitation2MType
Parameters.AirProperties
Parameters.WaterProperties
Parameters.ThermodynamicsParameters
Parameters.ArizonaTestDust
Parameters.DesertDust
Parameters.Illite
Expand Down
2 changes: 1 addition & 1 deletion docs/src/AerosolActivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const CMP = CloudMicrophysics.Parameters
const TD = Thermodynamics
FT = Float64
tps = CMP.ThermodynamicsParameters(FT)
tps = Thermodynamics.Parameters.ThermodynamicsParameters(FT)
aip = CMP.AirProperties(FT)
ap = CMP.AerosolActivationParameters(FT)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/Microphysics1M.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ const CMP = CloudMicrophysics.Parameters
FT = Float64
const tps = CMP.ThermodynamicsParameters(FT)
const tps = Thermodynamics.Parameters.ThermodynamicsParameters(FT)
const aps = CMP.AirProperties(FT)
const liquid = CMP.CloudLiquid(FT)
const ice = CMP.CloudIce(FT)
Expand Down
12 changes: 6 additions & 6 deletions docs/src/Microphysics2M.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,16 +638,16 @@ and the default free parameter values are:
using CairoMakie
CairoMakie.activate!(type = "svg")
import CloudMicrophysics
import CLIMAParameters
const CM1 = CloudMicrophysics.Microphysics1M
const CM2 = CloudMicrophysics.Microphysics2M
const CMP = CloudMicrophysics.Parameters
import Thermodynamics as TD
import CloudMicrophysics
import CloudMicrophysics.Microphysics1M as CM1
import CloudMicrophysics.Microphysics2M as CM2
import CloudMicrophysics.Parameters as CMP
FT = Float64
const tps = CMP.ThermodynamicsParameters(FT)
const tps = TD.Parameters.ThermodynamicsParameters(FT)
const aps = CMP.AirProperties(FT)
const KK2000 = CMP.KK2000(FT)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/ThresholdsTransition.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ for i in 1:3
println(io, "value = " * string(k_thrshld_stpnss_values[i]))
println(io, "type = \"float\"")
end
toml_dict = CP.create_toml_dict(FT; override_file, dict_type="alias")
toml_dict = CP.create_toml_dict(FT; override_file)
isfile(override_file) && rm(override_file; force=true)
push!(rain, CMP.Rain(FT, toml_dict))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/plots/ARGplots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TD = Thermodynamics

FT = Float64

tps = CMP.ThermodynamicsParameters(FT)
tps = Thermodynamics.Parameters.ThermodynamicsParameters(FT)
aip = CMP.AirProperties(FT)
ap = CMP.AerosolActivationParameters(FT)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/plots/Baumgartner2022_fig5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CMO = CM.Common
const CMP = CM.Parameters

FT = Float64
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
H2SO4_prs = CMP.H2SO4SolutionParameters(FT)

# Baumgartner at al 2022 Figure 5
Expand Down
2 changes: 1 addition & 1 deletion docs/src/plots/HomFreezingPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CMI = CM.HomIceNucleation
const CMP = CM.Parameters

FT = Float64
const tps = CMP.ThermodynamicsParameters(FT)
const tps = TD.Parameters.ThermodynamicsParameters(FT)
const H2SO4_prs = CMP.H2SO4SolutionParameters(FT)
const ip = CMP.IceNucleationParameters(FT)

Expand Down
10 changes: 5 additions & 5 deletions docs/src/plots/KnopfAlpert2013_fig1.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Plots as PL

import Thermodynamics as TD
import CloudMicrophysics as CM

const IN = CM.HetIceNucleation
const CMP = CM.Parameters
const CO = CM.Common
import CloudMicrophysics.Common as CO
import CloudMicrophysics.HetIceNucleation as IN
import CloudMicrophysics.Parameters as CMP

FT = Float64
const tps = CMP.ThermodynamicsParameters(FT)
const tps = TD.Parameters.ThermodynamicsParameters(FT)
const H2SO4_prs = CMP.H2SO4SolutionParameters(FT)
const kaolinite = CMP.Kaolinite(FT) # dust type

Expand Down
10 changes: 5 additions & 5 deletions docs/src/plots/KnopfAlpert2013_fig5.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import CairoMakie as MK

import CLIMAParameters
import Thermodynamics as TD
import CloudMicrophysics as CM

const CMO = CM.Common
const CMI = CM.HetIceNucleation
const CMP = CM.Parameters
import CloudMicrophysics.Common as CMO
import CloudMicrophysics.HetIceNucleation as CMI
import CloudMicrophysics.Parameters as CMP

FT = Float64
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
H2SO4_prs = CMP.H2SO4SolutionParameters(FT)
illite = CMP.Illite(FT) # dust type

Expand Down
2 changes: 1 addition & 1 deletion docs/src/plots/RainEvapoartionSB2006.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import CloudMicrophysics.Microphysics2M as CM2

FT = Float64

const tps = CMP.ThermodynamicsParameters(FT)
const tps = TD.Parameters.ThermodynamicsParameters(FT)
const aps = CMP.AirProperties(FT)
const SB2006 = CMP.SB2006(FT)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/plots/T_vs_wateractivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CMO = CM.Common
const CMP = CM.Parameters

FT = Float64
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
H2SO4_prs = CMP.H2SO4SolutionParameters(FT)

T_range = range(190, stop = 234, length = 100)
Expand Down
2 changes: 1 addition & 1 deletion parcel/Immersion_Freezing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CLIMAParameters as CP
include(joinpath(pkgdir(CM), "parcel", "parcel.jl"))
FT = Float64
# get free parameters
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
aps = CMP.AirProperties(FT)
wps = CMP.WaterProperties(FT)
ip = CMP.IceNucleationParameters(FT)
Expand Down
2 changes: 1 addition & 1 deletion parcel/Liquid_only.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(joinpath(pkgdir(CM), "parcel", "parcel.jl"))
FT = Float64

# Get free parameters
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
wps = CMP.WaterProperties(FT)
aps = CMP.AirProperties(FT)
ip = CMP.IceNucleationParameters(FT)
Expand Down
2 changes: 1 addition & 1 deletion parcel/Tully_et_al_2023.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
function Tully_et_al_2023(FT)

# get free parameters
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
aps = CMP.AirProperties(FT)
wps = CMP.WaterProperties(FT)
ip = CMP.IceNucleationParameters(FT)
Expand Down
3 changes: 0 additions & 3 deletions src/parameters/Parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import CLIMAParameters as CP
# Super-types (dispatch, broadcasting, etc...)
include("AbstractTypes.jl")

# Thermodynamics.jl parameters
include("Thermodynamics.jl")

# Parameters for moist air and water
include("AirProperties.jl")
include("WaterProperties.jl")
Expand Down
22 changes: 0 additions & 22 deletions src/parameters/Thermodynamics.jl

This file was deleted.

3 changes: 0 additions & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
RootSolvers = "7181ea78-2dcb-4de3-ab41-2b8ab5a31e74"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
CLIMAParameters = "0.7.15"
2 changes: 1 addition & 1 deletion test/aerosol_activation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CloudMicrophysics.Parameters as CMP

function test_aerosol_activation(FT)

tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
aip = CMP.AirProperties(FT)
ap = CMP.AerosolActivationParameters(FT)

Expand Down
3 changes: 1 addition & 2 deletions test/aqua.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ using Aqua
Aqua.test_stale_deps(CloudMicrophysics)
Aqua.test_deps_compat(CloudMicrophysics)
Aqua.test_project_extras(CloudMicrophysics)
Aqua.test_project_toml_formatting(CloudMicrophysics)
Aqua.test_piracy(CloudMicrophysics)
Aqua.test_piracies(CloudMicrophysics)
end

end
Expand Down
7 changes: 4 additions & 3 deletions test/common_functions_tests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Test as TT

import Thermodynamics as TD
import CloudMicrophysics as CM
import CloudMicrophysics.Common as CO
import CloudMicrophysics.Parameters as CMP
Expand Down Expand Up @@ -85,7 +86,7 @@ end

function test_a_w_xT(FT)

tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
H2SO4_prs = CMP.H2SO4SolutionParameters(FT)

TT.@testset "a_w_xT" begin
Expand All @@ -111,7 +112,7 @@ end

function test_a_w_eT(FT)

tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)

TT.@testset "a_w_eT" begin

Expand All @@ -132,7 +133,7 @@ end

function test_a_w_ice(FT)

tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)

TT.@testset "a_w_ice" begin

Expand Down
2 changes: 1 addition & 1 deletion test/gpu_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ function test_gpu(FT)

# thermodynamics and air properties
aps = CMP.AirProperties(FT)
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)

# aerosol activation
ap = CMP.AerosolActivationParameters(FT)
Expand Down
2 changes: 1 addition & 1 deletion test/heterogeneous_ice_nucleation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CloudMicrophysics.HetIceNucleation as CMI_het
function test_heterogeneous_ice_nucleation(FT)

# parameters for parameterizations
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
H2SO4_prs = CMP.H2SO4SolutionParameters(FT)
ip = CMP.IceNucleationParameters(FT)
# more parameters for aerosol properties
Expand Down
2 changes: 1 addition & 1 deletion test/homogeneous_ice_nucleation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import CloudMicrophysics.HomIceNucleation as CMH

function test_homogeneous_J(FT)

tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
H2SO4_prs = CMP.H2SO4SolutionParameters(FT)
ip = CMP.IceNucleationParameters(FT)

Expand Down
2 changes: 1 addition & 1 deletion test/microphysics1M_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CloudMicrophysics.Microphysics1M as CM1

function test_microphysics1M(FT)

tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)
aps = CMP.AirProperties(FT)

rain = CMP.Rain(FT)
Expand Down
2 changes: 1 addition & 1 deletion test/microphysics2M_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function test_microphysics2M(FT)

# Thermodynamics and air properties parameters
aps = CMP.AirProperties(FT)
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)

# Terminal velocity parameters
SB2006Vel = CMP.SB2006VelType(FT)
Expand Down
2 changes: 1 addition & 1 deletion test/performance_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function benchmark_test(FT)
organ_nuc = CMP.OrganicNucleationParameters(FT)
# air and thermodunamics parameters
aps = CMP.AirProperties(FT)
tps = CMP.ThermodynamicsParameters(FT)
tps = TD.Parameters.ThermodynamicsParameters(FT)

ρ_air = FT(1.2)
T_air = FT(280)
Expand Down

0 comments on commit 4dfe3ff

Please sign in to comment.