mit-crpg/openmc — pull request #346 by wbinventor (2014-12-18 22:08:13+00:00)
Title: Explicit tally moment order strings in statepoint files

This pull request modifies OpenMC's ``statepoint.*`` files to include explicit strings moment orders with for tallies with scores such as ``flux-PN``, ``scatter-YN``, etc at the request of @bforget. The current release version of openmc prints an integer array of the moment orders for each score. The issue with this is it is not transparent to the user which tally results correspond to which moment based on looking at the ``statepoint.h5`` files. For example, if a user assigns a ``scatter-P3`` score to a tally, this implicitly defines the four scores: ``scatter-0``, ``scatter-1``, ``scatter-2`` and ``scatter-3``. However, the moment order array in the ``statepoint.*`` file appears as ``[3,3,3,3]`` for each of these scores. This problem is exacerbated for spherical harmonic moments.

This PR explicitly writes strings for each moment to the statepoint file. In the example mentioned above, the new ``statepoint.*`` files will now have strings under the ``moment`` group (in HDF5) indexed by score with strings ```"P0"``, ``"P1"``, ``"P2"``, and ``"P3"``, respectively. Likewise, for spherical harmonics the strings will appear as ``"Y0,0"``, ``"Y1,2"``, etc. These strings are also now properly parsed with the ``StatePoint`` Python class for use by the user. Note that this functionality is an extension of the code implemented by @nelsonag for the ``tallies.out`` files in ``output.F90``, though modified somewhat to work with binary or HDF ``statepoint`` files.