File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import time
2020import traceback
2121import logging
22+ import os
2223import sys
2324
2425from mpas_analysis .shared .io import NameList , StreamsFile
@@ -506,11 +507,23 @@ def get_mesh_filename(self):
506507
507508 meshStream = self .config .get (self .componentName , 'meshStream' )
508509 try :
509- return self .runStreams .readpath (meshStream )[0 ]
510+ meshFilename = self .runStreams .readpath (meshStream )[0 ]
510511 except ValueError :
512+ meshFilename = None
513+
514+ if meshFilename is None or not os .path .exists (meshFilename ):
515+ # try again with "restart" stream
516+ try :
517+ meshFilename = self .runStreams .readpath ('restart' )[0 ]
518+ except ValueError :
519+ meshFilename = None
520+
521+ if meshFilename is None or not os .path .exists (meshFilename ):
511522 raise IOError (
512- f'The MPAS mesh file could not be found: needed to '
513- f'run { self .componentName } analysis' )
523+ f'The MPAS mesh file could not be found via either '
524+ f'"{ meshStream } " or "restart" streams' )
525+
526+ return meshFilename
514527
515528# }}}
516529
You can’t perform that action at this time.
0 commit comments