From defc2fe75046929c931ba953f061be7138f3b315 Mon Sep 17 00:00:00 2001 From: Manuel Schlund <32543114+schlunma@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:27:58 +0100 Subject: [PATCH 01/11] Fixed plot paths in NCL provenance tracking (#3422) Co-authored-by: Klaus Zimmermann --- esmvaltool/diag_scripts/austral_jet/asr.ncl | 2 +- esmvaltool/diag_scripts/austral_jet/main.ncl | 2 +- .../diag_scripts/carbon_ec/carbon_beta.ncl | 6 +----- .../carbon_ec/carbon_co2_cycle.ncl | 6 +----- .../carbon_ec/carbon_constraint.ncl | 2 +- .../carbon_ec/carbon_gammaHist.ncl | 2 +- .../ch12_calc_IAV_for_stippandhatch.ncl | 3 +-- .../diag_scripts/mder/select_for_mder.ncl | 2 +- .../diag_scripts/perfmetrics/collect.ncl | 5 +++-- .../russell18jgr/russell18jgr-fig2.ncl | 2 +- .../russell18jgr/russell18jgr-fig3b-2.ncl | 2 +- .../russell18jgr/russell18jgr-fig3b.ncl | 2 +- .../russell18jgr/russell18jgr-fig4.ncl | 2 +- .../russell18jgr/russell18jgr-fig5.ncl | 2 +- .../russell18jgr/russell18jgr-fig5g.ncl | 2 +- .../russell18jgr/russell18jgr-fig6a.ncl | 2 +- .../russell18jgr/russell18jgr-fig6b.ncl | 2 +- .../russell18jgr/russell18jgr-fig7h.ncl | 2 +- .../russell18jgr/russell18jgr-fig7i.ncl | 2 +- .../russell18jgr/russell18jgr-fig9a.ncl | 2 +- .../russell18jgr/russell18jgr-fig9b.ncl | 2 +- .../russell18jgr/russell18jgr-fig9c.ncl | 2 +- .../russell18jgr/russell18jgr-polar.ncl | 2 +- .../tebaldi21esd/calc_IAV_hatching.ncl | 3 +-- .../diag_scripts/xco2_analysis/delta_T.ncl | 2 +- .../diag_scripts/xco2_analysis/global_maps.ncl | 4 ++-- esmvaltool/diag_scripts/xco2_analysis/main.ncl | 6 +++--- .../diag_scripts/xco2_analysis/panel_plots.ncl | 4 ++-- .../diag_scripts/xco2_analysis/sat_masks.ncl | 4 ++-- .../xco2_analysis/station_comparison.ncl | 6 +++--- esmvaltool/interface_scripts/logging.ncl | 18 +++++++++++++++++- 31 files changed, 56 insertions(+), 49 deletions(-) diff --git a/esmvaltool/diag_scripts/austral_jet/asr.ncl b/esmvaltool/diag_scripts/austral_jet/asr.ncl index c12b66f166..5d855ad393 100644 --- a/esmvaltool/diag_scripts/austral_jet/asr.ncl +++ b/esmvaltool/diag_scripts/austral_jet/asr.ncl @@ -289,7 +289,7 @@ begin work_dir = output@work_dir opt = diag_script_info log_info(opt@wdiag) - plot_path = "missing" + plot_path = "n/a" plot_type = "" ; Iterate over all datasets diff --git a/esmvaltool/diag_scripts/austral_jet/main.ncl b/esmvaltool/diag_scripts/austral_jet/main.ncl index 446133e1d5..c078830687 100644 --- a/esmvaltool/diag_scripts/austral_jet/main.ncl +++ b/esmvaltool/diag_scripts/austral_jet/main.ncl @@ -731,7 +731,7 @@ begin if (output) then work_dir := output@work_dir opt = diag_script_info - plot_path = "missing" + plot_path = "n/a" plot_type = "" ; Iterate over all desired diagnostics diff --git a/esmvaltool/diag_scripts/carbon_ec/carbon_beta.ncl b/esmvaltool/diag_scripts/carbon_ec/carbon_beta.ncl index eb43b10cd3..0d6319ea85 100644 --- a/esmvaltool/diag_scripts/carbon_ec/carbon_beta.ncl +++ b/esmvaltool/diag_scripts/carbon_ec/carbon_beta.ncl @@ -279,11 +279,7 @@ begin create_legend_lines(leg@annots, leg, plot_dir + \ DIAG_SCRIPT + "_legend", "markers") - if (file_type .ne. "png") then - plotname = plot_dir + plot_file + "." + file_type - else - plotname = plot_dir + plot_file + ".000001.png" - end if + plotname = plot_dir + plot_file + "." + file_type ; Call provenance logger log_provenance(ncdf_outfile, \ diff --git a/esmvaltool/diag_scripts/carbon_ec/carbon_co2_cycle.ncl b/esmvaltool/diag_scripts/carbon_ec/carbon_co2_cycle.ncl index 7876ffdb62..f37b7bc23a 100644 --- a/esmvaltool/diag_scripts/carbon_ec/carbon_co2_cycle.ncl +++ b/esmvaltool/diag_scripts/carbon_ec/carbon_co2_cycle.ncl @@ -492,11 +492,7 @@ begin ; Write NetCDF output ncdf_outfile = ncdf_write(CO2var, new_path) - if (file_type .ne. "png") then - plotname = plot_dir + plot_file + "." + file_type - else - plotname = plot_dir + plot_file + ".000001.png" - end if + plotname = plot_dir + plot_file + "." + file_type ; ----------------------------------------------------------- ; Call provenance logger diff --git a/esmvaltool/diag_scripts/carbon_ec/carbon_constraint.ncl b/esmvaltool/diag_scripts/carbon_ec/carbon_constraint.ncl index 94d5b8145c..61f1f5c5a3 100644 --- a/esmvaltool/diag_scripts/carbon_ec/carbon_constraint.ncl +++ b/esmvaltool/diag_scripts/carbon_ec/carbon_constraint.ncl @@ -331,7 +331,7 @@ begin ; Call provenance logger log_provenance(ncdf_outfile, \ - output_dir + "." + file_type, \ + output_dir + plot_file + "." + file_type, \ XStg + " vs " + YStg, \ (/"anomaly", "corr", "stddev"/), \ (/"trop", "global"/),\ diff --git a/esmvaltool/diag_scripts/carbon_ec/carbon_gammaHist.ncl b/esmvaltool/diag_scripts/carbon_ec/carbon_gammaHist.ncl index 1479620173..589b0d72e8 100644 --- a/esmvaltool/diag_scripts/carbon_ec/carbon_gammaHist.ncl +++ b/esmvaltool/diag_scripts/carbon_ec/carbon_gammaHist.ncl @@ -336,7 +336,7 @@ begin ; Call provenance logger log_provenance(ncdf_outfile, \ - output_dir + "." + file_type, \ + output_dir + plot_file + "." + file_type, \ XStg + " vs " + YStg, \ (/"anomaly", "corr", "stddev"/), \ (/"trop", "global"/),\ diff --git a/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_IAV_for_stippandhatch.ncl b/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_IAV_for_stippandhatch.ncl index df1ea2375a..e92d60ab43 100644 --- a/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_IAV_for_stippandhatch.ncl +++ b/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_IAV_for_stippandhatch.ncl @@ -410,7 +410,6 @@ begin ; collect meta-data nc_file = ncdf_outfile - plot_file = work_dir + "/None" caption = "Inter-annual variability based on piControl runs." statistics = ("var") domains = ("global") @@ -418,7 +417,7 @@ begin authors = (/"lorenz_ruth"/) references = (/"collins13ipcc"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, "n/a", caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/mder/select_for_mder.ncl b/esmvaltool/diag_scripts/mder/select_for_mder.ncl index 8c9198a8f6..d07cda657f 100644 --- a/esmvaltool/diag_scripts/mder/select_for_mder.ncl +++ b/esmvaltool/diag_scripts/mder/select_for_mder.ncl @@ -97,7 +97,7 @@ begin AUTHORS = (/"wenzel_sabrina", "schlund_manuel"/) DOMAIN = diag_script_info@domain PLOT_TYPE = "" - PLOT_FILE = "missing" + PLOT_FILE = "n/a" REFERENCES = (/"wenzel16jclim"/) ; Get reference dataset(s) diff --git a/esmvaltool/diag_scripts/perfmetrics/collect.ncl b/esmvaltool/diag_scripts/perfmetrics/collect.ncl index 503a9c50d8..a2b14ab733 100644 --- a/esmvaltool/diag_scripts/perfmetrics/collect.ncl +++ b/esmvaltool/diag_scripts/perfmetrics/collect.ncl @@ -502,8 +502,9 @@ begin domains = (/"global"/) ; Call provenance logger - log_provenance(ncdf_outfile, plotpath, caption, statistics, domains, \ - plottype, authors, references, data_files) + log_provenance(ncdf_outfile, plotpath + "." + file_type, caption, \ + statistics, domains, plottype, authors, references, \ + data_files) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl index aa0db4d6a6..034d3a1287 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl @@ -158,7 +158,7 @@ begin ; Call provenance logger log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 2", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl index c182468947..c912663321 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl @@ -274,7 +274,7 @@ begin delete(last_index) delete(out_var) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 3b part 2", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl index 0b6b9d155f..fd4cf3f43b 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl @@ -264,7 +264,7 @@ begin delete(last_index) delete(out_var) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 3b", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl index 10f94a62b2..4e62c7b552 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl @@ -368,7 +368,7 @@ begin delete(totaltransport) ; Call provenance logger log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + file_type, \ "Russell et al 2018 figure 4", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl index bddd26791b..5a60ea03d9 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl @@ -169,7 +169,7 @@ begin delete(dataset) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 5 -polar", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl index 128fb25f43..67d8c53491 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl @@ -226,7 +226,7 @@ begin ; Call provenance logger log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 5g", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl index 29bbe4ace7..206d2909cc 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl @@ -699,7 +699,7 @@ begin ncdf_outfile = ncdf_write(out_var, nc_filename) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 6 part a", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl index bbbf72c72d..2287b62adf 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl @@ -678,7 +678,7 @@ begin ncdf_outfile = ncdf_write(out_var, nc_filename) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 6b", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl index 4a698f455e..249712d29f 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl @@ -164,7 +164,7 @@ begin delete(var_lon_avg) delete(dataset) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 7h", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl index dd56bd4a41..7abcc9e7a9 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl @@ -202,7 +202,7 @@ begin end if log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 7i", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl index 99cf97b2ce..8bef8cb204 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl @@ -317,7 +317,7 @@ begin ncdf_outfile = ncdf_write(outvar, nc_filename) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 9a", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl index bade43d9cf..8afd05425a 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl @@ -335,7 +335,7 @@ begin ncdf_outfile = ncdf_write(outvar, nc_filename) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 9b", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl index e669bac579..0e5c828a6a 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl @@ -331,7 +331,7 @@ begin ncdf_outfile = ncdf_write(outvar, nc_filename) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 figure 9c", \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl index e01771babf..b9c8f1faaa 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl @@ -232,7 +232,7 @@ begin ncdf_outfile = ncdf_write(dataset, nc_filename) delete(dataset) log_provenance(ncdf_outfile, \ - plotpath, \ + plotpath + "." + output_type(), \ "Russell et al 2018 polar plot " + var0, \ "mean", \ "sh", \ diff --git a/esmvaltool/diag_scripts/tebaldi21esd/calc_IAV_hatching.ncl b/esmvaltool/diag_scripts/tebaldi21esd/calc_IAV_hatching.ncl index 8484a00871..f8f0d83511 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/calc_IAV_hatching.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/calc_IAV_hatching.ncl @@ -399,7 +399,6 @@ begin ; collect meta-data nc_file = ncdf_outfile - plot_file = plot_dir + "/None" caption = "Inter-annual variability based on piControl runs." statistics = ("var") domains = ("global") @@ -407,7 +406,7 @@ begin authors = (/"lorenz_ruth"/) references = (/"collins13ipcc"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, "n/a", caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/xco2_analysis/delta_T.ncl b/esmvaltool/diag_scripts/xco2_analysis/delta_T.ncl index af7498d75b..f83f56cb31 100644 --- a/esmvaltool/diag_scripts/xco2_analysis/delta_T.ncl +++ b/esmvaltool/diag_scripts/xco2_analysis/delta_T.ncl @@ -332,7 +332,7 @@ begin ncdf_outfile = ncdf_write(delta_t_detr, outfile_netcdf_dtgr_detr) log_provenance(ncdf_outfile, \ - outfile_netcdf_dtgr_detr, \ + outfile_dtgr_detr + "." + file_type, \ "Sensitivity of interannual variability of " \ + var0 + " growth rate in the " + region + ", " + \ start_year + "-" + end_year + "to the interannual " \ diff --git a/esmvaltool/diag_scripts/xco2_analysis/global_maps.ncl b/esmvaltool/diag_scripts/xco2_analysis/global_maps.ncl index 9aa205db32..d1748425d4 100644 --- a/esmvaltool/diag_scripts/xco2_analysis/global_maps.ncl +++ b/esmvaltool/diag_scripts/xco2_analysis/global_maps.ncl @@ -472,7 +472,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile, \ + outfile + "." + file_type, \ "Maps of mean Seasonal Cycle Amplitude of " + var0 + " " \ + DATASETS(imod) + " for " + start_year + "-" \ + end_year + ". Top: SCA with observational sampling (left)" \ @@ -587,7 +587,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_scap, \ + outfile_scap + "." + file_type, \ "Maps of mean Seasonal Cycle Amplitude of " \ + var0 + " for " + start_year + "-" \ + end_year + ". Similar to Gier et al 2020, Fig 5.", \ diff --git a/esmvaltool/diag_scripts/xco2_analysis/main.ncl b/esmvaltool/diag_scripts/xco2_analysis/main.ncl index 8f585e5f62..0739e52edb 100644 --- a/esmvaltool/diag_scripts/xco2_analysis/main.ncl +++ b/esmvaltool/diag_scripts/xco2_analysis/main.ncl @@ -438,7 +438,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_ts_panels, \ + outfile_ts_panels + "." + file_type, \ "Timeseries, growth rate and seasonal cycle of " \ + var0 + " for " + region + ", " + start_year + "-" \ + end_year + ". Using masking: " + opt_mask \ @@ -550,7 +550,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_grbp, \ + outfile_grbp + "." + file_type, \ "Growth Rate histogram of " \ + var0 + " for " + region + ", " + start_year + "-" \ + end_year + ". Using masking: " + opt_mask \ @@ -653,7 +653,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_sabp, \ + outfile_sabp + "." + file_type, \ "Seasonal Cycle Amplitude histogram of " \ + var0 + " for " + region + ", " + start_year + "-" \ + end_year + ". Using masking: " + opt_mask, \ diff --git a/esmvaltool/diag_scripts/xco2_analysis/panel_plots.ncl b/esmvaltool/diag_scripts/xco2_analysis/panel_plots.ncl index bcd4c82002..08fe30ad0f 100644 --- a/esmvaltool/diag_scripts/xco2_analysis/panel_plots.ncl +++ b/esmvaltool/diag_scripts/xco2_analysis/panel_plots.ncl @@ -360,7 +360,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_scaplot, \ + outfile_scaplot + "." + file_type, \ "Trend of Seasonal Cycle Amplitude with " \ + var0 + " for " + region + ", " + start_year + "-" \ + end_year + ". Using masking: " + opt_mask \ @@ -391,7 +391,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_grplot, \ + outfile_grplot + "." + file_type, \ "Trend of Growth Rate with " \ + var0 + " for " + region + ", " + start_year + "-" \ + end_year + ". Using masking: " + opt_mask \ diff --git a/esmvaltool/diag_scripts/xco2_analysis/sat_masks.ncl b/esmvaltool/diag_scripts/xco2_analysis/sat_masks.ncl index c54df52d90..2bed5c74a6 100644 --- a/esmvaltool/diag_scripts/xco2_analysis/sat_masks.ncl +++ b/esmvaltool/diag_scripts/xco2_analysis/sat_masks.ncl @@ -258,7 +258,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile, \ + outfile + "." + file_type, \ var0 + "fractional data coverage " + start_year + "-" \ + end_year + ". Similar to Gier et al 2020, Fig 1.", \ (/"mean"/), \ @@ -377,7 +377,7 @@ begin delete(res) log_provenance(ncdf_outfile, \ - outfile_c3s, \ + outfile_c3s + "." + file_type, \ var0 + "fractional data coverage for different obs " \ + "periods. Similar to Gier et al 2020, Fig 8.", \ (/"mean"/), \ diff --git a/esmvaltool/diag_scripts/xco2_analysis/station_comparison.ncl b/esmvaltool/diag_scripts/xco2_analysis/station_comparison.ncl index 53734d94db..23155e36fa 100644 --- a/esmvaltool/diag_scripts/xco2_analysis/station_comparison.ncl +++ b/esmvaltool/diag_scripts/xco2_analysis/station_comparison.ncl @@ -285,7 +285,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_stations_masked, \ + outfile_stations_masked + "." + file_type, \ "Time series of station " + station_array&station(istat) \ + ", dotted denoting areas masked like observations.", \ (/""/), \ @@ -334,7 +334,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_stations_obs, \ + outfile_stations_obs + "." + file_type, \ "Time series of station " + station_array&station(istat) \ + ", for " + var0 + " and " + var1 + ".", \ (/"mean"/), \ @@ -501,7 +501,7 @@ begin ; Provenance log_provenance(ncdf_outfile, \ - outfile_map, \ + outfile_map + "." + file_type, \ "Time series for satellite, multi-model mean and station " \ + var0 + " and " + var1 \ + ". Similar to Gier et al, 2020 Fig. 2", \ diff --git a/esmvaltool/interface_scripts/logging.ncl b/esmvaltool/interface_scripts/logging.ncl index 3e1b10b0b2..4cb5ff1498 100644 --- a/esmvaltool/interface_scripts/logging.ncl +++ b/esmvaltool/interface_scripts/logging.ncl @@ -336,6 +336,12 @@ begin if (outfile .ne. "n/a") then suffix = get_file_suffix(outfile, 0) + if (ismissing(suffix)) then + error_msg("f", scriptname, funcname, "got invalid value for outfile " + \ + "(path to figure): '" + outfile + "'; expected path to a " + \ + "file or 'n/a'") + end if + ; For PNGs, additionally check for existence of files like ; "plot_file.000001.png", "plot_file.000002.png", etc. and save ; provenance record for each of them @@ -354,7 +360,10 @@ begin break end if end do - else + end if + + ; For all other cases, use outfile + if (.not. isvar("all_outfiles")) then all_outfiles = outfile end if @@ -362,6 +371,13 @@ begin original_entry = outstring do outfile_idx = 0, dimsizes(all_outfiles) - 1 file_to_add := all_outfiles(outfile_idx) + if (.not. fileexists(outfile)) then + error_msg("f", scriptname, funcname, "outfile (path to figure) '" + \ + file_to_add + "' does not exist (for PNGs, this " + \ + "function also searches for 'FILE.000001.png', " + \ + "'FILE.000002.png', etc.); if no plot file is available " + \ + "use 'n/a'") + end if new_entry = (/original_entry/) new_entry(0) = "? " + file_to_add outstring := array_append_record(outstring, new_entry, 0) From 8d8d4d9a51484e773d6b04fe7567d5c40eaa8709 Mon Sep 17 00:00:00 2001 From: Manuel Schlund <32543114+schlunma@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:20:07 +0100 Subject: [PATCH 02/11] Correctly handle `~` when reading `plot_folder` option of monitoring diagnostic (#3449) --- esmvaltool/diag_scripts/monitor/monitor_base.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/esmvaltool/diag_scripts/monitor/monitor_base.py b/esmvaltool/diag_scripts/monitor/monitor_base.py index 135027f374..21dc159619 100644 --- a/esmvaltool/diag_scripts/monitor/monitor_base.py +++ b/esmvaltool/diag_scripts/monitor/monitor_base.py @@ -97,7 +97,9 @@ def __init__(self, config): ) plot_folder = plot_folder.replace('{plot_dir}', self.cfg[names.PLOT_DIR]) - self.plot_folder = os.path.abspath(plot_folder) + self.plot_folder = os.path.abspath( + os.path.expandvars(os.path.expanduser(plot_folder)) + ) self.plot_filename = config.get( 'plot_filename', '{plot_type}_{real_name}_{dataset}_{mip}_{exp}_{ensemble}') @@ -293,11 +295,7 @@ def get_plot_folder(self, var_info): 'real_name': self._real_name(var_info['variable_group']), **var_info } - folder = os.path.expandvars( - os.path.expanduser( - list(_replace_tags(self.plot_folder, info))[0] - ) - ) + folder = list(_replace_tags(self.plot_folder, info))[0] if self.plot_folder.startswith('/'): folder = '/' + folder if not os.path.isdir(folder): From b1c622875bcbc7806c23855b7bb28de98d9f5740 Mon Sep 17 00:00:00 2001 From: Bouwe Andela Date: Thu, 14 Dec 2023 16:08:20 +0100 Subject: [PATCH 03/11] Fix obs4MIPs frequency in recipe_bock20jgr_fig_1-4.yml (#3473) --- esmvaltool/recipes/bock20jgr/recipe_bock20jgr_fig_1-4.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esmvaltool/recipes/bock20jgr/recipe_bock20jgr_fig_1-4.yml b/esmvaltool/recipes/bock20jgr/recipe_bock20jgr_fig_1-4.yml index 1ae9066ec3..07475e5d74 100644 --- a/esmvaltool/recipes/bock20jgr/recipe_bock20jgr_fig_1-4.yml +++ b/esmvaltool/recipes/bock20jgr/recipe_bock20jgr_fig_1-4.yml @@ -445,7 +445,11 @@ diagnostics: end_year: 1999 additional_datasets: *cmip3_tas additional_datasets: - - {dataset: GPCP-V2.3, project: obs4MIPs, tier: 1, mip: Amon} + - dataset: GPCP-V2.3 + project: obs4MIPs + tier: 1 + mip: Amon + frequency: mon scripts: model_bias: <<: *model_bias_settings From ba04b92bc57056324c373e9eb899b9a3ca5e1133 Mon Sep 17 00:00:00 2001 From: Klaus Zimmermann Date: Thu, 14 Dec 2023 16:13:38 +0100 Subject: [PATCH 04/11] Fix erroneous file_type handling in certain NCL diagnostics (#3474) --- ...12_calc_zonal_cont_diff_mmm_stippandhatch.ncl | 7 ------- .../ipcc_ar5/ch12_plot_map_diff_mmm_stipp.ncl | 7 ------- .../ipcc_ar5/ch12_plot_ts_line_mean_spread.ncl | 12 ++---------- .../ipcc_ar5/ch12_plot_zonal_diff_mmm_stipp.ncl | 6 ------ .../ipcc_ar5/ch12_snw_area_change_fig12-32.ncl | 7 ------- .../ipcc_ar5/ch12_ts_line_mean_spread.ncl | 7 ------- .../tebaldi21esd/calc_table_changes.ncl | 7 ------- .../tebaldi21esd/calc_table_warming_level.ncl | 7 ------- ...meseries_across_realization_stddev_runave.ncl | 7 ------- .../calc_timeseries_mean_spread_runave.ncl | 7 ------- .../calc_timeseries_mean_spread_ssp4.ncl | 7 ------- .../calc_timeseries_mean_spread_ssp5.ncl | 7 ------- .../diag_scripts/tebaldi21esd/plot_pattern.ncl | 7 ------- .../tebaldi21esd/plot_table_changes.ncl | 12 ++---------- .../tebaldi21esd/plot_table_warming_level.ncl | 12 ++---------- ...meseries_across_realization_stddev_runave.ncl | 16 ++++------------ .../tebaldi21esd/plot_timeseries_mean_spread.ncl | 12 ++---------- .../plot_timeseries_mean_spread_3scenarios.ncl | 12 ++---------- ...eries_mean_spread_constrained_projections.ncl | 12 ++---------- ...ot_timeseries_mean_spread_rightaxis_5scen.ncl | 12 ++---------- .../plot_timeseries_mean_spread_ssp4.ncl | 12 ++---------- .../plot_timeseries_mean_spread_ssp5.ncl | 12 ++---------- 22 files changed, 22 insertions(+), 185 deletions(-) diff --git a/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_zonal_cont_diff_mmm_stippandhatch.ncl b/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_zonal_cont_diff_mmm_stippandhatch.ncl index 1952cff668..dbe89529b6 100644 --- a/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_zonal_cont_diff_mmm_stippandhatch.ncl +++ b/esmvaltool/diag_scripts/ipcc_ar5/ch12_calc_zonal_cont_diff_mmm_stippandhatch.ncl @@ -78,13 +78,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_map_diff_mmm_stipp.ncl b/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_map_diff_mmm_stipp.ncl index 720840ff12..77f6441f59 100644 --- a/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_map_diff_mmm_stipp.ncl +++ b/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_map_diff_mmm_stipp.ncl @@ -51,13 +51,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_ts_line_mean_spread.ncl b/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_ts_line_mean_spread.ncl index 838888ae74..20a5e277ea 100644 --- a/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_ts_line_mean_spread.ncl +++ b/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_ts_line_mean_spread.ncl @@ -48,13 +48,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -251,11 +244,10 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type if (isatt(diag_script_info, "spread")) then spread_str = diag_script_info@spread @@ -279,7 +271,7 @@ begin authors = (/"lorenz_ruth"/) references = (/"collins13ipcc"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_zonal_diff_mmm_stipp.ncl b/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_zonal_diff_mmm_stipp.ncl index e58ae142c7..261082f79f 100644 --- a/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_zonal_diff_mmm_stipp.ncl +++ b/esmvaltool/diag_scripts/ipcc_ar5/ch12_plot_zonal_diff_mmm_stipp.ncl @@ -48,12 +48,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/ipcc_ar5/ch12_snw_area_change_fig12-32.ncl b/esmvaltool/diag_scripts/ipcc_ar5/ch12_snw_area_change_fig12-32.ncl index 51c0dcc787..4834f5ccf0 100644 --- a/esmvaltool/diag_scripts/ipcc_ar5/ch12_snw_area_change_fig12-32.ncl +++ b/esmvaltool/diag_scripts/ipcc_ar5/ch12_snw_area_change_fig12-32.ncl @@ -66,13 +66,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/ipcc_ar5/ch12_ts_line_mean_spread.ncl b/esmvaltool/diag_scripts/ipcc_ar5/ch12_ts_line_mean_spread.ncl index c47902d8bb..e488d3a07f 100644 --- a/esmvaltool/diag_scripts/ipcc_ar5/ch12_ts_line_mean_spread.ncl +++ b/esmvaltool/diag_scripts/ipcc_ar5/ch12_ts_line_mean_spread.ncl @@ -47,13 +47,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/calc_table_changes.ncl b/esmvaltool/diag_scripts/tebaldi21esd/calc_table_changes.ncl index a2fc676d9b..0064e2da01 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/calc_table_changes.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/calc_table_changes.ncl @@ -53,13 +53,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/calc_table_warming_level.ncl b/esmvaltool/diag_scripts/tebaldi21esd/calc_table_warming_level.ncl index 01fb0b5c41..942a725275 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/calc_table_warming_level.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/calc_table_warming_level.ncl @@ -55,13 +55,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_across_realization_stddev_runave.ncl b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_across_realization_stddev_runave.ncl index 4e772935e7..5cf278a046 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_across_realization_stddev_runave.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_across_realization_stddev_runave.ncl @@ -56,13 +56,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_runave.ncl b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_runave.ncl index e3c92d5458..ceda4512fb 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_runave.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_runave.ncl @@ -55,13 +55,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp4.ncl b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp4.ncl index a64e5204ef..74baee5d88 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp4.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp4.ncl @@ -54,13 +54,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp5.ncl b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp5.ncl index 938158d37d..0ec3479508 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp5.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/calc_timeseries_mean_spread_ssp5.ncl @@ -54,13 +54,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_pattern.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_pattern.ncl index 109975882b..cd5aeb93c6 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_pattern.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_pattern.ncl @@ -58,13 +58,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_table_changes.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_table_changes.ncl index 115d04b130..60b1e731be 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_table_changes.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_table_changes.ncl @@ -57,13 +57,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -159,13 +152,12 @@ begin gsn_table(wks, ncr4, x4, y4, text4, res4) draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; Collect meta-data netcdf_dir = diag_script_info@input_files(1) datapath = netcdf_dir + "/" + variable_info[0]@diagnostic + ".nc" nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type caption = "Table of global annual mean" + \ variable_info[0]@long_name + " anomalies (relative to " + \ diag_script_info@begin_ref_year + "-" + diag_script_info@end_ref_year + \ @@ -177,7 +169,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") end diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_table_warming_level.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_table_warming_level.ncl index 2d7da64ac5..4bd691b6ea 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_table_warming_level.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_table_warming_level.ncl @@ -55,13 +55,6 @@ begin end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -160,13 +153,12 @@ begin gsn_table(wks, ncr4, x4, y4, text4, res4) draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; Collect meta-data netcdf_dir = diag_script_info@input_files(1) datapath = netcdf_dir + "/" + variable_info[0]@diagnostic + ".nc" nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type caption = text4 statistics = ("mean") domains = ("global") @@ -174,7 +166,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_across_realization_stddev_runave.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_across_realization_stddev_runave.ncl index 04f3f90dab..c562115c2c 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_across_realization_stddev_runave.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_across_realization_stddev_runave.ncl @@ -57,13 +57,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -108,9 +101,9 @@ begin ; *********** PLOTTING ************ ; Create plot variables outfile = var0 + "_ts_line_" + syears(0) + "_" + eyears(nperiods - 1) - wks_type = file_type + wks_type = 0 wks_type@wkPaperSize = "A4" - wks = gsn_open_wks(wks_type, plot_dir + outfile) + wks = get_wks(wks_type, DIAG_SCRIPT, outfile) if(isatt(diag_script_info, "colormap")) then colormap = RGBtoCmap(diag_script_info@colormap) else @@ -229,18 +222,17 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type statistics = ("stddev") domains = ("global") plot_types = ("times") authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread.ncl index 8caaf9c62f..780de8a235 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread.ncl @@ -55,13 +55,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -265,11 +258,10 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type if (isatt(diag_script_info, "spread")) then spread_str = diag_script_info@spread @@ -282,7 +274,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_3scenarios.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_3scenarios.ncl index c95da587a4..6311d01782 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_3scenarios.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_3scenarios.ncl @@ -55,13 +55,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -261,11 +254,10 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type if (isatt(diag_script_info, "spread")) then spread_str = diag_script_info@spread @@ -278,7 +270,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_constrained_projections.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_constrained_projections.ncl index 938804358a..0254d53e03 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_constrained_projections.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_constrained_projections.ncl @@ -67,13 +67,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -334,11 +327,10 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type if (isatt(diag_script_info, "spread")) then spread_str = diag_script_info@spread @@ -351,7 +343,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_rightaxis_5scen.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_rightaxis_5scen.ncl index 475f9cbf56..72990171bc 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_rightaxis_5scen.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_rightaxis_5scen.ncl @@ -58,13 +58,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -279,11 +272,10 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type if (isatt(diag_script_info, "spread")) then spread_str = diag_script_info@spread @@ -296,7 +288,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp4.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp4.ncl index 4162ec01c4..be50e29bb2 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp4.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp4.ncl @@ -55,13 +55,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -268,11 +261,10 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type if (isatt(diag_script_info, "spread")) then spread_str = diag_script_info@spread @@ -285,7 +277,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") diff --git a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp5.ncl b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp5.ncl index edbf881e49..9570b09ae4 100644 --- a/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp5.ncl +++ b/esmvaltool/diag_scripts/tebaldi21esd/plot_timeseries_mean_spread_ssp5.ncl @@ -55,13 +55,6 @@ end begin - ; Get environment variables - if (isatt(diag_script_info, "plot_type")) then - file_type = diag_script_info@plot_type - else - file_type = "pdf" - end if - ; Output netcdf directory work_dir = config_user_info@work_dir system("mkdir -p " + work_dir) @@ -253,11 +246,10 @@ begin draw(wks) frame(wks) - log_info(" Wrote " + plot_dir + "/" + outfile + "." + file_type) + log_info(" Wrote " + wks@fullname) ; collect meta-data nc_file = datapath - plot_file = plot_dir + "/" + outfile + "." + file_type if (isatt(diag_script_info, "spread")) then spread_str = diag_script_info@spread @@ -270,7 +262,7 @@ begin authors = (/"debeire_kevin"/) references = (/"tebaldi21esd"/) infiles = metadata_att_as_array(info_items, "filename") - log_provenance(nc_file, plot_file, caption, statistics, domains, \ + log_provenance(nc_file, wks@fullname, caption, statistics, domains, \ plot_types, authors, references, infiles) leave_msg(DIAG_SCRIPT, "") From 32962f06810c8f894081eababbfd2851b6624e6b Mon Sep 17 00:00:00 2001 From: Klaus Zimmermann Date: Thu, 14 Dec 2023 16:32:42 +0100 Subject: [PATCH 05/11] Adapt to changed style scheme name in matplotlib (#3475) --- esmvaltool/recipes/recipe_landcover.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esmvaltool/recipes/recipe_landcover.yml b/esmvaltool/recipes/recipe_landcover.yml index d324c02dc9..75c892b37c 100644 --- a/esmvaltool/recipes/recipe_landcover.yml +++ b/esmvaltool/recipes/recipe_landcover.yml @@ -67,5 +67,5 @@ diagnostics: landcover: script: landcover/landcover.py comparison: variable - colorscheme: seaborn-darkgrid + colorscheme: seaborn-v0_8-darkgrid From 54ec50daa2a13d197e5d1267d4ef4e4c9456b3d9 Mon Sep 17 00:00:00 2001 From: Manuel Schlund <32543114+schlunma@users.noreply.github.com> Date: Fri, 15 Dec 2023 11:12:53 +0100 Subject: [PATCH 06/11] Fix NCL provenance tracking (#3477) --- esmvaltool/interface_scripts/logging.ncl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esmvaltool/interface_scripts/logging.ncl b/esmvaltool/interface_scripts/logging.ncl index 4cb5ff1498..6333479f96 100644 --- a/esmvaltool/interface_scripts/logging.ncl +++ b/esmvaltool/interface_scripts/logging.ncl @@ -371,7 +371,7 @@ begin original_entry = outstring do outfile_idx = 0, dimsizes(all_outfiles) - 1 file_to_add := all_outfiles(outfile_idx) - if (.not. fileexists(outfile)) then + if (.not. fileexists(file_to_add)) then error_msg("f", scriptname, funcname, "outfile (path to figure) '" + \ file_to_add + "' does not exist (for PNGs, this " + \ "function also searches for 'FILE.000001.png', " + \ From cda8c8598f3628fd549626c9aacb21c535229ede Mon Sep 17 00:00:00 2001 From: Manuel Schlund <32543114+schlunma@users.noreply.github.com> Date: Tue, 19 Dec 2023 09:33:33 +0100 Subject: [PATCH 07/11] Fix plots and provenance in Russell diagnostics (#3479) Co-authored-by: Axel Lauer --- .../russell18jgr/russell18jgr-fig2.ncl | 26 ++++++++++--------- .../russell18jgr/russell18jgr-fig3b-2.ncl | 23 +++++++++------- .../russell18jgr/russell18jgr-fig3b.ncl | 23 +++++++++------- .../russell18jgr/russell18jgr-fig4.ncl | 23 ++++++++-------- .../russell18jgr/russell18jgr-fig5.ncl | 23 ++++++++-------- .../russell18jgr/russell18jgr-fig5g.ncl | 26 ++++++++++--------- .../russell18jgr/russell18jgr-fig6a.ncl | 2 +- .../russell18jgr/russell18jgr-fig6b.ncl | 2 +- .../russell18jgr/russell18jgr-fig7h.ncl | 23 +++++++++------- .../russell18jgr/russell18jgr-fig7i.ncl | 24 +++++++++-------- .../russell18jgr/russell18jgr-fig9a.ncl | 4 ++- .../russell18jgr/russell18jgr-fig9b.ncl | 4 ++- .../russell18jgr/russell18jgr-fig9c.ncl | 4 ++- .../russell18jgr/russell18jgr-polar.ncl | 17 ++++++------ 14 files changed, 124 insertions(+), 100 deletions(-) diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl index 034d3a1287..db6426cc3a 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig2.ncl @@ -76,7 +76,7 @@ begin colors = project_style(input_file_info, diag_script_info, "colors") dashes = project_style(input_file_info, diag_script_info, "dashes") thicks = project_style(input_file_info, diag_script_info, "thicks") - plotpath = config_user_info@plot_dir + "/russell18jgr_fig2_" \ + plotpath = config_user_info@plot_dir + "russell18jgr_fig2_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -156,17 +156,6 @@ begin delete(var_lon_avg) delete(dataset) - ; Call provenance logger - log_provenance(ncdf_outfile, \ - plotpath + "." + output_type(), \ - "Russell et al 2018 figure 2", \ - "mean", \ - "sh", \ - "geo", \ - "russell_joellen", \ - "russell18jgr", \ - infile_path) - if (iii .ne. 0) then overlay(plot(0), plot(iii)) end if @@ -192,4 +181,17 @@ begin "lgLineDashSegLenF" : 0.11 end create draw(legend) + + frame(wks) + + ; Call provenance logger + log_provenance(ncdf_outfile, \ + plotpath + "." + output_type(), \ + "Russell et al 2018 figure 2", \ + "mean", \ + "sh", \ + "geo", \ + "russell_joellen", \ + "russell18jgr", \ + infile_path) end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl index c912663321..add52a2b7a 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b-2.ncl @@ -72,7 +72,7 @@ begin thicks = project_style(input_file_info, diag_script_info, "thicks") plotpath = config_user_info@plot_dir \ - + "/russell18jgr_fig3_Polar-Front-position_" \ + + "russell18jgr_fig3_Polar-Front-position_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -273,15 +273,6 @@ begin delete(e) delete(last_index) delete(out_var) - log_provenance(ncdf_outfile, \ - plotpath + "." + output_type(), \ - "Russell et al 2018 figure 3b part 2", \ - "mean", \ - "sh", \ - "geo", \ - "russell_joellen", \ - "russell18jgr", \ - inputfile_paths(iii)) end do draw(plot(0)) @@ -301,4 +292,16 @@ begin end create draw(legend) + frame(wks) + + log_provenance(ncdf_outfile, \ + plotpath + "." + output_type(), \ + "Russell et al 2018 figure 3b part 2", \ + "mean", \ + "sh", \ + "geo", \ + "russell_joellen", \ + "russell18jgr", \ + inputfile_paths) + end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl index fd4cf3f43b..41ee0c3194 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig3b.ncl @@ -69,7 +69,7 @@ begin dashes = project_style(input_file_info, diag_script_info, "dashes") thicks = project_style(input_file_info, diag_script_info, "thicks") - plotpath = config_user_info@plot_dir + "/Russell18jgr_fig3_Subantarctic" \ + plotpath = config_user_info@plot_dir + "Russell18jgr_fig3_Subantarctic" \ + "-Fronts_" + sprinti("%0.4i", min(toint(start_years_data))) \ + "-" + sprinti("%0.4i", max(toint(end_years_data))) @@ -263,15 +263,6 @@ begin delete(e) delete(last_index) delete(out_var) - log_provenance(ncdf_outfile, \ - plotpath + "." + output_type(), \ - "Russell et al 2018 figure 3b", \ - "mean", \ - "sh", \ - "geo", \ - "russell_joellen", \ - "russell18jgr", \ - inputfile_paths(iii)) end do draw(plot(0)) @@ -291,4 +282,16 @@ begin end create draw(legend) + frame(wks) + + log_provenance(ncdf_outfile, \ + plotpath + "." + output_type(), \ + "Russell et al 2018 figure 3b", \ + "mean", \ + "sh", \ + "geo", \ + "russell_joellen", \ + "russell18jgr", \ + inputfile_paths) + end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl index 4e62c7b552..b03b81959f 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig4.ncl @@ -93,7 +93,7 @@ begin (/238, 91, 12/), (/209, 49, 7/), (/178, 0, 0/) /) colors_new = colors_new / 256.0 - plotpath = config_user_info@plot_dir + "/Russell18jgr-fig4_" \ + plotpath = config_user_info@plot_dir + "Russell18jgr-fig4_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -366,16 +366,6 @@ begin delete(var_final) delete(exact_lon) delete(totaltransport) - ; Call provenance logger - log_provenance(ncdf_outfile, \ - plotpath + "." + file_type, \ - "Russell et al 2018 figure 4", \ - "mean", \ - "sh", \ - "geo", \ - "russell_joellen", \ - "russell18jgr", \ - (/inputfile_paths(iii), volfile_paths(iii)/)) end do @@ -389,4 +379,15 @@ begin + "This is not an error, no response is needed by user for " \ + "plotting. ") end if + + ; Call provenance logger + log_provenance(ncdf_outfile, \ + plotpath + "." + file_type, \ + "Russell et al 2018 figure 4", \ + "mean", \ + "sh", \ + "geo", \ + "russell_joellen", \ + "russell18jgr", \ + inputfile_paths) end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl index 5a60ea03d9..62a5a6be1a 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5.ncl @@ -59,7 +59,7 @@ end begin - plotpath = config_user_info@plot_dir + "/russell18jgr-fig5_" + var0 + "_" \ + plotpath = config_user_info@plot_dir + "russell18jgr-fig5_" + var0 + "_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -168,16 +168,6 @@ begin ncdf_outfile = ncdf_write(dataset, nc_filename) delete(dataset) - log_provenance(ncdf_outfile, \ - plotpath + "." + output_type(), \ - "Russell et al 2018 figure 5 -polar", \ - "mean", \ - "sh", \ - "geo", \ - "russell_joellen", \ - "russell18jgr", \ - infile_path) - end do ; Draw the panel @@ -185,4 +175,15 @@ begin pres@gsnPanelLabelBar = False outfile = panelling(wks, plots, nvert, nhori, pres) + log_provenance(ncdf_outfile, \ + plotpath + "." + output_type(), \ + "Russell et al 2018 figure 5 -polar", \ + "mean", \ + "sh", \ + "geo", \ + "russell_joellen", \ + "russell18jgr", \ + infile_path) + + end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl index 67d8c53491..0b48c1e7ed 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig5g.ncl @@ -84,7 +84,7 @@ begin dashes = project_style(input_file_info, diag_script_info, "dashes") thicks = project_style(input_file_info, diag_script_info, "thicks") - plotpath = config_user_info@plot_dir + "/russell18jgr-fig5g_" + var0 + "_" \ + plotpath = config_user_info@plot_dir + "russell18jgr-fig5g_" + var0 + "_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -224,17 +224,6 @@ begin overlay(plots(0), plots(iii)) end if - ; Call provenance logger - log_provenance(ncdf_outfile, \ - plotpath + "." + output_type(), \ - "Russell et al 2018 figure 5g", \ - "mean", \ - "sh", \ - "times", \ - "russell_joellen", \ - "russell18jgr", \ - infile_path) - end do draw(plots(0)) @@ -261,4 +250,17 @@ begin "not an error, no responce is needed by user for plotting ") end if + frame(wks) + + ; Call provenance logger + log_provenance(ncdf_outfile, \ + plotpath + "." + output_type(), \ + "Russell et al 2018 figure 5g", \ + "mean", \ + "sh", \ + "times", \ + "russell_joellen", \ + "russell18jgr", \ + infile_path) + end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl index 206d2909cc..bd672ed3cf 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6a.ncl @@ -90,7 +90,7 @@ end begin - plotpath = config_user_info@plot_dir + "/Russell_figure-6a_" \ + plotpath = config_user_info@plot_dir + "Russell_figure-6a_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl index 2287b62adf..6b019625f0 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig6b.ncl @@ -92,7 +92,7 @@ end begin - plotpath = config_user_info@plot_dir + "/russell18jgr-fig6b_" \ + plotpath = config_user_info@plot_dir + "russell18jgr-fig6b_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl index 249712d29f..7700790e65 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7h.ncl @@ -64,7 +64,7 @@ begin dashes = project_style(input_file_info, diag_script_info, "dashes") thicks = project_style(input_file_info, diag_script_info, "thicks") - plotpath = config_user_info@plot_dir + "/Russell_figure7h_" + var0 + "_" \ + plotpath = config_user_info@plot_dir + "Russell_figure7h_" + var0 + "_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -163,15 +163,6 @@ begin ncdf_outfile = ncdf_write(var_lon_avg, nc_filename) delete(var_lon_avg) delete(dataset) - log_provenance(ncdf_outfile, \ - plotpath + "." + output_type(), \ - "Russell et al 2018 figure 7h", \ - "mean", \ - "sh", \ - "zonal", \ - "russell_joellen", \ - "russell18jgr", \ - infile_path) end do draw(plot(0)) @@ -192,4 +183,16 @@ begin end create draw(legend) + frame(wks) + + log_provenance(ncdf_outfile, \ + plotpath + "." + output_type(), \ + "Russell et al 2018 figure 7h", \ + "mean", \ + "sh", \ + "zonal", \ + "russell_joellen", \ + "russell18jgr", \ + infile_path) + end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl index 7abcc9e7a9..86ce4bee70 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig7i.ncl @@ -61,7 +61,7 @@ begin var0 = variable_info[0]@short_name - plotpath = config_user_info@plot_dir + "/Russell_figure7i_" + var0 + "_" \ + plotpath = config_user_info@plot_dir + "Russell_figure7i_" + var0 + "_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -201,16 +201,6 @@ begin overlay(plot(0), plot(iii)) end if - log_provenance(ncdf_outfile, \ - plotpath + "." + output_type(), \ - "Russell et al 2018 figure 7i", \ - "mean", \ - "sh", \ - "zonal", \ - "russell_joellen", \ - "russell18jgr", \ - infile_path) - end do draw(plot(0)) @@ -230,4 +220,16 @@ begin end create draw(legend) + frame(wks) + + log_provenance(ncdf_outfile, \ + plotpath + "." + output_type(), \ + "Russell et al 2018 figure 7i", \ + "mean", \ + "sh", \ + "zonal", \ + "russell_joellen", \ + "russell18jgr", \ + infile_path) + end diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl index 8bef8cb204..24ebe3f12e 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9a.ncl @@ -103,7 +103,7 @@ end begin - plotpath = config_user_info@plot_dir + "/russell18jgr-fig9a_" \ + plotpath = config_user_info@plot_dir + "russell18jgr-fig9a_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -297,6 +297,8 @@ begin end create draw(legend) + frame(wks) + do idd = 0, dimsizes(lat_width) - 1 nc_filename = config_user_info@work_dir + "russell18jgr_fig9a_" \ + annots(idd) + "_" + (start_years_data(idd)) + "-" \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl index 8afd05425a..112cd846f5 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9b.ncl @@ -94,7 +94,7 @@ end begin - plotpath = config_user_info@plot_dir + "/russell18jgr-fig9b_" \ + plotpath = config_user_info@plot_dir + "russell18jgr-fig9b_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -315,6 +315,8 @@ begin end create draw(legend) + frame(wks) + do idd = 0, dimsizes(lat_width) - 1 nc_filename = config_user_info@work_dir + "russell18jgr_fig9b_" \ + annots(idd) + "_" + (start_years_data(idd)) + "-" \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl index 0e5c828a6a..2fe0cc3e4a 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-fig9c.ncl @@ -107,7 +107,7 @@ end begin - plotpath = config_user_info@plot_dir + "/russell18jgr-fig9c_" \ + plotpath = config_user_info@plot_dir + "russell18jgr-fig9c_" \ + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -312,6 +312,8 @@ begin end create draw(legend) + frame(wks) + do idd = 0, dimsizes(lat_width) - 1 nc_filename = config_user_info@work_dir + "russell18jgr_fig9c_" \ + annots(idd) + "_" + (start_years_data(idd)) + "-" \ diff --git a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl index b9c8f1faaa..106f161801 100644 --- a/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl +++ b/esmvaltool/diag_scripts/russell18jgr/russell18jgr-polar.ncl @@ -77,7 +77,7 @@ end begin - plotpath = config_user_info@plot_dir + "/Russell_polar-contour_" + var0 + \ + plotpath = config_user_info@plot_dir + "Russell_polar-contour_" + var0 + \ "_" + sprinti("%0.4i", min(toint(start_years_data))) + "-" \ + sprinti("%0.4i", max(toint(end_years_data))) @@ -231,6 +231,13 @@ begin ncdf_outfile = ncdf_write(dataset, nc_filename) delete(dataset) + end do + + ; Draw the panel + pres = True + pres@gsnPanelLabelBar = False + outfile = panelling(wks, plots, nvert, nhori, pres) + log_provenance(ncdf_outfile, \ plotpath + "." + output_type(), \ "Russell et al 2018 polar plot " + var0, \ @@ -239,11 +246,5 @@ begin "geo", \ "russell_joellen", \ "russell18jgr", \ - inputfile_paths(iii)) - end do - - ; Draw the panel - pres = True - pres@gsnPanelLabelBar = False - outfile = panelling(wks, plots, nvert, nhori, pres) + inputfile_paths) end From 7d61dc1c62bc3cab71bfc928e0225fa6ae984c8f Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Thu, 7 Dec 2023 07:45:58 +0000 Subject: [PATCH 08/11] regenerate Anconda shield/badge not to have ESMValTool version hardcoded in image name (#3453) Co-authored-by: Bouwe Andela --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71403fbf90..d170ee2f20 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/79bf6932c2e844eea15d0fb1ed7e415c)](https://www.codacy.com/gh/ESMValGroup/ESMValTool?utm_source=github.com&utm_medium=referral&utm_content=ESMValGroup/ESMValTool&utm_campaign=Badge_Coverage) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/79bf6932c2e844eea15d0fb1ed7e415c)](https://www.codacy.com/gh/ESMValGroup/ESMValTool?utm_source=github.com&utm_medium=referral&utm_content=ESMValGroup/ESMValTool&utm_campaign=Badge_Grade) [![Docker Build Status](https://img.shields.io/docker/cloud/build/esmvalgroup/esmvaltool.svg)](https://hub.docker.com/r/esmvalgroup/esmvaltool/) -[![Anaconda-Server Badge](https://img.shields.io/badge/Anaconda.org-2.9.0-blue.svg)](https://anaconda.org/conda-forge/esmvaltool) +[![Anaconda-Server Badge](https://img.shields.io/conda/vn/conda-forge/ESMValTool?color=blue&label=conda-forge&logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/esmvaltool) ![stand with Ukraine](https://badgen.net/badge/stand%20with/UKRAINE/?color=0057B8&labelColor=FFD700) ![esmvaltoollogo](https://raw.githubusercontent.com/ESMValGroup/ESMValTool/main/doc/sphinx/source/figures/ESMValTool-logo-2.png) From c8c06bdd48415fa0c76b3ec0b02d9b21d16252f1 Mon Sep 17 00:00:00 2001 From: Bouwe Andela Date: Tue, 19 Dec 2023 16:42:35 +0100 Subject: [PATCH 09/11] Add v2.10 release notes (#3485) Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com> --- CITATION.cff | 4 +- doc/sphinx/source/changelog.rst | 110 ++++++++++++++++++ .../source/recipes/broken_recipe_list.rst | 10 +- 3 files changed, 121 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 147e3acd17..cca827c46d 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -388,11 +388,11 @@ authors: orcid: "https://orcid.org/0000-0003-3780-0784" cff-version: 1.2.0 -date-released: 2023-07-06 +date-released: 2023-12-19 doi: "10.5281/zenodo.3401363" license: "Apache-2.0" message: "If you use this software, please cite it using these metadata." repository-code: "https://github.com/ESMValGroup/ESMValTool/" title: ESMValTool -version: "v2.9.0" +version: "v2.10.0" ... diff --git a/doc/sphinx/source/changelog.rst b/doc/sphinx/source/changelog.rst index 52c3aa3086..e06be38aa0 100644 --- a/doc/sphinx/source/changelog.rst +++ b/doc/sphinx/source/changelog.rst @@ -3,6 +3,116 @@ Changelog ========= +v2.10.0 +------- +Highlights + +- Add a realistic IPCC example recipe that reproduces figure 9.3 from AR6. It + computes the mean sea-surface temperature anomaly between 1850-2100 over all + available CMIP6 models. See the :ref:`recipe documentation ` + or read the `blog post `__ + for more information. + +- Added more plot types to monitoring diagnostic: Hovmoeller Z vs. time, + Hovmoeller time vs latlon, variable vs. latitude are now available. See the + :ref:`recipe documentation ` for more information. + +- Add support for 4 new datasets: + + - NOAA-CIRES-20CR v3 reanalysis + - NASA MERRA reanalysis + - NOAA marine boundary layer data for CH4 + - MOBO-DIC2004-2019 + + See :ref:`supported_datasets` and :ref:`inputdata_observations` for more + information. + +- Many recipes now have up-to-date obs4MIPs dataset names so required data can + automatically be downloaded from ESGF. + +This release includes + +Bug fixes +~~~~~~~~~ + +- Update recipe shapeselect to work with shapely v2 (`#3283 `__) `Lukas `__ +- Correctly handle ``~`` when reading ``plot_folder`` option of monitoring diagnostic (`#3449 `__) `Manuel Schlund `__ +- Fixed provenance tracking for NCL multipanel PNGs (`#3332 `__) `Manuel Schlund `__ +- Fixed plot paths in NCL provenance tracking (`#3422 `__) `Manuel Schlund `__ +- Fix erroneous file_type handling in certain NCL diagnostics (`#3474 `__) `Klaus Zimmermann `__ +- Fix NCL provenance tracking (`#3477 `__) `Manuel Schlund `__ +- Fix plots and provenance in Russell diagnostics (`#3479 `__) `Manuel Schlund `__ + +Documentation +~~~~~~~~~~~~~ + +- Add merge instructions to release instructions (`#3292 `__) `Rémi Kazeroni `__ +- Update release schedule after release of v2.9.0 (`#3289 `__) `Rémi Kazeroni `__ +- Add list of failing recipes for v2.9.0 release (`#3294 `__) `Rémi Kazeroni `__ +- Update ``mamba`` version in readthedocs configuration docs builds (`#3310 `__) `Valeriu Predoi `__ +- Add Romain Beucher to citation file as contributor (`#3318 `__) `Valeriu Predoi `__ +- Removed recipe_carvalhais14nat from list of broken recipes (`#3319 `__) `Rémi Kazeroni `__ +- Add `OBS-maintainers `__ team to documentation on OBS data maintenance and CMORizer reviews (`#3335 `__) `Rémi Kazeroni `__ +- Add Pauline Bonnet to citation file (`#3347 `__) `Paulinebonnet111 `__ +- Ensure compatible zstandard and zstd in readthedocs builds (`#3362 `__) `Klaus Zimmermann `__ +- Fix documentation build (`#3397 `__) `Bouwe Andela `__ +- Minor updates to release tools (`#3216 `__) `Bouwe Andela `__ +- Enhance provenance documentation (`#3305 `__) `Alistair Sellar `__ +- Re-add communities and grants in zenodo file (`#3416 `__) `Valeriu Predoi `__ +- Update Anconda badge in README (`#3375 `__, `#3453 `__) `Valeriu Predoi `__ + +Diagnostics +~~~~~~~~~~~ + +- Slight refactoring of diagnostic script ``galytska23/select_variables_for_tigramite.py`` for generality and portability (`#3298 `__) `Valeriu Predoi `__ and `Evgenia Galytska `__ +- Allow custom variable grouping in diagnostic script ``monitor/multi_datasets.py`` (`#3343 `__) `Manuel Schlund `__ +- Extended monitor diagnostic with plot type variable vs. latitude (`#3340 `__) `ellensarauer `__ +- Add Hovmoeller Z vs. time plot to monitoring diagnostic (`#3345 `__) `cubeme `__ and `helgehr `__ +- Adding Hovmoeller time vs latlon plots to monitoring recipes (`#3341 `__) `Lukas `__ and `jeremykraftdlr `__ +- Implied heat transport new diagnostic (`#3177 `__) `Alejandro Bodas `__ +- Recipe changes for new statistics preprocessors (percentiles) (`#3351 `__) `Manuel Schlund `__ +- Add a realistic example recipe (`#3356 `__) `Peter9192 `__ and `Bouwe Andela `__ +- Support ``CenteredNorm`` in diagnostic monitor/multidatasets.py (`#3415 `__) `Manuel Schlund `__ +- Use new preprocessor statistics calling convention for recipe_easy_ipcc.yml (`#3418 `__) `Bouwe Andela `__ +- Adapt to changed style scheme name in matplotlib (`#3475 `__) `Klaus Zimmermann `__ +- Add version to dataset in python example recipe to avoid "Unknown file format" issue on JASMIN (`#3322 `__) `Emma Hogan `__ +- Add the dataset version in the heatwaves_coldwaves recipe to avoid the "Unknown file format" issue on JASMIN (`#3373 `__) `Emma Hogan `__ + +Observational and re-analysis dataset support +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- Cmorizer for NOAA-CIRES-20CR v3 reanalysis (clt, clwvi, hus, prw, rlut, rlutcs, rsut, rsutcs) (`#3137 `__) `Lisa Bock `__ +- CMORizer for NASA MERRA reanalysis (`#3039 `__) `Axel Lauer `__ +- Download and formatting of NOAA marine boundary layer data for CH4 (NOAA-MBL-CH4) (`#3301 `__) `FranziskaWinterstein `__ +- Added CMORizer for MOBO-DIC2004-2019 (`#3297 `__) `Manuel Schlund `__ +- Update obs4MIPs dataset names in quantilebias recipe (`#3330 `__) `Romain Beucher `__ +- Update obs4MIPs dataset names in Schlund20esd recipe (`#3329 `__) `Romain Beucher `__ +- Update obs4MIPs dataset names in flatoipcc recipes (`#3328 `__) `Romain Beucher `__ +- Update obs4mips dataset names in clouds recipes (`#3326 `__) `Romain Beucher `__ +- Update Obs4MIPs dataset names in ECS recipes (`#3327 `__) `Romain Beucher `__ +- Update obs4mips dataset names in Bock et al recipes (`#3324 `__, `#3389 `__ and `#3473 `__) `Romain Beucher `__ and `Bouwe Andela `__ +- Update obs4mips dataset names in radiation budget recipe (`#3323 `__) `Romain Beucher `__ +- Update Obs4MIPs dataset names in perfmetrics CMIP5 recipe (`#3325 `__) `Romain Beucher `__ + +Automatic testing +~~~~~~~~~~~~~~~~~ + +- Made sklearn test backwards-compatible with sklearn < 1.3 (`#3285 `__) `Manuel Schlund `__ +- Update conda lock creation Github Action workflow and ship updated conda-lock file (`#3307 `__, `#3407 `__) `Valeriu Predoi `__ +- Compress all bash shell setters into one default option per GitHub Action workflow (`#3315 `__) `Valeriu Predoi `__ +- Remove deprecated option ``offline`` from CI configuration (`#3367 `__) `Manuel Schlund `__ + +Installation +~~~~~~~~~~~~ + +- Use ESMValCore v2.10.0 release candidates (`#3404 `__) `Klaus Zimmermann `__ + +Improvements +~~~~~~~~~~~~ + +- Merge v2.9.x into main (`#3286 `__) `Manuel Schlund `__ +- Allow NCL unit conversion `kg s-1` -> `GtC y-1` (`#3300 `__) `Manuel Schlund `__ + .. _changelog-v2-9-0: v2.9.0 diff --git a/doc/sphinx/source/recipes/broken_recipe_list.rst b/doc/sphinx/source/recipes/broken_recipe_list.rst index 18471b2382..e2c5b874d8 100644 --- a/doc/sphinx/source/recipes/broken_recipe_list.rst +++ b/doc/sphinx/source/recipes/broken_recipe_list.rst @@ -20,7 +20,15 @@ More details can be found in the :ref:`broken recipe policy - `ERA5_native6` - Derivation of custom variables `rlus` and `rsus` - `#1388 `_ + * - :ref:`recipe_julia.yml ` + - `example` + - fill values are not interpreted, resulting in an unusable plot + - `#2595 `_ * - :ref:`recipe_seaice_drift.yml ` - `sea_ice_drift_SCICEX` - - ``shapely`` issue + - ``shapely 2`` issue - `#3243 `_ + * - :ref:`recipe_pysplot.yml ` + - `plot_map` + - ``shapely 2`` issue + - `#3483 `_ From e869d157579e91f6ecfc91a6258f49bd43c69cc6 Mon Sep 17 00:00:00 2001 From: Bouwe Andela Date: Tue, 19 Dec 2023 20:16:28 +0100 Subject: [PATCH 10/11] Use ESMValCore v2.10 (#3486) --- doc/sphinx/source/changelog.rst | 2 +- environment.yml | 4 ++-- environment_osx.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/sphinx/source/changelog.rst b/doc/sphinx/source/changelog.rst index e06be38aa0..068a94a45b 100644 --- a/doc/sphinx/source/changelog.rst +++ b/doc/sphinx/source/changelog.rst @@ -105,7 +105,7 @@ Automatic testing Installation ~~~~~~~~~~~~ -- Use ESMValCore v2.10.0 release candidates (`#3404 `__) `Klaus Zimmermann `__ +- Use ESMValCore v2.10 (`#3486 `__) `Bouwe Andela `__ Improvements ~~~~~~~~~~~~ diff --git a/environment.yml b/environment.yml index fb2e5adb14..6409a35e6a 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: # The release candidate channel should only be activated # during the rc phase right before the next release of the # ESMValCore. - - conda-forge/label/esmvalcore_rc + # - conda-forge/label/esmvalcore_rc - conda-forge - nodefaults @@ -24,7 +24,7 @@ dependencies: - ecmwf-api-client - eofs - esmpy - - esmvalcore =2.10.0rc1 + - esmvalcore 2.10.* - fiona - fire - gdal diff --git a/environment_osx.yml b/environment_osx.yml index 0734dee2c6..7207ec9112 100644 --- a/environment_osx.yml +++ b/environment_osx.yml @@ -4,7 +4,7 @@ channels: # The release candidate channel should only be activated # during the rc phase right before the next release of the # ESMValCore. - - conda-forge/label/esmvalcore_rc + # - conda-forge/label/esmvalcore_rc - conda-forge - nodefaults @@ -24,7 +24,7 @@ dependencies: - ecmwf-api-client - eofs - esmpy - - esmvalcore =2.10.0rc1 + - esmvalcore 2.10.* - fiona - fire - gdal From 7e1ffaad0313629eaec39664ecf7df3b45e8d89c Mon Sep 17 00:00:00 2001 From: Bouwe Andela Date: Wed, 20 Dec 2023 08:45:54 +0100 Subject: [PATCH 11/11] Update release date --- CITATION.cff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index cca827c46d..5c253e3bb5 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -388,7 +388,7 @@ authors: orcid: "https://orcid.org/0000-0003-3780-0784" cff-version: 1.2.0 -date-released: 2023-12-19 +date-released: 2023-12-20 doi: "10.5281/zenodo.3401363" license: "Apache-2.0" message: "If you use this software, please cite it using these metadata."