Salome HOME
Homard executable
[modules/homard.git] / src / tool / Utilitaire / utsex2.F
1       subroutine utsex2 ( nbfonc, nofonc,
2      >                    edsuav, edsuap, edsaav, edsaap, nbenti,
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    UTilitaire - Solution - EXtrusion - phase 2
25 c    --           -          --                -
26 c    Changement des caracteristiques d'une fonction
27 c ______________________________________________________________________
28 c .        .     .        .                                            .
29 c .  nom   . e/s . taille .           description                      .
30 c .____________________________________________________________________.
31 c . nbfonc . e   .   1    . nombre de fonctions a traiter              .
32 c . nofonc . e   . nbfonc . nom des objets qui contiennent la          .
33 c .        .     .        . description de chaque fonction             .
34 c . edsuav . e   .   1    . type med avant                             .
35 c . edsuap . e   .   1    . type med apres                             .
36 c . edsaav . e   .   1    . type med associe avant                     .
37 c . edsaap . e   .   1    . type med associe apres                     .
38 c . nbenti . e   .   1    . nombre d'entites apres                     .
39 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
40 c . langue . e   .    1   . langue des messages                        .
41 c .        .     .        . 1 : francais, 2 : anglais                  .
42 c . codret . es  .    1   . code de retour des modules                 .
43 c .        .     .        . 0 : pas de probleme                        .
44 c .        .     .        . 1 : probleme                               .
45 c ______________________________________________________________________
46 c
47 c====
48 c 0. declarations et dimensionnement
49 c====
50 c
51 c 0.1. ==> generalites
52 c
53       implicit none
54       save
55 c
56       character*6 nompro
57       parameter ( nompro = 'UTSEX2' )
58 c
59 #include "nblang.h"
60 c
61 c 0.2. ==> communs
62 c
63 #include "envex1.h"
64 c
65 #include "gmenti.h"
66 c
67 c 0.3. ==> arguments
68 c
69       integer nbfonc
70       integer edsuav, edsuap, edsaav, edsaap, nbenti
71 c
72       character*8 nofonc(nbfonc)
73 c
74       integer ulsort, langue, codret
75 c
76 c 0.4. ==> variables locales
77 c
78       integer iaux
79       integer codre1, codre2
80       integer codre0
81 c
82       integer nrfonc, nbtyas, typgeo
83       integer adtyas
84 c
85       character*8 obfonc
86 c
87       integer nbmess
88       parameter ( nbmess = 10 )
89       character*80 texte(nblang,nbmess)
90 c
91 c 0.5. ==> initialisations
92 c ______________________________________________________________________
93 c
94 c====
95 c 1. initialisations
96 c====
97 c
98 #include "impr01.h"
99 c
100 #ifdef _DEBUG_HOMARD_
101       write (ulsort,texte(langue,1)) 'Entree', nompro
102       call dmflsh (iaux)
103 #endif
104 c
105       texte(1,4) = '(''Fonction numero'',i3)'
106 c
107       texte(2,4) = '(''Function #'',i3)'
108 c
109 #include "impr03.h"
110 c
111 #ifdef _DEBUG_HOMARD_
112       write (ulsort,90015) 'Fonctions. Passage de', edsuav,' a', edsuap
113       write (ulsort,90015) 'S. associe. Passage de', edsaav,' a', edsaap
114       write (ulsort,90002) 'nbenti', nbenti
115 #endif
116 c
117       codret = 0
118 c
119 c====
120 c 2. exploration des fonctions
121 c====
122 c
123       do 20 , nrfonc = 1 , nbfonc
124 c
125         obfonc = nofonc(nrfonc)
126 c
127 #ifdef _DEBUG_HOMARD_
128         write (ulsort,texte(langue,4)) nrfonc
129 #endif
130 #ifdef _DEBUG_HOMARD_
131         call gmprsx (nompro, obfonc )
132 #endif
133 c
134 c 2.1. ==> caracteristiques de la fonction
135 c
136         if ( codret.eq.0 ) then
137 c
138         call gmliat ( obfonc, 1, typgeo, codre1 )
139         call gmliat ( obfonc, 5, nbtyas, codre2 )
140 c
141         codre0 = min ( codre1, codre2 )
142         codret = max ( abs(codre0), codret,
143      >                 codre1, codre2 )
144 c
145         endif
146 c
147 #ifdef _DEBUG_HOMARD_
148         write (ulsort,90002) 'typgeo', typgeo
149         write (ulsort,90002) 'nbtyas', nbtyas
150 #endif
151 c
152 c 2.2. ==> modification des caracteristiques entieres des fonctions
153 c
154         if ( typgeo.eq.edsuav ) then
155 c
156 c 2.2.1. ==> type geometrique du support et nombre de valeurs
157 c
158           if ( codret.eq.0 ) then
159 c
160           call gmecat ( obfonc, 1, edsuap, codre1 )
161           call gmecat ( obfonc, 3, nbenti, codre2 )
162 c
163           codre0 = min ( codre1, codre2 )
164           codret = max ( abs(codre0), codret,
165      >                 codre1, codre2 )
166 c
167           endif
168 c
169 c 2.2.2. ==> type associes eventuels
170 c
171           if ( nbtyas.gt.0 ) then
172 c
173             if ( codret.eq.0 ) then
174 c
175             call gmadoj ( obfonc//'.TypeSuAs', adtyas, iaux, codre0)
176 c
177             codret = max ( abs(codre0), codret )
178 c
179             if ( codret.eq.0 ) then
180               do 222 , iaux = 1 , nbtyas
181                 if ( imem(adtyas-1+iaux).eq.edsaav ) then
182                   imem(adtyas-1+iaux) = edsaap
183                 endif
184   222         continue
185             endif
186 c
187             endif
188 c
189           endif
190 c
191         endif
192 c
193    20 continue
194 c
195 c====
196 c 3. la fin
197 c====
198 c
199       if ( codret.ne.0 ) then
200 c
201 #include "envex2.h"
202 c
203       write (ulsort,texte(langue,1)) 'Sortie', nompro
204       write (ulsort,texte(langue,2)) codret
205 c
206       endif
207 c
208 #ifdef _DEBUG_HOMARD_
209       write (ulsort,texte(langue,1)) 'Sortie', nompro
210       call dmflsh (iaux)
211 #endif
212 c
213       end