1 subroutine gbcara ( nomtab , nrotab, adut , ilong , type8 )
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 ______________________________________________________________________
21 c ......................................................................
22 c . derniere modif octo 93 at prise en compte du type simple precision
23 c . modif octo 93 gn prise en compte du type double precision
24 c . modif juin 93 jyb prise en compte du type character*8
25 c . modif 15/06/89 jc jyb
26 c ......................................................................
27 c . recherche les caracteristiques d'un tableau (position,longueur
28 c . et type ) a partir de son nom. retourne un code d'erreur si le
29 c . nom n'est pas repertorie ou si il y a ambiguite.
30 c ______________________________________________________________________
32 c . nom . e/s . taille . description .
33 c .____________________________________________________________________.
34 c . nomtab . e . ch*8 . nom du tableau a rechercher .
35 c . nrotab . s . 1 . numero du tableau dans sa categorie .
36 c . adut . s . 1 . adresse de debut de tableau dans le maxi- .
37 c . . . . tableau associe a son type .
38 c . ilong . s . 1 . dimension du tableau .
39 c . type8 . s . ch*8 . type de tableau ou probleme rencontre .
40 c . coergm . s . 1 . code de retour d'erreur .
41 c . . . . 0 tableau trouve .
42 c . . . . 1 tableau non trouve .
43 c . . . . 2 tableau repertorie plusieurs fois reel .
44 c . . . . 3 tableau repertorie plusieurs fois ent .
45 c . . . . 4 tableau repertorie plusieurs fois simp .
46 c . . . . 5 tableau repertorie plusieurs fois char .
47 c . . . . 6 tableau repertorie plusieurs fois comp .
48 c . . . . 7 tableau repertorie dans deux types .
49 c ______________________________________________________________________
52 c 0. declarations et dimensionnement
55 c 0.1. ==> generalites
60 parameter ( nompro = 'GBCARA' )
88 integer nrotab, adut , ilong
90 c 0.4. ==> variables locales
95 integer icpti, icptr, icpts
97 integer ltype, ad0, ad1
101 parameter ( nbmess = 20 )
102 character*80 texte(nblang,nbmess)
104 character*1 carint(1)
106 c 0.5. ==> initialisations
110 data carint(1) / ' ' /
111 c ______________________________________________________________________
119 #ifdef _DEBUG_HOMARD_
120 write (ulsort,texte(langue,1)) 'Entree', nompro
125 > '(''Nom de l''''objet a rechercher en memoire centrale :'')'
126 texte(1,11) = '(''L''''objet n''''est pas alloue.'')'
127 texte(1,12) = '(''Present plusieurs fois dans les reels.'')'
128 texte(1,13) = '(''Present plusieurs fois dans les entiers.'')'
129 texte(1,14) = '(''Present plusieurs fois dans les chaines.'')'
130 texte(1,15) = '(''Present dans deux types.'')'
131 texte(1,18) = '(''Mode de gestion de la memoire inconnu.'')'
132 texte(1,20) = '(''Le nom est incorrect.'')'
135 > '(''Name of the wanted object in central memory :'')'
136 texte(2,11) = '(''The object is not allocated.'')'
137 texte(2,12) = '(''Present several times in reals.'')'
138 texte(2,13) = '(''Present several times in integers.'')'
139 texte(2,14) = '(''Present several times in character.'')'
140 texte(2,15) = '(''Present in two types.'')'
141 texte(2,18) = '(''Unknown memory management mode.'')'
142 texte(2,20) = '(''Name is uncorrect.'')'
144 #ifdef _DEBUG_HOMARD_
145 c write (ulsort,90000)
146 write (ulsort,texte(langue,10))
147 write (ulsort,*) nomtab
154 call gmntve ( nomtab, nomvar, nbcain, carint, coergm )
156 cgn write (ulsort,*) coergm
157 if ( coergm.ne.0 ) then
162 c 2. recherche du nombre d'occurences dans les tableaux
163 c entiers, reels et character*8
165 #ifdef _DEBUG_HOMARD_
166 write (ulsort,*) '2. Recherche ; coergm = ', coergm
169 if ( coergm.eq.0 ) then
175 if ( nomvar.eq.nomali(i) ) then
183 if ( nomvar.eq.nomalr(i) ) then
191 if ( nomvar.eq.nomals(i) ) then
200 c 3. bilan de la recherche
202 #ifdef _DEBUG_HOMARD_
203 write (ulsort,*) '3. Bilan de la recherche ; coergm = ', coergm
206 if ( coergm.eq.0 ) then
208 c 3.1. ==> cas sympa : le tableau n'apparait qu'une seule fois
210 if ( (icptr + icpti + icpts).eq.1 ) then
212 c 3.1.1. ==> chez les entiers
214 if ( icpti.eq.1 ) then
216 iadd = ptalli (nrotab)
217 ilong = lgalli (nrotab)
223 c 3.1.2. ==> chez les reels double precison
225 elseif ( icptr.eq.1 ) then
226 iadd = ptallr (nrotab)
227 ilong = lgallr (nrotab)
233 c 3.1.3. ==> chez les character*8
235 elseif ( icpts.eq.1 ) then
237 iadd = ptalls (nrotab)
238 ilong = lgalls (nrotab)
246 c 3.1.6. ==> correction de l'adresse utile
248 if ( modgm.eq.0 ) then
249 adut = ((ad1-ad0)/ltype) + iadd
251 else if ( modgm.eq.1 ) then
252 adut = ((ad1-ad0)/ltype) + iadd + 1
254 else if ( modgm.eq.2 ) then
258 adut = (iadd-ad0)/ltype
260 c en particulier pour les "gros types",
261 c on n'a pas vraiment de garantie que la division precedente
262 c "tombe juste". Le fait d'avoir en fait alloue un peu plus grand
263 c (cf. appel a gbalme dans gmalog) permet de se mettre a l'abris
264 c de ce genre de probleme (entre autres).
266 if ( adut*ltype .ge. iadd-ad0 ) then
280 c 3.2. ==> autres cas : mise a zero des grandeurs puis messages
282 c 3.2.1. ==> mise a zero des grandeurs
287 c 3.2.2. ==> 1er cas : le tableau n'apparait pas
289 if ( (icpti + icptr + icpts).eq.0 ) then
294 c 3.2.3. ==> Cas pas sympa : ou le tableau apparait plusieurs fois
296 c 3.2.3.1. ==> dans les reels
298 if ( icptr .gt. 1 ) then
303 c 3.2.3.2. ==> dans les entiers
305 if ( icpti .gt. 1 ) then
310 c 3.2.3.3. ==> dans les character*8
312 if ( icpts .gt. 1 ) then
317 c 3.2.3.4. ==> dans deux categories
319 if ( (icptr*icpti).ne.0 ) then
324 if ( (icptr*icpts).ne.0 ) then
329 if ( (icpti*icpts).ne.0 ) then
339 c 4. gestion des erreurs
342 if ( coergm.ne.0 ) then
345 iaux = 10+abs(coergm)
347 #ifdef _DEBUG_HOMARD_
348 write (ulsort,texte(langue,iaux))
351 if ( iaux.eq.20 ) then
353 call ugstop('gbcara',ulsort,1,1,1)
358 #ifdef _DEBUG_HOMARD_
360 90000 format (70('='))