Skip to content

Commit

Permalink
Merge #1051
Browse files Browse the repository at this point in the history
1051: Fix calibrate_io diagnostics r=ilopezgp a=ilopezgp



Co-authored-by: Ignacio <[email protected]>
  • Loading branch information
bors[bot] and ilopezgp authored May 26, 2022
2 parents aaee02e + ed984f0 commit 7c8eca7
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 280 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ steps:
artifact_paths: "Output.Bomex.01_NN/stats/comparison/*"

- label: ":partly_sunny: Bomex with FNO"
command: "julia --color=yes --project=integration_tests integration_tests/driver.jl --case Bomex --entr FNO --skip_tests true --suffix _FNO"
command: "julia --color=yes --project=integration_tests integration_tests/driver.jl --case Bomex --entr FNO --skip_tests true --broken_tests true --suffix _FNO"
artifact_paths: "Output.Bomex.01_FNO/stats/comparison/*"

- label: ":partly_sunny: Bomex with RF"
Expand Down
114 changes: 49 additions & 65 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ git-tree-sha1 = "6f1d9bc1c08f9f4a8fa92e3ea3cb50153a1b40d4"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.1.0"

[[deps.AbstractTrees]]
git-tree-sha1 = "03e0550477d86222521d254b741d470ba17ea0b5"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.3.4"

