Skip to content

Commit

Permalink
print more helpful error msg if fgout_grids.data seems to be pre511
Browse files Browse the repository at this point in the history
  • Loading branch information
rjleveque committed Jul 29, 2024
1 parent 665bbda commit f373e23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/python/geoclaw/fgout_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,14 @@ def read_fgout_grids_data(self, fgno=None, data_file='fgout_grids.data'):
% (self.fgno, data_file))

lineno = 0 # next input line
self.output_style = int(fgout_input[lineno].split()[lineno])
next_value = fgout_input[lineno].split()[lineno] # a string
next_value_int = ('.' not in next_value) # should be True in v5.11
err_msg = '\n*** Expecting integer output_style next in %s' \
% data_file \
+ '\n If this is fgout data from before v5.11, try using' \
+ '\n read_fgout_grids_data_pre511'
assert next_value_int, err_msg
self.output_style = int(next_value)
lineno += 1
if (self.output_style == 1):
# equally spaced times:
Expand Down

0 comments on commit f373e23

Please sign in to comment.