Create mechanism to easily output diagnostic values
Diagnostic values (like total KE/ total enstrophy/ mass/ etc) are often desired outputs at each time-step. These values are easily printed to a txt file using two functions: add_diagnostic and write_diagnostics. add_diagnostic adds the name and value of a diagnostic into a pair of strings which will be written into diagnostics.txt which the function write_diagnostics. Usage of add_diagnostic is as follows: add_diagnostic(name, value, header, line); This will add the string, 'name', onto the string, 'header', which will be the header of the diagnostics.txt file. The double (or int), 'value', will be added onto the string, 'line', which will be a row (or line) in the diagnostics.txt file. write_diagnostics will write these lines (header and line) into diagnostics.txt.
Showing with 123 additions and 57 deletions