Salome HOME
Homard executable
[modules/homard.git] / src / tool / AP_Conversion / pccapf.F
1       subroutine pccapf ( nppafo, npfopa, nbcham, nocham,
2      >                    nbpara, carenf, carchf,
3      >                    option,
4      >                    ulsort, langue, codret )
5 c ______________________________________________________________________
6 c
7 c                             H O M A R D
8 c
9 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
10 c
11 c Version originale enregistree le 18 juin 1996 sous le numero 96036
12 c aupres des huissiers de justice Simart et Lavoir a Clamart
13 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
14 c aupres des huissiers de justice
15 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
16 c
17 c    HOMARD est une marque deposee d'Electricite de France
18 c
19 c Copyright EDF 1996
20 c Copyright EDF 1998
21 c Copyright EDF 2002
22 c Copyright EDF 2020
23 c ______________________________________________________________________
24 c
25 c    aPres adaptation - mise a jour des CAracteristiques
26 c     -                                 --
27 c                                   des Paquets de Fonctions
28 c                                       -          -
29 c ______________________________________________________________________
30 c .        .     .        .                                            .
31 c .  nom   . e/s . taille .           description                      .
32 c .____________________________________________________________________.
33 c . nppafo . e   .    1   . nom du paquet de fonctions iteration p     .
34 c . npfopa . e   .   1    . nombre de fonctions a traiter              .
35 c . nbcham . e   .   1    . nombre de champs                           .
36 c . nocham . es  . nbcham . nom des objets qui contiennent la          .
37 c .        .     .        . description de chaque champ                .
38 c . nbpara . e   .   1    . nombre de parametres a enregistrer par fonc.
39 c . carenf .   s .nbpara* . caracteristiques entieres des fonctions :  .
40 c .        .     .  nnfopa.  1 : 0, pour une fonction ancienne isolee  .
41 c .        .     .        .      1, pour une ancienne associee a une   .
42 c .        .     .        .         autre fonction                     .
43 c .        .     .        .      -1, pour une nouvelle fonction        .
44 c .        .     .        .  2 : typcha                                .
45 c .        .     .        .  3 : typgeo                                .
46 c .        .     .        .  4 : typass                                .
47 c .        .     .        .  5 : ngauss                                .
48 c .        .     .        .  6 : nnenmx                                .
49 c .        .     .        .  7 : nnvapr                                .
50 c .        .     .        .  8 : carsup                                .
51 c .        .     .        .  9 : nbtafo                                .
52 c .        .     .        . 10 : anvale                                .
53 c .        .     .        . 11 : anvalr                                .
54 c .        .     .        . 12 : anobch                                .
55 c .        .     .        . 13 : adprpg                                .
56 c .        .     .        . 14 : anlipr                                .
57 c .        .     .        . 15 : npenmx                                .
58 c .        .     .        . 16 : npvapr                                .
59 c .        .     .        . 17 : apvale                                .
60 c .        .     .        . 18 : apvalr                                .
61 c .        .     .        . 19 : apobch                                .
62 c .        .     .        . 20 : apprpg                                .
63 c .        .     .        . 21 : apvatt                                .
64 c .        .     .        . 22 : apvane                                .
65 c .        .     .        . 23 : antyas                                .
66 c .        .     .        . 24 : aptyas                                .
67 c .        .     .        . 25 : numero de la 1ere fonction associee   .
68 c .        .     .        . 26 : numero de la 2nde fonction associee   .
69 c . carchf . es  .nbpara* . caracteristiques caracteres des fonctions :.
70 c .        .     .  nnfopa.  1 : nom de la fonction                    .
71 c .        .     .        .  2 : nom de la fonction n associee         .
72 c .        .     .        .  3 : nom de la fonction p associee         .
73 c .        .     .        .  4 : obpcan                                .
74 c .        .     .        .  5 : obpcap                                .
75 c .        .     .        .  6 : obprof                                .
76 c .        .     .        .  7 : oblopg                                .
77 c .        .     .        .  8 : si aux points de Gauss, nom de la     .
78 c .        .     .        .      fonction n ELNO correspondante        .
79 c .        .     .        .  9 : si aux points de Gauss, nom de la     .
80 c .        .     .        .      fonction p ELNO correspondante        .
81 c . option . e   .    1   . option du traitement                       .
82 c .        .     .        . -1 : Pas de changement dans le maillage    .
83 c .        .     .        .  0 : Adaptation complete                   .
84 c .        .     .        .  1 : Modification de degre                 .
85 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
86 c . langue . e   .    1   . langue des messages                        .
87 c .        .     .        . 1 : francais, 2 : anglais                  .
88 c . codret . es  .    1   . code de retour des modules                 .
89 c .        .     .        . 0 : pas de probleme                        .
90 c .        .     .        . 1 : probleme                               .
91 c ______________________________________________________________________
92 c
93 c====
94 c 0. declarations et dimensionnement
95 c====
96 c
97 c 0.1. ==> generalites
98 c
99       implicit none
100       save
101 c
102       character*6 nompro
103       parameter ( nompro = 'PCCAPF' )
104 c
105 #include "nblang.h"
106 c
107 c 0.2. ==> communs
108 c
109 #include "envex1.h"
110 c
111 c 0.3. ==> arguments
112 c
113       integer nbpara
114       integer npfopa, nbcham
115       integer carenf(nbpara,*)
116       integer option
117 c
118       character*8 nppafo
119       character*8 nocham(nbcham)
120       character*8 carchf(nbpara,*)
121 c
122       integer ulsort, langue, codret
123 c
124 c 0.4. ==> variables locales
125 c
126       integer iaux, jaux
127 c
128       integer nrfonc
129       integer tbiaux(1)
130       integer typgpf, ngauss, carsup, typint
131       integer apobfo
132 c
133       character*8 nnfonc
134       character*8 npfonc, opprof, oplopg
135       character*8 nnpafo
136       character*8 tbsaux(1)
137 c
138       integer nbmess
139       parameter ( nbmess = 20 )
140       character*80 texte(nblang,nbmess)
141 c
142 c 0.5. ==> initialisations
143 c ______________________________________________________________________
144 c
145 c====
146 c 1. initialisations
147 c====
148 c
149 #include "impr01.h"
150 c
151 #ifdef _DEBUG_HOMARD_
152       write (ulsort,texte(langue,1)) 'Entree', nompro
153       call dmflsh (iaux)
154 #endif
155 c
156       texte(1,4) =
157      > '(''Nom de la fonction '',a,'' numero'',i3,'' : '',a8)'
158       texte(1,5) = '(''... Nom du profil = '',a8)'
159       texte(1,6) = '(''... fonction nouvelle'')'
160       texte(1,7) = '(''... fonction ancienne isolee'')'
161       texte(1,8) = '(''... fonction ancienne associee a une autre'')'
162       texte(1,9) = '(''Suppression de la fonction '',a)'
163       texte(1,10) = '(''... '',a,'' : '',i6)'
164       texte(1,11) =
165      > '(''Remplacement du nom de la fonction dans le paquet :'')'
166       texte(1,12) = '(3x,a,'' devient '',a)'
167       texte(1,13) =
168      > '(''Ajout du nom de la fonction '',a,'' dans le paquet'')'
169       texte(1,20) = '(''Nombre de fonctions dans le paquet :'',i4)'
170 c
171       texte(2,4) = '(''Name of the function '',a,'' #'',i3,'' : '',a8)'
172       texte(2,5) = '(''... Name of the profile = '',a8)'
173       texte(2,6) = '(''... new function'')'
174       texte(2,7) = '(''... old lonesome function'')'
175       texte(2,8) = '(''... old function connected to another one'')'
176       texte(2,9) = '(''Deleting of the function '',a)'
177       texte(2,10) = '(''... '',a,'' : '',i6)'
178       texte(2,11) = '(''Change of function name in the pack'')'
179       texte(2,12) = '(3x,a,'' becomes '',a)'
180       texte(2,13) =
181      > '(''Addition of function name '',a,'' to the pack'')'
182       texte(2,20) = '(''Number of functions in the pack :'',i4)'
183 c
184 #include "impr03.h"
185 c
186 #ifdef _DEBUG_HOMARD_
187       write (ulsort,texte(langue,20)) npfopa
188       write (ulsort,90002) 'option', option
189 #endif
190 c
191 c====
192 c 2. mise a jour des caracteristiques des fonctions
193 c====
194 c
195       do 20 , nrfonc = 1 , npfopa
196 c
197 c 2.1. ==> mise a jour des caracteristiques des fonctions
198 c
199         if ( codret.eq.0 ) then
200 c
201 cgn      write (ulsort,texte(langue,10)), 'nrfonc', nrfonc
202 cgn      write (ulsort,91010) (carenf(iaux,nrfonc),iaux=1,nbpara)
203 cgn      write (ulsort,93010) (carchf(iaux,nrfonc),iaux=1,nbpara)
204 c
205         iaux = nrfonc
206 #ifdef _DEBUG_HOMARD_
207       write (ulsort,texte(langue,3)) 'PCCAFO', nompro
208 #endif
209         call pccafo ( iaux, npfonc, opprof, oplopg,
210      >                nbpara, carenf, carchf,
211      >                option,
212      >                ulsort, langue, codret )
213 c
214         endif
215 c
216 #ifdef _DEBUG_HOMARD_
217         write (ulsort,*) ' '
218         write (ulsort,texte(langue,4)) 'p', nrfonc, npfonc
219         write (ulsort,texte(langue,5)) opprof
220         call gmprsx (nompro,npfonc)
221         call gmprot (nompro,npfonc//'.ValeursR',1,20)
222 cgn        call gmprsx (nompro,npfonc//'.InfoPrPG')
223 #endif
224 c
225 c 2.2. ==> mise a jour des caracteristiques des champs
226 #ifdef _DEBUG_HOMARD_
227       write (ulsort,*) '2.2. mise a jour ; codret =', codret
228 #endif
229 c
230         iaux = carenf(1,nrfonc)
231 c
232 #ifdef _DEBUG_HOMARD_
233         write (ulsort,texte(langue,7+iaux))
234 #endif
235 c
236 c 2.2.1. ==> remplacement quand la fonction existait deja
237 c
238         if ( iaux.ge.0 ) then
239 c
240           if ( codret.eq.0 ) then
241 c
242           nnfonc = carchf( 2,nrfonc)
243 #ifdef _DEBUG_HOMARD_
244           write (ulsort,texte(langue,4)) 'n', nrfonc, nnfonc
245           write (ulsort,texte(langue,11))
246           write (ulsort,texte(langue,12)) nnfonc, npfonc
247 cgn        call gmprsx (nompro,nnfonc)
248 cgn        call gmprsx (nompro,nnfonc//'.InfoPrPG')
249       write (ulsort,texte(langue,3)) 'PCCAC1', nompro
250 #endif
251           call pccac1 ( nbcham, nocham,
252      >                  nnfonc, npfonc, opprof, oplopg,
253      >                  ulsort, langue, codret )
254 c
255           endif
256 c
257 c 2.2.2. ==> ajout sinon
258 c
259         else
260 c
261           if ( codret.eq.0 ) then
262 c
263           nnfonc = carchf( 3,nrfonc)
264 c
265 #ifdef _DEBUG_HOMARD_
266           write (ulsort,texte(langue,4)) 'n', nrfonc, nnfonc
267           write (ulsort,texte(langue,13)) npfonc
268       write (ulsort,texte(langue,3)) 'PCCAC2', nompro
269 #endif
270           call pccac2 ( npfonc, nnfonc,
271      >                  ulsort, langue, codret )
272 c
273           endif
274 c
275         endif
276 c
277    20 continue
278 c
279 c====
280 c 3. suppression des anciennes fonctions
281 c    attention a ne le faire qu'a ce moment, car le nom connu peut
282 c    etre le meme pour plusieurs fonctions p dans le cas de conformite.
283 c    Si on le faisait dans la boucle 20, on perdrait tout !
284 c====
285 #ifdef _DEBUG_HOMARD_
286       write (ulsort,*) '3. suppression ; codret =', codret
287 #endif
288 c
289       do 30 , nrfonc = 1 , npfopa
290 c
291         if ( codret.eq.0 ) then
292 c
293         iaux = carenf(1,nrfonc)
294 c
295         if ( iaux.eq.0 ) then
296 c
297           nnfonc = carchf( 2,nrfonc)
298 c
299 #ifdef _DEBUG_HOMARD_
300           write (ulsort,texte(langue,9)) nnfonc
301 #endif
302 c
303           call gmobal ( nnfonc, jaux )
304 c
305           if ( jaux.eq.1 ) then
306             call gmsgoj ( nnfonc , codret )
307           elseif ( jaux.ne.0 ) then
308             codret = 3
309           endif
310 c
311         endif
312 c
313         endif
314 c
315    30 continue
316 c
317 c====
318 c 4. degre du type geometrique
319 c====
320 c
321       if ( option.eq.1 ) then
322 c
323       if ( codret.eq.0 ) then
324 c
325 #ifdef _DEBUG_HOMARD_
326       write (ulsort,texte(langue,3)) 'UTMOPF', nompro
327 #endif
328       iaux = 6
329       call utmopf ( nppafo, iaux,
330      >              jaux, tbsaux, tbiaux,
331      >              nnpafo,
332      >              npfopa, typgpf, ngauss, carsup, typint,
333      >              apobfo,
334      >              ulsort, langue, codret )
335 c
336       endif
337 c
338       endif
339 c
340 c====
341 c 5. la fin
342 c====
343 c
344       if ( codret.ne.0 ) then
345 c
346 #include "envex2.h"
347 c
348       write (ulsort,texte(langue,1)) 'Sortie', nompro
349       write (ulsort,texte(langue,2)) codret
350 c
351       endif
352 c
353 #ifdef _DEBUG_HOMARD_
354       write (ulsort,texte(langue,1)) 'Sortie', nompro
355       call dmflsh (iaux)
356 #endif
357 c
358       end