Skip to content

Commit 65b63b9

Browse files
Merge branch 'main' into mpassit_driver
2 parents a0294bc + 7486627 commit 65b63b9

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/uwtools/drivers/ungrib.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class Ungrib(DriverCycleBased):
2020
"""
2121

2222
PREFIX = "FILE"
23-
TIMEFMT = "%Y-%m-%d_%H:00:00"
2423

2524
# Workflow tasks
2625

@@ -49,13 +48,14 @@ def namelist_file(self):
4948
"""
5049
The namelist file.
5150
"""
51+
timefmt = "%Y-%m-%d_%H:00:00"
5252
d = {
5353
"update_values": {
5454
"share": {
55-
"end_date": self._end_date.strftime(self.TIMEFMT),
55+
"end_date": self._end_date.strftime(timefmt),
5656
"interval_seconds": self._interval,
5757
"max_dom": 1,
58-
"start_date": self._cycle.strftime(self.TIMEFMT),
58+
"start_date": self._cycle.strftime(timefmt),
5959
"wrf_core": "ARW",
6060
},
6161
"ungrib": {
@@ -117,7 +117,7 @@ def output(self) -> dict[str, list[Path]]:
117117
paths = []
118118
ts = self._cycle
119119
while ts <= self._end_date:
120-
fn = "%s:%s" % (self.PREFIX, ts.strftime(self.TIMEFMT))
120+
fn = "%s:%s" % (self.PREFIX, ts.strftime("%Y-%m-%d_%H"))
121121
paths.append(self.rundir / fn)
122122
ts += timedelta(seconds=self._interval)
123123
return {"paths": paths}

src/uwtools/tests/drivers/test_ungrib.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,7 @@ def test_Ungrib_namelist_file(driverobj):
8282

8383
def test_Ungrib_output(driverobj):
8484
assert driverobj.output["paths"] == [
85-
driverobj.rundir / f"FILE:{x}"
86-
for x in (
87-
"2024-02-01_18:00:00",
88-
"2024-02-02_00:00:00",
89-
"2024-02-02_06:00:00",
90-
)
85+
driverobj.rundir / f"FILE:{x}" for x in ("2024-02-01_18", "2024-02-02_00", "2024-02-02_06")
9186
]
9287

9388

0 commit comments

Comments
 (0)