From e8fc4db0c1b53f8303d1d6e7e2ebd240827ac2ec Mon Sep 17 00:00:00 2001 From: jialinl6 Date: Wed, 10 Jul 2024 21:03:53 +0800 Subject: [PATCH] Update Emission unit test & delete system name GasChem+ --- src/Fast-JX.jl | 2 +- src/SuperFast.jl | 2 +- src/geoschem_fullchem.jl | 2 +- test/Emission_test.jl | 9 ++++----- test/geoschem_test.jl | 10 +++++----- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Fast-JX.jl b/src/Fast-JX.jl index 01f24e94..3cee2a5a 100644 --- a/src/Fast-JX.jl +++ b/src/Fast-JX.jl @@ -173,5 +173,5 @@ function FastJX(t) j_NO2 ~ j_mean_NO2(t*j_unit, lat, long, T) * j_unit ] - ODESystem(eqs, t, [j_h2o2, j_CH2Oa, j_o31D, j_CH3OOH, j_NO2], [lat, long, j_unit, T]; name=:GasChem₊fastjx) + ODESystem(eqs, t, [j_h2o2, j_CH2Oa, j_o31D, j_CH3OOH, j_NO2], [lat, long, j_unit, T]; name=:fastjx) end \ No newline at end of file diff --git a/src/SuperFast.jl b/src/SuperFast.jl index ef04fe11..7c14c4ae 100644 --- a/src/SuperFast.jl +++ b/src/SuperFast.jl @@ -130,5 +130,5 @@ function SuperFast(t) #OH + CO = HO2 Reaction(k19 * c, [OH, CO], [HO2], [1, 1], [1]) ] - rxn_sys = ReactionSystem(rxs, t; combinatoric_ratelaws=false, name=:GasChem₊superfast) + rxn_sys = ReactionSystem(rxs, t; combinatoric_ratelaws=false, name=:superfast) end \ No newline at end of file diff --git a/src/geoschem_fullchem.jl b/src/geoschem_fullchem.jl index 8aa9e64a..82a1d610 100644 --- a/src/geoschem_fullchem.jl +++ b/src/geoschem_fullchem.jl @@ -1710,5 +1710,5 @@ function GEOSChemGasPhase(t) j_166, NPHEN --> HNO2 + CO + CO2 + AROMP4 + HO2 #==2021/09/29; Bates2021b; KHB,MSL==# end rxn_sys = compose(rxn_sys, rate_systems) - sys = convert(ODESystem, rxn_sys, combinatoric_ratelaws=false, name=:GasChem₊GEOSChemGasPhase) + sys = convert(ODESystem, rxn_sys, combinatoric_ratelaws=false, name=:GEOSChemGasPhase) end \ No newline at end of file diff --git a/test/Emission_test.jl b/test/Emission_test.jl index 6a382552..715b704c 100644 --- a/test/Emission_test.jl +++ b/test/Emission_test.jl @@ -14,9 +14,8 @@ using Test, Dates, ModelingToolkit, DifferentialEquations, EarthSciMLBase, Unitf sys = structural_simplify(get_mtk(model_3way)) @test length(states(sys)) ≈ 18 - - start = Dates.datetime2unix(Dates.DateTime(2016, 5, 1)) - tspan = (start, start+24*3600) - sol_3way = solve(ODEProblem(sys, [], tspan, []), AutoTsit5(Rosenbrock23())) - @test sol_3way[1,end] ≈ 2479.8538498918574 + + eqs = string(equations(sys)) + wanteqs = ["Differential(t)(superfast₊CH2O(t)) ~ superfast₊NEI2016MonthlyEmis_mrggrid_withbeis_withrwc₊FORM(t)"] + @test contains(string(eqs), wanteqs[1]) end \ No newline at end of file diff --git a/test/geoschem_test.jl b/test/geoschem_test.jl index 60c4ff38..98d9d8e7 100644 --- a/test/geoschem_test.jl +++ b/test/geoschem_test.jl @@ -118,11 +118,11 @@ end eqs = string(equations(gf)) - wanteqs = ["GasChem₊GEOSChemGasPhase₊j_9(t) ~ uconv*GasChem₊fastjx₊j_h2o2(t)", - "GasChem₊GEOSChemGasPhase₊j_7(t) ~ uconv*GasChem₊fastjx₊j_CH2Oa(t)", - "GasChem₊GEOSChemGasPhase₊j_10(t) ~ uconv*GasChem₊fastjx₊j_CH3OOH(t)", - "GasChem₊GEOSChemGasPhase₊j_11(t) ~ uconv*GasChem₊astjx₊j_NO2(t)", - "GasChem₊GEOSChemGasPhase₊j_3(t) ~ c_fixme1*GasChem₊fastjx₊j_o31D(t)"] + wanteqs = ["GEOSChemGasPhase₊j_9(t) ~ uconv*fastjx₊j_h2o2(t)", + "GEOSChemGasPhase₊j_7(t) ~ uconv*fastjx₊j_CH2Oa(t)", + "GEOSChemGasPhase₊j_10(t) ~ uconv*fastjx₊j_CH3OOH(t)", + "GEOSChemGasPhase₊j_11(t) ~ uconv*fastjx₊j_NO2(t)", + "GEOSChemGasPhase₊j_3(t) ~ c_fixme1*fastjx₊j_o31D(t)"] for eq in wanteqs @test contains(string(eqs), wanteqs[1]) end