This swaps all the instances of BaryonField[field] = new float[size] with AllocateGrids(). The latter really only does the former, so this is not any change in functionality. But for a forthcoming pull request it will be useful to keep allocation consistent.
As of this morning (May 1), this PR passes the test suite (push suite), as compared to the tip of enzo-dev.
The changes seem quite reasonable to me. Several of the files don't define the variable field inside the for statement, which might leave an unused variable definition elsewhere in those files. If they're not used for anything else, they should be removed. However, that's a minor issue and I am fine with accepting the PR as-is, except for the documentation suggestion.
Thanks, those are useful suggestions. I changed the docs and removed all instances of field that weren't otherwise used. I also removed instances of size that aren't used, since they were often only used for that allocation.
Thanks for taking care of this tedious work, Dave!
The changes proposed look good and I'm generally happy to approve the pull request.
Two (quick) final questions:
In order to clean up this part of the code, I think we could also remove the commented code relating to these allocation in ./hydro_rk/Grid_MHD2DTestInitializeGrid.C:88:97