Appends a new row of diagnostic data to the CSV file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(case_params_t), | intent(in) | :: | params | |||
| type(flow_mpi_t), | intent(in) | :: | flow | |||
| integer, | intent(in) | :: | step | |||
| real(kind=rk), | intent(in) | :: | time | |||
| type(solver_stats_t), | intent(in) | :: | stats |
subroutine write_diagnostics_row(params, flow, step, time, stats) type(case_params_t), intent(in) :: params type(flow_mpi_t), intent(in) :: flow integer, intent(in) :: step real(rk), intent(in) :: time type(solver_stats_t), intent(in) :: stats integer :: unit_id character(len=path_len + 32) :: filename if (flow%rank /= 0 .or. .not. params%write_diagnostics) return filename = trim(params%output_dir)//'/diagnostics.csv' open(newunit=unit_id, file=trim(filename), status='old', position='append', action='write') write(unit_id,'(i0,a,es16.8,a,es16.8,a,es16.8,a,es16.8,a,es16.8,a,es16.8,a,'// & 'i0,a,i0,a,i0,a,es16.8,a,i0,a,es16.8,a,es16.8,a,es16.8,a,'// & 'es16.8,a,es16.8,a,es16.8)') & step, ',', time, ',', params%dt, ',', stats%max_divergence, ',', & stats%rms_divergence, ',', stats%net_boundary_flux, ',', & stats%kinetic_energy, ',', stats%pressure_iterations, ',', & stats%pressure_iterations_total, ',', stats%pressure_iterations_max, ',', & stats%pressure_iterations_avg, ',', stats%pressure_solve_count, ',', & stats%pressure_residual, ',', stats%cfl, ',', stats%wall_time, ',', & stats%max_velocity, ',', stats%total_mass, ',', stats%min_species_y close(unit_id) end subroutine write_diagnostics_row