Skip to content

Commit

Permalink
Merge pull request #870 from xylar/fix-woa-extrap-filename
Browse files Browse the repository at this point in the history
Fix filename produced by extrap_woa test case
  • Loading branch information
xylar authored Oct 30, 2024
2 parents 2a2a215 + 4d144f7 commit 53f1abc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 53f1abc

Please sign in to comment.