Skip to content

Commit

Permalink
Add TOA and surface radiation diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Feb 2, 2024
1 parent a21c62f commit 22353ea
Show file tree
Hide file tree
Showing 4 changed files with 622 additions and 38 deletions.
81 changes: 49 additions & 32 deletions post_processing/ci_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,18 @@ function make_plots(
simdir = SimDir(simulation_path)

reduction = "average"
short_names_3D = ["ua", "ta", "hus", "rsd", "rsu", "rld", "rlu"]
short_names_sfc = ["hfes", "evspsbl"]
short_names_3D = ["ua", "ta", "hus"]
short_names_2D = [
"rsdt",
"rsds",
"rsut",
"rsus",
"rlds",
"rlut",
"rlus",
"hfes",
"evspsbl",
]
available_periods = ClimaAnalysis.available_periods(
simdir;
short_name = short_names_3D[1],
Expand All @@ -464,9 +474,9 @@ function make_plots(
vars_3D = [
get(simdir; short_name, reduction, period) |> ClimaAnalysis.average_lon for short_name in short_names_3D
]
vars_sfc = [
vars_2D = [
get(simdir; short_name, reduction, period) for
short_name in short_names_sfc
short_name in short_names_2D
]
make_plots_generic(
simulation_path,
Expand All @@ -476,9 +486,9 @@ function make_plots(
)
make_plots_generic(
simulation_path,
vars_sfc,
vars_2D,
time = LAST_SNAP,
output_name = "summary_sfc",
output_name = "summary_2D",
)
end

Expand All @@ -497,29 +507,26 @@ function make_plots(

reduction = "average"
period = "10d"
short_names_3D = [
"ta",
"thetaa",
"rhoa",
"ua",
"va",
"wa",
"hur",
"hus",
"clw",
"cli",
"rsd",
"rsu",
"rld",
"rlu",
short_names_3D =
["ta", "thetaa", "rhoa", "ua", "va", "wa", "hur", "hus", "clw", "cli"]
short_names_2D = [
"rsdt",
"rsds",
"rsut",
"rsus",
"rlds",
"rlut",
"rlus",
"hfes",
"evspsbl",
"ts",
]
short_names_sfc = ["hfes", "evspsbl", "ts"]
vars_3D = [
get(simdir; short_name, reduction, period) |> ClimaAnalysis.average_lon for short_name in short_names_3D
]
vars_sfc = [
vars_2D = [
get(simdir; short_name, reduction, period) for
short_name in short_names_sfc
short_name in short_names_2D
]
make_plots_generic(
simulation_path,
Expand All @@ -529,9 +536,9 @@ function make_plots(
)
make_plots_generic(
simulation_path,
vars_sfc,
vars_2D,
time = LAST_SNAP,
output_name = "summary_sfc",
output_name = "summary_2D",
)
end

Expand All @@ -553,8 +560,18 @@ function make_plots(::AquaplanetPlots, simulation_path)
simdir = SimDir(simulation_path)

reduction = "average"
short_names_3D = ["ua", "ta", "hus", "rsd", "rsu", "rld", "rlu"]
short_names_sfc = ["hfes", "evspsbl"]
short_names_3D = ["ua", "ta", "hus"]
short_names_2D = [
"rsdt",
"rsds",
"rsut",
"rsus",
"rlds",
"rlut",
"rlus",
"hfes",
"evspsbl",
]
available_periods = ClimaAnalysis.available_periods(
simdir;
short_name = short_names_3D[1],
Expand All @@ -570,8 +587,8 @@ function make_plots(::AquaplanetPlots, simulation_path)
vars_3D = [
get(simdir; short_name, reduction, period) |> ClimaAnalysis.average_lon for short_name in short_names_3D
]
vars_sfc =
[get(simdir; short_name, reduction) for short_name in short_names_sfc]
vars_2D =
[get(simdir; short_name, reduction) for short_name in short_names_2D]
make_plots_generic(
simulation_path,
vars_3D,
Expand All @@ -580,9 +597,9 @@ function make_plots(::AquaplanetPlots, simulation_path)
)
make_plots_generic(
simulation_path,
vars_sfc,
vars_2D,
time = LAST_SNAP,
output_name = "summary_sfc",
output_name = "summary_2D",
)
end

Expand Down
45 changes: 41 additions & 4 deletions src/diagnostics/default_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,19 @@ end
# Radiation mode #
##################
function default_diagnostics(::RRTMGPI.AbstractRRTMGPMode, t_end; output_writer)
rad_diagnostics = ["rsd", "rsu", "rld", "rlu"]
rad_diagnostics = [
"rsd",
"rsdt",
"rsds",
"rsu",
"rsut",
"rsus",
"rld",
"rlds",
"rlu",
"rlut",
"rlus",
]

average_func = frequency_averages(t_end)

Expand All @@ -187,12 +199,37 @@ function default_diagnostics(
t_end;
output_writer,
)
rad_diagnostics =
["rsd", "rsu", "rld", "rlu", "rsdcs", "rsucs", "rldcs", "rlucs"]
rad_diagnostics = [
"rsd",
"rsdt",
"rsds",
"rsu",
"rsut",
"rsus",
"rld",
"rlds",
"rlu",
"rlut",
"rlus",
]
rad_clearsky_diagnostics = [
"rsdcs",
"rsdscs",
"rsucs",
"rsutcs",
"rsuscs",
"rldcs",
"rldscs",
"rlucs",
"rlutcs",
]

average_func = frequency_averages(t_end)

return [average_func(rad_diagnostics...; output_writer)...]
return [
average_func(rad_diagnostics...; output_writer)...,
average_func(rad_clearsky_diagnostics...; output_writer)...,
]
end

##################
Expand Down
Loading

0 comments on commit 22353ea

Please sign in to comment.