Close various text output files
subroutine close_files
use file_utils, only: close_output_file
use mp, only: proc0
implicit none
if(.not.proc0) return
if (write_ascii .and. write_parity) call close_output_file (parity_unit)
if (write_ascii .and. write_verr) then
call close_output_file (res_unit)
call close_output_file (lpc_unit)
if (write_max_verr) call close_output_file (res_unit2)
end if
if (write_ascii .and. write_cerr) call close_output_file(cres_unit)
if (write_ascii .and. write_g) call close_output_file(dist_unit)
if (write_ascii .and. write_gyx) call close_output_file(yxdist_unit)
if (write_ascii) call close_output_file (out_unit)
if (write_ascii .and. write_cross_phase) call close_output_file (phase_unit)
if (write_ascii .and. write_heating) call close_output_file (heat_unit)
if (write_ascii .and. write_heating) call close_output_file (heat_unit2)
if (write_ascii .and. write_jext) call close_output_file (jext_unit)
if (dump_check1) call close_output_file (dump_check1_unit)
if (dump_check2) call close_output_file (dump_check2_unit)
end subroutine close_files