Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filename produced by extrap_woa test case #870

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compass/ocean/tests/global_ocean/init/initial_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self, test_case, mesh, initial_condition,
if initial_condition == 'WOA23':
self.add_input_file(
filename='woa23.nc',
target='woa23_decav_0.25_extrap.20230416.nc',
target='woa23_decav_0.25_jan_extrap.20230416.nc',
database='initial_condition_database')
elif initial_condition == 'PHC':
self.add_input_file(
Expand Down
7 changes: 5 additions & 2 deletions compass/ocean/tests/utility/extrap_woa/extrap_step.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from datetime import datetime
from functools import partial
from multiprocessing import Pool

Expand Down Expand Up @@ -48,7 +49,9 @@ def setup(self):
"""
Determine the output filename
"""
self.woa_filename = 'woa23_decav_0.25_extrap.nc'
now = datetime.now()
datestring = now.strftime("%Y%m%d")
self.woa_filename = f'woa23_decav_0.25_jan_extrap.{datestring}.nc'
self.add_output_file(self.woa_filename)

def run(self):
Expand Down Expand Up @@ -162,7 +165,7 @@ def _extrap_vert(self, use_ocean_mask):
out_filename = 'extrap_ocean/woa_extrap.nc'
else:
in_filename = 'extrap_land/woa_extrap_horiz.nc'
out_filename = 'woa23_decav_0.25_extrap.nc'
out_filename = self.woa_filename

ds = xr.open_dataset(in_filename)

Expand Down
Loading