1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
*DECK MOCDSP
SUBROUTINE MOCDSP(N,NFI,NLONG,LC,NZON,NOM,KM,MCU,IM,PREV,NEXT,H)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Calculation of the position of the coefficients relative to a track
* in ACA matrices. Cyclic tracking version.
*
*Copyright:
* Copyright (C) 2002 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version
*
*Author(s): I. Suslov and R. Le Tellier
*
*Parameters: input
* NFI total number of volumes and surfaces.
* NLONG total number of cells with unknowns quantities.
* LC dimension of vector MCU.
* NZON index-number of the mixture type assigned to each volume.
* KM used in CDD acceleration.
* MCU used in CDD acceleration.
* IM used in CDD acceleration.
*
*Parameters: output
* PREV PREV(I): location of non diagonal element (NOM(I),NOM(I-1))
* of preconditioning matrices in vector CF and CQ.
* NEXT NEXT(I): location of non diagonal element (NOM(I),NOM(I+1))
* of preconditioning matrices in vector CF and CQ.
*
*Parameters: input/output
* N number of elements in the current track.
* NOM integer tracking elements.
* H real tracking elements.
*
*-----------------------------------------------------------------------
*
IMPLICIT NONE
*----
* SUBROUTINE ARGUMENTS
*----
INTEGER N,NFI,NLONG,LC,NZON(NFI),NOM(N),KM(NLONG),MCU(LC),
1 IM(NLONG),PREV(N),NEXT(N)
DOUBLE PRECISION H(N)
*----
* LOCAL VARIABLES
*----
INTEGER I,I1,I2,II,FOUN,FOUP,NOMI,NOMIN,NOMIP,NZI
*----
* UNFOLD CYCLIC TRACKING LINE
*----
CALL MCGTRK(NFI,NZON,N,NOM,H)
*----
* CONSTRUCT PREV & NEXT
*----
DO I=1,N
FOUN=-1
FOUP=-1
* current cell
NOMI=NOM(I)
IF((NOMI.LT.1).OR.(NOMI.GT.NFI)) THEN
WRITE(6,*) 'NFI= ',NFI,' NOMI= ',NOMI
CALL XABORT('MOCDSP: KM OVERFLOW.')
ENDIF
NZI=NZON(NOMI)
IF (NZI.LT.0) THEN
NEXT(I)=0
PREV(I)=0
ELSE
I1=IM(NOMI)
* next cell
IF (I.EQ.N) THEN
NOMIN=NOM(1)
ELSE
NOMIN=NOM(I+1)
ENDIF
* previous cell
IF(I.EQ.1) THEN
NOMIP=NOM(N)
ELSE
NOMIP=NOM(I-1)
ENDIF
IF ((NOMI.EQ.NOMIN).OR.(NZON(NOMIN).LT.0)) THEN
FOUN=0
ENDIF
IF ((NOMI.EQ.NOMIP).OR.(NZON(NOMIP).LT.0)) THEN
FOUP=0
ENDIF
*
I2=I1+KM(NOMI)
I1=I1+1
DO II=I1,I2
IF ((FOUN.LT.0).AND.(MCU(II).EQ.NOMIN)) THEN
FOUN=II
ENDIF
IF ((FOUP.LT.0).AND.(MCU(II).EQ.NOMIP)) THEN
FOUP=II
ENDIF
IF ((FOUN.GE.0).AND.(FOUP.GE.0)) GOTO 10
ENDDO
* connectivity between NOMI and NOMIN and/or NOMIP not found
WRITE(6,100) I,NOMI,NOMIN,NOMIP
CALL PRINIM('NOM ',NOM(1),N)
CALL PRINIM('MCU ',MCU(I1),KM(NOMI))
CALL XABORT('MOCDSP: FAILURE 1.')
10 IF ((FOUN.LE.LC).AND.(FOUP.LE.LC)) THEN
PREV(I)=FOUP
NEXT(I)=FOUN
ELSE
CALL XABORT('MOCDSP: CQ/CF OVERFLOW.')
ENDIF
ENDIF
ENDDO
*
100 FORMAT(1X,'I=',I3,' NOMI=',I5,' NOMIN=',I5,' NOMIP=',I5)
*
RETURN
END
|