Print a log that can be used to check whether the code still produces the same output (regression test)
subroutine printlog_regression_test() use mod_global_parameters integer, parameter :: n_modes = 2 character(len=40) :: fmt_string character(len=2048) :: line logical, save :: file_open = .false. integer :: power double precision :: modes(nw, n_modes), volume integer :: amode, istatus(MPI_STATUS_SIZE) character(len=80) :: filename do power = 1, n_modes call get_volume_average(power, modes(:, power), volume) end do if (mype == 0) then if (.not. file_open) then filename = trim(base_filename) // ".log" amode = ior(MPI_MODE_CREATE,MPI_MODE_WRONLY) amode = ior(amode,MPI_MODE_APPEND) call MPI_FILE_OPEN(MPI_COMM_SELF, filename, amode, MPI_INFO_NULL,& log_fh, ierrmpi) file_open = .true. line= "# time mean(w) mean(w**2)" call MPI_FILE_WRITE(log_fh, trim(line) // new_line('a'),& len_trim(line)+1, MPI_CHARACTER, istatus, ierrmpi) end if write(fmt_string, "(a,i0,a)") "(", nw * n_modes + 1, fmt_r // ")" write(line, fmt_string) global_time, modes call MPI_FILE_WRITE(log_fh, trim(line) // new_line('a') ,& len_trim(line)+1, MPI_CHARACTER, istatus, ierrmpi) end if end subroutine printlog_regression_test