1 subroutine gbgeno ( nomet, champ, nomgen, 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 GM - Base - GEneration d'un Nom d'Objet
25 c Le nom genere est forme par :
26 c - caracteres 1 et 2 : les 2 premiers du nom etendu
27 c - caracteres 3 et 4 : les 2 premiers du champ
28 c - caracteres 5, 6, 7 et 8 : un caractere alphanumerique
30 c On a le choix entre 10 chiffres, 26 lettres minuscules,
31 c 26 lettres majuscules, soit 62 signes pour former l'un des
32 c caracteres 5, 6, 7 et 8.
33 c Cela revient a ecrire le nombre d'appels de ce programme
35 c Ce qui fait 62**4 - 1 = 14 776 335 possibilites.
37 c Meme si l'objet est desalloue, on ne reutilise pas sa sequence,
38 c donc il y a un risque d'arriver en limite pour un transitoire
39 c avec de nombreux pas de temps. Ce risque est tres faible
40 c car il faudrait environ 10 000 pas de temps pour l'atteindre.
41 c Si cela se produit, il faudra gerer la reutilisation des codes.
43 c Gerald NICOLAS le 12 mars 1998
44 c ______________________________________________________________________
46 c . nom . e/s . taille . description .
47 c .____________________________________________________________________.
48 c . nomet . e . char* . nom etendu a traduire .
49 c . champ . e . char8 . . si nom-etendu a plusieurs elements : .
50 c . . . . = ' ' ou champ-terminal .
51 c . . . . . si nom-etendu a un seul element : .
52 c . . . . = champ de l'objet 'nomet' .
53 c . nomgen . s . char8 . nom genere .
54 c . codret . s . 1 . code de retour .
55 c . . . . -4 : nom-etendu invalide .
56 c . . . . -3 : 'nomet' n'a qu'un element et n'est .
57 c . . . . pas un objet structure .
58 c . . . . -2 : 'nomet' a plusieurs elements et .
59 c . . . . 'champ' /= ' ' et /= champ-terminal .
60 c . . . . -1 : 'nomet' a un seul element et 'champ' .
61 c . . . . ne correspond pas a un champ de 'nomet.
62 c . . . . 0 : tout va bien .
63 c ______________________________________________________________________
66 c 0. declarations et dimensionnement
70 c 0.1. ==> generalites
89 character*(*) nomet,champ
94 c 0.4. ==> variables locales
96 character*8 objrep, objter, chater
102 c 0.5. ==> initialisations
105 c ______________________________________________________________________
108 c 1. decodage 'nomet'
113 c 1.1. ==> prgramme de decodage
115 call gbdnoe(nomet,objrep,objter,chater,idec)
117 c 1.2. ==> le nom etendu est invalide
123 c 1.3. ==> le nom etendu n'a qu'un element
125 elseif (idec.eq.0) then
127 do 131 , iaux = 1,iptobj-1
128 if (nomobj(iaux).eq.nomet) then
139 do 133 , iaux = adrdst(ity),adrdst(ity)+nbc-1
140 if (nomcha(iaux).eq.champ) then
148 c 1.4. ==> autres cas
152 if ( champ.ne.' ' .and. champ.ne.chater ) then
159 c 2. formation du nom genere
162 if ( codret.eq.0 ) then
164 c 2.1. ==> 4 premiers caracteres deduits du nom etendu
166 if (champ.eq.' ') then
167 nomgen(1:4) = nomet(1:2)//chater(1:2)
169 nomgen(1:4) = nomet(1:2)//champ(1:2)
172 if (nomgen(iaux:iaux).eq.' ') then
173 nomgen(iaux:iaux) = '$'
177 c 2.2. ==> 4 caracteres suivants
183 iaux = mod(indnom,lgalnu)
184 nomgen(8:8) = alphnu(iaux)
186 if ( indnom.ge.lgalnu ) then
188 jaux = (indnom-iaux) / lgalnu
189 iaux = mod(jaux,lgalnu)
190 nomgen(7:7) = alphnu(iaux)
192 if ( indnom.ge.lgaln2 ) then
194 jaux = (jaux-iaux) / lgalnu
195 iaux = mod(jaux,lgalnu)
196 nomgen(6:6) = alphnu(iaux)
198 if ( indnom.ge.lgaln3 ) then
199 jaux = (jaux-iaux) / lgalnu
200 iaux = mod(jaux,lgalnu)
201 nomgen(5:5) = alphnu(iaux)
214 if ( codret.ne.0 ) then
215 write (ulsort,*) 'Probleme dans gbgeno'
216 write (ulsort,*) 'Code de retour = ',codret