subroutine initialize_results(this, nsteps_in, niters_in, nprocs_in, nlevels_in,rank_in)
class(pf_results_t), intent(inout) :: this
integer, intent(in) :: nsteps_in, niters_in, nprocs_in, nlevels_in,rank_in
if (rank_in == 0) then
open(unit=123, file='result-size.dat', form='formatted')
write(123,'(I5, I5, I5, I5)') nsteps_in, niters_in, nprocs_in, nlevels_in
close(unit=123)
end if
this%dump => dump_results
this%destroy => destroy_results
this%nsteps=nsteps_in
this%nblocks=nsteps_in/nprocs_in
this%niters=niters_in
this%nprocs=nprocs_in
this%nlevels=nlevels_in
this%p_index=rank_in+100
write (this%fname_r, "(A13,I0.3,A4)") 'dat/residual_',rank_in,'.dat'
write (this%fname_e, "(A10,I0.3,A4)") 'dat/errors_',rank_in,'.dat'
allocate(this%errors(niters_in, this%nblocks, nlevels_in), &
this%residuals(niters_in, this%nblocks, nlevels_in))
this%errors = 0.0_pfdp
this%residuals = 0.0_pfdp
end subroutine initialize_results