diff --git a/src/parameterized_tendencies/radiation/RRTMGPInterface.jl b/src/parameterized_tendencies/radiation/RRTMGPInterface.jl index 31947d6da9..c16a4375e6 100644 --- a/src/parameterized_tendencies/radiation/RRTMGPInterface.jl +++ b/src/parameterized_tendencies/radiation/RRTMGPInterface.jl @@ -521,6 +521,16 @@ function RRTMGPModel( end lookups = (; lookups..., lookup_lw_cld) end + if radiation_mode.aerosol_radiation + local lookup_lw_aero + data_loader(joinpath("rrtmgp-aerosols-merra-lw.nc")) do ds + lookup_lw_aero = + RRTMGP.LookUpTables.LookUpAerosolMerra(ds, FT, DA) + end + else + lookup_lw_aero = nothing + end + lookups = (; lookups..., lookup_lw_aero) end src_lw = RRTMGP.Sources.source_func_longwave( @@ -582,6 +592,17 @@ function RRTMGPModel( end lookups = (; lookups..., lookup_sw_cld) end + + if radiation_mode.aerosol_radiation + local lookup_sw_aero + data_loader(joinpath("rrtmgp-aerosols-merra-sw.nc")) do ds + lookup_sw_aero = + RRTMGP.LookUpTables.LookUpAerosolMerra(ds, FT, DA) + end + else + lookup_sw_aero = nothing + end + lookups = (; lookups..., lookup_sw_aero) end src_sw = @@ -787,7 +808,7 @@ function RRTMGPModel( end if radiation_mode.aerosol_radiation - aero_type = DA{FT}(undef, nlay, ncol) + aero_type = DA{Int}(undef, nlay, ncol) name = "center_aerosol_type" set_and_save!(aero_type, name, t..., dict) aero_size = DA{FT}(undef, nlay, ncol) @@ -1129,6 +1150,8 @@ NVTX.@annotate update_lw_fluxes!(::ClearSkyRadiation, model) = model.lw_solver, model.as, model.lookups.lookup_lw, + nothing, + model.lookups.lookup_lw_aero, ) NVTX.@annotate update_lw_fluxes!(::AllSkyRadiation, model) = RRTMGP.RTESolver.solve_lw!( @@ -1136,6 +1159,7 @@ NVTX.@annotate update_lw_fluxes!(::AllSkyRadiation, model) = model.as, model.lookups.lookup_lw, model.lookups.lookup_lw_cld, + model.lookups.lookup_lw_aero, ) NVTX.@annotate function update_lw_fluxes!( ::AllSkyRadiationWithClearSkyDiagnostics, @@ -1145,6 +1169,8 @@ NVTX.@annotate function update_lw_fluxes!( model.lw_solver, model.as, model.lookups.lookup_lw, + nothing, + model.lookups.lookup_lw_aero, ) parent(model.face_clear_lw_flux_up) .= parent(model.face_lw_flux_up) parent(model.face_clear_lw_flux_dn) .= parent(model.face_lw_flux_dn) @@ -1154,6 +1180,7 @@ NVTX.@annotate function update_lw_fluxes!( model.as, model.lookups.lookup_lw, model.lookups.lookup_lw_cld, + model.lookups.lookup_lw_aero, ) end @@ -1164,6 +1191,8 @@ NVTX.@annotate update_sw_fluxes!(::ClearSkyRadiation, model) = model.sw_solver, model.as, model.lookups.lookup_sw, + nothing, + model.lookups.lookup_sw_aero, ) NVTX.@annotate update_sw_fluxes!(::AllSkyRadiation, model) = RRTMGP.RTESolver.solve_sw!( @@ -1171,6 +1200,7 @@ NVTX.@annotate update_sw_fluxes!(::AllSkyRadiation, model) = model.as, model.lookups.lookup_sw, model.lookups.lookup_sw_cld, + model.lookups.lookup_sw_aero, ) NVTX.@annotate function update_sw_fluxes!( ::AllSkyRadiationWithClearSkyDiagnostics, @@ -1180,6 +1210,8 @@ NVTX.@annotate function update_sw_fluxes!( model.sw_solver, model.as, model.lookups.lookup_sw, + nothing, + model.lookups.lookup_sw_aero, ) parent(model.face_clear_sw_flux_up) .= parent(model.face_sw_flux_up) parent(model.face_clear_sw_flux_dn) .= parent(model.face_sw_flux_dn) @@ -1191,6 +1223,7 @@ NVTX.@annotate function update_sw_fluxes!( model.as, model.lookups.lookup_sw, model.lookups.lookup_sw_cld, + model.lookups.lookup_sw_aero, ) end