The TELEMAC-MASCARET system  trunk
cntpre.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE cntpre
3 ! *****************
4 !
5  &(dam,npoin,ipreco,iprec2)
6 !
7 !***********************************************************************
8 ! ARTEMIS V7P0
9 !***********************************************************************
10 !
11 !brief INHIBITS THE DIAGONAL PRECONDITIONING IF ONE OF THE
12 !+ ELEMENTS OF DAM IS NEGATIVE OR ZERO.
13 !code
14 !+ --------------------------------------------------------------------
15 !+ | VALUE OF IPREC2 I MEANING
16 !+ | OR IPRECO I
17 !+ --------------------------------------------------------------------
18 !+ | 1 I NOTHING.
19 !+ | 2 I DIAGONAL PRECONDITIONING USING THE MATRIX
20 !+ | I DIAGONAL.
21 !+ | 3 I DIAGONAL PRECONDITIONING USING THE CONDENSED
22 !+ | I MATRIX.
23 !+ | 5 I OTHER (NOT DEFINED)
24 !+ | I
25 !+ | 7 I CROUT PRECONDITIONING BY ELEMENT
26 !+ | I (NOT CODED IN)
27 !+ --------------------------------------------------------------------
28 !
29 !history J-M HERVOUET (LNH)
30 !+
31 !+
32 !+ LINKED TO BIEF 5.0
33 !
34 !history D. AELBRECHT (LNH)
35 !+ 02/06/1999
36 !+ V5P1
37 !+
38 !
39 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
40 !+ 13/07/2010
41 !+ V6P0
42 !+ Translation of French comments within the FORTRAN sources into
43 !+ English comments
44 !
45 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
46 !+ 21/08/2010
47 !+ V6P0
48 !+ Creation of DOXYGEN tags for automated documentation and
49 !+ cross-referencing of the FORTRAN sources
50 !
51 !history J-M HERVOUET (EDF LAB, LNHE)
52 !+ 23/02/2015
53 !+ V7P0
54 !+ A parallel communication is necessary when the preconditioning
55 !+ is changed.
56 !
57 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 !| DAM |-->| DIAGONALE OF THE MATRIX
59 !| IPREC2 |<--| PRECONDITIONNING USED
60 !| IPRECO |-->| PRECONDITIONNING REQUIRED BY USER
61 !| NPOIN |-->| NUMBER OF POINTS
62 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 !
64  USE bief
66 !
68  IMPLICIT NONE
69 !
70  INTEGER, INTENT(IN) :: NPOIN
71  INTEGER, INTENT(INOUT) :: IPRECO, IPREC2
72  DOUBLE PRECISION, INTENT(IN) :: DAM(npoin)
73 !
74 !-----------------------------------------------------------------------
75 !
76  INTEGER I
77 !
78 !-----------------------------------------------------------------------
79 !
80  IF (ipreco.EQ.0) ipreco = 1
81  iprec2 = ipreco
82 !
83  IF (mod(ipreco,2).EQ.0.OR.mod(ipreco,3).EQ.0) THEN
84 !
85  DO i=1,npoin
86  IF (dam(i).LE.0.d0) THEN
87  DO WHILE(mod(iprec2,2).EQ.0)
88  iprec2 = iprec2/2
89  ENDDO
90  DO WHILE(mod(iprec2,3).EQ.0)
91  iprec2 = iprec2/3
92  ENDDO
93  WRITE(lu,101)
94 101 FORMAT(1x,'CNTPRE (ARTEMIS) : DIAGONAL SCALING NOT APPLIED (ONE
95  &COEFFICIENT OF THE MATRIX DIAGONAL IS NEGATIVE OR ZERO)')
96  EXIT
97  ENDIF
98  ENDDO
99 !
100  ELSEIF (mod(ipreco,5).EQ.0) THEN
101 !
102  DO i=1,npoin
103  IF (abs(dam(i)).LE.1.d-6) THEN
104  DO WHILE(mod(iprec2,5).EQ.0)
105  iprec2 = iprec2/5
106  ENDDO
107  WRITE(lu,201)
108 201 FORMAT(1x,'CNTPRE (ARTEMIS) : DIAGONAL SCALING NOT APPLIED (ONE
109  &COEFFICIENT OF THE MATRIX DIAGONAL IS ZERO)')
110  EXIT
111  ENDIF
112  ENDDO
113 !
114  ENDIF
115 !
116 !-----------------------------------------------------------------------
117 !
118 ! IPREC2 MAY HAVE BEEN CHANGED IN ANOTHER PROCESSOR, BUT ALWAYS
119 ! IN THE SENSE OF A REDUCTION
120 !
121  IF(ncsize.GT.1) iprec2=p_min(iprec2)
122 !
123 !-----------------------------------------------------------------------
124 !
125  RETURN
126  END
127 
subroutine cntpre(DAM, NPOIN, IPRECO, IPREC2)
Definition: cntpre.f:7
Definition: bief.f:3