Salome HOME
Homard executable
[modules/homard.git] / src / tool / AP_Conversion / pccac2.F
1       subroutine pccac2 ( nofonc, nnfonc,
2      >                    ulsort, langue, codret )
3 c ______________________________________________________________________
4 c
5 c                             H O M A R D
6 c
7 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
8 c
9 c Version originale enregistree le 18 juin 1996 sous le numero 96036
10 c aupres des huissiers de justice Simart et Lavoir a Clamart
11 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
12 c aupres des huissiers de justice
13 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
14 c
15 c    HOMARD est une marque deposee d'Electricite de France
16 c
17 c Copyright EDF 1996
18 c Copyright EDF 1998
19 c Copyright EDF 2002
20 c Copyright EDF 2020
21 c ______________________________________________________________________
22 c
23 c    aPres adaptation - mise a jour des CAracteristiques des Champs - 2
24 c     -                                 --                   -        -
25 c ______________________________________________________________________
26 c .        .     .        .                                            .
27 c .  nom   . e/s . taille .           description                      .
28 c .____________________________________________________________________.
29 c . nofonc . e   . char8  . nom de la fonction a ajouter               .
30 c . nnfonc . e   . char8  . nom de la fonction associee                .
31 c . adinch .   s .   1    . adresse de l'information sur les champs    .
32 c . adinpf .   s .   1    . adresse de l'information sur les fonctions .
33 c . adinpr .   s .   1    . adresse de l'information sur les profils   .
34 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
35 c . langue . e   .    1   . langue des messages                        .
36 c .        .     .        . 1 : francais, 2 : anglais                  .
37 c . codret . es  .    1   . code de retour des modules                 .
38 c .        .     .        . 0 : pas de probleme                        .
39 c .        .     .        . 1 : probleme                               .
40 c ______________________________________________________________________
41 c
42 c====
43 c 0. declarations et dimensionnement
44 c====
45 c
46 c 0.1. ==> generalites
47 c
48       implicit none
49       save
50 c
51       character*6 nompro
52       parameter ( nompro = 'PCCAC2' )
53 c
54 #include "nblang.h"
55 c
56 c 0.2. ==> communs
57 c
58 #include "envex1.h"
59 c
60 #include "gmstri.h"
61 c
62 c 0.3. ==> arguments
63 c
64       character*8 nofonc
65       character*8 nnfonc
66 c
67       integer ulsort, langue, codret
68 c
69 c 0.4. ==> variables locales
70 c
71       integer iaux, jaux
72       integer codre1, codre2
73       integer codre0
74 c
75       integer nbtafo
76       integer adobch
77       integer nbcomp, nbtvch, typcha
78       integer adnocp, adcaen, adcare, adcaca
79 c
80       character*8 nocham, saux08
81 c
82       integer nbmess
83       parameter ( nbmess = 10 )
84       character*80 texte(nblang,nbmess)
85 c
86 c 0.5. ==> initialisations
87 c ______________________________________________________________________
88 c
89 c====
90 c 1. initialisations
91 c====
92 c
93 c 1.1. ==> messages
94 c
95 #include "impr01.h"
96 c
97 #ifdef _DEBUG_HOMARD_
98       write (ulsort,texte(langue,1)) 'Entree', nompro
99       call dmflsh (iaux)
100 #endif
101 c
102       texte(1,4) = '(''Nom de la fonction a ajouter : '',a8)'
103       texte(1,5) = '(''Nom de la fonction associee  : '',a8)'
104       texte(1,6) = '(''..... Tableau'',i4,'' ==> Nom du champ : '',a)'
105       texte(1,7) = '(''..... Avant l''''ajout de la fonction :'')'
106       texte(1,8) = '(''..... Apres l''''ajout de la fonction :'')'
107       texte(1,9) = '(''Nombre de tableaux :'',i8)'
108 c
109       texte(2,4) = '(''Name of the function to add     : '',a8)'
110       texte(2,5) = '(''Name of the associated function : '',a8)'
111       texte(2,6) = '(''..... Array'',i4,'' ==> Name of field : '',a)'
112       texte(2,7) = '(''..... Before the addition of function :'')'
113       texte(2,8) = '(''..... Following the addition of function :'')'
114       texte(2,9) = '(''Number of arrays :'',i8)'
115 c
116 #ifdef _DEBUG_HOMARD_
117       write (ulsort,texte(langue,4)) nofonc
118       call gmprsx (nompro, nofonc )
119       write (ulsort,texte(langue,5)) nnfonc
120       call gmprsx (nompro, nnfonc )
121       call gmprsx (nompro, nnfonc//'.InfoCham' )
122 #endif
123 c
124 c====
125 c 2. mise a jour des caracteristiques du champ
126 c====
127 c
128 c 2.1. ==> reperage des tableaux et des champs associes a cette fonction
129 c
130       if ( codret.eq.0 ) then
131 c
132       call gmliat ( nofonc, 7, nbtafo, codre1 )
133       call gmadoj ( nofonc//'.InfoCham', adobch, iaux, codre2 )
134 c
135       codre0 = min ( codre1, codre2 )
136       codret = max ( abs(codre0), codret,
137      >               codre1, codre2 )
138 c
139       endif
140 c
141 #ifdef _DEBUG_HOMARD_
142       write (ulsort,texte(langue,9)) nbtafo
143 #endif
144 c
145 c 2.2. ==> enregistrement du champ associe a chaque tableau de
146 c          cette fonction
147 c
148       if ( codret.eq.0 ) then
149 c
150       saux08 = '        '
151 c               12345678
152 c
153       do 22 , jaux = 1 , nbtafo
154 c
155         nocham = smem(adobch+jaux-1)
156 c
157 #ifdef _DEBUG_HOMARD_
158         write (ulsort,texte(langue,6)) jaux, nocham
159 #endif
160 c
161         if ( nocham.ne.saux08 ) then
162 c
163 #ifdef _DEBUG_HOMARD_
164           if ( codret.eq.0 ) then
165           write (ulsort,texte(langue,7))
166           call gmprsx (nompro, nocham )
167           call gmprsx (nompro, nocham//'.Cham_Ent' )
168           call gmprsx (nompro, nocham//'.Cham_Car' )
169           endif
170 #endif
171 c
172           iaux = 1
173 c
174 #ifdef _DEBUG_HOMARD_
175       write (ulsort,texte(langue,3)) 'UTMOCH', nompro
176 #endif
177           call utmoch ( nocham, iaux,
178      >                  nofonc, nnfonc,
179      >                  nbcomp, nbtvch, typcha,
180      >                  adnocp, adcaen, adcare, adcaca,
181      >                  ulsort, langue, codret )
182 c
183           saux08 = nocham
184 c
185 #ifdef _DEBUG_HOMARD_
186           if ( codret.eq.0 ) then
187           write (ulsort,texte(langue,8))
188           call gmprsx (nompro, nocham )
189           call gmprsx (nompro, nocham//'.Cham_Ent' )
190           call gmprsx (nompro, nocham//'.Cham_Car' )
191           endif
192 #endif
193 c
194         endif
195 c
196    22 continue
197 c
198       endif
199 c
200 c====
201 c 3. la fin
202 c====
203 c
204       if ( codret.ne.0 ) then
205 c
206 #include "envex2.h"
207 c
208       write (ulsort,texte(langue,1)) 'Sortie', nompro
209       write (ulsort,texte(langue,2)) codret
210 c
211       endif
212 c
213 #ifdef _DEBUG_HOMARD_
214       write (ulsort,texte(langue,1)) 'Sortie', nompro
215       call dmflsh (iaux)
216 #endif
217 c
218       end