1 subroutine eslsm1 ( idfmed, nomamd,
3 > nbseal, cactal, caetal, cartal,
4 > nbcham, nocham, nbtosv,
7 > ulsort, langue, codret )
8 c ______________________________________________________________________
12 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
14 c Version originale enregistree le 18 juin 1996 sous le numero 96036
15 c aupres des huissiers de justice Simart et Lavoir a Clamart
16 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
17 c aupres des huissiers de justice
18 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
20 c HOMARD est une marque deposee d'Electricite de France
26 c ______________________________________________________________________
28 c Entree-Sortie - Lecture d'une Solution au format MED - phase 1
30 c En sortie, on a des tableaux caracteristiques des champs contenus
32 c ______________________________________________________________________
34 c . nom . e/s . taille . description .
35 c .____________________________________________________________________.
36 c . idfmed . e . 1 . identifiant du fichier med en entree .
37 c . nomamd . e . char64 . nom du maillage MED .
38 c . nbchfi . e . 1 . nombre de champs dans le fichier .
39 c . option . e . 1 . 1 : on controle que l'on a les couples (aux.
40 c . . . . noeuds par element/aux points de Gauss) .
41 c . . . . 0 : pas de controle .
42 c . nbseal . e . 1 . nombre de sequences a lire .
43 c . . . . si -1, on lit tous les champs du fichier .
44 c . cactal . e .8*nbseal. caracteristiques caracteres de chaque .
45 c . . . . tableau a lire .
46 c . . . . 1,..,8. nom du champ associe .
47 c . caetal . es . 12 * . caracteristiques entieres de chaque .
48 c . . . nbseal . tableau a lire .
49 c . . . . 1. type de support au sens MED .
50 c . . . . -1, si on prend tous les supports .
51 c . . . . 2. 2, on prend le dernier pas de temps .
52 c . . . . 1, le numero du pas de temps est fourni .
54 c . . . . 3. numero du pas de temps .
55 c . . . . 4. 2, on prend le dernier numero d'ordre .
56 c . . . . 1, le numero d'ordre est fourni .
58 c . . . . 5. numero d'ordre .
59 c . . . . 6. 2, on prend le dernier instant .
60 c . . . . 1, l'instant est fourni .
62 c . . . . 7. 1, si aux noeuds par elements, 0 sinon, .
63 c . . . . -1, si non precise .
64 c . . . . 8. numero du champ noeuds/element associe .
65 c . . . . 9. numero du champ associe dans HOMARD .
66 c . . . . 10. type d'interpolation .
67 c . . . . 0, si automatique .
68 c . . . . 1 si degre 1, 2 si degre 2, 3 si iso-P2 .
69 c . . . . 11. 1, s'il fait partie du champ en cours .
70 c . . . . d'examen, 0, sinon .
71 c . . . . 12. type de champ edfl64/edin64 .
72 c . cartal . e . nbseal . caracteristiques reelles de chaque .
73 c . . . . tableau a lire .
74 c . . . . 1. instant .
75 c . nbcham . s . 1 . nombre de champs a lire .
76 c . nocham . s . nbchfi . nom des objets qui contiennent la .
77 c . . . . description de chaque champ .
78 c . nbtosv . s . 1 . nombre total de tableaux de valeurs .
79 c . nbprof . es . 1 . nombre cumule de profils a lire .
80 c . liprof . s .9*nbrpro. 1-8 : nom du -i-eme profil lu .
81 c . . . . 9 : nom de l'objet de type 'Profil' associe.
82 c . nblopg . es . 1 . nombre cumule de localisations Gauss a lire.
83 c . lilopg . s .9*nbrlpg. 1-8 : nom de la -i-eme localisation lue .
84 c . . . . 9 : nom de l'objet de type 'LocaPG' associe.
85 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
86 c . langue . e . 1 . langue des messages .
87 c . . . . 1 : francais, 2 : anglais .
88 c . codret . es . 1 . code de retour des modules .
89 c . . . . 0 : pas de probleme .
90 c . . . . 1 : probleme .
91 c ______________________________________________________________________
94 c 0. declarations et dimensionnement
97 c 0.1. ==> generalites
103 parameter ( nompro = 'ESLSM1' )
123 integer nbchfi, nbseal
124 integer nbtosv, nbcham
125 integer nbprof, nblopg
128 double precision cartal(*)
130 character*8 nocham(nbchfi)
131 character*8 cactal(*)
132 character*8 liprof(*)
133 character*8 lilopg(*)
136 integer ulsort, langue, codret
138 c 0.4. ==> variables locales
140 integer codre1, codre2, codre3, codre4, codre5
143 integer lmesh, typcha
144 integer iaux, jaux, kaux
145 integer adnocp, adcaen, adcare, adcaca
146 integer nrocha, nbcomp
147 integer nbsqch, nbtvlu
149 integer nbtvch, numdtx
154 character*64 nomcha, nomach
159 parameter ( nbmess = 150 )
160 character*80 texte(nblang,nbmess)
162 c 0.5. ==> initialisations
163 c ______________________________________________________________________
171 #ifdef _DEBUG_HOMARD_
172 write (ulsort,texte(langue,1)) 'Entree', nompro
184 #ifdef _DEBUG_HOMARD_
185 write (ulsort,90002) '. Debut de '//nompro//', nbseal', nbseal
186 write (ulsort,90002) 'Nombre de champs dans le fichier', nbchfi
187 cgn write (ulsort,*) '. Premier champ a lire = ',
188 cgn > cactal(1),cactal(2),cactal(3),cactal(4),
189 cgn > cactal(5),cactal(6),cactal(7),cactal(8)
193 c 2. caracterisation des champs
195 #ifdef _DEBUG_HOMARD_
196 write (ulsort,90002) '2. caracterisation champ ; codret', codret
201 if ( codret.eq.0 ) then
203 do 20 , nrocha = 1 , nbchfi
205 #ifdef _DEBUG_HOMARD_
206 if ( codret.eq.0 ) then
208 write (ulsort,*) '.......................................'//
209 > '.......................................'
210 write (ulsort,90002) 'Dans le fichier, champ numero', nrocha
214 c 2.1. ==> allocation de la structure decrivant le champ numero nrocha.
215 c le nom de la structure est conserve dans obcham
217 if ( codret.eq.0 ) then
219 call gmalot ( obcham, 'InfoCham', 0, iaux, codret )
223 c 2.2. ==> nombre de composantes du champ courant
225 if ( codret.eq.0 ) then
227 #ifdef _DEBUG_HOMARD_
228 write (ulsort,texte(langue,3)) 'MFDNFC', nompro
231 call mfdnfc ( idfmed, iaux, nbcomp, codret )
235 c 2.3. ==> allocation des tableaux decrivant le champ et ses composantes
236 c remarque : ce dimensionnement suppose que :
237 c 1. le nom des champs est code sur 64 caracteres
238 c 2. le nom des composantes l'est sur 16
239 c 3. le nom des unites des composantes l'est sur 16
240 c 4. le nom de l'unite du pas de temps l'est sur 16
242 if ( codret.eq.0 ) then
243 #ifdef _DEBUG_HOMARD_
244 write (ulsort,texte(langue,85)) nbcomp
247 call gmecat ( obcham, 1, nbcomp, codre1 )
248 iaux = 8 + 4*nbcomp + 2
249 call gmaloj ( obcham//'.Nom_Comp', ' ', iaux, adnocp, codre2 )
251 codre0 = min ( codre1, codre2 )
252 codret = max ( abs(codre0), codret,
257 c 2.4. ==> lecture du nom du champ, du maillage associe, du type
258 c de champ, des noms et des unites de ses composantes,
259 c de l'unite du pas de temps, du nombre de sequences
261 if ( codret.eq.0 ) then
263 #ifdef _DEBUG_HOMARD_
264 write (ulsort,texte(langue,3)) 'MFDFDI', nompro
268 call mfdfdi ( idfmed, iaux,
269 > nomcha, nomach, lmesh, typcha,
270 > smem(adnocp+8), smem(adnocp+8+2*nbcomp),
271 > smem(adnocp+8+4*nbcomp), nbsqch, codret)
272 #ifdef _DEBUG_HOMARD_
273 write(ulsort,texte(langue,32)) nomcha
274 do 241 , jaux=1,nbcomp
275 write(ulsort,texte(langue,54))smem(adnocp+8+2*(jaux-1))//
276 > smem(adnocp+8+2*jaux-1)
277 write(ulsort,90003) ' unite',
278 > smem(adnocp+8+2*nbcomp+2*(jaux-1))//
279 > smem(adnocp+8+2*nbcomp+2*(jaux-1)+1)
281 write(ulsort,90003) 'nomach', nomach
282 write(ulsort,90002) 'lmesh ', lmesh
283 write(ulsort,90002) 'typcha', typcha
284 write(ulsort,90003) 'dtunit', smem(adnocp+8+4*nbcomp)//
285 > smem(adnocp+8+4*nbcomp+1)
286 write(ulsort,90002) 'nbsqch', nbsqch
291 c 2.5. ==> On ne lit le champ que si le nombre de sequences
292 c est non nul. Logique.
294 if ( codret.eq.0 ) then
296 if ( nbsqch.gt.0 ) then
304 c 2.6. ==> le champ est-il sur le bon maillage ?
308 if ( codret.eq.0 ) then
310 #ifdef _DEBUG_HOMARD_
311 write (ulsort,90003) 'Nom de ce champ (nomcha)', nomcha
312 write (ulsort,90003) 'Maillage du champ', nomach
313 write (ulsort,90003) 'Maillage courant ', nomamd
316 call utdich ( nomach, nomamd,
317 > ulsort, langue, codret )
319 if ( codret.eq.1 .or. codret.eq.2 ) then
324 #ifdef _DEBUG_HOMARD_
325 write (ulsort,99001) 'Fin de 2.6. alire', alire
332 c 2.7. ==> le champ est-il dans la liste des sequences enregistrees ?
336 if ( codret.eq.0 ) then
338 #ifdef _DEBUG_HOMARD_
339 write (ulsort,90003) 'Nom de ce champ (nomcha)', nomcha
342 if ( nbseal.gt.0 ) then
345 do 27 , iaux = 1 , nbseal
347 if ( codret.eq.0 ) then
348 call uts8ch ( cactal(8*(iaux-1)+1), 64, saux64,
349 > ulsort, langue, codret )
351 #ifdef _DEBUG_HOMARD_
352 write (ulsort,90064) iaux,
353 > '-me champ que l''on veut lire : ', saux64
356 if ( codret.eq.0 ) then
358 if ( saux64.eq.nomcha ) then
359 #ifdef _DEBUG_HOMARD_
360 write (ulsort,*) '..... ce champ doit etre lu'
368 caetal(12,iaux) = typcha
372 #ifdef _DEBUG_HOMARD_
373 write (ulsort,90005) 'caetal',
374 > caetal(1,iaux),caetal(2,iaux),caetal(3,iaux),caetal(4,iaux),
375 > caetal(5,iaux),caetal(6,iaux),caetal(7,iaux),
376 > caetal(8,iaux),caetal(9,iaux),caetal(10,iaux),
377 > caetal(11,iaux),caetal(12,iaux)
378 write (ulsort,90004) 'cartal', cartal(iaux)
384 #ifdef _DEBUG_HOMARD_
385 write (ulsort,99001) 'Fin de 2.7. alire', alire
392 c 2.8. ==> on lira le champ, donc on le garde
396 if ( codret.eq.0 ) then
399 call utchs8 ( nomcha, iaux, smem(adnocp),
400 > ulsort, langue, codret )
406 c 2.9. ==> Nombre de tableaux de valeurs de ce champ ecrits dans le
407 c fichier pour toutes les sequences et tous les types
412 if ( codret.eq.0 ) then
415 #ifdef _DEBUG_HOMARD_
416 write (ulsort,texte(langue,3)) 'ESLCH1', nompro
418 call eslch1 ( idfmed, nomcha, nbsqch,
422 > ulsort, langue, codret )
424 #ifdef _DEBUG_HOMARD_
425 write (ulsort,90002) 'Nombre total de tableaux de valeurs '//
426 > 'presents (nbtvch)', nbtvch
427 write (ulsort,90002) 'Dernier instant (numdtx)', numdtx
432 if ( codret.eq.0 ) then
434 if ( nbtvch.eq.0 ) then
442 c 2.10. ==> description des tableaux de valeurs
444 #ifdef _DEBUG_HOMARD_
445 write (ulsort,99001) '2.10. alire', alire
450 c 2.10.1. ==> allocation des tableaux decrivant les tableaux de valeurs
451 c pour chaque tableau du champ
453 if ( codret.eq.0 ) then
455 iaux = nbinec * nbtvch
456 call gmaloj ( obcham//'.Cham_Ent', ' ', iaux, adcaen, codre1 )
457 call gmaloj ( obcham//'.Cham_Ree', ' ',
458 > nbtvch, adcare, codre2 )
459 iaux = nbincc * nbtvch
460 call gmaloj ( obcham//'.Cham_Car', ' ',
461 > iaux, adcaca, codre3 )
463 codre0 = min ( codre1, codre2, codre3 )
464 codret = max ( abs(codre0), codret,
465 > codre1, codre2, codre3 )
469 c 2.10.2. ==> remplissage des caracteristiques
471 if ( codret.eq.0 ) then
473 #ifdef _DEBUG_HOMARD_
474 write (ulsort,texte(langue,3)) 'ESLCH2', nompro
476 call eslch2 ( idfmed, nomcha, numdtx, typcha,
478 > nbsqch, nbtvch, nbtvlu,
479 > nbcham, nbseal, caetal, cartal,
480 > imem(adcaen), rmem(adcare), smem(adcaca),
483 > ulsort, langue, codret )
485 #ifdef _DEBUG_HOMARD_
486 write (ulsort,90002) '... nombre total de tableaux de '//
487 > 'valeurs a lire (nbtvlu)', nbtvlu
488 call gmprsx (nompro, obcham )
489 call gmprsx (nompro, obcham//'.Cham_Ent' )
490 call gmprsx (nompro, obcham//'.Cham_Ree' )
491 call gmprsx (nompro, obcham//'.Cham_Car' )
498 c 2.11. ==> gestion de l'objet qui memorise le champ
499 c 2.11.1. ==> quand on garde le champ, on memorise son nom et on
500 c ajuste la taille des tableaux
502 #ifdef _DEBUG_HOMARD_
503 write (ulsort,99001) 'Debut de 2.11, alire',alire
504 write (ulsort,90002) 'nbcham', nbcham
509 if ( codret.eq.0 ) then
512 nocham(nbcham) = obcham
514 nbtosv = nbtosv + nbtvlu
516 if ( codret.eq.0 ) then
517 #ifdef _DEBUG_HOMARD_
518 if ( codret.eq.0 ) then
519 write (ulsort,21000) nbcham, nomcha
520 call gmprsx (nompro, obcham )
521 call gmprsx (nompro, obcham//'.Nom_Comp' )
522 call gmprsx (nompro, obcham//'.Cham_Ent' )
523 call gmprsx (nompro, obcham//'.Cham_Ree' )
524 call gmprsx (nompro, obcham//'.Cham_Car' )
528 call gmecat ( obcham, 2, nbtvlu, codre1 )
529 call gmecat ( obcham, 3, typcha, codre2 )
530 call gmmod ( obcham//'.Cham_Ent',
531 > adcaen, nbinec, nbinec, nbtvch, nbtvlu, codre3 )
532 call gmmod ( obcham//'.Cham_Ree',
533 > adcare, 1, 1, nbtvch, nbtvlu, codre4 )
534 call gmmod ( obcham//'.Cham_Car',
535 > adcaca, nbincc, nbincc, nbtvch, nbtvlu, codre5 )
537 codre0 = min ( codre1, codre2, codre3, codre4, codre5 )
538 codret = max ( abs(codre0), codret,
539 > codre1, codre2, codre3, codre4, codre5 )
543 #ifdef _DEBUG_HOMARD_
544 write (ulsort,90002) 'nombre cumule de tableaux de '//
545 > ' valeurs (nbtosv) = ',nbtosv
547 #ifdef _DEBUG_HOMARD_
548 if ( codret.eq.0 ) then
549 write (ulsort,21000) nbcham, nomcha
550 21000 format(/,'Champ numero ',i3,' : ',a64,/,18('='),/)
551 call gmprsx (nompro, obcham )
552 call gmprsx (nompro, obcham//'.Nom_Comp' )
553 call gmprsx (nompro, obcham//'.Cham_Ent' )
554 call gmprsx (nompro, obcham//'.Cham_Ree' )
555 call gmprsx (nompro, obcham//'.Cham_Car' )
559 c 2.11.2. ==> N'etant pas lu, le champ est detruit
563 if ( codret.eq.0 ) then
565 call gmsgoj ( obcham, codret )
573 #ifdef _DEBUG_HOMARD_
575 > nompro//', avant 20 continue, pour nrocha',nrocha
584 c 3. On parcourt tous les champs enregistres pour memoriser les
585 c relations entre les champs aux points de Gauss et leurs
586 c homologues aux noeuds par elements
587 c il faut traiter dans l'ordre :
588 c 1. Les champs standards
589 c 2. Les champs aux points de Gauss
590 c 3. Les champs aux noeuds par element
593 #ifdef _DEBUG_HOMARD_
594 write (ulsort,90002) '... Debut de 3., codret', codret
597 if ( option.eq.1 ) then
599 #ifdef _DEBUG_HOMARD_
600 do 33333 , iaux=1,nbtosv
601 write (ulsort,*) '... Champ '//cactal(8*iaux-7)//
602 > cactal(8*iaux-6)//cactal(8*iaux-5)//cactal(8*iaux-4)//
604 > cactal(8*iaux-2)//cactal(8*iaux-1)//cactal(8*iaux)
605 write (ulsort,90005) '.. caetal',
606 > caetal(1,iaux),caetal(2,iaux),caetal(3,iaux),caetal(4,iaux),
607 > caetal(5,iaux),caetal(6,iaux),caetal(7,iaux),
608 > caetal(8,iaux),caetal(9,iaux),caetal(10,iaux),
610 write (ulsort,90004) '.. cartal',cartal(iaux)
614 c 3.1. ==> allocation d'un tableau auxiliaire pour memoriser les
617 if ( codret.eq.0 ) then
618 call gmalot ( ntrav1, 'entier ', nbcham, adtra1, codret )
620 do 30 , iaux = adtra1 , adtra1+nbcham-1
626 c 3.2. ==> choix du type de champ a traiter
628 if ( codret.eq.0 ) then
630 #ifdef _DEBUG_HOMARD_
632 write (ulsort,*) '+++++++++++++++++++++++++++++++++++++++++'
633 write (ulsort,texte(langue,64+jaux))
635 if ( jaux.eq.1 ) then
637 elseif ( jaux.eq.2 ) then
645 c 3.3. ==> parcours des champs enregistres
647 do 33 , nrocha = 1 , nbcham
649 c 3.3.1. ==> caracteristiques du champ numero nrocha
651 if ( codret.eq.0 ) then
653 obcham = nocham(nrocha)
655 call gmliat ( obcham, 2, nbtvlu, codre1 )
656 call gmadoj ( obcham//'.Cham_Ent', adcaen, iaux, codre2 )
657 call gmadoj ( obcham//'.Nom_Comp', adnocp, iaux, codre3 )
659 codre0 = min ( codre1, codre2, codre3 )
660 codret = max ( abs(codre0), codret,
661 > codre1, codre2, codre3 )
665 if ( codret.eq.0 ) then
667 call uts8ch ( smem(adnocp), iaux, nomcha,
668 > ulsort, langue, codret )
671 c 3.3.2. ==> appel ad-hoc
673 if ( codret.eq.0 ) then
675 #ifdef _DEBUG_HOMARD_
676 write (ulsort,texte(langue,3)) 'ESLCH6', nompro
677 cgn call gmprsx (nompro, obcham//'.Cham_Ent' )
680 call eslch6 ( iaux, kaux, nbtvlu, imem(adcaen), nomcha,
682 > nbcham, imem(adtra1),
683 > ulsort, langue, codret )
687 #ifdef _DEBUG_HOMARD_
688 if ( codret.eq.0 ) then
689 write (ulsort,31000) nomcha, nrocha
690 31000 format(/,60('='),/,'Champ ',a,', de numero ',i3,/)
691 call gmprsx (nompro, obcham )
692 call gmprsx (nompro, obcham//'.Cham_Ent' )
700 if ( codret.eq.0 ) then
702 call gmlboj ( ntrav1, codret )
709 c 4. controle de la presence des champs demandes
710 c on memorise le codret dans la variable jaux
713 #ifdef _DEBUG_HOMARD_
714 write (ulsort,90002) '... Debut de 4., codret', codret
719 do 4 , iaux = 1 , nbseal
721 if ( codret.eq.0 ) then
723 #ifdef _DEBUG_HOMARD_
724 write (ulsort,90005) 'caetal',
725 > caetal(1,iaux),caetal(2,iaux),caetal(3,iaux),caetal(4,iaux),
726 > caetal(5,iaux),caetal(6,iaux),caetal(7,iaux),
727 > caetal(8,iaux),caetal(9,iaux),caetal(10,iaux),
728 > caetal(11,iaux),caetal(12,iaux)
729 write (ulsort,90004) 'cartal', cartal(iaux)
730 write (ulsort,90122) 'caetal', 9, iaux, caetal(9,iaux)
733 if ( caetal(9,iaux).eq.0 ) then
737 if ( codret.eq.0 ) then
738 call uts8ch ( cactal(8*iaux-7), 64, saux64,
739 > ulsort, langue, codret )
741 if ( codret.eq.0 ) then
742 write (ulsort,texte(langue,32)) saux64
743 if ( caetal(2,iaux).gt.0 ) then
744 write (ulsort,texte(langue,113)) caetal(3,iaux)
746 if ( caetal(4,iaux).gt.0 ) then
747 write (ulsort,texte(langue,114)) caetal(5,iaux)
749 if ( caetal(6,iaux).gt.0 ) then
750 write (ulsort,texte(langue,115)) cartal(iaux)
752 write (ulsort,texte(langue,92))
761 if ( jaux.ne.0 ) then
769 if ( codret.ne.0 ) then
773 write (ulsort,texte(langue,1)) 'Sortie', nompro
774 write (ulsort,texte(langue,2)) codret
778 #ifdef _DEBUG_HOMARD_
779 write (ulsort,texte(langue,1)) 'Sortie', nompro