Skip to content

Commit 53f1abc

Browse files
authored
Merge pull request #870 from xylar/fix-woa-extrap-filename
Fix filename produced by extrap_woa test case
2 parents 2a2a215 + 4d144f7 commit 53f1abc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compass/ocean/tests/global_ocean/init/initial_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def __init__(self, test_case, mesh, initial_condition,
122122
if initial_condition == 'WOA23':
123123
self.add_input_file(
124124
filename='woa23.nc',
125-
target='woa23_decav_0.25_extrap.20230416.nc',
125+
target='woa23_decav_0.25_jan_extrap.20230416.nc',
126126
database='initial_condition_database')
127127
elif initial_condition == 'PHC':
128128
self.add_input_file(

compass/ocean/tests/utility/extrap_woa/extrap_step.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from datetime import datetime
23
from functools import partial
34
from multiprocessing import Pool
45

@@ -48,7 +49,9 @@ def setup(self):
4849
"""
4950
Determine the output filename
5051
"""
51-
self.woa_filename = 'woa23_decav_0.25_extrap.nc'
52+
now = datetime.now()
53+
datestring = now.strftime("%Y%m%d")
54+
self.woa_filename = f'woa23_decav_0.25_jan_extrap.{datestring}.nc'
5255
self.add_output_file(self.woa_filename)
5356

5457
def run(self):
@@ -162,7 +165,7 @@ def _extrap_vert(self, use_ocean_mask):
162165
out_filename = 'extrap_ocean/woa_extrap.nc'
163166
else:
164167
in_filename = 'extrap_land/woa_extrap_horiz.nc'
165-
out_filename = 'woa23_decav_0.25_extrap.nc'
168+
out_filename = self.woa_filename
166169

167170
ds = xr.open_dataset(in_filename)
168171

0 commit comments

Comments
 (0)