The TELEMAC-MASCARET system  trunk
p_imax_array.F
Go to the documentation of this file.
1 ! ***********************
2  SUBROUTINE p_imax_array
3 ! ***********************
4 !
5  &(send_buffer, recv_buffer, ncount, ierr)
6 !
7 !***********************************************************************
8 ! PARALLEL V6P1 21/08/2010
9 !***********************************************************************
10 !
11 !brief MAX VALUES FROM ALL PROCESSES AND DISTRIBUTES THE RESULT BACK TO ALL PROCESSES
12 !
13 !history AUDOUIN YOANN
14 !+ 25/04/2013
15 !+
16 !+ CREATED
17 !
18 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 !| MYPART |-->| SEND BUFFER.
20 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 !
24  IMPLICIT NONE
25 !
26 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
27 !
28  INTEGER, INTENT(IN) :: NCOUNT
29  INTEGER, INTENT(IN) :: SEND_BUFFER(ncount)
30  INTEGER, INTENT(OUT) :: RECV_BUFFER(ncount)
31  INTEGER, INTENT(OUT) :: IERR
32 !
33 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 !
35 !
36 !-----------------------------------------------------------------------
37 !
38  ierr = 0
39  recv_buffer = 0
40 #if defined HAVE_MPI
41  CALL mpi_allreduce(send_buffer,recv_buffer,ncount,mpi_integer,
42  & mpi_max,comm,ierr)
43 !
44  IF(ierr.NE.0) THEN
45  WRITE(lu,*) 'P_IMAX_ARRAY: ERROR IN MPI_ALLREDUCE'
46  WRITE(lu,*) 'MPI ERROR ',ierr
47  CALL plante(1)
48  stop
49  ENDIF
50  RETURN
51 #else
52  WRITE(lu,*)'CALL OF P_IMAX_ARRAY IN ITS VOID VERSION'
53 !
54 !-----------------------------------------------------------------------
55 !
56 #endif
57 !
58 !-----------------------------------------------------------------------
59 !
60  END
61 
62 
integer, parameter mpi_integer
subroutine p_imax_array(SEND_BUFFER, RECV_BUFFER, NCOUNT, IERR)
Definition: p_imax_array.F:7