Skip to content

Commit 06315b9

Browse files
authored
Merge pull request #654 from kbarnhart/fgout_fixes_post511
post 5.11 fixes for dclaw: fgout_tools and fgout xarray backends
2 parents aade70a + 6926b58 commit 06315b9

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/python/geoclaw/fgout_tools.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,13 @@ def __init__(self,fgno=None,outdir='.',output_format=None,
342342
self.output_format = output_format
343343

344344
# list of which components to print:
345-
if 'eta' in self.qmap.keys():
346-
# default: h,hu,hv,eta as in previous versions of GeoClaw
347-
self.q_out_vars = [1,2,3,self.qmap['eta']]
345+
if qmap == 'dclaw':
346+
# default: h,hu,hv,hm,pb,hchi,bdif,eta, DClaw
347+
self.q_out_vars = [1,2,3,4,5,6,7]
348348
else:
349-
self.q_out_vars = [1,2,3] # if qmap['eta'] not defined
349+
self.q_out_vars = [1,2,3] # use Geoclaw values as default.
350+
if 'eta' in self.qmap.keys():
351+
self.q_out_vars.append(self.qmap['eta'])
350352

351353
self.drytol = 1e-3 # used for computing u,v from hu,hv
352354

src/python/geoclaw/xarray_backends.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ def open_dataset(
221221
if fgout_grid.point_style != 2:
222222
raise ValueError("FGOutBackend only works with fg.point_style=2")
223223

224-
fgout_grid.read_fgout_grids_data()
224+
try:
225+
fgout_grid.read_fgout_grids_data()
226+
except AssertionError:
227+
fgout_grid.read_fgout_grids_data_pre511()
228+
225229
fgout = fgout_grid.read_frame(frameno)
226230

227231
time = fgout.t

0 commit comments

Comments
 (0)