Skip to content

Change Output, TDOutput and OutputHow to allow more options

Description

Adding support for new format of Output definition in the input file (Closes #50 (closed)) Changes apply to:

  • Output, Output_KPT, OutputLDA_U: consolidated into the "Output" block
  • OutputFormat: Possible to define inside the Output block
  • OutputInterval: Possible to define inside the Output block
  • OutputMatrixElements > converted to block
  • MaxwellOutput > converted to block
  • MaxwellOutputInterval: Possible to define inside the MaxwellOutput block
  • TDOutput > converted to block
  • PhotoelectronSpectrumOutput > converted to block

Supported formats

%Output
 density
 wfs
%
OutputFormat = cube + axis_z
OutputInterval = 50
%Output
 density | cube + axis_z
 wfs     | cube
%
OutputInterval = 50
%Output
 mmb_den
 mmb_wfs | plane_z + axis_x
%
%Output
 density | "output_interval" | 10   | "output_format"   | cube + axis_z
 wfs     | "output_format"   | cube | "output_interval" | 50
%   
%Output
 density | "output_interval" | 10   | "output_format"   | cube + axis_z
 wfs     | "output_format"   | cube
%        

Implementation notes

The output_t type has been modified and its members what, how, and output_interval are converted into arrays (0:MAX_OUTPUT_TYPES):

  • what is a logical array. Each member represents an output option being active or not. With this change, the old checks as bitand(outp%what, OPTION__OUTPUT__WFS) /= 0 can be now expressed as outp%what(OPTION__OUTPUT__WFS)
  • how is an integer(8) array. Each member defines the flags for format(s) of the corresponding what
  • output_interval is an integer array. Each member defines the output interval of the corresponding what

Parsing the input file is done with a new subroutine io_function_read_what_how_when (@src/grid/io_function.F90) which accepts optional tags for what/how/interval and supports multiple input formats.

The new outp%what_now(OPTION__OUTPUT__X, iter) function returns true/false to indicate if OPTION__OUTPUT__X needs to be written at the iteration=iter or not.

Checklist

  • Update the tests to use the new format
  • Fix all the failing tests
  • Write new tests for the extra functionality
  • Update the documentations
  • Refactor the code
  • Rebase the changes
Edited by Meisam Tabriz

Merge request reports