Salome HOME
Homard executable
[modules/homard.git] / src / tool / ES_HOMARD / eslmh4.F
1       subroutine eslmh4 ( idfmed,
2      >                    nomail,
3      >                    ulsort, langue, codret)
4 c
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  Entree-Sortie : Lecture du Maillage Homard - phase 4
26 c  -      -        -          -        -              -
27 c ______________________________________________________________________
28 c .  nom   . e/s . taille .           description                      .
29 c .____________________________________________________________________.
30 c . idfmed . e   .   1    . identificateur du fichier MED              .
31 c . nomail . e   . char*8 . nom du maillage a lire                     .
32 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
33 c . langue . e   .    1   . langue des messages                        .
34 c .        .     .        . 1 : francais, 2 : anglais                  .
35 c . codret . es  .    1   . code de retour des modules                 .
36 c .        .     .        . 0 : pas de probleme                        .
37 c ______________________________________________________________________
38 c
39 c====
40 c 0. declarations et dimensionnement
41 c====
42 c
43 c 0.1. ==> generalites
44 c
45       implicit none
46       save
47 c
48       character*6 nompro
49       parameter ( nompro = 'ESLMH4' )
50 c
51 #include "nblang.h"
52 #include "consts.h"
53 c
54 c 0.2. ==> communs
55 c
56 #include "gmenti.h"
57 c
58 #include "envex1.h"
59 #include "enti01.h"
60 #include "nbutil.h"
61 c
62 c 0.3. ==> arguments
63 c
64       integer*8 idfmed
65 c
66       character*8 nomail
67 c
68       integer ulsort, langue, codret
69 c
70 c 0.4. ==> variables locales
71 c
72 #include "meddc0.h"
73 c
74       integer iaux, jaux, kaux, laux
75       integer codre1, codre2
76       integer codre0
77       integer nbprof
78       integer nbvapr, adenho
79       integer typenh
80 c
81       integer nbattx
82       parameter ( nbattx = 19 )
83       integer tbiaux(nbattx)
84 c
85       character*8 norenu
86       character*8 saux08
87       character*64 noprof
88 c
89       integer nbmess
90       parameter ( nbmess = 150 )
91       character*80 texte(nblang,nbmess)
92 c ______________________________________________________________________
93 c
94 c====
95 c 1. intialisations
96 c====
97 c 1.1. ==> messages
98 c
99 #include "impr01.h"
100 c
101 #ifdef _DEBUG_HOMARD_
102       write (ulsort,texte(langue,1)) 'Entree', nompro
103       call dmflsh (iaux)
104 #endif
105 c
106       texte(1,4) = '(''... Renumerotations'')'
107       texte(1,7) = '(''Premieres valeurs : '',10i6)'
108 c
109       texte(2,4) = '(''... Numbers'')'
110       texte(2,7) = '(''First values : '',10i6)'
111 c
112 #include "esimpr.h"
113 c
114 c====
115 c 2. Recuperation des parametres essentiels
116 c====
117 c 2.1. ==> Nombre de profils
118 c
119       if ( codret.eq.0 ) then
120 c
121 #ifdef _DEBUG_HOMARD_
122       write (ulsort,texte(langue,3)) 'MPFNPF', nompro
123 #endif
124       call mpfnpf ( idfmed, nbprof, codret )
125 #ifdef _DEBUG_HOMARD_
126       write (ulsort,texte(langue,86)) nbprof
127 #endif
128 c
129       endif
130 c
131 c 2.2. ==> Parcours des profils
132 c
133       if ( codret.eq.0 ) then
134 c
135       do 22 , iaux = 1 , nbprof
136 c
137 c 2.2.1. ==> nom et taille du profil a lire
138 c
139         if ( codret.eq.0 ) then
140 c
141         jaux = iaux
142 c
143 #ifdef _DEBUG_HOMARD_
144       write (ulsort,texte(langue,3)) 'MPFPFI', nompro
145 #endif
146         call mpfpfi ( idfmed, jaux, noprof, nbvapr, codret )
147         if ( codret.ne.0 ) then
148         write (ulsort,texte(langue,79))
149         endif
150 c
151 #ifdef _DEBUG_HOMARD_
152         write (ulsort,texte(langue,61)) noprof
153         write (ulsort,texte(langue,62)) nbvapr
154 #endif
155 c
156         endif
157 c
158 c 2.2.2. ==> On ne continue que pour les renumerotations
159 c
160         if ( codret.eq.0 ) then
161 c
162         jaux = -2
163         saux08 = 'Nombres '
164         if ( noprof(1:8).eq.saux08 ) then
165           jaux = 8
166         else
167           do 222 , typenh = -1 , 7
168             saux08 = suffix(3,typenh)(1:2)//'HOMARD'
169             if ( noprof(1:8).eq.saux08 ) then
170               jaux = typenh
171               goto 223
172             endif
173   222     continue
174         endif
175 c
176         if ( jaux.eq.-2 ) then
177           goto 22
178         else
179           typenh = jaux
180         endif
181 c
182         endif
183 c
184 c 2.2.3. ==> Allocation du tableau receptacle
185 c
186   223   continue
187 c
188         if ( typenh.le.7 ) then
189 c
190           if ( codret.eq.0 ) then
191 c
192           call gmobal ( nomail//'.RenuMail', codre1 )
193           if ( codre1.eq.1 ) then
194             codret = 0
195           elseif ( codre1.eq.0 ) then
196             call gmaloj ( nomail//'.RenuMail', ' ', 0, jaux, codret )
197           else
198             codret = 1
199           endif
200 c
201           endif
202 c
203           if ( codret.eq.0 ) then
204 c
205           call gmnomc ( nomail//'.RenuMail', norenu, codret )
206 c
207           endif
208 c
209           if ( codret.eq.0 ) then
210 c
211           jaux = 30
212 #ifdef _DEBUG_HOMARD_
213       write (ulsort,texte(langue,3)) 'UTRE01', nompro
214 #endif
215           call utre01 ( typenh, jaux,
216      >                  norenu, nbvapr, 0,
217      >                  adenho, kaux, laux,
218      >                  ulsort, langue, codret)
219 c
220           endif
221 c
222         elseif ( typenh.eq.8 ) then
223 c
224           if ( codret.eq.0 ) then
225 c
226           call gmaloj ( norenu//'.'//saux08, ' ',
227      >                  nbvapr, adenho, codre1 )
228           call gmecat ( norenu , 19, nbvapr, codre2 )
229           codre0 = min ( codre1, codre2 )
230           codret = max ( abs(codre0), codret,
231      >                   codre1, codre2 )
232 c
233           endif
234 c
235         endif
236 c
237 c 2.2.4. ==> Lecture de la liste des valeurs
238 c
239         if ( codret.eq.0 ) then
240 c
241 #ifdef _DEBUG_HOMARD_
242       write (ulsort,texte(langue,3)) 'MPFPRR', nompro
243 #endif
244         call mpfprr ( idfmed, noprof, imem(adenho), codret )
245 ccc       call gmprsx ( nompro, norenu//'.'//saux08 )
246 c
247         endif
248 c
249    22 continue
250 c
251       endif
252 c
253 c====
254 c 3. les attributs
255 c    Il faut le faire seulement maintenant, sinon certaines valeurs
256 c    sont ecrasees par utre01
257 c====
258 c
259 c 3.1. ==> Allocation eventuelle
260 c
261       if ( codret.eq.0 ) then
262 c
263       call gmnomc ( nomail//'.RenuMail', norenu, codret )
264 c
265       endif
266 c
267 c 3.2. ==> Lecture
268 c
269       if ( codret.eq.0 ) then
270 c
271       noprof = blan64
272 c                     1234567890123456789
273       noprof(1:19) = 'Attributs_de_norenu'
274 c
275 #ifdef _DEBUG_HOMARD_
276       write (ulsort,texte(langue,3)) 'MPFPRR', nompro
277 #endif
278       call mpfprr ( idfmed, noprof, tbiaux, codret )
279 c
280       endif
281 #ifdef _DEBUG_HOMARD_
282       write (ulsort,texte(langue,61)) noprof
283       write (ulsort,texte(langue,62)) nbattx
284       write (ulsort,texte(langue,7)) (tbiaux(jaux), jaux = 1, nbattx)
285 #endif
286 c
287 c 3.3. ==> Transfert
288 c
289       if ( codret.eq.0 ) then
290 c
291       do 33 , jaux = 1 , nbattx
292 c
293         kaux = jaux
294         call gmecat ( norenu, kaux, tbiaux(jaux), codre0 )
295 c
296         codret = max ( abs(codre0), codret )
297 c
298    33 continue
299 c
300       endif
301 c
302 c 3.4. ==> Initialisation des nombres de mailles du calcul
303 c
304       if ( codret.eq.0 ) then
305 c
306       nbmapo = tbiaux(3)
307       nbsegm = tbiaux(5)
308       nbtria = tbiaux(7)
309       nbtetr = tbiaux(9)
310       nbquad = tbiaux(11)
311       nbpyra = tbiaux(13)
312       nbhexa = tbiaux(15)
313       nbpent = tbiaux(17)
314 c
315       endif
316 c
317 c====
318 c 4. la fin
319 c====
320 c
321       if ( codret.ne.0 ) then
322 c
323 #include "envex2.h"
324 c
325       write (ulsort,texte(langue,1)) 'Sortie', nompro
326       write (ulsort,texte(langue,2)) codret
327 c
328       endif
329 c
330 #ifdef _DEBUG_HOMARD_
331       write (ulsort,texte(langue,1)) 'Sortie', nompro
332       call dmflsh (iaux)
333 #endif
334 c
335       end