Skip to content

Commit 5326771

Browse files
committed
plots for version sent to coauthors
1 parent ecbc1b9 commit 5326771

File tree

3 files changed

+70
-71
lines changed

3 files changed

+70
-71
lines changed

experiments/long_runs/data_paper_plots.jl

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,27 @@ function get_sim_var_dict(simdir)
7474
return sim_var_swd
7575
end
7676

77-
# Compute LWN = LWD - LWU
78-
sim_var_dict["lwn"] =
79-
() -> begin
80-
lwd = sim_var_dict["lwd"]()
81-
lwu = sim_var_dict["lwu"]()
82-
lwn = lwd - lwu
83-
lwn.attributes["long_name"] = "Net longwave radiation"
84-
lwn.attributes["units"] = "W m⁻²"
85-
return lwn
86-
end
87-
88-
# Compute SWN = SWD - SWU
89-
sim_var_dict["swn"] =
90-
() -> begin
91-
swd = sim_var_dict["swd"]()
92-
swu = sim_var_dict["swu"]()
93-
swn = swd - swu
94-
swn.attributes["long_name"] = "Net shortwave radiation"
95-
swn.attributes["units"] = "W m⁻²"
96-
return swn
97-
end
77+
# # Compute LWN = LWD - LWU
78+
# sim_var_dict["lwn"] =
79+
# () -> begin
80+
# lwd = sim_var_dict["lwd"]()
81+
# lwu = sim_var_dict["lwu"]()
82+
# lwn = lwd - lwu
83+
# lwn.attributes["long_name"] = "Net longwave radiation"
84+
# lwn.attributes["units"] = "W m⁻²"
85+
# return lwn
86+
# end
87+
88+
# # Compute SWN = SWD - SWU
89+
# sim_var_dict["swn"] =
90+
# () -> begin
91+
# swd = sim_var_dict["swd"]()
92+
# swu = sim_var_dict["swu"]()
93+
# swn = swd - swu
94+
# swn.attributes["long_name"] = "Net shortwave radiation"
95+
# swn.attributes["units"] = "W m⁻²"
96+
# return swn
97+
# end
9898

9999
return sim_var_dict
100100
end
@@ -104,12 +104,12 @@ function get_obs_var_dict()
104104
ClimaLand.Artifacts.era5_monthly_averages_2008_folder_path(),
105105
"era5_monthly_surface_fluxes_200801-200812.nc",
106106
)
107-
era5_land_forcing_data_path = joinpath(
108-
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(
109-
lowres = false,
110-
),
111-
"era5_2008_0.9x1.25.nc",
112-
)
107+
# era5_land_forcing_data_path = joinpath(
108+
# ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(
109+
# lowres = false,
110+
# ),
111+
# "era5_2008_0.9x1.25.nc",
112+
# )
113113

114114
# Dict for loading in observational data
115115
obs_var_dict = Dict{String, Any}()
@@ -304,27 +304,27 @@ function get_obs_var_dict()
304304
end
305305

306306

307-
# Compute LWN = LWD - LWU
308-
obs_var_dict["lwn"] =
309-
(start_date) -> begin
310-
lwd = obs_var_dict["lwd"](start_date)
311-
lwu = obs_var_dict["lwu"](start_date)
312-
lwn = lwd - lwu
313-
lwn.attributes["long_name"] = "Net longwave radiation"
314-
lwn.attributes["units"] = "W m⁻²"
315-
return lwu
316-
end
317-
318-
# Compute SWN = SWD - SWU
319-
obs_var_dict["swn"] =
320-
(start_date) -> begin
321-
swd = obs_var_dict["swd"](start_date)
322-
swu = obs_var_dict["swu"](start_date)
323-
swn = swd - swu
324-
swn.attributes["long_name"] = "Net shortwave radiation"
325-
swn.attributes["units"] = "W m⁻²"
326-
return swn
327-
end
307+
# # Compute LWN = LWD - LWU
308+
# obs_var_dict["lwn"] =
309+
# (start_date) -> begin
310+
# lwd = obs_var_dict["lwd"](start_date)
311+
# lwu = obs_var_dict["lwu"](start_date)
312+
# lwn = lwd - lwu
313+
# lwn.attributes["long_name"] = "Net longwave radiation"
314+
# lwn.attributes["units"] = "W m⁻²"
315+
# return lwu
316+
# end
317+
318+
# # Compute SWN = SWD - SWU
319+
# obs_var_dict["swn"] =
320+
# (start_date) -> begin
321+
# swd = obs_var_dict["swd"](start_date)
322+
# swu = obs_var_dict["swu"](start_date)
323+
# swn = swd - swu
324+
# swn.attributes["long_name"] = "Net shortwave radiation"
325+
# swn.attributes["units"] = "W m⁻²"
326+
# return swn
327+
# end
328328

