Skip to content

Commit 62b595b

Browse files
.mrc year transition 3
1 parent 14f7371 commit 62b595b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ def write_mrc(ds, exp_folder=None):
231231
year = dt.year
232232
# writing the current files
233233
with open(
234-
f"{exp_folder}/oce_files/merc{dt.year-2000:02d}{dt.month:02d}{day:02d}{hour:02d}.mrc",
234+
f"{exp_folder}/oce_files/merc{year-2000:02d}{month:02d}{day:02d}{hour:02d}.mrc",
235235
"w",
236236
) as f:
237237
f.write(
238-
f"Ocean forecast data for {day:02d}/{dt.month:02d}/{dt.year} {hour:02d}:00\n"
238+
f"Ocean forecast data for {day:02d}/{month:02d}/{year} {hour:02d}:00\n"
239239
)
240240
f.write("Subregion of the Global Ocean:\n")
241241
f.write(
@@ -386,11 +386,11 @@ def process_mrc(i, concat, exp_folder=None):
386386

387387
# writing the current files
388388
with open(
389-
f"{exp_folder}/oce_files/merc{dt.year-2000:02d}{month:02d}{day:02d}{hour:02d}.mrc",
389+
f"{exp_folder}/oce_files/merc{year-2000:02d}{month:02d}{day:02d}{hour:02d}.mrc",
390390
"w",
391391
) as f:
392392
f.write(
393-
f"Ocean forecast data for {day:02d}/{month:02d}/{dt.year} {hour:02d}:00\n"
393+
f"Ocean forecast data for {day:02d}/{month:02d}/{year} {hour:02d}:00\n"
394394
)
395395
f.write("Subregion of the Global Ocean:\n")
396396
f.write(

0 commit comments

Comments
 (0)