]> SALOME platform Git repositories - modules/homard.git/blob - src/tool/Decision/deinit.F
Salome HOME
Copyright update 2022
[modules/homard.git] / src / tool / Decision / deinit.F
1       subroutine deinit ( nomail, nohind,
2      >                    lgopti, taopti, lgoptr, taoptr,
3      >                    lgopts, taopts, lgetco, taetco,
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 traitement des DEcisions - INITialisations
26 c                --          ----
27 c ______________________________________________________________________
28 c .        .     .        .                                            .
29 c .  nom   . e/s . taille .           description                      .
30 c .____________________________________________________________________.
31 c . nomail . e   .  ch8   . nom de l'objet contenant le maillage       .
32 c . nohind . e   .  ch8   . nom de l'objet contenant l'indicateur      .
33 c . lgopti . e   .   1    . longueur du tableau des options            .
34 c . taopti . e   . lgopti . tableau des options                        .
35 c . lgoptr . e   .   1    . longueur du tableau des options reelles    .
36 c . taoptr . e   . lgoptr . tableau des options reelles                .
37 c . lgopts . e   .   1    . longueur du tableau des options caracteres .
38 c . taopts . e   . lgopts . tableau des options caracteres             .
39 c . lgetco . e   .   1    . longueur du tableau de l'etat courant      .
40 c . taetco . e   . lgetco . tableau de l'etat courant                  .
41 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
42 c . langue . e   .    1   . langue des messages                        .
43 c .        .     .        . 1 : francais, 2 : anglais                  .
44 c . codret . es  .    1   . code de retour des modules                 .
45 c .        .     .        . 0 : pas de probleme                        .
46 c ______________________________________________________________________
47 c
48 c====
49 c 0. declarations et dimensionnement
50 c====
51 c
52 c 0.1. ==> generalites
53 c
54       implicit none
55       save
56 c
57       character*6 nompro
58       parameter ( nompro = 'DEINIT' )
59 c
60 #include "nblang.h"
61 c
62 c 0.2. ==> communs
63 c
64 #include "envex1.h"
65 c
66 #include "gmenti.h"
67 c
68 #include "nombmp.h"
69 #include "nombar.h"
70 #include "nombtr.h"
71 #include "nombqu.h"
72 #include "nombte.h"
73 #include "nombpy.h"
74 #include "nombhe.h"
75 #include "nombpe.h"
76 #include "envca1.h"
77 #include "envada.h"
78 #include "impr02.h"
79 c
80 c 0.3. ==> arguments
81 c
82       character*8 nomail, nohind
83 c
84       integer lgopti
85       integer taopti(lgopti)
86 c
87       integer lgoptr
88       double precision taoptr(lgoptr)
89 c
90       integer lgopts
91       character*8 taopts(lgopts)
92 c
93       integer lgetco
94       integer taetco(lgetco)
95 c
96       integer ulsort, langue, codret
97 c
98 c 0.4. ==> variables locales
99 c
100       integer codava
101       integer nrosec
102       integer nretap, nrsset
103       integer iaux, jaux
104       integer ideb, ifin
105 c
106       integer pdecfa, pdecar
107       integer ppovos, pvoiso
108       integer pnoemp, phetmp
109       integer psomar, phetar, pfilar, pmerar, pnp2ar
110       integer pposif, pfacar
111       integer paretr, phettr, pfiltr, ppertr, pnivtr, advotr
112       integer parequ, phetqu, pfilqu, pperqu, pnivqu, advoqu
113       integer ptrite, phette, pfilte
114       integer pfacpy, phetpy
115       integer pquahe, phethe, pfilhe
116       integer pfacpe, phetpe, pfilpe
117       integer adpptr, adppqu
118       integer adtra3
119 c
120       integer codre0, codre1, codre2
121 c
122       character*6 saux
123       character*8 norenu
124       character*8 nhnoeu, nhmapo, nharet, nhtria, nhquad
125       character*8 nhtetr, nhhexa, nhpyra, nhpent
126       character*8 nhelig
127       character*8 nhvois, nhsupe, nhsups
128       character*8 ntrav1, ntrav2, ntrav3
129 c
130       integer nbmess
131       parameter ( nbmess = 10 )
132       character*80 texte(nblang,nbmess)
133 c
134 c 0.5. ==> initialisations
135 c ______________________________________________________________________
136 c
137 c====
138 c 1. messages
139 c====
140 c
141 #include "impr01.h"
142 c
143 #ifdef _DEBUG_HOMARD_
144       write (ulsort,texte(langue,1)) 'Entree', nompro
145       call dmflsh (iaux)
146 #endif
147 c
148       codava = codret
149 c
150 c=======================================================================
151       if ( codava.eq.0 ) then
152 c=======================================================================
153 c
154 c 1.1. ==> le debut des mesures de temps
155 c
156       nrosec = taetco(4)
157       call gtdems (nrosec)
158 c
159 c 1.3. ==> les messages
160 c
161       texte(1,4) =
162      > '(/,a6,'' INITIALISATION ET FILTRAGE DES DECISIONS'')'
163       texte(1,5) = '(47(''=''),/)'
164       texte(1,6) = '(/,''Decisions sur les '',a)'
165       texte(1,7) = '(/,5x,''Bilan de l''''initialisation'')'
166 c
167       texte(2,4) =
168      > '(/,a6,'' INITIALISATION AND FILTERING OF DECISIONS'')'
169       texte(2,5) = '(48(''=''),/)'
170       texte(2,6) = '(/,''Decisions over '',a)'
171       texte(2,7) = '(/,5x,''Summary after the initialisation'')'
172 c
173 #include "impr03.h"
174 c
175 c 1.4. ==> le numero de sous-etape
176 c
177       nretap = taetco(1)
178       nrsset = taetco(2) + 1
179       taetco(2) = nrsset
180 c
181       call utcvne ( nretap, nrsset, saux, iaux, codret )
182 c
183 c 1.5. ==> le titre
184 c
185       write (ulsort,texte(langue,4)) saux
186       write (ulsort,texte(langue,5))
187 c
188 c====
189 c 2. gestion des tableaux
190 c====
191 c
192 c 2.1. ==> structure generale
193 c
194       if ( codret.eq.0 ) then
195 c
196 #ifdef _DEBUG_HOMARD_
197       write (ulsort,texte(langue,3)) 'UTNOMH', nompro
198 #endif
199       call utnomh ( nomail,
200      >                sdim,   mdim,
201      >               degre, maconf, homolo, hierar,
202      >              rafdef, nbmane, typcca, typsfr, maextr,
203      >              mailet,
204      >              norenu,
205      >              nhnoeu, nhmapo, nharet,
206      >              nhtria, nhquad,
207      >              nhtetr, nhhexa, nhpyra, nhpent,
208      >              nhelig,
209      >              nhvois, nhsupe, nhsups,
210      >              ulsort, langue, codret)
211 c
212       endif
213 c
214 c 2.2. ==> tableaux
215 c
216       if ( codret.eq.0 ) then
217 c
218       if ( nbmpto.ne.0 ) then
219 c
220 #ifdef _DEBUG_HOMARD_
221       write (ulsort,texte(langue,3)) 'UTAD02_mp', nompro
222 #endif
223         iaux = 2
224         call utad02 ( iaux, nhmapo,
225      >                phetmp, pnoemp, jaux  , jaux  ,
226      >                  jaux,   jaux,   jaux,
227      >                  jaux,   jaux,   jaux,
228      >                  jaux,   jaux,   jaux,
229      >                ulsort, langue, codret )
230 c
231       endif
232 c
233       if ( taopti(19).gt.0 ) then
234 c
235         if ( nbmpto.ne.0 ) then
236 c
237           if ( codret.eq.0 ) then
238 c
239 #ifdef _DEBUG_HOMARD_
240       write (ulsort,texte(langue,3)) 'UTVGAN', nompro
241 #endif
242 c
243           iaux = 1
244           call utvgan ( nhvois, nhnoeu, nharet,
245      >                  iaux,
246      >                  ppovos, pvoiso,
247      >                  ulsort, langue, codret)
248 c
249           endif
250 c
251         endif
252 c
253       endif
254 c
255       if ( codret.eq.0 ) then
256 c
257       iaux = 6
258       if ( nbiter.gt.0 .and. taopti(38).ne.0 ) then
259         iaux = iaux*5
260       endif
261       if ( degre.eq.2 ) then
262         iaux = iaux*13
263       endif
264 #ifdef _DEBUG_HOMARD_
265       write (ulsort,texte(langue,3)) 'UTAD02_ar', nompro
266 #endif
267       call utad02 ( iaux, nharet,
268      >              phetar, psomar, pfilar, pmerar,
269      >                jaux,   jaux,   jaux,
270      >                jaux, pnp2ar,   jaux,
271      >                jaux,   jaux,   jaux,
272      >              ulsort, langue, codret )
273 c
274       endif
275 c
276       if ( nbtrto.ne.0 ) then
277 c
278         iaux = 66
279         if ( nbiter.gt.0 .and. taopti(38).ne.0 ) then
280           iaux = iaux*5
281         endif
282 #ifdef _DEBUG_HOMARD_
283       write (ulsort,texte(langue,3)) 'UTAD02_tr', nompro
284 #endif
285         call utad02 ( iaux, nhtria,
286      >                phettr, paretr, pfiltr, ppertr,
287      >                  jaux,   jaux,   jaux,
288      >                pnivtr,   jaux,   jaux,
289      >                  jaux,   jaux,   jaux,
290      >                ulsort, langue, codret )
291 c
292       endif
293 c
294       if ( nbquto.ne.0 ) then
295 c
296         iaux = 330
297 #ifdef _DEBUG_HOMARD_
298       write (ulsort,texte(langue,3)) 'UTAD02_qu', nompro
299 #endif
300         call utad02 ( iaux, nhquad,
301      >                phetqu, parequ, pfilqu, pperqu,
302      >                  jaux,   jaux,   jaux,
303      >                pnivqu,   jaux,   jaux,
304      >                  jaux,   jaux,   jaux,
305      >                ulsort, langue, codret )
306 c
307       endif
308 c
309       if ( nbteto.ne.0 ) then
310 c
311         iaux = 6
312 #ifdef _DEBUG_HOMARD_
313       write (ulsort,texte(langue,3)) 'UTAD02_te', nompro
314 #endif
315         call utad02 ( iaux, nhtetr,
316      >                phette, ptrite, pfilte, jaux,
317      >                  jaux,   jaux,   jaux,
318      >                  jaux,   jaux,   jaux,
319      >                  jaux,   jaux,   jaux,
320      >                ulsort, langue, codret )
321 c
322       endif
323 c
324       if ( nbheto.ne.0 ) then
325 c
326         iaux = 6
327 #ifdef _DEBUG_HOMARD_
328       write (ulsort,texte(langue,3)) 'UTAD02_he', nompro
329 #endif
330         call utad02 ( iaux, nhhexa,
331      >                phethe, pquahe, pfilhe, jaux,
332      >                  jaux,   jaux,   jaux,
333      >                  jaux,   jaux,   jaux,
334      >                  jaux,   jaux,   jaux,
335      >                ulsort, langue, codret )
336 c
337       endif
338 c
339       if ( nbpyto.ne.0 ) then
340 c
341         iaux = 2
342 #ifdef _DEBUG_HOMARD_
343       write (ulsort,texte(langue,3)) 'UTAD02_py', nompro
344 #endif
345         call utad02 ( iaux, nhpyra,
346      >                phetpy, pfacpy,   jaux, jaux,
347      >                  jaux,   jaux,   jaux,
348      >                  jaux,   jaux,   jaux,
349      >                  jaux,   jaux,   jaux,
350      >                ulsort, langue, codret )
351 c
352       endif
353 c
354       if ( nbpeto.ne.0 ) then
355 c
356         iaux = 6
357 #ifdef _DEBUG_HOMARD_
358       write (ulsort,texte(langue,3)) 'UTAD02_pe', nompro
359 #endif
360         call utad02 ( iaux, nhpent,
361      >                phetpe, pfacpe, pfilpe, jaux,
362      >                  jaux,   jaux,   jaux,
363      >                  jaux,   jaux,   jaux,
364      >                  jaux,   jaux,   jaux,
365      >                ulsort, langue, codret )
366 c
367       endif
368 c
369       endif
370 c
371       if ( codret.eq.0 ) then
372 c
373       iaux = 3
374       if ( nbteto.ne.0 .or. nbpyto.ne.0 .or. nbpeto.ne.0 ) then
375         iaux = iaux*5
376       endif
377       if ( nbheto.ne.0 .or. nbpyto.ne.0 .or. nbpeto.ne.0 ) then
378         iaux = iaux*7
379       endif
380       if ( nbpyto.ne.0 .or. nbpeto.ne.0 ) then
381         iaux = iaux*221
382       endif
383 #ifdef _DEBUG_HOMARD_
384       write (ulsort,texte(langue,3)) 'UTAD04', nompro
385 #endif
386       call utad04 ( iaux, nhvois,
387      >                jaux,   jaux, pposif, pfacar,
388      >              advotr, advoqu,
389      >                jaux,   jaux, adpptr, adppqu,
390      >                jaux,   jaux,   jaux,
391      >                jaux,   jaux,   jaux,
392      >                jaux,   jaux,   jaux,
393      >                jaux,   jaux,   jaux,
394      >              ulsort, langue, codret )
395 c
396       endif
397 c
398 c 2.3. ==> les decisions sur les faces et les aretes
399 #ifdef _DEBUG_HOMARD_
400       write (ulsort,90002) '2.3. decare/decfac ; codret', codret
401 #endif
402 c
403       if ( codret.eq.0 ) then
404 c
405       iaux = nbarto + 1
406       call gmalot ( ntrav1, 'entier  ', iaux, pdecar, codre1 )
407       iaux = nbquto + nbtrto + 1
408       call gmalot ( ntrav2, 'entier  ', iaux, pdecfa, codre2 )
409       codre0 = min ( codre1, codre2)
410       codret = max ( abs(codre0), codret,
411      >               codre1, codre2 )
412 c
413       endif
414 c
415       if ( codret.eq.0 ) then
416         taopts(11) = ntrav1
417         taopts(12) = ntrav2
418       endif
419 c
420 c    A priori, rien ne se passe, donc on met 0
421 c
422       if ( codret.eq.0 ) then
423 c
424       ideb = pdecar
425       ifin = pdecar + nbarto
426       do 231 , iaux = ideb , ifin
427         imem(iaux) = 0
428   231 continue
429 c
430       ideb = pdecfa
431       ifin = pdecfa + nbtrto + nbquto
432       do 232 , iaux = ideb , ifin
433         imem(iaux) = 0
434   232 continue
435 c
436       endif
437 c
438 c 2.4. ==> tableau de travail
439 c
440       if ( codret.eq.0 ) then
441 c
442       iaux = nbquto + nbtrto + 1
443       call gmalot ( ntrav3, 'entier  ', iaux, adtra3, codret )
444 c
445       endif
446 c
447 c====
448 c 3. initialisations des tableaux des decisions sur les faces et
449 c    les aretes
450 c====
451 #ifdef _DEBUG_HOMARD_
452       write (ulsort,90002) '3. initialisations ; codret', codret
453       write (ulsort,90002) 'taopti(31)/pilraf', taopti(31)
454       write (ulsort,90002) 'taopti(32)/pilder', taopti(32)
455       write (ulsort,90002) 'taopti(19)/filada', taopti(19)
456       write (ulsort,90004) 'taoptr( 3)/diammi', taoptr( 3)
457 #endif
458 c
459       if ( codret.eq.0 ) then
460 c
461 c 3.1. ==> Cas du raffinement uniforme sans filtrage
462 c
463       if ( taopti(31).eq.-1 .and.
464      >   (  taopti(19).eq.0 .and. taoptr(3).le.0.d0 ) ) then
465 c
466 #ifdef _DEBUG_HOMARD_
467       write (ulsort,texte(langue,3)) 'DEINUN', nompro
468 cgn      call gmprsx (nompro,nhvois)
469 #endif
470         call deinun
471      >       ( taopti(31), taopti(32), taopti(33), taopti(34),
472      >         imem(pdecfa), imem(pdecar),
473      >         imem(phetar),
474      >         imem(phettr),
475      >         imem(phetqu),
476      >         ulsort, langue, codret )
477 c
478 c 3.2. ==> Cas du pilotage par zone, par indicateur ou raffinement
479 c          uniforme avec filtrage ou deraffinement uniforme
480 c
481       elseif ( taopti(31).gt.0 .or. taopti(32).gt.0 .or.
482      >         ( taopti(31).eq.-1 .and.
483      >           ( taopti(19).gt.0 .or. taoptr(3).gt.0.d0 ) ) .or.
484      >         taopti(32).eq.-1 ) then
485 c
486 #ifdef _DEBUG_HOMARD_
487       write (ulsort,texte(langue,3)) 'DEINNU', nompro
488 #endif
489 c
490         call deinnu
491      >       ( nomail, nohind,
492      >         taopti(30), taopti(31), taopti(32),
493      >         taopti(33), taopti(34),
494      >         taopti( 6), taopti( 7), taoptr( 1), taoptr( 2),
495      >         taopti( 8),
496      >         taopti(19), taoptr( 3), taopti(37), taopti(38),
497      >         taopti(44),
498      >         imem(pdecar), imem(pdecfa),
499      >         imem(ppovos), imem(pvoiso),
500      >         imem(pnoemp),
501      >         imem(psomar), imem(phetar), imem(pfilar), imem(pmerar),
502      >         imem(pnp2ar), imem(pposif), imem(pfacar),
503      >         imem(paretr), imem(phettr),
504      >         imem(pfiltr), imem(ppertr), imem(pnivtr),
505      >         imem(advotr), imem(adpptr),
506      >         imem(parequ), imem(phetqu),
507      >         imem(pfilqu), imem(pperqu), imem(pnivqu),
508      >         imem(advoqu),
509      >         imem(ptrite), imem(phette), imem(pfilte),
510      >         imem(pquahe), imem(phethe), imem(pfilhe),
511      >         imem(pfacpy), imem(phetpy),
512      >         imem(pfacpe), imem(phetpe), imem(pfilpe),
513      >         imem(adtra3),
514      >         lgopts, taopts,
515      >         ulsort, langue, codret)
516 c
517 #ifdef _DEBUG_HOMARD_
518       if ( codret.eq.0 ) then
519 c
520       iaux = 2
521       call delist ( nomail, 'DEINNU', iaux,
522      >              lgopts, taopts,
523      >              ulsort, langue, codret )
524 c
525       endif
526 #endif
527 c
528       endif
529 c
530       endif
531 c
532 c====
533 c 4. Menage du fitrage eventuel
534 c====
535 #ifdef _DEBUG_HOMARD_
536       write (ulsort,90002) '4. Menage ; codret', codret
537 #endif
538 c
539       if ( codret.eq.0 ) then
540 c
541       if ( taopti(19).gt.0 ) then
542 c
543         if ( nbmpto.ne.0 ) then
544           call gmsgoj ( nhvois//'.0D/1D' , codre0 )
545           codret = max ( abs(codre0), codret )
546         endif
547 c
548       endif
549 c
550       endif
551 c
552 c====
553 c 5. decompte des decisions
554 c====
555 #ifdef _DEBUG_HOMARD_
556       write (ulsort,90002) '5. decompte des decisions ; codret', codret
557 #endif
558 c
559       if ( codret.eq.0 ) then
560 c
561       write (ulsort,texte(langue,7))
562 c
563 #ifdef _DEBUG_HOMARD_
564       write (ulsort,texte(langue,3)) 'DECPTE', nompro
565 #endif
566       call decpte
567      >        ( taopti(31), taopti(32),
568      >          imem(pdecar), imem(pdecfa),
569      >          imem(phettr), imem(phetqu), imem(ptrite), imem(phette),
570      >          imem(pquahe), imem(phethe),
571      >          imem(pfacpy), imem(phetpy),
572      >          imem(pfacpe), imem(phetpe),
573      >          ulsort, langue, codret )
574 c
575       endif
576 c
577 c====
578 c 6. la fin
579 c====
580 c
581       if ( codret.eq.0 ) then
582 c
583       call gmlboj ( ntrav3, codret )
584 c
585       endif
586 c
587 #ifdef _DEBUG_HOMARD_
588        if ( codret.eq.0 ) then
589         write (ulsort,texte(langue,6)) mess14(langue,3,1)
590         call gmprot ( 'DECARE a la fin de '//nompro,
591      >                ntrav1 , 1, min(50,nbarto+1) )
592         if ( nbarto.gt.50 ) then
593           call gmprot ( 'DECARE a la fin de '//nompro,
594      >                   ntrav1 , max(51,nbarto-49), nbarto+1 )
595         endif
596         write (ulsort,texte(langue,6)) mess14(langue,3,8)
597         call gmprot ( 'DECFAC a la fin de '//nompro,
598      >                ntrav2 , 1, min(50,nbtrto+nbquto+1) )
599         if ( nbtrto+nbquto.gt.50 ) then
600         call gmprot ( 'DECFAC a la fin de '//nompro,
601      >          ntrav2 , max(51,nbtrto+nbquto-49), nbtrto+nbquto+1)
602         endif
603         endif
604 #endif
605 #ifdef _DEBUG_HOMARD_
606       write (ulsort,*) 'en sortie de ',nompro
607 #endif
608 #ifdef _DEBUG_HOMARD_
609       write (ulsort,91010) (imem(pdecfa+nbquto+iaux),iaux=1,nbtrto)
610       write (ulsort,91010) (imem(pdecar+iaux),iaux=0,nbarto)
611 #endif
612 #ifdef _DEBUG_HOMARD_
613       do 111,iaux=1,nbtrto
614       if (imem(pdecfa+nbquto+iaux).ne.0 ) then
615         write (ulsort,90002) 'tr ',iaux
616       endif
617   111 continue
618 #endif
619 #ifdef _DEBUG_HOMARD_
620       do 112,iaux=1,nbquto
621       if (imem(pdecfa-1+iaux).ne.0 ) then
622         write (ulsort,90002) 'qu ',iaux
623       endif
624   112 continue
625 #ifdef _DEBUG_HOMARD_
626 #endif
627       do 113,iaux=1,nbarto
628       if (imem(pdecar+iaux-1).ne.0 ) then
629         write (ulsort,90002) 'ar ',iaux
630       endif
631   113 continue
632 #endif
633 c
634 c 6.1. ==> message si erreur
635 c
636       if ( codret.ne.0 ) then
637 c
638 #include "envex2.h"
639 c
640       write (ulsort,texte(langue,1)) 'Sortie', nompro
641       write (ulsort,texte(langue,2)) codret
642 c
643       endif
644 c
645 c 6.2. ==> fin des mesures de temps de la section
646 c
647       call gtfims (nrosec)
648 c
649 #ifdef _DEBUG_HOMARD_
650       write (ulsort,texte(langue,1)) 'Sortie', nompro
651       call dmflsh (iaux)
652 #endif
653 c
654 c=======================================================================
655       endif
656 c=======================================================================
657 c
658       end