Skip to content

Commit

Permalink
Merge branch 'main' into compathelper/new_version/2024-11-20-01-29-07…
Browse files Browse the repository at this point in the history
…-577-01601417224
  • Loading branch information
ctessum authored Dec 11, 2024
2 parents 7278654 + a829c70 commit 3b3975c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.9'
- '1.10'
- '1.11'
os:
- ubuntu-latest
arch:
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AtmosphericDeposition"
uuid = "1a52f20c-0d16-41d8-a00a-b2996d86a462"
authors = ["EarthSciML authors and contributors"]
version = "0.2.1"
version = "0.2.2"

[deps]
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
Expand All @@ -25,9 +25,9 @@ GasChemExt = "GasChem"
[compat]
DifferentialEquations = "7"
DynamicQuantities = "1"
EarthSciData = "0.10"
EarthSciMLBase = "0.19"
GasChem = "0.7"
EarthSciData = "0.12"
EarthSciMLBase = "0.20"
GasChem = "0.9"
ModelingToolkit = "9"
SafeTestsets = "0.1"
StaticArrays = "1"
Expand Down
6 changes: 3 additions & 3 deletions ext/GasChemExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function EarthSciMLBase.couple2(c::GasChem.SuperFastCoupler, d::AtmosphericDepos
c, d = c.sys, d.sys

operator_compose(convert(ODESystem, c), d, Dict(
c.SO2 => d.SO2,
#c.SO2 => d.SO2, # SuperFast does not currently have SO2
c.NO2 => d.NO2,
c.O3 => d.O3,
c.H2O2 => d.H2O2,
Expand All @@ -18,12 +18,12 @@ function EarthSciMLBase.couple2(c::GasChem.SuperFastCoupler, d::AtmosphericDepos
c, d = c.sys, d.sys

operator_compose(convert(ODESystem, c), d, Dict(
c.SO2 => d.SO2,
#c.SO2 => d.SO2, # SuperFast does not currently have SO2
c.NO2 => d.NO2,
c.O3 => d.O3,
c.H2O2 => d.H2O2,
c.CH2O => d.CH2O,
))
end

end
end
17 changes: 7 additions & 10 deletions test/connector_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ domain = DomainInfo(DateTime(2022, 1, 1), DateTime(2022, 1, 3);
@testset "GasChemExt" begin
start = Dates.datetime2unix(Dates.DateTime(2016, 5, 1))
composed_ode = couple(SuperFast(), FastJX(), DrydepositionG(), Wetdeposition())
combined_mtk = convert(ODESystem, composed_ode)
sys = structural_simplify(combined_mtk)
sys = convert(ODESystem, composed_ode)
print(unknowns(sys))
@test length(unknowns(sys)) 20
#TODO Change 20 to 18 after the latest GasChem package include species HNO3
@test length(unknowns(sys)) 15

eqs = string(equations(sys))
wanteqs = ["Differential(t)(SuperFast₊O3(t)) ~ SuperFast₊DrydepositionG_ddt_O3ˍt(t) + SuperFast₊Wetdeposition_ddt_O3ˍt(t)"]
Expand All @@ -27,18 +25,17 @@ end
@parameters lev = 1

geosfp = GEOSFP("4x5", domain)

model = couple(SuperFast(), FastJX(), geosfp, Wetdeposition(), DrydepositionG())

sys = structural_simplify(convert(ODESystem, model))
@test length(unknowns(sys)) 20
#TODO Change 20 to 18 after the latest GasChem package include species HNO3
sys = convert(ODESystem, model)
@test length(unknowns(sys)) 15

eqs = string(equations(convert(ODESystem, model)))
eqs = string(observed(sys))
wanteq = "DrydepositionG₊G(t) ~ GEOSFP₊A1₊SWGDN(t)"
@test contains(eqs, wanteq)
wanteq = "Wetdeposition₊cloudFrac(t) ~ GEOSFP₊A3cld₊CLOUD(t)"
@test contains(eqs, wanteq)
wanted = "Wetdeposition₊ρA(t) ~ GEOSFP₊P/(GEOSFP₊I3₊T*R)*kgperg*MW_air"
@test contains(eqs, wanteq)
end
end

0 comments on commit 3b3975c

Please sign in to comment.