From 249e242e33a33feeb1c81bedd51198309f669de0 Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Thu, 9 May 2024 09:27:36 -0400 Subject: [PATCH] Make the seaice DA actually do something ... (#1092) - fixes #1087 --- parm/soca/berror/soca_diagb.yaml.j2 | 2 +- scripts/exgdas_global_marine_analysis_post.py | 3 ++- scripts/exgdas_global_marine_analysis_prep.py | 1 - utils/soca/fig_gallery/gdassoca_obsstats.py | 17 +++++++++++------ utils/soca/fig_gallery/time_series_omb.html | 1 + 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/parm/soca/berror/soca_diagb.yaml.j2 b/parm/soca/berror/soca_diagb.yaml.j2 index fcfd7442f..767b41f92 100644 --- a/parm/soca/berror/soca_diagb.yaml.j2 +++ b/parm/soca/berror/soca_diagb.yaml.j2 @@ -27,7 +27,7 @@ min depth: 500.0 # zero out the bkg. error. at less than min depth number of halo points: 4 number of neighbors: 16 simple smoothing: - horizontal iterations: 2 + horizontal iterations: 10 vertical iterations: 1 # TODO(G): Start using when the normalization is optional diff --git a/scripts/exgdas_global_marine_analysis_post.py b/scripts/exgdas_global_marine_analysis_post.py index d207840f0..119fed228 100755 --- a/scripts/exgdas_global_marine_analysis_post.py +++ b/scripts/exgdas_global_marine_analysis_post.py @@ -41,6 +41,7 @@ def list_all_files(dir_in, dir_out, wc='*', fh_list=[]): com_ocean_analysis = os.getenv('COM_OCEAN_ANALYSIS') +com_ice_analysis = os.getenv('COM_ICE_ANALYSIS') com_ice_restart = os.getenv('COM_ICE_RESTART') anl_dir = os.getenv('DATA') cdate = os.getenv('CDATE') @@ -100,7 +101,7 @@ def list_all_files(dir_in, dir_out, wc='*', fh_list=[]): cice_rst_date = cdatedt.strftime('%Y%m%d.%H%M%S') post_file_list.append([os.path.join(anl_dir, 'Data', f'{cice_rst_date}.cice_model.res.nc'), - os.path.join(com_ice_restart, f'{cdate}.cice_model_anl.res.nc')]) + os.path.join(com_ice_analysis, f'{cice_rst_date}.cice_model_anl.res.nc')]) FileHandler({'copy': post_file_list}).sync() diff --git a/scripts/exgdas_global_marine_analysis_prep.py b/scripts/exgdas_global_marine_analysis_prep.py index 265526eb0..03ff7c018 100755 --- a/scripts/exgdas_global_marine_analysis_prep.py +++ b/scripts/exgdas_global_marine_analysis_prep.py @@ -53,7 +53,6 @@ def find_clim_ens(input_date): """ Find the clim. ens. that is the closest to the DA window """ - logger.info(f"$$$$$$$$$$$$$$$$$$$$$$$ {os.getenv('SOCA_INPUT_FIX_DIR')}") ens_clim_dir = os.path.join(os.getenv('SOCA_INPUT_FIX_DIR'), 'bkgerr', 'ens') dirs = glob.glob(os.path.join(ens_clim_dir, '*')) diff --git a/utils/soca/fig_gallery/gdassoca_obsstats.py b/utils/soca/fig_gallery/gdassoca_obsstats.py index 3f92f799d..960dfbf79 100644 --- a/utils/soca/fig_gallery/gdassoca_obsstats.py +++ b/utils/soca/fig_gallery/gdassoca_obsstats.py @@ -49,10 +49,13 @@ def plot_timeseries(self, ocean, variable, inst="", dirout=""): # Get unique experiments experiments = filtered_data['Exp'].unique() - + experiments.sort() + print(experiments) + # Plot settings fig, axs = plt.subplots(3, 1, figsize=(10, 15), sharex=True) - fig.suptitle(f'{inst} {variable} statistics, {ocean} ocean', fontsize=16, fontweight='bold') + fig.suptitle(f'{inst} {variable} statistics, {ocean} ocean', fontsize=18, fontweight='bold') + exp_counter = 0 for exp in experiments: @@ -65,7 +68,7 @@ def plot_timeseries(self, ocean, variable, inst="", dirout=""): axs[0].xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H')) axs[0].xaxis.set_major_locator(mdates.DayLocator()) axs[0].tick_params(labelbottom=False) - axs[0].set_ylabel('RMSE') + axs[0].set_ylabel('RMSE', fontsize=18, fontweight='bold') axs[0].legend() axs[0].grid(True) @@ -74,16 +77,18 @@ def plot_timeseries(self, ocean, variable, inst="", dirout=""): axs[1].xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H')) axs[1].xaxis.set_major_locator(mdates.DayLocator()) axs[1].tick_params(labelbottom=False) - axs[1].set_ylabel('Bias') + axs[1].set_ylabel('Bias', fontsize=18, fontweight='bold') axs[1].grid(True) # Plot Count axs[2].plot(exp_data['date'], exp_data['Count'], marker='o', linestyle='-', color=colors[exp_counter], label=exp) axs[2].xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H')) axs[2].xaxis.set_major_locator(mdates.DayLocator()) - axs[2].set_ylabel('Count') + axs[2].set_ylabel('Count', fontsize=18, fontweight='bold') axs[2].grid(True) + exp_counter += 1 + # Improve layout and show plot plt.tight_layout(rect=[0, 0.03, 1, 0.95]) plt.savefig(f'{dirout}/{inst}_{variable}_{ocean}.png') @@ -111,5 +116,5 @@ def plot_timeseries(self, ocean, variable, inst="", dirout=""): obsStats = ObsStats() obsStats.read_csv(flist) for var, ocean in product(['ombg_noqc', 'ombg_qc'], - ['Atlantic', 'Pacific', 'Indian', 'Arctic', 'Southern']): + ['Global', 'Atlantic', 'Pacific', 'Indian', 'Arctic', 'Southern']): obsStats.plot_timeseries(ocean, var, inst=inst, dirout=args.dirout) diff --git a/utils/soca/fig_gallery/time_series_omb.html b/utils/soca/fig_gallery/time_series_omb.html index 4e06b5e56..c3c70eb75 100644 --- a/utils/soca/fig_gallery/time_series_omb.html +++ b/utils/soca/fig_gallery/time_series_omb.html @@ -57,6 +57,7 @@
+