1 subroutine gmcpgp ( nom1, nom2, codret )
2 c ______________________________________________________________________
6 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
8 c Version originale enregistree le 18 juin 1996 sous le numero 96036
9 c aupres des huissiers de justice Simart et Lavoir a Clamart
10 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
11 c aupres des huissiers de justice
12 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
14 c HOMARD est une marque deposee d'Electricite de France
20 c ______________________________________________________________________
22 c copier le graphe de l'objet 'nom1' simple ou structure
23 c a la place du graphe de l'objet 'nom2' :
24 c - si nom1 est un objet simple on ecrit simplement cet
26 c - l'ancien graphe de nom2 est supprime, un nouveau graphe
27 c est cree avec des noms nouveaux (sauf la racine) pour
28 c recevoir le graphe de nom2
29 c ______________________________________________________________________
31 c . nom . e/s . taille . description .
32 c .____________________________________________________________________.
33 c . nom1 . e . char(*). nom etendu source .
34 c . nom2 . e .char(*) . nom etendu destinataire .
35 c . codret . s . ent . code retour de l'operation .
37 c . . . . -1 : 'nom1' invalide ou non alloue .
38 c . . . . -2 : objets destinataire et source ne sont .
39 c . . . . pas de meme type .
40 c . . . . -3 : nom etendu invalide .
41 c . . . . -4 : premier caractere interdit .
42 c . . . . -5 : dimensionnement insuffisant .
43 c ______________________________________________________________________
46 c 0. declarations et dimensionnement
49 c 0.1. ==> generalites
54 parameter ( nompro = 'GMCPGP' )
70 character*(*) nom1, nom2
72 c 0.4. ==> variables locales
77 integer i,nbj,ide1,ioa1,ity1,ide2,isup,igrp
78 integer impopt, nbchem,j,nj1,i2,iadr,long1,jc,ieco,iato
82 character*8 chemin(ix,jx), objet
83 character*8 obrep1,obter1,chter1,racine
84 character*8 obrep2,obter2,chter2
85 character*8 obj1(nbjx), obj2(nbjx)
91 parameter ( nbmess = 20 )
92 character*80 texte(nblang,nbmess)
95 c 0.5. ==> initialisations
96 c ______________________________________________________________________
104 #ifdef _DEBUG_HOMARD_
105 write (ulsort,texte(langue,1)) 'Entree', nompro
109 texte(1,20) = '(1x,''Copie du graphe de l''''objet '',a8)'
110 texte(1,4) = '(1x,''a la place du graphe de l''''objet '',a8)'
111 texte(1,11) = '(1x,''Le premier objet est invalide.'')'
112 texte(1,12) = '(1x,''Les deux objets ne sont pas de meme type.'')'
113 texte(1,13) = '(1x,''Le second objet est invalide.'')'
114 texte(1,14) = '(1x,''Premier caractere du 2nd nom interdit.'')'
115 texte(1,15) = '(1x,''Dimensionnement insuffisant.'')'
117 texte(2,20) = '(1x,''Copy of the graph of the object '',a8)'
118 texte(2,4) = '(1x,''to the graph of the object '',a8)'
119 texte(2,11) = '(1x,''The first object is not valid.'')'
120 texte(2,12) = '(1x,''The types of 2 objects are different.'')'
121 texte(2,13) = '(1x,''The second object is not valid.'')'
122 texte(2,14) = '(1x,''1st character of 2nd name is forbidden.'')'
123 texte(2,15) = '(1x,''Lack of central memory.'')'
133 c 2. ecrire d'abord l'objet 'nom1'
135 call gmcpoj (nom1,nom2,codret)
136 if (codret.lt.0) then
140 c si objet simple : fini
142 call gbdnoe(nom1,obrep1,obter1,chter1,ide1)
143 call gbobal(obter1,ity1,ioa1)
148 c 3. supprimer le graphe de l'objet 'nom2' s'il existe
150 if (nom2.eq.sindef) then
154 call gbdnoe(nom2,obrep2,obter2,chter2,ide2)
155 call gasgmc(obter2,isup)
156 if ((isup.ne.0).and.(isup.ne.-5)) then
157 mess = ' gmcpgp -> gasgmc -> codret : '
158 write(mess(29:30),'(i2)') isup
160 call ugstop('gmcpgp',ulsort,1,1,1)
164 c 4 construction du graphe de 'nom1'
166 #ifdef _DEBUG_HOMARD_
174 call gagpmc(obter1,iaux,jaux,chemin,lgchem,nbchem,impopt,igrp)
176 mess = ' gmcpgp -> gagpmc -> codret : '
177 write(mess(29:30),'(i2)') igrp
179 call ugstop('gmcpgp',ulsort,1,1,1)
182 c 5. ecrire le graphe de 'nom1'
186 if ( (chemin(i,j)(1:1).eq.'*') .or.
187 > (chemin(i,j)(1:1).eq.'=') .or.
188 > (chemin(i,j)(1:1).eq.'+') .or.
189 > (chemin(i,j)(1:1).eq.'-') .or.
190 > (chemin(i,j)(1:1).eq.'<') ) then
200 chaine(1:i2) = racine
204 chaine = chaine(1:i2)//'.'//chemin(i,j-1)
208 if (objet.eq.sindef) then
210 else if (chemin(i,j+1)(1:1).eq.'=') then
213 if (chemin(i,j+1)(1:1).eq.'*') then
214 call gbcara(objet,nrotab,iadr,long1,letype)
215 if (coergm.ne.0) then
220 c recherche si objet est deja ecrit
223 if (obj1(jc).eq.objet) then
229 c si l'objet n'est pas ecrit : on l'ecrit
231 call gmcpoj (objet,chaine(1:i2),ieco)
233 mess = ' gmcpgp -> gmcpoj -> codret : '
234 write(mess(29:30),'(i2)') ieco
236 call ugstop('gmcpgp',ulsort,1,1,1)
239 c mise a jour des tableaux obj1 et obj2
241 call gbdnoe(chaine(1:i2),obrep2,obter2,chter2,ide2)
247 c si l'objet est deja ecrit et si champ destinataire
248 c est vide : y attacher l'objet disque deja ecrit
251 call gmatoj(chaine(1:i2),obj2(jaux),iato)
252 if ((iato.ne.0).and.(iato.ne.-1)) then
253 mess = ' gmcpgp -> gmatoj -> codret : '
254 write(mess(29:30),'(i2)') iato
256 call ugstop('gmcpgp',ulsort,1,1,1)
266 c 9. gestion des erreurs
271 if ( codret.ne.0 ) then
273 iaux = 10+abs(codret)
276 write (ulsort,texte(langue,1)) 'Sortie', nompro
277 write (ulsort,texte(langue,20)) nom1
278 write (ulsort,texte(langue,4)) nom2
279 write (ulsort,texte(langue,iaux))
284 90000 format (1x,70('='))