assemble_resnom_at_each_process Subroutine

private subroutine assemble_resnom_at_each_process(control)

Sum residual obtained from all the processes after MPI_Communication

Arguments

Type IntentOptional AttributesName
type(controltype), intent(in) :: control

Control parameters: number of variables and total mpi processes


Called by

proc~~assemble_resnom_at_each_process~~CalledByGraph proc~assemble_resnom_at_each_process assemble_resnom_at_each_process proc~find_resnorm find_resnorm proc~find_resnorm->proc~assemble_resnom_at_each_process proc~iterate_one_more_time_step iterate_one_more_time_step proc~iterate_one_more_time_step->proc~find_resnorm program~main main program~main->proc~iterate_one_more_time_step

Contents


Source Code

    subroutine assemble_resnom_at_each_process(control)
      !< Sum residual obtained from all the processes after MPI_Communication
      implicit none
      type(controltype), intent(in) :: control
      !< Control parameters: number of variables and total mpi processes
      integer :: i,j
      Res_abs=0.
      do i=0,control%total_process-1
        do j = 0,control%n_var
          Res_abs(j) =  Res_abs(j)+buffer((j+1)+(control%n_var+1)*i)
        end do
      end do
      Res_abs(1:) = sqrt(Res_abs(1:))
      Res_abs(0) =  abs(Res_abs(0))
    end subroutine assemble_resnom_at_each_process