NCAR / icar

The Intermediate Complexity Atmospheric Research model (ICAR)
MIT License
72 stars 53 forks source link

Check if output and restart file path is writeable #167

Closed scrasmussen closed 1 year ago

scrasmussen commented 1 year ago

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

gutmann commented 1 year ago

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