Skip to content

Append to driver .out file instead of overwriting - #967

Merged
maddenp-cu merged 2 commits into
ufs-community:mainfrom
maddenp-cu:append-to-driver-log
Aug 27, 2026
Merged

Append to driver .out file instead of overwriting#967
maddenp-cu merged 2 commits into
ufs-community:mainfrom
maddenp-cu:append-to-driver-log

Conversation

@maddenp-cu

Copy link
Copy Markdown
Collaborator

Synopsis

Update driver logic to append to runscript.<driver>.out file instead of overwriting it, preserving the output from multiple invocations of the driver, should those occur. As an example:

Before:

$ rm -rf /tmp/ungrib/
$ uw ungrib run -c config.yaml --cycle 2026-02-19T00
...
[2026-08-27T19:29:04]     INFO Running: ./runscript.ungrib >runscript.ungrib.out 2>&1
[2026-08-27T19:29:04]     INFO   in directory
[2026-08-27T19:29:04]     INFO     /tmp/ungrib
[2026-08-27T19:29:12]     INFO 20260219 00Z ungrib run via local execution: Ready
[2026-08-27T19:29:12]     INFO 20260219 00Z ungrib run: Ready
$ cat /tmp/ungrib/runscript.ungrib.out | wc -l
85
$ rm /tmp/ungrib/runscript.ungrib.done 
$ uw ungrib run -c config.yaml --cycle 2026-02-19T00
...
[2026-08-27T19:29:57]     INFO Running: ./runscript.ungrib >runscript.ungrib.out 2>&1
[2026-08-27T19:29:57]     INFO   in directory
[2026-08-27T19:29:57]     INFO     /tmp/ungrib
[2026-08-27T19:30:03]     INFO 20260219 00Z ungrib run via local execution: Ready
[2026-08-27T19:30:03]     INFO 20260219 00Z ungrib run: Ready
$ cat /tmp/ungrib/runscript.ungrib.out | wc -l
85

Note that runscript.ungrib.out was overwritten by the second driver invocation.

After:

$ rm -rf /tmp/ungrib/
$ uw ungrib run -c config.yaml --cycle 2026-02-19T00
...
[2026-08-27T19:31:17]     INFO Running: ./runscript.ungrib >>runscript.ungrib.out 2>&1
[2026-08-27T19:31:17]     INFO   in directory
[2026-08-27T19:31:17]     INFO     /tmp/ungrib
[2026-08-27T19:31:23]     INFO 20260219 00Z ungrib run via local execution: Ready
[2026-08-27T19:31:23]     INFO 20260219 00Z ungrib run: Ready
$ cat /tmp/ungrib/runscript.ungrib.out | wc -l
85
$ rm /tmp/ungrib/runscript.ungrib.done
$ uw ungrib run -c config.yaml --cycle 2026-02-19T00
...
[2026-08-27T19:36:29]     INFO Running: ./runscript.ungrib >>runscript.ungrib.out 2>&1
[2026-08-27T19:36:29]     INFO   in directory
[2026-08-27T19:36:29]     INFO     /tmp/ungrib
[2026-08-27T19:36:35]     INFO 20260219 00Z ungrib run via local execution: Ready
[2026-08-27T19:36:35]     INFO 20260219 00Z ungrib run: Ready
$ cat /tmp/ungrib/runscript.ungrib.out | wc -l
170

Here runscript.ungrib.out was appended to by the second driver invocation.

Type

  • Enhancement (adds new functionality)

Impact

  • This is a non-breaking change (existing functionality continues to work as expected)

Checklist

  • I have added myself and any co-authors to the PR's Assignees list.
  • I have reviewed the documentation and have made any updates necessitated by this change.
  • Where helpful, I have written comments in this PR's Files changed view to assist reviewers.

@maddenp-cu maddenp-cu self-assigned this Aug 27, 2026
Comment thread src/uwtools/drivers/ungrib.py
@maddenp-cu
maddenp-cu marked this pull request as ready for review August 27, 2026 20:13

@christinaholtNOAA christinaholtNOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that seems like a heavy lift! 😉

@maddenp-cu
maddenp-cu merged commit b0fbf60 into ufs-community:main Aug 27, 2026
2 checks passed
@maddenp-cu
maddenp-cu deleted the append-to-driver-log branch August 27, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants