Skip to content

Commit

Permalink
Make the seaice DA actually do something ... (#1092)
Browse files Browse the repository at this point in the history
- fixes #1087
  • Loading branch information
guillaumevernieres committed May 9, 2024
1 parent 2b2d417 commit 249e242
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion parm/soca/berror/soca_diagb.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion scripts/exgdas_global_marine_analysis_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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()

Expand Down
1 change: 0 additions & 1 deletion scripts/exgdas_global_marine_analysis_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, '*'))

Expand Down
17 changes: 11 additions & 6 deletions utils/soca/fig_gallery/gdassoca_obsstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)

Expand All @@ -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')
Expand Down Expand Up @@ -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)
1 change: 1 addition & 0 deletions utils/soca/fig_gallery/time_series_omb.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</div>
<div>
<!-- Buttons for selecting oceans -->
<button class="button" id="Global" onclick="showImages(currentType, 'Global')">Global</button>
<button class="button" id="Arctic" onclick="showImages(currentType, 'Arctic')">Arctic</button>
<button class="button" id="Atlantic" onclick="showImages(currentType, 'Atlantic')">Atlantic</button>
<button class="button" id="Indian" onclick="showImages(currentType, 'Indian')">Indian</button>
Expand Down

0 comments on commit 249e242

Please sign in to comment.