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

fix fgout_tools.FGoutGrid.read_fgout_grids_data for time array #621

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

rjleveque
Copy link
Member

Now that output_style==2 is supported for fgout grids (an array of times, see #617), the function fgout_tools.FGoutGrid.read_fgout_grids_data needs to be fixed to properly read in the new format of fgout_grids.data. And also note that nout now comes before tstart and tend for output_style==1.

I was thinking we might might want to rewrite this code so that it makes a .data file with := in the lines, similar to claw.data and others, so that clawutil.data.ClawData.read can be used to read it rather than depending on a particular line ordering. But the problem is that there might be more than one fgout grid specified in the file, so I don't think this will work. (Similarly for fgmax).

Now that `output_style==2` is supported for fgout grids (an array of times,
see clawpack#617), the function
fgout_tools.FGoutGrid.read_fgout_grids_data needs to be fixed to properly
read in the new format of `fgout_grids.data`, also note that `nout`
now comes before `tstart` and `tend` for `output_style==1`.
@mandli
Copy link
Member

mandli commented Jun 19, 2024

Is it possible that you would know a priori how many grids and then read each? That's how some of the other data files work.

@rjleveque
Copy link
Member Author

The first thing in fgout_grids.data is the number of fgout grids, and the current implementation first reads that and then loops over the grids to read the other data. The problem is that it wouldn't work to replace the line
1 # fgno
by
1 := fgno
for example, and expect to read in the grid info properly with clawutil.data.ClawData.read if the file also has a later line
2 := fgno
for a second fgout grid.

Short of having a separate .data file for each fgout grid, best avoided, I don't think it would be easy, or worthwhile to spend time on this.

I added the comment since I know I've thought about this before and others may have wondered about this too.

@mandli
Copy link
Member

mandli commented Jun 19, 2024

I guess I was thinking of writing a read routine rather than making it automatic, which would be difficult to finagle.

@rjleveque rjleveque merged commit 0386136 into clawpack:master Jul 1, 2024
1 check failed
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