329329
return obs_var_dict
330330
end

experiments/long_runs/paper_plots.jl

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ root_path = joinpath(pwd(), "snowy_land_longrun_gpu")
2424
# outdir = "snowy_land_longrun_gpu-3761-alpha1/output_active" # on local
2525
# outdir = "snowy_land_longrun_gpu-3771-new_default/output_active"
2626
# outdir = "snowy_land_longrun_gpu-3761-new_default/output_active" # on local
27-
outdir = "snowy_land_longrun_gpu-3777-alpha2/output_active" # on local
27+
outdir = "snowy_land_longrun_gpu-3785"
2828
root_path = outdir
2929

30-
short_names = ["lhf", "shf", "lwu", "swu", "lwn", "swn"]
30+
short_names = ["lhf", "shf", "lwu", "swu"]#, "lwn", "swn"]
3131
title_stubs = Dict(
32-
"lhf" => "Latent heat flux",
33-
"shf" => "Sensible heat flux",
34-
"lwu" => "Upward longwave radiation",
35-
"swu" => "Upward shortwave radiation",
36-
"lwn" => "Net longwave radiation",
37-
"swn" => "Net shortwave radiation",
32+
"lhf" => "LE",#"Latent heat flux",
33+
"shf" => "H",#"Sensible heat flux",
34+
"lwu" => "LWᵤ",#"Upward longwave radiation",
35+
"swu" => "SWᵤ",#"Upward shortwave radiation",
3836
)
3937
# Define levels for contour colorbars
4038
levels_dict = Dict(
@@ -55,7 +53,7 @@ function compute_global_average(masked_var)
5553
land_data = ClimaAnalysis.apply_oceanmask(masked_var).data
5654
lat_data = masked_var.dims[latitude_name]
5755
mask = .~isnan.(land_data)
58-
nlon = length(masked_var.dims[lon_name])µ
56+
nlon = length(masked_var.dims[lon_name])
5957
resized_lat_data = transpose(repeat(lat_data, 1, nlon))
6058

6159
return sum(land_data[mask] .* cosd.(resized_lat_data[mask])) /
@@ -206,13 +204,13 @@ function make_paper_figures(
206204
xgridvisible = false, # don't show lat grid
207205
ygridvisible = false, # don't show lon grid
208206
height = 235,
209-
ylabel = "$(sim_var.attributes["long_name"]) $units_label", # plot variable label on y-axis for leftmost column (sim)
207+
ylabel = "$title_stub $units_label", # plot variable label on y-axis for leftmost column (sim)
210208
ylabelvisible = true,
211209
ylabelpadding = 0,
212210
),
213211
:cb => ClimaAnalysis.Utils.kwargs(
214212
vertical = false, # horizontal colorbar
215-
label = "$(sim_var.attributes["long_name"]) $units_label",
213+
label = "$title_stub $units_label",
216214
labelsize = 20,
217215
flipaxis = false, # label underneath colorbar
218216
height = 15,
@@ -234,7 +232,7 @@ function make_paper_figures(
234232
contour = viz.contour2D_on_globe!(
235233
fig,
236234
sim_var_annual_average,
237-
# ylabel = "$(sim_var.attributes["long_name"]) $units_label", # plot variable label on y-axis for leftmost column (sim)
235+
# ylabel = "$title_stub $units_label", # plot variable label on y-axis for leftmost column (sim)
238236
p_loc = (fig_row, 1), # plot in the first column
239237
plot_colorbar = false,
240238
mask = viz.oceanmask(),
@@ -255,7 +253,7 @@ function make_paper_figures(
255253
xgridvisible = false, # don't show lat grid
256254
ygridvisible = false, # don't show lon grid
257255
height = 235,
258-
ylabel = "$(sim_var.attributes["long_name"]) $units_label", # plot variable label on y-axis for leftmost column (sim)
256+
ylabel = "$title_stub $units_label", # plot variable label on y-axis for leftmost column (sim)
259257
ylabelpadding = -5,
260258
ylabelvisible = true,
261259
# limits = clims,
@@ -264,7 +262,7 @@ function make_paper_figures(
264262
)
265263
Makie.Colorbar(
266264
fig[fig_row + 1, 1],
267-
label = "$(sim_var.attributes["long_name"]) $units_label",
265+
label = "$title_stub $units_label",
268266
labelsize = 20,
269267
vertical = false, # horizontal colorbar
270268
flipaxis = false, # label underneath colorbar
@@ -293,7 +291,7 @@ function make_paper_figures(
293291
levels,
294292
p_loc = (fig_row, 2), # plot in the first column
295293
plot_colorbar = true,
296-
# colorbar_label = "$(sim_var.attributes["long_name"]) $units_label",
294+
# colorbar_label = "$title_stub $units_label",
297295
mask = viz.oceanmask(),
298296
cmap_extrema = clims,
299297
more_kwargs = Dict(
@@ -310,7 +308,7 @@ function make_paper_figures(
310308
),
311309
:cb => ClimaAnalysis.Utils.kwargs(
312310
vertical = false, # horizontal colorbar
313-
label = "$(sim_var.attributes["long_name"]) $units_label",
311+
label = "$title_stub $units_label",
314312
labelsize = 20,
315313
flipaxis = false, # label underneath colorbar
316314
height = 15,
@@ -359,7 +357,7 @@ function make_paper_figures(
359357
)
360358
Makie.Colorbar(
361359
fig[fig_row + 1, 2],
362-
label = "$(sim_var.attributes["long_name"]) $units_label",
360+
label = "$title_stub $units_label",
363361
labelsize = 20,
364362
vertical = false, # horizontal colorbar
365363
flipaxis = false, # label underneath colorbar
@@ -386,7 +384,7 @@ function make_paper_figures(
386384
bias_title =
387385
fig_row == 1 ?
388386
CairoMakie.rich("ClimaLand vs ERA5 bias", fontsize = 28) : "" # title of the figure
389-
bias_colorbar_label = "$(sim_var.attributes["long_name"]) $units_label"
387+
bias_colorbar_label = "$title_stub $units_label"
390388
viz.plot_bias_on_globe!(
391389
fig,
392390
sim_var_annual_average,
@@ -510,11 +508,11 @@ function make_paper_figures(
510508

511509

512510
end
513-
save_name = joinpath(root_path, "combined_figures.pdf")
511+
save_name = joinpath(root_path, "combined_figures.png")
514512
save_name =
515-
plot_bias ? joinpath(root_path, "combined_figures_bias.pdf") : save_name
513+
plot_bias ? joinpath(root_path, "combined_figures_bias.png") : save_name
516514
save_name =
517-
plot_seasonal ? joinpath(root_path, "combined_figures_seasonal.pdf") :
515+
plot_seasonal ? joinpath(root_path, "combined_figures_seasonal.png") :
518516
save_name
519517
CairoMakie.save(save_name, fig)
520518
@show save_name

experiments/long_runs/seasonal_paper_plots.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ root_path = joinpath(pwd(), "snowy_land_longrun_gpu")
2222
# outdir = "snowy_land_longrun_gpu-3771-new_default/output_active"
2323
# outdir = "snowy_land_longrun_gpu-3761-new_default/output_active" # on local
2424
# outdir = "snowy_land_longrun_gpu-3761-alpha1/output_active" # on local
25-
outdir = "snowy_land_longrun_gpu-3777-alpha2/output_active" # on local
25+
# outdir = "snowy_land_longrun_gpu-3777-alpha2/output_active" # on local
26+
outdir = "snowy_land_longrun_gpu-3785"
2627
root_path = outdir
2728

2829
short_names = ["lhf", "shf", "lwu", "swu"]
@@ -192,7 +193,7 @@ function make_seasonal_cycle_figure(root_path, outdir, short_names, title_stubs)
192193
font = "TeX Gyre Heros Bold Makie",
193194
)
194195

195-
save_name = joinpath(root_path, "seasonal_cycle.pdf")
196+
save_name = joinpath(root_path, "seasonal_cycle.png")
196197
CairoMakie.save(save_name, fig)
197198
@show save_name
198199
return nothing

0 commit comments

Comments
 (0)