Skip to content

Commit

Permalink
Treat idealized_{insolation,clouds} as idealized_h20
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed Sep 8, 2023
1 parent 7768031 commit ea05100
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
7 changes: 0 additions & 7 deletions src/cache/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,12 @@ function additional_cache(
)
(; precip_model, forcing_type, radiation_mode, turbconv_model) = atmos

idealized_insolation = parsed_args["idealized_insolation"]
@assert idealized_insolation in (true, false)
idealized_clouds = parsed_args["idealized_clouds"]
@assert idealized_clouds in (true, false)

radiation_cache = if radiation_mode isa RRTMGPI.AbstractRRTMGPMode
radiation_model_cache(
Y,
default_cache,
params,
radiation_mode;
idealized_insolation,
idealized_clouds,
data_loader = rrtmgp_data_loader,
)
else
Expand Down
8 changes: 8 additions & 0 deletions src/parameterized_tendencies/radiation/RRTMGPInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,23 @@ array2data(
abstract type AbstractRRTMGPMode end
struct GrayRadiation <: AbstractRRTMGPMode
idealized_h2o::Bool
idealized_insolation::Bool
idealized_clouds::Bool
end
struct ClearSkyRadiation <: AbstractRRTMGPMode
idealized_h2o::Bool
idealized_insolation::Bool
idealized_clouds::Bool
end
struct AllSkyRadiation <: AbstractRRTMGPMode
idealized_h2o::Bool
idealized_insolation::Bool
idealized_clouds::Bool
end
struct AllSkyRadiationWithClearSkyDiagnostics <: AbstractRRTMGPMode
idealized_h2o::Bool
idealized_insolation::Bool
idealized_clouds::Bool
end

"""
Expand Down
4 changes: 1 addition & 3 deletions src/parameterized_tendencies/radiation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ function radiation_model_cache(
radiation_mode::RRTMGPI.AbstractRRTMGPMode = RRTMGPI.ClearSkyRadiation();
interpolation = RRTMGPI.BestFit(),
bottom_extrapolation = RRTMGPI.SameAsInterpolation(),
idealized_insolation = true,
idealized_clouds = false,
data_loader,
)
context = ClimaComms.context(axes(Y.c))
(; idealized_h2o) = radiation_mode
(; idealized_h2o, idealized_insolation, idealized_clouds) = radiation_mode
FT = Spaces.undertype(axes(Y.c))
rrtmgp_params = CAP.rrtmgp_params(params)
if idealized_h2o && radiation_mode isa RRTMGPI.GrayRadiation
Expand Down
28 changes: 24 additions & 4 deletions src/solver/model_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ end
function get_radiation_mode(parsed_args, ::Type{FT}) where {FT}
idealized_h2o = parsed_args["idealized_h2o"]
@assert idealized_h2o in (true, false)
idealized_insolation = parsed_args["idealized_insolation"]
@assert idealized_insolation in (true, false)
idealized_clouds = parsed_args["idealized_clouds"]
@assert idealized_clouds in (true, false)
radiation_name = parsed_args["rad"]
@assert radiation_name in (
nothing,
Expand All @@ -193,13 +197,29 @@ function get_radiation_mode(parsed_args, ::Type{FT}) where {FT}
"TRMM_LBA",
)
return if radiation_name == "clearsky"
RRTMGPI.ClearSkyRadiation(idealized_h2o)
RRTMGPI.ClearSkyRadiation(
idealized_h2o,
idealized_insolation,
idealized_clouds,
)
elseif radiation_name == "gray"
RRTMGPI.GrayRadiation(idealized_h2o)
RRTMGPI.GrayRadiation(
idealized_h2o,
idealized_insolation,
idealized_clouds,
)
elseif radiation_name == "allsky"
RRTMGPI.AllSkyRadiation(idealized_h2o)
RRTMGPI.AllSkyRadiation(
idealized_h2o,
idealized_insolation,
idealized_clouds,
)
elseif radiation_name == "allskywithclear"
RRTMGPI.AllSkyRadiationWithClearSkyDiagnostics(idealized_h2o)
RRTMGPI.AllSkyRadiationWithClearSkyDiagnostics(
idealized_h2o,
idealized_insolation,
idealized_clouds,
)
elseif radiation_name == "DYCOMS_RF01"
RadiationDYCOMS_RF01{FT}()
elseif radiation_name == "TRMM_LBA"
Expand Down

0 comments on commit ea05100

Please sign in to comment.