-
Notifications
You must be signed in to change notification settings - Fork 87
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
Allow specifying which components of q to output on each fgout grid #624
Conversation
Modifications to fgout_module.f90 and fgout_tools.py, primarily. Can now set `fgout.q_out_vars` to a list of which components of q to output for each fgout frame (Fortran indexing). The default is `fgout.q_out_vars = [1,2,3,4]` for all components of q[1:3] and also eta (4), consistent with the previous behavior. The user could also/instead ask to output the topo B as component 5. (If two out of three of h, eta, B are output then the other can be computed from these.) Note that this list is written out to `fgout_grids.data` rather than a boolean list of True/False values for each possible component as is done in other places in GeoClaw.
… D-Claw When instantiating fgout_tools.FGoutGrid object, new qmap parameter can be set to 'geoclaw', 'geoclaw-bouss', 'dclaw', or a custom dictionary. (Eventually add 'dclaw-bouss' option also). This dictionary has the form `{'h':1, 'hu':2, etc}` with mapping from fgout variable names to Fortran indices of q in the code creating the fgout output.
This has been updated to handle Bouss and D-Claw. When instantiating |
…rids.data from before v5.11
Now need to call fgout_grid.read_fgout_grids_data() explicitly, but do not need to set format.
this is ignored since it is read from fgout_grids.data. Also properly handle output_format == 2 for binary32.
I fixed a few issues and I think this is ready to merge. I also updated the documentation, see |
This was modified in the shallow/amr2.f90 code to support more fgout flexibility in clawpack#624, and this change is also required in the bouss version. Also enhanced the examples/bouss README files a bit.
Modifications to fgout_module.f90 and fgout_tools.py, primarily. Can now set
fgout.q_out_vars
to a list of which components of q to output for each fgout frame (Fortran indexing). The default isfgout.q_out_vars = [1,2,3,4]
for all components of q[1:3] and also eta (4), consistent with the previous behavior on standard GeoClaw.The user could also/instead ask to output the topo B as component 5. (If two out of three of h, eta, B are output then the other can be computed from these.)
Note that this list is written out to
fgout_grids.data
rather than a boolean list of True/False values for each possible component as is done in other places in GeoClaw. This turned out to be both easier and clearer.I got rid of the
fgout.dclaw
parameter that was introduced in #617 and all the complication of hard-wiring different sets of variables for geoclaw vs dclaw since this should now allow much more control to use either as well as reducing the size of fgout files when only a few components are desired.For the Boussinesq version of GeoClaw, there are 6 variables in q and so to print out only h,hu,hv,eta you would specify
fgout.q_out_vars = [1,2,3,7]
, or just[1,7]
if you do not want to write the momenta and only want h,eta.Needs some more testing still and I'd be happy for feedback.