Skip to content

Commit 7b9a797

Browse files
committed
add sensible and latent heat flux to bias plot
1 parent 39c9c8e commit 7b9a797

File tree

2 files changed

+47
-13
lines changed

2 files changed

+47
-13
lines changed

experiments/ClimaEarth/Artifacts.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,10 @@ git-tree-sha1 = "cbbc6b3752d9cb9b667ec33cfbeb46819f8db418"
5858

5959
[era5_monthly_averages_pressure_levels_1979_2024]
6060
git-tree-sha1 = "dd7ee9500805f590f8fc4c00bfc373eeb7a01587"
61+
62+
[era5_monthly_averages_surface_single_level_1979_2024]
63+
git-tree-sha1 = "6cddb07eeee2dd46dc5a19e9b2f706302ddba2c9"
64+
65+
[[era5_monthly_averages_surface_single_level_1979_2024.download]]
66+
sha256 = "46b422722d98c89c6bc0b8641bff259db1caee253f45389ddf9eb9c2d31ed605"
67+
url = "https://caltech.box.com/shared/static/jbgtyt6oq9lxvk8il5zzck6k581q7f3k.gz"

experiments/ClimaEarth/leaderboard/data_sources.jl

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ClimaAnalysis
22
import ClimaUtilities.ClimaArtifacts: @clima_artifact
33

44
# Tuple of short names for loading simulation and observational data
5-
sim_obs_short_names_no_pr = [
5+
sim_obs_short_names_rad = [
66
("rsdt", "solar_mon"),
77
("rsut", "toa_sw_all_mon"),
88
("rlut", "toa_lw_all_mon"),
@@ -17,6 +17,8 @@ sim_obs_short_names_no_pr = [
1717
("rldscs", "sfc_lw_down_clr_t_mon"),
1818
]
1919

20+
sim_obs_short_names_sf = [("hfss", "msshf"), ("hfls", "mslhf")]
21+
2022
"""
2123
get_compare_vars_biases_groups()
2224
@@ -29,6 +31,7 @@ function get_compare_vars_biases_groups()
2931
["pr", "rsdt", "rsut", "rlut"],
3032
["rsds", "rsus", "rlds", "rlus"],
3133
["rsutcs", "rlutcs", "rsdscs", "rsuscs", "rldscs"],
34+
["hfss", "hfls"],
3235
]
3336
return compare_vars_biases_groups
3437
end
@@ -59,6 +62,8 @@ function get_compare_vars_biases_plot_extrema()
5962
"rsdscs" => (-10.0, 10.0),
6063
"rsuscs" => (-10.0, 10.0),
6164
"rldscs" => (-20.0, 20.0),
65+
"hfss" => (-50.0, 50.0),
66+
"hfls" => (-50.0, 50.0),
6267
)
6368
return compare_vars_biases_plot_extrema
6469
end
@@ -79,8 +84,9 @@ The variable should have only three dimensions: latitude, longitude, and time.
7984
"""
8085
function get_sim_var_dict(diagnostics_folder_path)
8186
available_short_names = get_short_names_monthly_averages(diagnostics_folder_path)
82-
sim_var_dict = Dict{String, Any}()
8387
# Dict for loading in simulation data
88+
sim_var_dict = Dict{String, Any}()
89+
# Add "pr" and the necessary preprocessing
8490
"pr" in available_short_names && (
8591
sim_var_dict["pr"] =
8692
() -> begin
@@ -100,8 +106,7 @@ function get_sim_var_dict(diagnostics_folder_path)
100106
end
101107
)
102108

103-
# Add "pr" and the necessary preprocessing
104-
for (short_name, _) in sim_obs_short_names_no_pr
109+
for (short_name, _) in vcat(sim_obs_short_names_rad, sim_obs_short_names_sf)
105110
short_name in available_short_names && (
106111
sim_var_dict[short_name] =
107112
() -> begin
@@ -137,22 +142,44 @@ dates.
137142
The variable should have only three dimensions: latitude, longitude, and time.
138143
"""
139144
function get_obs_var_dict()
140-
# Add "pr" and the necessary preprocessing
141-
obs_var_dict = Dict{String, Any}(
142-
"pr" =>
145+
obs_var_dict = Dict{String, Any}()
146+
obs_var_dict["pr"] =
147+
(start_date) -> begin
148+
obs_var = ClimaAnalysis.OutputVar(
149+
joinpath(@clima_artifact("precipitation_obs"), "precip.mon.mean.nc"),
150+
"precip",
151+
new_start_date = start_date,
152+
shift_by = Dates.firstdayofmonth,
153+
)
154+
return obs_var
155+
end
156+
157+
for (sim_name, obs_name) in sim_obs_short_names_sf
158+
obs_var_dict[sim_name] =
143159
(start_date) -> begin
144160
obs_var = ClimaAnalysis.OutputVar(
145-
joinpath(@clima_artifact("precipitation_obs"), "precip.mon.mean.nc"),
146-
"precip",
161+
joinpath(
162+
@clima_artifact(
163+
"era5_monthly_averages_surface_single_level_1979_2024"
164+
),
165+
"era5_monthly_averages_surface_single_level_197901-202410.nc",
166+
),
167+
obs_name,
147168
new_start_date = start_date,
148169
shift_by = Dates.firstdayofmonth,
149170
)
171+
(ClimaAnalysis.units(obs_var) == "W m**-2") && (
172+
obs_var = ClimaAnalysis.convert_units(
173+
obs_var,
174+
"W m^-2",
175+
conversion_function = units -> units * -1.0,
176+
)
177+
)
150178
return obs_var
151-
end,
152-
)
179+
end
180+
end
153181

154-
# Loop to load the rest of the observational data and the necessary preprocessing
155-
for (sim_name, obs_name) in sim_obs_short_names_no_pr
182+
for (sim_name, obs_name) in sim_obs_short_names_rad
156183
obs_var_dict[sim_name] =
157184
(start_date) -> begin
158185
obs_var = ClimaAnalysis.OutputVar(

0 commit comments

Comments
 (0)