From 3d4b945ba130b071cf7aad15d31af85f6d1c68c6 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Mon, 24 Jun 2024 11:41:45 -0700 Subject: [PATCH] Update to RRTMGP v0.17.0 --- Project.toml | 2 +- docs/Manifest.toml | 12 ++++++------ examples/Manifest.toml | 16 ++++++++-------- perf/Manifest.toml | 16 ++++++++-------- src/callbacks/callbacks.jl | 6 ++++++ .../radiation/RRTMGPInterface.jl | 5 ++++- .../radiation/radiation.jl | 1 + 7 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Project.toml b/Project.toml index 084a1c44d8..6e6b72cdbb 100644 --- a/Project.toml +++ b/Project.toml @@ -72,7 +72,7 @@ NCDatasets = "0.14.2" NVTX = "0.3" Pkg = "1.8" Printf = "1" -RRTMGP = "0.16" +RRTMGP = "0.17" Random = "1" RootSolvers = "0.2, 0.3, 0.4" SciMLBase = "1, 2" diff --git a/docs/Manifest.toml b/docs/Manifest.toml index a2aae2b587..41f8f09265 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -5,9 +5,9 @@ manifest_format = "2.0" project_hash = "64afcb8dacf7a673d0068ba1a72602801e8d529a" [[deps.ADTypes]] -git-tree-sha1 = "fa0822e5baee6e23081c2685ae27265dabee23d8" +git-tree-sha1 = "2314e58e823f0fd6ee02dbbecb997370f501dd4a" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "1.4.0" +version = "1.5.0" weakdeps = ["ChainRulesCore", "EnzymeCore"] [deps.ADTypes.extensions] @@ -1249,9 +1249,9 @@ version = "0.6.0" [[deps.KernelAbstractions]] deps = ["Adapt", "Atomix", "InteractiveUtils", "LinearAlgebra", "MacroTools", "PrecompileTools", "Requires", "SparseArrays", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"] -git-tree-sha1 = "8e5a339882cc401688d79b811d923a38ba77d50a" +git-tree-sha1 = "b8fcefe4418e4a7a2c3aaac883fecddd8efbe286" uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c" -version = "0.9.20" +version = "0.9.21" weakdeps = ["EnzymeCore"] [deps.KernelAbstractions.extensions] @@ -1967,9 +1967,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.RRTMGP]] deps = ["Adapt", "Artifacts", "ClimaComms", "DocStringExtensions", "Random"] -git-tree-sha1 = "9a507a71e305f4b15e9d9f9c65e1752f6e20bcc4" +git-tree-sha1 = "866d94b4cf46fe3a0ffd35d1414a3a4181c9db08" uuid = "a01a1ee8-cea4-48fc-987c-fc7878d79da1" -version = "0.16.0" +version = "0.17.0" [deps.RRTMGP.extensions] CreateParametersExt = "ClimaParams" diff --git a/examples/Manifest.toml b/examples/Manifest.toml index 16ab3cc824..996fdb89f2 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -5,9 +5,9 @@ manifest_format = "2.0" project_hash = "d95e2ede05eb683ad8fc21789282919021c2aa3d" [[deps.ADTypes]] -git-tree-sha1 = "fa0822e5baee6e23081c2685ae27265dabee23d8" +git-tree-sha1 = "2314e58e823f0fd6ee02dbbecb997370f501dd4a" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "1.4.0" +version = "1.5.0" weakdeps = ["ChainRulesCore", "EnzymeCore"] [deps.ADTypes.extensions] @@ -1315,9 +1315,9 @@ version = "0.6.0" [[deps.KernelAbstractions]] deps = ["Adapt", "Atomix", "InteractiveUtils", "LinearAlgebra", "MacroTools", "PrecompileTools", "Requires", "SparseArrays", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"] -git-tree-sha1 = "8e5a339882cc401688d79b811d923a38ba77d50a" +git-tree-sha1 = "b8fcefe4418e4a7a2c3aaac883fecddd8efbe286" uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c" -version = "0.9.20" +version = "0.9.21" weakdeps = ["EnzymeCore"] [deps.KernelAbstractions.extensions] @@ -1619,9 +1619,9 @@ version = "2024.1.0+0" [[deps.MPI]] deps = ["Distributed", "DocStringExtensions", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "PkgVersion", "PrecompileTools", "Requires", "Serialization", "Sockets"] -git-tree-sha1 = "4e3136db3735924f96632a5b40a5979f1f53fa07" +git-tree-sha1 = "14cef41baf5b675b192b02a22c710f725ab333a7" uuid = "da04e1cc-30fd-572f-bb4f-1f8673147195" -version = "0.20.19" +version = "0.20.20" [deps.MPI.extensions] AMDGPUExt = "AMDGPU" @@ -2112,9 +2112,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.RRTMGP]] deps = ["Adapt", "Artifacts", "ClimaComms", "DocStringExtensions", "Random"] -git-tree-sha1 = "9a507a71e305f4b15e9d9f9c65e1752f6e20bcc4" +git-tree-sha1 = "866d94b4cf46fe3a0ffd35d1414a3a4181c9db08" uuid = "a01a1ee8-cea4-48fc-987c-fc7878d79da1" -version = "0.16.0" +version = "0.17.0" weakdeps = ["CUDA", "ClimaParams"] [deps.RRTMGP.extensions] diff --git a/perf/Manifest.toml b/perf/Manifest.toml index d4911aae00..ceb45ee603 100644 --- a/perf/Manifest.toml +++ b/perf/Manifest.toml @@ -5,9 +5,9 @@ manifest_format = "2.0" project_hash = "7a92cac99b6b02f9ad635d89d8820baa11d445e7" [[deps.ADTypes]] -git-tree-sha1 = "fa0822e5baee6e23081c2685ae27265dabee23d8" +git-tree-sha1 = "2314e58e823f0fd6ee02dbbecb997370f501dd4a" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "1.4.0" +version = "1.5.0" weakdeps = ["ChainRulesCore", "EnzymeCore"] [deps.ADTypes.extensions] @@ -1355,9 +1355,9 @@ version = "0.6.0" [[deps.KernelAbstractions]] deps = ["Adapt", "Atomix", "InteractiveUtils", "LinearAlgebra", "MacroTools", "PrecompileTools", "Requires", "SparseArrays", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"] -git-tree-sha1 = "8e5a339882cc401688d79b811d923a38ba77d50a" +git-tree-sha1 = "b8fcefe4418e4a7a2c3aaac883fecddd8efbe286" uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c" -version = "0.9.20" +version = "0.9.21" weakdeps = ["EnzymeCore"] [deps.KernelAbstractions.extensions] @@ -1665,9 +1665,9 @@ version = "2024.1.0+0" [[deps.MPI]] deps = ["Distributed", "DocStringExtensions", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "PkgVersion", "PrecompileTools", "Requires", "Serialization", "Sockets"] -git-tree-sha1 = "4e3136db3735924f96632a5b40a5979f1f53fa07" +git-tree-sha1 = "14cef41baf5b675b192b02a22c710f725ab333a7" uuid = "da04e1cc-30fd-572f-bb4f-1f8673147195" -version = "0.20.19" +version = "0.20.20" [deps.MPI.extensions] AMDGPUExt = "AMDGPU" @@ -2188,9 +2188,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.RRTMGP]] deps = ["Adapt", "Artifacts", "ClimaComms", "DocStringExtensions", "Random"] -git-tree-sha1 = "9a507a71e305f4b15e9d9f9c65e1752f6e20bcc4" +git-tree-sha1 = "866d94b4cf46fe3a0ffd35d1414a3a4181c9db08" uuid = "a01a1ee8-cea4-48fc-987c-fc7878d79da1" -version = "0.16.0" +version = "0.17.0" weakdeps = ["CUDA", "ClimaParams"] [deps.RRTMGP.extensions] diff --git a/src/callbacks/callbacks.jl b/src/callbacks/callbacks.jl index cbafd671ef..7e5c8240a8 100644 --- a/src/callbacks/callbacks.jl +++ b/src/callbacks/callbacks.jl @@ -86,6 +86,10 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator) min(max(TD.air_temperature(thermo_params, ᶜts), FT(T_min)), FT(T_max)) if !(radiation_model.radiation_mode isa RRTMGPI.GrayRadiation) + ᶜrh = Fields.array2field( + radiation_model.center_relative_humidity, + axes(Y.c), + ) ᶜvmr_h2o = Fields.array2field( radiation_model.center_volume_mixing_ratio_h2o, axes(Y.c), @@ -98,6 +102,7 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator) if t < t_increasing_humidity max_relative_humidity *= t / t_increasing_humidity end + @. ᶜrh = max_relative_humidity # temporarily store ᶜq_tot in ᶜvmr_h2o ᶜq_tot = ᶜvmr_h2o @@ -118,6 +123,7 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator) thermo_params, TD.PhasePartition(thermo_params, ᶜts), ) + @. ᶜrh = TD.relative_humidity(thermo_params, ᶜts) end end diff --git a/src/parameterized_tendencies/radiation/RRTMGPInterface.jl b/src/parameterized_tendencies/radiation/RRTMGPInterface.jl index a3fa92f48d..30ad8dd5c5 100644 --- a/src/parameterized_tendencies/radiation/RRTMGPInterface.jl +++ b/src/parameterized_tendencies/radiation/RRTMGPInterface.jl @@ -705,12 +705,14 @@ function RRTMGPModel( otp, ) else - layerdata = DA{FT}(undef, 3, nlay, ncol) + layerdata = DA{FT}(undef, 4, nlay, ncol) p_lay = view(layerdata, 2, :, :) t_lay = view(layerdata, 3, :, :) + rh_lay = view(layerdata, 4, :, :) if implied_values != :center set_and_save!(p_lay, "center_pressure", t..., dict) set_and_save!(t_lay, "center_temperature", t..., dict) + set_and_save!(rh_lay, "center_relative_humidity", t..., dict) end vmr_str = "volume_mixing_ratio_" gas_names = filter( @@ -795,6 +797,7 @@ function RRTMGPModel( t_sfc, vmr, cloud_state, + nothing, ) end diff --git a/src/parameterized_tendencies/radiation/radiation.jl b/src/parameterized_tendencies/radiation/radiation.jl index d538ce7a8a..d058283a8c 100644 --- a/src/parameterized_tendencies/radiation/radiation.jl +++ b/src/parameterized_tendencies/radiation/radiation.jl @@ -112,6 +112,7 @@ function radiation_model_cache( kwargs = (; use_global_means_for_well_mixed_gases = true, center_volume_mixing_ratio_h2o = NaN, # initialize in tendency + center_relative_humidity = NaN, # initialized in callback center_volume_mixing_ratio_o3, volume_mixing_ratio_co2 = input_vmr("carbon_dioxide_GM"), volume_mixing_ratio_n2o = input_vmr("nitrous_oxide_GM"),