vplanet icon indicating copy to clipboard operation
vplanet copied to clipboard

Printing of output parameters should be limited to those that are requested

Open RoryBarnes opened this issue 3 years ago • 1 comments

When the code outputs parameters, it loops over all possible values, MODULEOPTEND, which is inefficient. Instead the code should record the number of outputs per body and just loop over them.

RoryBarnes avatar Apr 23 '21 23:04 RoryBarnes

To fix this, I would create new variables in the Outfile struct called something like iNumOutputs and *iaOutput, which correspond to the total number of outputs (for that file) and an array of integer that correspond to each output. Then in options.c:ReadOutputOrder, allocate the memory for iaOutput based on the number of arguments returned from ReadOptionStringArray, and assign each element the integer ID for that option. Then, in output.c, loop over each Outfile's iNumOutputs instead of all possibilities.

RoryBarnes avatar May 03 '21 18:05 RoryBarnes