Salome HOME
Homard executable
[modules/homard.git] / src / tool / AP_Conversion / pccapr.F
1       subroutine pccapr ( npfopa, npprof, liprof,
2      >                    nbpara, carenf, carach,
3      >                    ulsort, langue, codret )
4 c ______________________________________________________________________
5 c
6 c                             H O M A R D
7 c
8 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
9 c
10 c Version originale enregistree le 18 juin 1996 sous le numero 96036
11 c aupres des huissiers de justice Simart et Lavoir a Clamart
12 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
13 c aupres des huissiers de justice
14 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
15 c
16 c    HOMARD est une marque deposee d'Electricite de France
17 c
18 c Copyright EDF 1996
19 c Copyright EDF 1998
20 c Copyright EDF 2002
21 c Copyright EDF 2020
22 c ______________________________________________________________________
23 c
24 c    aPres adaptation - mise a jour des CAracteristiques
25 c     -                                 --
26 c                                   des PRofils
27 c                                       --
28 c ______________________________________________________________________
29 c .        .     .        .                                            .
30 c .  nom   . e/s . taille .           description                      .
31 c .____________________________________________________________________.
32 c . npfopa . e   .   1    . nombre de fonctions a traiter              .
33 c . npprof . es  .   1    . nombre de profils en sortie enregistres    .
34 c . liprof . es  . char*8 . nom des objets de type 'Profil' enregistres.
35 c . nbpara . e   .   1    . nombre de parametres a enregistrer par fonc.
36 c . carenf .   s .nbpara* . caracteristiques entieres des fonctions :  .
37 c .        .     .  nnfopa.  1 : 0, pour une fonction ancienne isolee  .
38 c .        .     .        .      1, pour une ancienne associee a une   .
39 c .        .     .        .         autre fonction                     .
40 c .        .     .        .      -1, pour une nouvelle fonction        .
41 c .        .     .        .  2 : typcha                                .
42 c .        .     .        .  3 : typgeo                                .
43 c .        .     .        .  4 : typass                                .
44 c .        .     .        .  5 : ngauss                                .
45 c .        .     .        .  6 : nnenmx                                .
46 c .        .     .        .  7 : nnvapr                                .
47 c .        .     .        .  8 : carsup                                .
48 c .        .     .        .  9 : nbtafo                                .
49 c .        .     .        . 10 : anvale                                .
50 c .        .     .        . 11 : anvalr                                .
51 c .        .     .        . 12 : anobch                                .
52 c .        .     .        . 13 : adprpg                                .
53 c .        .     .        . 14 : anlipr                                .
54 c .        .     .        . 15 : npenmx                                .
55 c .        .     .        . 16 : npvapr                                .
56 c .        .     .        . 17 : apvale                                .
57 c .        .     .        . 18 : apvalr                                .
58 c .        .     .        . 19 : apobch                                .
59 c .        .     .        . 20 : apprpg                                .
60 c .        .     .        . 21 : apvatt                                .
61 c .        .     .        . 22 : apvane                                .
62 c .        .     .        . 23 : antyas                                .
63 c .        .     .        . 24 : aptyas                                .
64 c .        .     .        . 25 : numero de la 1ere fonction associee   .
65 c .        .     .        . 26 : numero de la 2nde fonction associee   .
66 c . carach . es  .nbpara* . caracteristiques caracteres des fonctions :.
67 c .        .     .  nnfopa.  1 : nom de la fonction                    .
68 c .        .     .        .  2 : nom de la fonction n associee         .
69 c .        .     .        .  3 : nom de la fonction p associee         .
70 c .        .     .        .  4 : obpcan                                .
71 c .        .     .        .  5 : obpcap                                .
72 c .        .     .        .  6 : obprof                                .
73 c .        .     .        .  7 : oblopg                                .
74 c .        .     .        .  8 : si aux points de Gauss, nom de la     .
75 c .        .     .        .      fonction n ELNO correspondante        .
76 c .        .     .        .  9 : si aux points de Gauss, nom de la     .
77 c .        .     .        .      fonction p ELNO correspondante        .
78 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
79 c . langue . e   .    1   . langue des messages                        .
80 c .        .     .        . 1 : francais, 2 : anglais                  .
81 c . codret . es  .    1   . code de retour des modules                 .
82 c .        .     .        . 0 : pas de probleme                        .
83 c .        .     .        . 1 : probleme                               .
84 c ______________________________________________________________________
85 c
86 c====
87 c 0. declarations et dimensionnement
88 c====
89 c
90 c 0.1. ==> generalites
91 c
92       implicit none
93       save
94 c
95       character*6 nompro
96       parameter ( nompro = 'PCCAPR' )
97 c
98 #include "nblang.h"
99 #include "consts.h"
100 #include "meddc0.h"
101 c
102 c 0.2. ==> communs
103 c
104 #include "envex1.h"
105 c
106 #include "gmenti.h"
107 c
108 #include "nombsr.h"
109 #include "nbutil.h"
110 c
111 c 0.3. ==> arguments
112 c
113       integer npfopa, npprof
114       integer nbpara
115       integer carenf(nbpara,*)
116 c
117       character*8 liprof(*)
118       character*8 carach(nbpara,*)
119 c
120       integer ulsort, langue, codret
121 c
122 c 0.4. ==> variables locales
123 c
124       integer iaux, jaux
125 c
126       integer nrfonc
127       integer rsenac, adpcap
128       integer typgeo
129       integer nnvapr, npvapr
130 c
131       character*8 obpcap, opprof
132 c
133       integer nbmess
134       parameter ( nbmess = 10 )
135       character*80 texte(nblang,nbmess)
136 c
137 c 0.5. ==> initialisations
138 c ______________________________________________________________________
139 c
140 c====
141 c 1. initialisations
142 c====
143 c
144 c 1.1. ==> messages
145 c
146 #include "impr01.h"
147 c
148 #ifdef _DEBUG_HOMARD_
149       write (ulsort,texte(langue,1)) 'Entree', nompro
150       call dmflsh (iaux)
151 #endif
152 c
153       texte(1,4) = '(''Nom de l''''objet profil etape n = '',a8)'
154 c
155       texte(2,4) = '(''Name of the profile object #n: '',a8)'
156 c
157 #include "impr03.h"
158 c
159 c====
160 c 2. mise a jour des caracteristiques des profils
161 c====
162 c
163       do 20 , nrfonc = 1 , npfopa
164 c
165         if ( codret.eq.0 ) then
166 c
167         nnvapr = carenf(7,nrfonc)
168 c
169 #ifdef _DEBUG_HOMARD_
170         write (ulsort,*) '============================'
171         write (ulsort,90002) 'nnvapr', nnvapr
172 #endif
173 c
174         endif
175 c
176 c 2.1. ==> creation du profil eventuel
177 c
178 c 2.1.1. ==> recuperation des informations
179 c
180         if ( nnvapr.gt.0 ) then
181 c
182           if ( codret.eq.0 ) then
183 c
184           obpcap = carach( 5,nrfonc)
185 c
186 #ifdef _DEBUG_HOMARD_
187           write (ulsort,texte(langue,4)) obpcap
188 cgn          call gmprsx (nompro, obpcap )
189 #endif
190           call gmadoj ( obpcap, adpcap, iaux, codret )
191 c
192           endif
193 c
194           if ( codret.eq.0 ) then
195 c
196           typgeo = carenf( 3,nrfonc)
197 c
198 #ifdef _DEBUG_HOMARD_
199           write (ulsort,90002) 'typgeo', typgeo
200 #endif
201 c
202 c          Par convention HOMARD, les mailles sont rangees ainsi :
203 c            . les tetraedres
204 c            . les triangles
205 c            . les aretes
206 c            . les mailles-points
207 c            . les quadrangles
208 c            . les hexaedres
209 c            . les pyramides
210 c            . les pentaedres
211 c
212           if ( typgeo.eq.0 ) then
213             rsenac = rsnoto
214             iaux = 1
215             jaux = 0
216           elseif ( typgeo.eq.edtet4 .or. typgeo.eq.edte10 ) then
217             rsenac = rsteac
218             iaux = 1
219             jaux = 0
220           elseif ( typgeo.eq.edtri3 .or. typgeo.eq.edtri6 ) then
221             rsenac = rstrac
222             iaux = 1
223             jaux = nbtetr
224           elseif ( typgeo.eq.edseg2 .or. typgeo.eq.edseg3 ) then
225             rsenac = rsarac
226             iaux = 1
227             jaux = nbtetr + nbtria
228           elseif ( typgeo.eq.edpoi1 ) then
229             rsenac = rsmpac
230             iaux = 1
231             jaux = nbtetr + nbtria + nbsegm
232           elseif ( typgeo.eq.edqua4 .or. typgeo.eq.edqua8 ) then
233             rsenac = rsquac
234             iaux = 1
235             jaux = nbtetr + nbtria + nbsegm + nbmapo
236           elseif ( typgeo.eq.edhex8 .or. typgeo.eq.edhe20 ) then
237             rsenac = rsheac
238             iaux = 1
239             jaux = nbtetr + nbtria + nbsegm + nbmapo + nbquad
240           elseif ( typgeo.eq.edpyr5 .or. typgeo.eq.edpy13 ) then
241 cc            rsenac = rspyac
242             iaux = 1
243             jaux = nbtetr + nbtria + nbsegm + nbmapo + nbquad + nbhexa
244           elseif ( typgeo.eq.edpen6 .or. typgeo.eq.edpe15 ) then
245 cc            rsenac = rspeac
246             iaux = 1
247             jaux = nbtetr + nbtria + nbsegm + nbmapo + nbquad + nbhexa
248      >           + nbpyra
249           else
250             goto 20
251           endif
252 c
253           endif
254 c
255 #ifdef _DEBUG_HOMARD_
256           write (ulsort,90002) 'rsenac', rsenac
257           write (ulsort,90002) 'iaux  ', iaux
258           write (ulsort,90002) 'jaux  ', jaux
259 #endif
260 c
261 c 2.1.2. ==> creation du profil
262 c
263           if ( codret.eq.0 ) then
264 c
265 #ifdef _DEBUG_HOMARD_
266         write (ulsort,texte(langue,3)) 'UTPR01', nompro
267 #endif
268           call utpr01 ( iaux, jaux,
269      >                  rsenac, imem(adpcap), imem(iaux),
270      >                  npvapr, opprof,
271      >                  npprof, liprof,
272      >                  ulsort, langue, codret )
273 c
274 c
275 #ifdef _DEBUG_HOMARD_
276           call gmprsx (nompro,opprof)
277           call gmprsx (nompro,opprof//'.ListEnti')
278 #endif
279 c
280           endif
281 c
282 c 2.2. ==> sans profil
283 c
284         else
285 c
286           npvapr = -1
287           opprof = '        '
288 c                   12345678
289 c
290         endif
291 c
292 c 2.3. ==> archivages
293 c
294         if ( codret.eq.0 ) then
295 c
296 #ifdef _DEBUG_HOMARD_
297         write (ulsort,90002) 'npvapr', npvapr
298 #endif
299         carenf(16,nrfonc) = npvapr
300         carach( 6,nrfonc) = opprof
301 c
302         endif
303 c
304 c
305    20 continue
306 c
307 c====
308 c 3. la fin
309 c====
310 c
311       if ( codret.ne.0 ) then
312 c
313 #include "envex2.h"
314 c
315       write (ulsort,texte(langue,1)) 'Sortie', nompro
316       write (ulsort,texte(langue,2)) codret
317 c
318       endif
319 c
320 #ifdef _DEBUG_HOMARD_
321       write (ulsort,texte(langue,1)) 'Sortie', nompro
322       call dmflsh (iaux)
323 #endif
324 c
325       end