1 subroutine esemmd ( nocmai, mcfima, mcnoma, typouv,
2 > ulsort, langue, codret )
3 c ______________________________________________________________________
7 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
9 c Version originale enregistree le 18 juin 1996 sous le numero 96036
10 c aupres des huissiers de justice Simart et Lavoir a Clamart
11 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
12 c aupres des huissiers de justice
13 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
15 c HOMARD est une marque deposee d'Electricite de France
21 c ______________________________________________________________________
23 c Entree-Sortie - Ecriture d'un Maillage au format MeD
25 c ______________________________________________________________________
27 c . nom . e/s . taille . description .
28 c .____________________________________________________________________.
29 c . nocmai . e . char*8 . nom de l'objet maillage calcul .
30 c . mcfima . e . char*8 . mot-cle pour le fichier du maillage .
31 c . mcnoma . e . char*8 . mot-cle du nom du maillage dans le fichier .
32 c . typouv . e . 1 . type d'ouverture du fichier a ecrire .
33 c . . . . 0 : ecrasement .
34 c . . . . 1 : enrichissement .
35 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
36 c . langue . e . 1 . langue des messages .
37 c . . . . 1 : francais, 2 : anglais .
38 c . codret . es . 1 . code de retour des modules .
39 c . . . . en entree = celui du module d'avant .
40 c . . . . en sortie = celui du module en cours .
41 c . . . . 0 : pas de probleme .
42 c . . . . 2x : probleme dans les memoires .
43 c . . . . 3x : probleme dans les fichiers .
44 c . . . . -10 : fichier inconnu .
45 c . . . . -20 : nom de maillage inconnu .
46 c ______________________________________________________________________
49 c 0. declarations et dimensionnement
52 c 0.1. ==> generalites
58 parameter ( nompro = 'ESEMMD' )
78 character*8 nocmai, mcfima, mcnoma
80 integer ulsort, langue, codret
82 c 0.4. ==> variables locales
88 integer pfamen, pcoonc, pfamee, pnoeel, ptypel
90 integer pnumfa, pnomfa
93 integer adeqpo, adeqin
94 integer adeqno, adeqar, adeqtr, adeqqu
95 integer adeqte, adeqhe
96 integer ptrav1, ptrav2
98 integer codre1, codre2, codre3, codre4, codre5
103 integer lnomfi, lnomam
108 character*8 ntrav1, ntrav2
109 character*8 ncinfo, ncnoeu, nccono, nccode
110 character*8 nccoex, ncfami
111 character*8 ncequi, ncfron, ncnomb
116 parameter ( nbmess = 150 )
117 character*80 texte(nblang,nbmess)
119 c 0.5. ==> initialisations
120 c ______________________________________________________________________
128 #ifdef _DEBUG_HOMARD_
129 write (ulsort,texte(langue,1)) 'Entree', nompro
138 c 2. premiers decodages
141 c 2.1. ==> nom du fichier contenant le maillage
146 call utfino ( typobs, iaux, nomfic, lnomfi,
148 > ulsort, langue, codret )
149 if ( codret.ne.0 ) then
150 write (ulsort,texte(langue,8)) 'en sortie'
154 c 2.2. ==> nom du maillage dans le fichier
156 if ( codret.eq.0 ) then
160 call utfino ( typobs, iaux, nomamd, lnomam,
162 > ulsort, langue, codret )
163 if ( codret.ne.0 ) then
164 call utosme ( typobs, ulsort, langue )
165 if ( codret.eq.4 ) then
166 write (ulsort,texte(langue,52)) lnomam
167 write (ulsort,texte(langue,53)) len(nomamd)
174 c 3. ouverture en mode d'ecrasement ou d'enrichissement
176 #ifdef _DEBUG_HOMARD_
177 write (ulsort,90002) '3. ouverture ; codret', codret
180 if ( codret.eq.0 ) then
182 if ( typouv.eq.0 ) then
187 #ifdef _DEBUG_HOMARD_
188 write (ulsort,texte(langue,3)) 'MFIOPE', nompro
190 call mfiope ( idfmed, nomfic(1:lnomfi), iaux, codret )
191 if ( codret.ne.0 ) then
192 write (ulsort,texte(langue,9))
197 c 4. recuperation des donnees du maillage de calcul
199 #ifdef _DEBUG_HOMARD_
200 write (ulsort,90002) '4. recuperation ; codret', codret
203 c 4.1. ==> l'objet de tete
205 if ( codret.eq.0 ) then
207 #ifdef _DEBUG_HOMARD_
208 call gmprsx (nompro, nocmai )
211 #ifdef _DEBUG_HOMARD_
212 write (ulsort,texte(langue,3)) 'UTNOMC', nompro
214 call utnomc ( nocmai,
216 > degre, mailet, maconf, homolo, hierar,
218 > ncinfo, ncnoeu, nccono, nccode,
220 > ncequi, ncfron, ncnomb,
221 > ulsort, langue, codret)
223 #ifdef _DEBUG_HOMARD_
224 write (ulsort,90002) 'sdimca', sdimca
225 write (ulsort,90002) 'mdimca', mdimca
226 call gmprsx (nompro, ncnoeu )
227 call gmprsx (nompro, nccono )
228 call gmprsx (nompro, ncfami )
229 call gmprsx (nompro,ncfami//'.Nom')
230 call gmprsx (nompro,ncfami//'.Groupe')
235 c 4.2. ==> objets lies au maillage de calcul
237 c 4.2.1. ==> les informations generales
239 if ( codret.eq.0 ) then
241 call gmadoj ( ncinfo//'.Table' , pinftb, iaux, codre0 )
242 call gmliat ( ncinfo, 1, iaux, codre2 )
245 codre0 = min ( codre1, codre2 )
246 codret = max ( abs(codre0), codret,
251 c 4.2.2. ==> les nombres
253 if ( codret.eq.0 ) then
255 call gmadoj ( ncnomb, adnomb, iaux, codret )
259 if ( codret.eq.0 ) then
261 #ifdef _DEBUG_HOMARD_
262 write (ulsort,texte(langue,3)) 'UTNBMC', nompro
264 call utnbmc ( imem(adnomb),
265 > nbmaae, nbmafe, nbmnei,
268 > nbmapo, nbsegm, nbtria, nbtetr,
269 > nbquad, nbhexa, nbpent, nbpyra,
270 > nbfmed, nbfmen, ngrouc,
272 > nbeqno, nbeqmp, nbeqar, nbeqtr, nbeqqu,
273 > ulsort, langue, codret )
277 c 4.2.3. ==> les nombres
279 if ( codret.eq.0 ) then
281 call gmliat ( ncnoeu, 1, nbnoto, codre1 )
282 call gmliat ( nccono, 1, nbelem, codre2 )
283 call gmliat ( nccono, 2, nbmane, codre3 )
285 codre0 = min ( codre1, codre2, codre3 )
286 codret = max ( abs(codre0), codret,
287 > codre1, codre2, codre3 )
289 c 4.2.4. ==> les adresses
291 #ifdef _DEBUG_HOMARD_
292 write (ulsort,texte(langue,3)) 'UTAD11', nompro
295 call utad11 ( iaux, ncnoeu, nccono,
296 > pcoonc, pfamen, jaux, jaux,
297 > ptypel, pfamee, pnoeel, jaux,
298 > ulsort, langue, codret )
300 c 4.2.5. ==> les familles
307 if ( nbfmed.ne.0 ) then
309 #ifdef _DEBUG_HOMARD_
310 write (ulsort,texte(langue,3)) 'UTAD13', nompro
313 if ( ngrouc.gt.0 ) then
316 call utad13 ( iaux, ncfami,
318 > pgrpo, jaux, pgrtab,
319 > ulsort, langue, codret )
322 cgn call gmprsx (nompro, ncfami//'.Groupe')
323 cgn call gmprsx (nompro, ncfami//'.Groupe.Pointeur')
324 cgn call gmprsx (nompro, ncfami//'.Groupe.Taille')
325 cgn call gmprsx (nompro, ncfami//'.Groupe.Table')
327 c 4.2.6. ==> les equivalences
329 if ( nbequi.ne.0 ) then
331 call gmadoj ( ncequi//'.Pointeur', adeqpo, iaux, codre1 )
332 call gmadoj ( ncequi//'.InfoGene', adeqin, iaux, codre2 )
334 codre0 = min ( codre1, codre2 )
335 codret = max ( abs(codre0), codret,
338 call gmadoj ( ncequi//'.Noeud', adeqno, iaux, codre1 )
339 call gmadoj ( ncequi//'.Arete', adeqar, iaux, codre2 )
340 call gmadoj ( ncequi//'.Trian', adeqtr, iaux, codre3 )
341 call gmadoj ( ncequi//'.Quadr', adeqqu, iaux, codre4 )
342 call gmadoj ( ncequi//'.Tetra', adeqte, iaux, codre5 )
343 call gmadoj ( ncequi//'.Hexae', adeqhe, iaux, codre6 )
345 codre0 = min ( codre1, codre2, codre3, codre4, codre5,
347 codret = max ( abs(codre0), codret,
348 > codre1, codre2, codre3, codre4, codre5,
353 c 4.2.7. ==> la frontiere
357 c 4.3. ==> tableaux de travail
359 if ( codret.eq.0 ) then
361 iaux = nbelem*(nbmane+1)+nbsegm+nbtria
362 call gmalot ( ntrav1, 'entier ', iaux , ptrav1, codre1 )
363 call gmalot ( ntrav2, 'entier ', nbelem , ptrav2, codre2 )
365 codre0 = min ( codre1, codre2 )
366 codret = max ( abs(codre0), codret,
371 c 5. ecriture proprement dite
373 #ifdef _DEBUG_HOMARD_
374 write (ulsort,90002) '5. ecriture ; codret', codret
377 if ( codret.eq.0 ) then
379 #ifdef _DEBUG_HOMARD_
380 write (ulsort,texte(langue,3)) 'ESEMM1', nompro
382 call esemm1 ( idfmed, nomamd, lnomam,
384 > rmem(pcoonc), imem(pfamen), imem(pnoeel),
385 > imem(pfamee), imem(ptypel),
386 > imem(pnumfa), smem(pnomfa),
387 > imem(pgrpo), smem(pgrtab),
388 > nbpqt, smem(pinftb),
389 > imem(adeqpo), smem(adeqin),
391 > imem(adeqar), imem(adeqtr), imem(adeqqu),
392 > imem(adeqte), imem(adeqhe),
393 > imem(ptrav1), imem(ptrav2),
394 > ulsort, langue, codret )
402 if ( codret.eq.0 ) then
404 call gmlboj ( ntrav1 , codre1 )
405 call gmlboj ( ntrav2 , codre2 )
407 codre0 = min ( codre1, codre2 )
408 codret = max ( abs(codre0), codret,
414 c 7. fermeture du fichier
417 if ( codret.eq.0 ) then
419 #ifdef _DEBUG_HOMARD_
420 write (ulsort,texte(langue,3)) 'MFICLO', nompro
422 call mficlo ( idfmed, codret )
423 if ( codret.ne.0 ) then
424 write (ulsort,texte(langue,10))
433 if ( codret.ne.0 ) then
437 write (ulsort,texte(langue,1)) 'Sortie', nompro
438 write (ulsort,texte(langue,2)) codret
439 if ( codret.ne.-10 ) then
440 write (ulsort,texte(langue,8)) nomfic
441 if ( codret.ne.-20 ) then
442 write (ulsort,texte(langue,22)) nomamd
448 #ifdef _DEBUG_HOMARD_
449 write (ulsort,texte(langue,1)) 'Sortie', nompro