Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if output and restart file path is writeable #167

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

scrasmussen
Copy link
Member

TYPE: new feature

KEYWORDS: IO Files, Namelist Validation

SOURCE: Soren Rasmussen, NCAR

DESCRIPTION OF CHANGES: New subroutine checks if output and restart file paths are writeable. When the namelist is read, the existence of the directories where the output and restart files are being written to is checked. If they do not exist the routine will report error then, rather than throwing an error later when the NetCDF library tries to write to the file.

TESTS CONDUCTED: Checked that the subroutine functioned correctly for the following input file strings

output_file = "output/foo/icar_out_"
output_file = "output/icar_out_"
output_file = "output//icar_out_"
output_file = "./icar_out_"
output_file = "icar_out_"

Checklist

  • Closes issue #xxxx (An issue must exist or be created to be closed. The
    issue describes and documents the problem and general solution, the PR
    describes the technical details of the solution.)
  • Tests added (unit tests and/or regression/integration tests)
  • Backwards compatible
  • Requires new files? If so, how to generate them.
  • Fully documented

… check, when the namelist is read, the existense of the directories where the output and restart files are being written to. If they do not exist routine will report error then, rather than throwing an error later when the netcdf library tries to write to the file.
@gutmann
Copy link
Member

gutmann commented Jul 31, 2023

Thanks, looks like quite a straightforward addition that could save a lot of pain!

@gutmann gutmann merged commit 2247c83 into NCAR:develop Jul 31, 2023
1 check passed
@scrasmussen scrasmussen deleted the new-feature/output-path-check branch August 5, 2023 18:41
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.

2 participants