visclaw icon indicating copy to clipboard operation
visclaw copied to clipboard

cannot mix binary and ascii output in same setplot.py

Open rjleveque opened this issue 5 years ago • 1 comments

In setplot.py we set plotdata.format to ascii or binary and then all output directories referenced have to have the same format. Often there's only one _output or maybe two similar ones if making comparison plots.

But I'm looking at a case where the I want to compare transects of a 2D solution with a 1D solution in a radially symmetric case, and the 2D output is big so would be best to use binary but there is no binary output option for 1D.

If plotdata.format = "binary" but an outdir has ascii format then it throws a non-informative error

*** Reached EOF in file .../fort.t0000

It took me a long time to figure out that's because for binary output the fort.t files are expected to contain one more line (with num_ghost) than in the ascii case.

We should consider allowing different formats for each outdir.

Also it would help to give a better error message currently.

See also #222 though this goes beyond that.

rjleveque avatar Jul 27 '20 21:07 rjleveque

At some point I had looked into passing down file_format as an argument down the call stack in visclaw but it got a bit too convoluted. Doing that would probably fix this and allow for removing this sort of state from VisClaw. One way around this and to allow more flexibility/modularity I was thinking about was to change the setplot functions so that they initiate the plotting if asked.

mandli avatar Jul 27 '20 21:07 mandli