initialize_results Subroutine

public subroutine initialize_results(this, nsteps_in, niters_in, nprocs_in, nlevels_in, rank_in)

Arguments

Type IntentOptional AttributesName
class(pf_results_t), intent(inout) :: this
integer, intent(in) :: nsteps_in
integer, intent(in) :: niters_in
integer, intent(in) :: nprocs_in
integer, intent(in) :: nlevels_in
integer, intent(in) :: rank_in

Called by

proc~~initialize_results~~CalledByGraph proc~initialize_results initialize_results proc~pf_pfasst_run pf_pfasst_run proc~pf_pfasst_run->proc~initialize_results

Contents

Source Code


Source Code

    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