Skip to content

Commit

Permalink
Add implicit diffusion solver
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisYatunin committed Nov 29, 2023
1 parent 48d6f4f commit b41603f
Show file tree
Hide file tree
Showing 13 changed files with 282 additions and 89 deletions.
14 changes: 14 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,20 @@ steps:
--nc_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff
--fig_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff --case_name aquaplanet
artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_expvdiff/*"

- label: ":computer: no lim ARS baroclinic wave (ρe) equilmoist implicit vertdiff"
command: >
julia --color=yes --project=examples examples/hybrid/driver.jl
--config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist_impvdiff.yml
julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl
--data_dir sphere_baroclinic_wave_rhoe_equilmoist_impvdiff
--out_dir sphere_baroclinic_wave_rhoe_equilmoist_impvdiff
julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl
--nc_dir sphere_baroclinic_wave_rhoe_equilmoist_impvdiff
--fig_dir sphere_baroclinic_wave_rhoe_equilmoist_impvdiff --case_name aquaplanet
artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_impvdiff/*"

# Add this back when we figure out what to do with SSP and zalesak
# - label: ":computer: SSP zalesak tracer & energy upwind baroclinic wave (ρe_tot) equilmoist"
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Artifacts = "1"
AtmosphericProfilesLibrary = "0.1"
CLIMAParameters = "0.7.25"
ClimaComms = "0.5.6"
ClimaCore = "0.11.0"
ClimaCore = "0.11.1"
ClimaTimeSteppers = "0.7.14"
CloudMicrophysics = "0.15.0"
Colors = "0.12"
Expand Down
9 changes: 9 additions & 0 deletions config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ prognostic_tke:
prognostic_surface:
help: "Determines if surface temperature is prognostic [`false` (default), , `true`, `PrognosticSurfaceTemperature`, `PrescribedSurfaceTemperature`]"
value: "false"
implicit_diffusion:
help: "Whether the implicit tendency should include vertical diffusion [`false`, `true` (default)]"
value: true
use_diffusion_derivative:
help: "Whether the Jacobian should include the derivative of vertical diffusion with respect to the quantities being diffused [`false` (default), `true`]"
value: false
use_enthalpy_derivative:
help: "Whether the Jacobian should include the derivative of total enthalpy with respect to vertical velocity [`false` (default), `true`]"
value: false
override_τ_precip:
help: "If true, sets τ_precip to dt. Otherwise, τ_precip is set to the value in the toml dictionary"
value: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ z_elem: 20
dz_bottom: 100
dt_save_to_disk: "12hours"
initial_condition: "MoistBaroclinicWave"
dt: "40secs"
implicit_diffusion: false
dt: "20secs"
t_end: "12hours"
job_id: "sphere_baroclinic_wave_rhoe_equilmoist_expvdiff"
moist: "equil"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
precip_model: "0M"
vert_diff: "true"
z_elem: 20
dz_bottom: 100
dt_save_to_disk: "12hours"
initial_condition: "MoistBaroclinicWave"
use_diffusion_derivative: true
max_newton_iters_ode: 3
dt: "400secs"
t_end: "6days"
job_id: "sphere_baroclinic_wave_rhoe_equilmoist_impvdiff"
moist: "equil"
toml: [toml/sphere_baroclinic_wave_rhoe_equilmoist_expvdiff.toml]
16 changes: 13 additions & 3 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,14 @@ uuid = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
version = "0.5.6"

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "WeakValueDicts"]
git-tree-sha1 = "5c3809c5da88a3b01b8fe18558f50470fd3c33ed"
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "WeakValueDicts"]
git-tree-sha1 = "3d6cd2e89f0d99664b23549da9081ade4e7d8fdb"
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.11.0"
version = "0.11.1"
weakdeps = ["Krylov"]

[deps.ClimaCore.extensions]
KrylovExt = "Krylov"

[[deps.ClimaTimeSteppers]]
deps = ["CUDA", "ClimaComms", "Colors", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "KernelAbstractions", "Krylov", "LinearAlgebra", "LinearOperators", "NVTX", "SciMLBase", "StaticArrays"]
Expand Down Expand Up @@ -856,6 +860,12 @@ git-tree-sha1 = "17e462054b42dcdda73e9a9ba0c67754170c88ae"
uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
version = "0.9.4"

[[deps.KrylovKit]]
deps = ["ChainRulesCore", "GPUArraysCore", "LinearAlgebra", "Printf"]
git-tree-sha1 = "1a5e1d9941c783b0119897d29f2eb665d876ecf3"
uuid = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
version = "0.6.0"

[[deps.LDLFactorizations]]
deps = ["AMD", "LinearAlgebra", "SparseArrays", "Test"]
git-tree-sha1 = "70f582b446a1c3ad82cf87e62b878668beef9d13"
Expand Down
32 changes: 21 additions & 11 deletions examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,14 @@ uuid = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
version = "0.5.6"

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "WeakValueDicts"]
git-tree-sha1 = "5c3809c5da88a3b01b8fe18558f50470fd3c33ed"
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "WeakValueDicts"]
git-tree-sha1 = "3d6cd2e89f0d99664b23549da9081ade4e7d8fdb"
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.11.0"
version = "0.11.1"
weakdeps = ["Krylov"]

[deps.ClimaCore.extensions]
KrylovExt = "Krylov"

[[deps.ClimaCoreMakie]]
deps = ["ClimaCore", "Makie"]
Expand Down Expand Up @@ -1236,6 +1240,12 @@ git-tree-sha1 = "17e462054b42dcdda73e9a9ba0c67754170c88ae"
uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
version = "0.9.4"

[[deps.KrylovKit]]
deps = ["ChainRulesCore", "GPUArraysCore", "LinearAlgebra", "Printf"]
git-tree-sha1 = "1a5e1d9941c783b0119897d29f2eb665d876ecf3"
uuid = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
version = "0.6.0"

[[deps.LAME_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "f6250b16881adf048549549fba48b1161acdac8c"
Expand Down Expand Up @@ -1421,9 +1431,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.LinearAlgebraX]]
deps = ["LinearAlgebra", "Mods", "Permutations", "Primes", "SimplePolynomials"]
git-tree-sha1 = "3d93e38b11993bbdbfac967a46dcb36dd9dd733f"
git-tree-sha1 = "8889b8aa6821c0ee73828a2139314b4d596e7dbc"
uuid = "9b3f67b0-2d00-526e-9884-9e4938f8fb88"
version = "0.2.1"
version = "0.2.2"

[[deps.LinearOperators]]
deps = ["FastClosures", "LDLFactorizations", "LinearAlgebra", "Printf", "SparseArrays", "TimerOutputs"]
Expand Down Expand Up @@ -1757,9 +1767,9 @@ version = "0.11.30"

[[deps.PNGFiles]]
deps = ["Base64", "CEnum", "ImageCore", "IndirectArrays", "OffsetArrays", "libpng_jll"]
git-tree-sha1 = "5ded86ccaf0647349231ed6c0822c10886d4a1ee"
git-tree-sha1 = "eed372b0fa15624273a9cdb188b1b88476e6a233"
uuid = "f57f5aa1-a3ce-4bc8-8ab9-96f992907883"
version = "0.4.1"
version = "0.4.2"

[[deps.Packing]]
deps = ["GeometryBasics"]
Expand Down Expand Up @@ -2228,9 +2238,9 @@ version = "0.3.1"

[[deps.SimplePolynomials]]
deps = ["Mods", "Multisets", "Polynomials", "Primes"]
git-tree-sha1 = "d537c31cf9995236166e3e9afc424a5a1c59ff9d"
git-tree-sha1 = "e14e1a7063179a90c2981faf3c8cbf12aacccdaf"
uuid = "cc47b68c-3164-5771-a705-2bc0097375a0"
version = "0.2.14"
version = "0.2.16"

[[deps.SimpleRandom]]
deps = ["Distributions", "LinearAlgebra", "Random"]
Expand Down Expand Up @@ -2531,9 +2541,9 @@ version = "0.4.1"

[[deps.Unitful]]
deps = ["Dates", "LinearAlgebra", "Random"]
git-tree-sha1 = "242982d62ff0d1671e9029b52743062739255c7e"
git-tree-sha1 = "3c793be6df9dd77a0cf49d80984ef9ff996948fa"
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
version = "1.18.0"
version = "1.19.0"
weakdeps = ["ConstructionBase", "InverseFunctions"]

[deps.Unitful.extensions]
Expand Down
32 changes: 21 additions & 11 deletions perf/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,14 @@ uuid = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
version = "0.5.6"

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "WeakValueDicts"]
git-tree-sha1 = "5c3809c5da88a3b01b8fe18558f50470fd3c33ed"
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "WeakValueDicts"]
git-tree-sha1 = "3d6cd2e89f0d99664b23549da9081ade4e7d8fdb"
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.11.0"
version = "0.11.1"
weakdeps = ["Krylov"]

[deps.ClimaCore.extensions]
KrylovExt = "Krylov"

[[deps.ClimaCoreMakie]]
deps = ["ClimaCore", "Makie"]
Expand Down Expand Up @@ -1288,6 +1292,12 @@ git-tree-sha1 = "17e462054b42dcdda73e9a9ba0c67754170c88ae"
uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
version = "0.9.4"

[[deps.KrylovKit]]
deps = ["ChainRulesCore", "GPUArraysCore", "LinearAlgebra", "Printf"]
git-tree-sha1 = "1a5e1d9941c783b0119897d29f2eb665d876ecf3"
uuid = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
version = "0.6.0"

[[deps.LAME_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "f6250b16881adf048549549fba48b1161acdac8c"
Expand Down Expand Up @@ -1479,9 +1489,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.LinearAlgebraX]]
deps = ["LinearAlgebra", "Mods", "Permutations", "Primes", "SimplePolynomials"]
git-tree-sha1 = "3d93e38b11993bbdbfac967a46dcb36dd9dd733f"
git-tree-sha1 = "8889b8aa6821c0ee73828a2139314b4d596e7dbc"
uuid = "9b3f67b0-2d00-526e-9884-9e4938f8fb88"
version = "0.2.1"
version = "0.2.2"

[[deps.LinearOperators]]
deps = ["FastClosures", "LDLFactorizations", "LinearAlgebra", "Printf", "SparseArrays", "TimerOutputs"]
Expand Down Expand Up @@ -1809,9 +1819,9 @@ version = "0.11.30"

[[deps.PNGFiles]]
deps = ["Base64", "CEnum", "ImageCore", "IndirectArrays", "OffsetArrays", "libpng_jll"]
git-tree-sha1 = "5ded86ccaf0647349231ed6c0822c10886d4a1ee"
git-tree-sha1 = "eed372b0fa15624273a9cdb188b1b88476e6a233"
uuid = "f57f5aa1-a3ce-4bc8-8ab9-96f992907883"
version = "0.4.1"
version = "0.4.2"

[[deps.PProf]]
deps = ["AbstractTrees", "EnumX", "FlameGraphs", "Libdl", "OrderedCollections", "Profile", "ProgressMeter", "ProtoBuf", "pprof_jll"]
Expand Down Expand Up @@ -2304,9 +2314,9 @@ version = "0.3.1"

[[deps.SimplePolynomials]]
deps = ["Mods", "Multisets", "Polynomials", "Primes"]
git-tree-sha1 = "d537c31cf9995236166e3e9afc424a5a1c59ff9d"
git-tree-sha1 = "e14e1a7063179a90c2981faf3c8cbf12aacccdaf"
uuid = "cc47b68c-3164-5771-a705-2bc0097375a0"
version = "0.2.14"
version = "0.2.16"

[[deps.SimpleRandom]]
deps = ["Distributions", "LinearAlgebra", "Random"]
Expand Down Expand Up @@ -2625,9 +2635,9 @@ version = "0.4.1"

[[deps.Unitful]]
deps = ["Dates", "LinearAlgebra", "Random"]
git-tree-sha1 = "242982d62ff0d1671e9029b52743062739255c7e"
git-tree-sha1 = "3c793be6df9dd77a0cf49d80984ef9ff996948fa"
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
version = "1.18.0"
version = "1.19.0"
weakdeps = ["ConstructionBase", "InverseFunctions"]

[deps.Unitful.extensions]
Expand Down
Loading

0 comments on commit b41603f

Please sign in to comment.