Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading output files in format binary32 #687

Merged
merged 9 commits into from
Jul 11, 2022

Conversation

rjleveque
Copy link
Member

Support reading fort.bxxxx files that are either binary64 == binary or binary32 format.

seemed to work fine anyway, but this looks more correct.
Added Solution.read_t function to read the file_format before importing
appropriate read function for ascii or binary.
* master:
  add support for binary files containing float32 values
@rjleveque
Copy link
Member Author

I think this works properly with clawpack/geoclaw#533, but it assumes that the fort.txxxx file for each frame includes a new line with the file_format (one of ascii, binary == binary64, or binary32) as described in clawpack/geoclaw#533, e.g. something like:

    0.30000000E+02    time
     4                 meqn
     4                 ngrids
     3                 naux
     2                 ndim
     2                 nghost
  ascii                format

This currently does not work with classic or amrclaw, but I am working on fixing that.

@mandli, @ketch: Does this require any other changes for pyclaw or petclaw when writing output files?

…ined in 3 places

pyclaw.fileio.binary and pyclaw.solution now import from pyclaw.fileio.ascii
rather than having 3 versions that previously were not exactly consistent.
Also added except clause so that if file_format is not in the fort.t file,
it is backward compatible with output from running with a previous version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants