BOUT-dev icon indicating copy to clipboard operation
BOUT-dev copied to clipboard

More grid file provenance tracking

Open johnomotani opened this issue 3 years ago • 1 comments
trafficstars

We currently save a fair amount of information about hypnotoad, when running from a grid file https://github.com/boutproject/BOUT-dev/blob/ab69d52f362dcaaddb22f3bd3b16aa7bab924d84/src/mesh/impls/bout/boutmesh.cxx#L2685-L2713

It would be nice to add a bit more! Hypnotoad now saves the complete input as hypnotoad_inputs_yaml and the eqdsk file used as hypnotoad_input_geqdsk_file_contents. With those along with the hypnotoad version information already saved, we should be able to reproduce a grid file just from a BOUT.dmp.*.nc! I have done this when grabbing the inputs from an existing grid file (to save hunting down the input file and eqdsk), and it's easy! See https://github.com/boutproject/hypnotoad/blob/master/hypnotoad/scripts/hypnotoad_recreate_inputs.py - we could add a similar script to hypnotoad to extract inputs from a BOUT++ dump file.

I'm mostly opening this as a reminder to myself, but if anyone wants to beat me to it, I won't object!

johnomotani avatar Sep 14 '22 18:09 johnomotani

It looks like this would be a pain to do in v4, because we cannot read str type variables with the old I/O classes (only str attributes). It should (I think?) be easier in v5 because the new OptionsNetCDF handles str variables (need to check what happens with attributes vs. variables though).

johnomotani avatar Oct 10 '22 12:10 johnomotani