File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 19
19
import time
20
20
import traceback
21
21
import logging
22
+ import os
22
23
import sys
23
24
24
25
from mpas_analysis .shared .io import NameList , StreamsFile
@@ -506,11 +507,23 @@ def get_mesh_filename(self):
506
507
507
508
meshStream = self .config .get (self .componentName , 'meshStream' )
508
509
try :
509
- return self .runStreams .readpath (meshStream )[0 ]
510
+ meshFilename = self .runStreams .readpath (meshStream )[0 ]
510
511
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 ):
511
522
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
514
527
515
528
# }}}
516
529
You can’t perform that action at this time.
0 commit comments