The TELEMAC-MASCARET system  trunk
p_dmin.F
Go to the documentation of this file.
1 ! ********************************
2  DOUBLE PRECISION FUNCTION p_dmin
3 ! ********************************
4 !
5  &(mypart)
6 !
7 !***********************************************************************
8 ! PARALLEL V6P1 21/08/2010
9 !***********************************************************************
10 !
11 !brief MINIMUM VALUE FROM ALL THE PROCESSORS.
12 !
13 !history J-M HERVOUET (LNHE)
14 !+ 08/01/1997
15 !+
16 !+
17 !
18 !history RAINER JOHANNI (SGI MUNICH)
19 !+ **/10/1999
20 !+
21 !+ ADAPTED FOR MPI
22 !
23 !history J.A. JANKOWSKI (BAW KARLSRUHE)
24 !+ 28/12/1999
25 !+
26 !+ RELEASE 5.0 MODIFIED
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 # ifdef COMPAD
60  p_dmin=0.d0
61  CALL ampi_allreduce(mypart,p_dmin,1,ampi_type,ampi_op_min,
62  & comm,ier)
63 # else
64  CALL mpi_allreduce(mypart,p_dmin,1,mpi_double_precision,mpi_min,
65  & comm,ier)
66 # endif
67 !
68  IF(ier.NE.0) THEN
69  WRITE(lu,*) 'P_DMIN: ERROR IN MPI_ALLREDUCE'
70  WRITE(lu,*) 'MPI ERROR ',ier
71  CALL plante(1)
72  stop
73  ENDIF
74  RETURN
75 #else
76 !
77  p_dmin=mypart
78 !
79 #endif
80 !
81 !-----------------------------------------------------------------------
82 !
83  END
integer, parameter mpi_double_precision
double precision function p_dmin(MYPART)
Definition: p_dmin.F:7
integer, parameter ampi_type