The TELEMAC-MASCARET system  trunk
p_dmax.F
Go to the documentation of this file.
1 ! ********************************
2  DOUBLE PRECISION FUNCTION p_dmax
3 ! ********************************
4 !
5  &(mypart)
6 !
7 !***********************************************************************
8 ! PARALLEL V6P3 21/08/2010
9 !***********************************************************************
10 !
11 !brief MAXIMUM VALUE FROM ALL THE PROCESSORS.
12 !
13 !history RAINER JOHANNI (SGI MUNICH)
14 !+ **/10/1999
15 !+
16 !+ ADAPTED FOR MPI
17 !
18 !history J.A. JANKOWSKI (BAW KARLSRUHE)
19 !+ 28/12/1999
20 !+
21 !+ RELEASE 5.0 MODIFIED
22 !
23 !history J-M HERVOUET (LNHE)
24 !+ 23/06/2008
25 !+ V5P9
26 !+
27 !
28 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
29 !+ 13/07/2010
30 !+ V6P0
31 !+ Translation of French comments within the FORTRAN sources into
32 !+ English comments
33 !
34 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
35 !+ 21/08/2010
36 !+ V6P0
37 !+ Creation of DOXYGEN tags for automated documentation and
38 !+ cross-referencing of the FORTRAN sources
39 !
40 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41 !| MYPART |-->| SEND BUFFER
42 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 !
46  IMPLICIT NONE
47 !
48 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
49 !
50  DOUBLE PRECISION, INTENT(IN) :: MYPART
51 !
52 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
53 !
54 #if defined HAVE_MPI
55  INTEGER IER
56 !
57 !-----------------------------------------------------------------------
58 !
59 
60 # ifdef COMPAD
61  p_dmax=0.d0
62  CALL ampi_allreduce(mypart,p_dmax,1,ampi_type,ampi_op_max,
63  & comm,ier)
64 # else
65  CALL mpi_allreduce(mypart,p_dmax,1,mpi_double_precision,mpi_max,
66  & comm,ier)
67 # endif
68 !
69  IF(ier.NE.0) THEN
70  WRITE(lu,*) 'P_DMAX: ERROR IN MPI_ALLREDUCE'
71  WRITE(lu,*) 'MPI ERROR ',ier
72  CALL plante(1)
73  stop
74  ENDIF
75  RETURN
76 #else
77 !
78  p_dmax=mypart
79 !
80 #endif
81 !
82 !-----------------------------------------------------------------------
83 !
84  END
double precision function p_dmax(MYPART)
Definition: p_dmax.F:7
integer, parameter mpi_double_precision
integer, parameter ampi_type