From 438e9bc08041829808dac283e35192366146d3ac Mon Sep 17 00:00:00 2001 From: Hsiang-He Lee Date: Mon, 5 Jun 2023 13:36:50 -0500 Subject: [PATCH] skip NOAA CO plot when simulation period does not match obs. --- ChemDyg_example_script.cfg | 2 +- chemdyg/templates/chemdyg_noaa_co_comparison.bash | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChemDyg_example_script.cfg b/ChemDyg_example_script.cfg index e9ef5da..246588b 100644 --- a/ChemDyg_example_script.cfg +++ b/ChemDyg_example_script.cfg @@ -6,7 +6,7 @@ case = 20230221.F20TR.NGD_v3atm_v2.1oi_alt www = /lcrc/group/e3sm/public_html/diagnostic_output/ac.lee1061 partition = compute e3sm_unified = latest -plugins = "/home/ac.lee1061/zppy_code/ChemDyg/e3sm_chem_diags.py", +plugins = "chemdyg", [climo] active = True diff --git a/chemdyg/templates/chemdyg_noaa_co_comparison.bash b/chemdyg/templates/chemdyg_noaa_co_comparison.bash index 7d1d69d..f64b27d 100644 --- a/chemdyg/templates/chemdyg_noaa_co_comparison.bash +++ b/chemdyg/templates/chemdyg_noaa_co_comparison.bash @@ -203,6 +203,8 @@ for n in range(len(Sta)): nmonth = np.arange(0,len(CO_sel_1D),1) mask = ~np.isnan(CO_sel_1D) + if (len(nmonth[mask]) == 0): + continue slope_e3sm, intercept, r_value, p_value, std_err = linregress(nmonth[mask], CO_sel_1D[mask]) lin_e3sm = nmonth*slope_e3sm+intercept lin_e3sm_xa = xr.DataArray(lin_e3sm, coords=[time_range_noaa], dims=["time"])