[[deps.Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "af92965fb30777147966f58acb05da51c5616b5f"
Expand All @@ -42,15 +37,15 @@ version = "0.2.0"

[[deps.ArrayInterface]]
deps = ["ArrayInterfaceCore", "Compat", "IfElse", "LinearAlgebra", "Static"]
git-tree-sha1 = "4244e1be1dd8bae3c26e97dd84c08c56deb3881c"
git-tree-sha1 = "ff29cb1b13fe4db6a944bff087ad202fc3c3fc5f"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "6.0.1"
version = "6.0.2"

[[deps.ArrayInterfaceCore]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "8a9c02f9d323d4dd8a47245abb106355bf7b45e6"
git-tree-sha1 = "8cf9950ecb894a76d5908e0633c9272784d52f95"
uuid = "30b0a656-2188-435a-8636-2ec0e6a096e2"
version = "0.1.2"
version = "0.1.3"

[[deps.ArrayInterfaceGPUArrays]]
deps = ["Adapt", "ArrayInterfaceCore", "GPUArrays", "LinearAlgebra"]
Expand Down Expand Up @@ -229,12 +224,6 @@ git-tree-sha1 = "e8f3bfcbca8369b54fab96991271b35c4d70e94d"
uuid = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b"
version = "0.5.0"

[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.0"

[[deps.ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Random"]
git-tree-sha1 = "7297381ccb5df764549818d9a7d57e45f1057d30"
Expand Down Expand Up @@ -354,9 +343,9 @@ version = "0.1.0+0"

[[deps.DiffEqBase]]
deps = ["ArrayInterfaceCore", "ChainRulesCore", "DEDataArrays", "DataStructures", "Distributions", "DocStringExtensions", "FastBroadcast", "ForwardDiff", "FunctionWrappers", "IterativeSolvers", "LabelledArrays", "LinearAlgebra", "Logging", "MuladdMacro", "NonlinearSolve", "Parameters", "PreallocationTools", "Printf", "RecursiveArrayTools", "RecursiveFactorization", "Reexport", "Requires", "SciMLBase", "Setfield", "SparseArrays", "StaticArrays", "Statistics", "SuiteSparse", "ZygoteRules"]
git-tree-sha1 = "9f3bddf45d0dcb21ed0957a71ae545daeb27683c"
git-tree-sha1 = "ee1edeafeb79f09c828f0bd22c5528ad26737a70"
uuid = "2b5f629d-d688-5b77-993f-72d75c75574e"
version = "6.87.0"
version = "6.88.0"

[[deps.DiffEqJump]]
deps = ["ArrayInterfaceCore", "DataStructures", "DiffEqBase", "DocStringExtensions", "FunctionWrappers", "Graphs", "LinearAlgebra", "Markdown", "PoissonRandom", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "StaticArrays", "TreeViews", "UnPack"]
Expand Down Expand Up @@ -520,10 +509,10 @@ uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.4"

[[deps.Flux]]
deps = ["AbstractTrees", "Adapt", "CUDA", "CodecZlib", "Colors", "DelimitedFiles", "Functors", "Juno", "LinearAlgebra", "MacroTools", "NNlib", "NNlibCUDA", "Pkg", "Printf", "Random", "Reexport", "SHA", "Statistics", "StatsBase", "Test", "ZipFile", "Zygote"]
git-tree-sha1 = "0b3c6d0ce57d3b793eabd346ccc8f605035ef079"
deps = ["Adapt", "ArrayInterface", "CUDA", "ChainRulesCore", "Functors", "LinearAlgebra", "MLUtils", "MacroTools", "NNlib", "NNlibCUDA", "Optimisers", "ProgressLogging", "Random", "Reexport", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "Test", "Zygote"]
git-tree-sha1 = "170c7046f23ae115b587dbe91a905487e1e3b3df"
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
version = "0.12.4"
version = "0.13.2"

[[deps.Fontconfig_jll]]
deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"]
Expand Down Expand Up @@ -775,12 +764,6 @@ git-tree-sha1 = "b53380851c6e6664204efb2e62cd24fa5c47e4ba"
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
version = "2.1.2+0"

[[deps.Juno]]
deps = ["Base64", "Logging", "Media", "Profile"]
git-tree-sha1 = "07cb43290a840908a771552911a6274bc6c072c7"
uuid = "e5e0dc1b-0480-54bc-9374-aad01c23163d"
version = "0.8.4"

[[deps.KLU]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"]
git-tree-sha1 = "cae5e3dfd89b209e01bcd65b3a25e74462c67ee0"
Expand Down Expand Up @@ -952,9 +935,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.LinearSolve]]
deps = ["ArrayInterfaceCore", "DocStringExtensions", "GPUArrays", "IterativeSolvers", "KLU", "Krylov", "KrylovKit", "LinearAlgebra", "RecursiveFactorization", "Reexport", "SciMLBase", "Setfield", "SparseArrays", "SuiteSparse", "UnPack"]
git-tree-sha1 = "5b095894601b8d53b025f8a8235a75e4b21c49e4"
git-tree-sha1 = "7c2d2127793a167fabda1a2303ab9558808e4d6f"
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
version = "1.17.0"
version = "1.18.0"

[[deps.LogExpFunctions]]
deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
Expand All @@ -967,16 +950,22 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.LoopVectorization]]
deps = ["ArrayInterface", "ArrayInterfaceOffsetArrays", "ArrayInterfaceStaticArrays", "CPUSummary", "ChainRulesCore", "CloseOpenIntervals", "DocStringExtensions", "ForwardDiff", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "SIMDDualNumbers", "SLEEFPirates", "SpecialFunctions", "Static", "ThreadingUtilities", "UnPack", "VectorizationBase"]
git-tree-sha1 = "4e4f18eaeb9631442bb6745b1e21d0742944632f"
git-tree-sha1 = "1d216376720ec00aec7ef4e9a357451262fed001"
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
version = "0.12.111"
version = "0.12.113"

[[deps.MKL_jll]]
deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"]
git-tree-sha1 = "e595b205efd49508358f7dc670a940c790204629"
uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7"
version = "2022.0.0+0"

[[deps.MLUtils]]
deps = ["ChainRulesCore", "DelimitedFiles", "Random", "ShowCases", "Statistics", "StatsBase"]
git-tree-sha1 = "c92a10a2492dffac0e152a19d5ffd99a5030349a"
uuid = "f1d291b0-491e-4a28-83b9-f70985020b54"
version = "0.2.1"

[[deps.MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf"
Expand Down Expand Up @@ -1007,12 +996,6 @@ git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.1"

[[deps.Media]]
deps = ["MacroTools", "Test"]
git-tree-sha1 = "75a54abd10709c01f1b86b84ec225d26e840ed58"
uuid = "e89f7d12-3494-54d1-8411-f7d8b9ae1f27"
version = "0.5.0"

[[deps.Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f"
Expand Down Expand Up @@ -1050,15 +1033,15 @@ version = "4.5.1"

[[deps.NNlib]]
deps = ["Adapt", "ChainRulesCore", "Compat", "LinearAlgebra", "Pkg", "Requires", "Statistics"]
git-tree-sha1 = "3a8dfd0cfb5bb3b82d09949e14423409b9334acb"
git-tree-sha1 = "f89de462a7bc3243f95834e75751d70b3a33e59d"
uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
version = "0.7.34"
version = "0.8.5"

[[deps.NNlibCUDA]]
deps = ["CUDA", "LinearAlgebra", "NNlib", "Random", "Statistics"]
git-tree-sha1 = "a2dc748c9f6615197b6b97c10bcce829830574c9"
git-tree-sha1 = "e161b835c6aa9e2339c1e72c3d4e39891eac7a4f"
uuid = "a00861dc-f156-4864-bf3c-e6376f28a68d"
version = "0.1.11"
version = "0.2.3"

[[deps.NaNMath]]
git-tree-sha1 = "b086b7ea07f8e38cf122f5016af580881ac914fe"
Expand Down Expand Up @@ -1113,17 +1096,23 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
version = "0.5.5+0"

[[deps.OperatorFlux]]
deps = ["ChainRulesCore", "ChainRulesTestUtils", "Distributions", "FFTW", "Flux", "LinearAlgebra", "Tullio", "Zygote"]
git-tree-sha1 = "9a3bb211e7f3370961af5349fc7f65c0d1d197ab"
deps = ["ChainRulesCore", "ChainRulesTestUtils", "Distributions", "FFTW", "Flux", "GaussQuadrature", "LinearAlgebra", "Tullio"]
git-tree-sha1 = "1903970fbe90d9fdb745ba82bdde45eca9ddf07e"
uuid = "47cfafe2-3833-4da3-8183-ce14c2b92cbd"
version = "0.1.1"
version = "0.1.2"

[[deps.Optim]]
deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"]
git-tree-sha1 = "7a28efc8e34d5df89fc87343318b0a8add2c4021"
uuid = "429524aa-4258-5aef-a3af-852621145aeb"
version = "1.7.0"

[[deps.Optimisers]]
deps = ["ChainRulesCore", "Functors", "LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "26f58049054343c8103d67a5530284a35f1186cb"
uuid = "3bd65402-5787-11e9-1adc-39752487f4e2"
version = "0.2.5"

[[deps.Opus_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "51a08fb14ec28da2ec7a927c4337e4332c2a4720"
Expand All @@ -1137,9 +1126,9 @@ version = "1.4.1"

[[deps.OrdinaryDiffEq]]
deps = ["Adapt", "ArrayInterface", "ArrayInterfaceGPUArrays", "ArrayInterfaceStaticArrays", "DataStructures", "DiffEqBase", "DocStringExtensions", "ExponentialUtilities", "FastClosures", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "Logging", "LoopVectorization", "MacroTools", "MuladdMacro", "NLsolve", "NonlinearSolve", "Polyester", "PreallocationTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "SparseArrays", "SparseDiffTools", "StaticArrays", "UnPack"]
git-tree-sha1 = "d2f58ab523814b9c7f909855503a5a83241ab1e7"
git-tree-sha1 = "8736f2b0fea5883e192b8aaf794516afcab579b3"
uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
version = "6.13.0"
version = "6.13.1"

[[deps.PCRE_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down Expand Up @@ -1233,9 +1222,11 @@ version = "1.3.0"
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[deps.Profile]]
deps = ["Printf"]
uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
[[deps.ProgressLogging]]
deps = ["Logging", "SHA", "UUIDs"]
git-tree-sha1 = "80d919dee55b9c50e8d9e2da5eeafff3fe58b539"
uuid = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
version = "0.1.4"

[[deps.Qt5Base_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"]
Expand Down Expand Up @@ -1394,14 +1385,19 @@ uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[deps.Setfield]]
deps = ["ConstructionBase", "Future", "MacroTools", "Requires"]
git-tree-sha1 = "38d88503f695eb0301479bc9b0d4320b378bafe5"
git-tree-sha1 = "77172cadd2fdfa0c84c87e3a01215a4ca7723310"
uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46"
version = "0.8.2"
version = "1.0.0"

[[deps.SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[deps.ShowCases]]
git-tree-sha1 = "7f534ad62ab2bd48591bdeac81994ea8c445e4a5"
uuid = "605ecd9f-84a6-4c9e-81e2-4798472b76a3"
version = "0.1.0"

[[deps.Showoff]]
deps = ["Dates", "Grisu"]
git-tree-sha1 = "91eddf657aca81df9ae6ceb20b959ae5653ad1de"
Expand Down Expand Up @@ -1429,9 +1425,9 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[deps.SparseDiffTools]]
deps = ["Adapt", "ArrayInterfaceCore", "ArrayInterfaceStaticArrays", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "Requires", "SparseArrays", "StaticArrays", "VertexSafeGraphs"]
git-tree-sha1 = "56a100f020fa03ec49f4f9390e3886bd2a672647"
git-tree-sha1 = "f71f06cce80d21e9b93933bc04b1334bb90259ab"
uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
version = "1.22.0"
version = "1.23.0"

[[deps.SpecialFunctions]]
deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
Expand Down Expand Up @@ -1564,12 +1560,6 @@ git-tree-sha1 = "7638550aaea1c9a1e86817a231ef0faa9aca79bd"
uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
version = "0.5.19"

[[deps.TranscodingStreams]]
deps = ["Random", "Test"]
git-tree-sha1 = "216b95ea110b5972db65aa90f88d8d89dcb8851c"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.9.6"

[[deps.TreeViews]]
deps = ["Test"]
git-tree-sha1 = "8d0d7a3fe2f30d6a7f833a5f19f7c7a5b396eae6"
Expand All @@ -1592,7 +1582,7 @@ version = "0.3.4"
deps = ["CLIMAParameters", "ClimaCore", "CloudMicrophysics", "Dierckx", "Distributions", "DocStringExtensions", "FastGaussQuadrature", "Flux", "LambertW", "LinearAlgebra", "OperatorFlux", "StaticArrays", "StatsBase", "StochasticDiffEq", "Thermodynamics", "UnPack"]
path = ".."
uuid = "8e072fc4-01f8-44fb-b9dc-f9336c367e6b"
version = "0.27.0"
version = "0.27.1"

[[deps.URIs]]
git-tree-sha1 = "97bbe755a53fe859669cd907f2d96aee8d2c1355"
Expand Down Expand Up @@ -1790,12 +1780,6 @@ git-tree-sha1 = "3c6e8b9f5cdaaa21340f841653942e1a6b6561e5"
uuid = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
version = "0.4.7"

[[deps.ZipFile]]
deps = ["Libdl", "Printf", "Zlib_jll"]
git-tree-sha1 = "3593e69e469d2111389a9bd06bac1f3d730ac6de"
uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
version = "0.9.4"

[[deps.Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
Expand Down
37 changes: 31 additions & 6 deletions driver/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,33 @@ function affect_io!(integrator)
# TODO: is this the best location to call diagnostics?
compute_diagnostics!(edmf, precip_model, param_set, grid, state, diagnostics, Stats, case, t, calibrate_io)

cent = TC.Cent(1)
diag_svpc = svpc_diagnostics_grid_mean(diagnostics)
diag_tc_svpc = svpc_diagnostics_turbconv(diagnostics)
write_ts(Stats, "lwp_mean", diag_svpc.lwp_mean[cent])
write_ts(Stats, "iwp_mean", diag_svpc.iwp_mean[cent])
write_ts(Stats, "rwp_mean", diag_svpc.rwp_mean[cent])
write_ts(Stats, "swp_mean", diag_svpc.swp_mean[cent])

if !calibrate_io
write_ts(Stats, "updraft_cloud_cover", diag_tc_svpc.updraft_cloud_cover[cent])
write_ts(Stats, "updraft_cloud_base", diag_tc_svpc.updraft_cloud_base[cent])
write_ts(Stats, "updraft_cloud_top", diag_tc_svpc.updraft_cloud_top[cent])
write_ts(Stats, "env_cloud_cover", diag_tc_svpc.env_cloud_cover[cent])
write_ts(Stats, "env_cloud_base", diag_tc_svpc.env_cloud_base[cent])
write_ts(Stats, "env_cloud_top", diag_tc_svpc.env_cloud_top[cent])
write_ts(Stats, "env_lwp", diag_tc_svpc.env_lwp[cent])
write_ts(Stats, "env_iwp", diag_tc_svpc.env_iwp[cent])
write_ts(Stats, "Hd", diag_tc_svpc.Hd[cent])
write_ts(Stats, "updraft_lwp", diag_tc_svpc.updraft_lwp[cent])
write_ts(Stats, "updraft_iwp", diag_tc_svpc.updraft_iwp[cent])

write_ts(Stats, "cutoff_precipitation_rate", diag_svpc.cutoff_precipitation_rate[cent])
write_ts(Stats, "cloud_cover_mean", diag_svpc.cloud_cover_mean[cent])
write_ts(Stats, "cloud_base_mean", diag_svpc.cloud_base_mean[cent])
write_ts(Stats, "cloud_top_mean", diag_svpc.cloud_top_mean[cent])
end

# TODO: remove `vars` hack that avoids
# https://github.com/Alexander-Barth/NCDatasets.jl/issues/135
# opening/closing files every step should be okay. #removeVarsHack
Expand All @@ -31,10 +58,8 @@ function affect_io!(integrator)
io(io_nt.aux, Stats, state)
io(io_nt.diagnostics, Stats, diagnostics)

if !calibrate_io
surf = get_surface(case.surf_params, grid, state, t, param_set)
io(surf, case.surf_params, grid, state, Stats, t)
end
surf = get_surface(case.surf_params, grid, state, t, param_set)
io(surf, case.surf_params, grid, state, Stats, t)

ODE.u_modified!(integrator, false) # We're legitamately not mutating `u` (the state vector)
end
Expand Down Expand Up @@ -65,7 +90,7 @@ function dt_max!(integrator)
state = TC.State(integrator.u, aux, ODE.get_du(integrator))
prog_gm = TC.center_prog_grid_mean(state)
prog_gm_f = TC.face_prog_grid_mean(state)
Δzc = TC.get_Δz(prog_gm.u)
Δzc = TC.get_Δz(prog_gm.ρ)
Δzf = TC.get_Δz(prog_gm_f.w)
CFL_limit = TS.cfl_limit
N_up = TC.n_updrafts(edmf)
Expand Down Expand Up @@ -107,7 +132,7 @@ function monitor_cfl!(integrator)
UnPack.@unpack grid, edmf, aux, TS = integrator.p
state = TC.State(integrator.u, aux, ODE.get_du(integrator))
prog_gm = TC.center_prog_grid_mean(state)
Δz = TC.get_Δz(prog_gm.u)
Δz = TC.get_Δz(prog_gm.ρ)
Δt = TS.dt
CFL_limit = TS.cfl_limit

Expand Down
25 changes: 0 additions & 25 deletions driver/compute_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ function compute_diagnostics!(
diag_svpc.rwp_mean[cent] = sum(ρ_c .* prog_pr.q_rai)
diag_svpc.swp_mean[cent] = sum(ρ_c .* prog_pr.q_sno)

write_ts(Stats, "lwp_mean", diag_svpc.lwp_mean[cent])
write_ts(Stats, "iwp_mean", diag_svpc.iwp_mean[cent])
write_ts(Stats, "rwp_mean", diag_svpc.rwp_mean[cent])
write_ts(Stats, "swp_mean", diag_svpc.swp_mean[cent])

# We only need computations above here for calibration io.
calibrate_io && return nothing

Expand Down Expand Up @@ -353,25 +348,5 @@ function compute_diagnostics!(
diag_tc_svpc.updraft_iwp[cent] = iwp
diag_tc_svpc.Hd[cent] = StatsBase.mean(plume_scale_height)

# Demonstration of how we can move all of the `write_ts` calls
# outside of `compute_diagnostics!`, which currently computes
# _and_ exports (some) diagnostics.
write_ts(Stats, "updraft_cloud_cover", diag_tc_svpc.updraft_cloud_cover[cent])
write_ts(Stats, "updraft_cloud_base", diag_tc_svpc.updraft_cloud_base[cent])
write_ts(Stats, "updraft_cloud_top", diag_tc_svpc.updraft_cloud_top[cent])
write_ts(Stats, "env_cloud_cover", diag_tc_svpc.env_cloud_cover[cent])
write_ts(Stats, "env_cloud_base", diag_tc_svpc.env_cloud_base[cent])
write_ts(Stats, "env_cloud_top", diag_tc_svpc.env_cloud_top[cent])
write_ts(Stats, "env_lwp", diag_tc_svpc.env_lwp[cent])
write_ts(Stats, "env_iwp", diag_tc_svpc.env_iwp[cent])
write_ts(Stats, "Hd", diag_tc_svpc.Hd[cent])
write_ts(Stats, "updraft_lwp", diag_tc_svpc.updraft_lwp[cent])
write_ts(Stats, "updraft_iwp", diag_tc_svpc.updraft_iwp[cent])

write_ts(Stats, "cutoff_precipitation_rate", diag_svpc.cutoff_precipitation_rate[cent])
write_ts(Stats, "cloud_cover_mean", diag_svpc.cloud_cover_mean[cent])
write_ts(Stats, "cloud_base_mean", diag_svpc.cloud_base_mean[cent])
write_ts(Stats, "cloud_top_mean", diag_svpc.cloud_top_mean[cent])

return
end
Loading

0 comments on commit 7c8eca7

Please sign in to comment.