Skip to content

Commit

Permalink
Update to RRTMGP v0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Jun 24, 2024
1 parent 9ab25e2 commit 97d8f17
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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"
Expand Down
16 changes: 8 additions & 8 deletions examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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]
Expand Down
16 changes: 8 additions & 8 deletions perf/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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]
Expand Down
8 changes: 8 additions & 0 deletions src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ 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),
Expand All @@ -99,6 +104,8 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator)
max_relative_humidity *= t / t_increasing_humidity
end

@. ᶜrh = max_relative_humidity

# temporarily store ᶜq_tot in ᶜvmr_h2o
ᶜq_tot = ᶜvmr_h2o
@. ᶜq_tot =
Expand All @@ -118,6 +125,7 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator)
thermo_params,
TD.PhasePartition(thermo_params, ᶜts),
)
@. ᶜrh = TD.relative_humidity(thermo_params, ᶜts)
end
end

Expand Down
9 changes: 8 additions & 1 deletion src/parameterized_tendencies/radiation/RRTMGPInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,12 @@ function RRTMGPModel(
if radiation_mode isa GrayRadiation
p_lay = DA{FT}(undef, nlay, ncol)
t_lay = DA{FT}(undef, nlay, ncol)
rh_lay = DA{FT}(undef, nlay, ncol)

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

z_lev = DA{FT}(undef, nlay + 1, ncol) # TODO: z_lev required but unused
Expand Down Expand Up @@ -705,12 +708,15 @@ 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(
Expand Down Expand Up @@ -795,6 +801,7 @@ function RRTMGPModel(
t_sfc,
vmr,
cloud_state,
nothing,
)
end

Expand Down
1 change: 1 addition & 0 deletions src/parameterized_tendencies/radiation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ function radiation_model_cache(
center_pressure = NaN, # initialized in callback
center_temperature = NaN, # initialized in callback
surface_temperature = NaN, # initialized in callback
center_relative_humidity = NaN, # initialized in callback
surface_emissivity = 1,
direct_sw_surface_albedo = NaN, # initialized in callback
diffuse_sw_surface_albedo = NaN, # initialized in callback
Expand Down

0 comments on commit 97d8f17

Please sign in to comment.