@@ -32,24 +32,32 @@ def setup(self):
3232 self .opts .init_file = 'init.msh'
3333
3434 # Set links to base mesh
35- if self .config .has_option ('wave_mesh' , 'ocean_base_mesh' ):
36- ocean_base_mesh_path = self .config .get ('wave_mesh' ,
37- 'ocean_base_mesh' )
38- else :
35+ if self .ocean_base_mesh is not None :
3936 mesh_path = self .ocean_base_mesh .steps ['base_mesh' ].path
4037 ocean_base_mesh_path = f'{ mesh_path } /base_mesh.nc'
38+ else :
39+ if self .config .has_option ('wave_mesh' , 'ocean_base_mesh' ):
40+ ocean_base_mesh_path = self .config .get ('wave_mesh' ,
41+ 'ocean_base_mesh' )
42+ else :
43+ raise ValueError ('ocean_base_mesh option required '
44+ 'in wave_mesh section in cfg file' )
4145
4246 self .add_input_file (
4347 filename = 'ocean_base_mesh.nc' ,
4448 work_dir_target = ocean_base_mesh_path )
4549
4650 # Set links to culled mesh
47- if self .config .has_option ('wave_mesh' , 'ocean_culled_mesh' ):
48- ocean_culled_mesh_path = self .config .get ('wave_mesh' ,
49- 'ocean_culled_mesh' )
50- else :
51+ if self .ocean_culled_mesh is not None :
5152 mesh_path = self .ocean_culled_mesh .steps ['initial_state' ].path
5253 ocean_culled_mesh_path = f'{ mesh_path } /initial_state.nc'
54+ else :
55+ if self .config .has_option ('wave_mesh' , 'ocean_culled_mesh' ):
56+ ocean_culled_mesh_path = self .config .get ('wave_mesh' ,
57+ 'ocean_culled_mesh' )
58+ else :
59+ raise ValueError ('ocean_culled_mesh option required '
60+ 'in wave_mesh section in cfg file' )
5361
5462 self .add_input_file (
5563 filename = 'ocean_culled_mesh.nc' ,
0 commit comments