1 subroutine gucara ( fichie, lfichi, nuroul, 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 but : recuperer l'unite associee a un fichier
23 c ______________________________________________________________________
25 c . nom . e/s . taille . description .
26 c .____________________________________________________________________.
27 c . fichie . e . ch<200 . nom du fichier a examiner .
28 c . lfichi . e . 1 . -1 : on recupere l'unite d'entree standard .
29 c . . . . 0 : on recupere l'unite de sortie standard.
30 c . . . . >0 : longueur du nom du fichier a examiner .
31 c . nuroul . s . 1 . 0 si le fichier est inconnu, sinon c'est le.
32 c . . . . numero de l'unite logique attribuee .
33 c . codret . s . 1 . 0 : tout va bien .
34 c . . . . 3 : nom de fichier trop long .
35 c ______________________________________________________________________
38 c 0. declarations et dimensionnement
41 c 0.1. ==> generalites
47 parameter ( nompro = 'GUCARA' )
56 integer lfichi, nuroul, codret
59 c 0.4. ==> variables locales
65 integer gunmbr(lgunmb)
66 integer statut(mbmxul), lnomfi(mbmxul)
68 character*200 nomfic(mbmxul)
71 parameter ( nbmess = 10 )
72 character*80 texte(nblang,nbmess)
78 c 0.5. ==> initialisations
79 c ______________________________________________________________________
87 texte(1,10) = '(''La longueur du nom vaut'',i4,'' curieux !'')'
88 texte(1,4) = '(''Il faut :'')'
89 texte(1,5) = '(''-1 pour le numero de l''''entree standard'')'
90 texte(1,6) = '(''0, pour le numero de la sortie standard'')'
91 texte(1,7) = '(''la vraie longueur du nom (1=<l=<200) sinon.'')'
92 texte(1,8) = '(''Ce fichier est inconnu du gestionnaire :'')'
94 texte(2,10) = '(''The length of the name is'',i4,'' curious!'')'
95 texte(2,4) = '(''You need :'')'
96 texte(2,5) = '(''-1 for the number of standard input'')'
97 texte(2,6) = '(''0, for the number of standard output'')'
99 > '(''the real length of the name (1=<l=<200) if not.'')'
100 texte(2,8) = '(''This file is unknown by the manager :'')'
105 c 2. recuperation de l'information
109 call gutabl ( code, gunmbr, statut, nomfic, lnomfi )
115 #ifdef _DEBUG_HOMARD_
116 write (ulsort,texte(langue,1)) 'Entree', nompro
121 c 3. recherche du bon numero
123 cgn write (ulsort,*) 'lfichi =', lfichi
124 cgn write (ulsort,*) 'fichie(1:lfichi) =', fichie(1:lfichi)
128 if ( lfichi.lt.-1 .or. lfichi.gt.200 .or.
129 > lfichi.gt.len(fichie) ) then
133 write (ulsort,texte(langue,1)) 'Sortie', nompro
134 if (lfichi.gt.0 .and. len(fichie).gt.0) then
135 write (ulsort,*) fichie( 1 : min(lfichi,len(fichie)) )
139 write (ulsort,texte(langue,10)) lfichi
140 write (ulsort,texte(langue,4))
141 write (ulsort,texte(langue,5))
142 write (ulsort,texte(langue,6))
143 write (ulsort,texte(langue,7))
145 if ( typarr.eq.0 ) then
148 call gustop ( nompro, ulsort, guimp, raison )
153 c 3.2. ==> cas des entrees/sorties standard
155 elseif ( lfichi.eq.-1 ) then
159 elseif ( lfichi.eq.0 ) then
163 c 3.3. ==> un fichier particulier : recherche du bon nom
164 c remarque : on ne recherche que parmi les unites qui sont ouvertes
170 do 331 , iaux = 1 , mbmxul
172 if ( statut(iaux).ge.1 .and. statut(iaux).le.6 ) then
173 if ( lnomfi(iaux).eq.lfichi ) then
174 if ( nomfic(iaux)(1:lfichi).eq.fichie(1:lfichi) ) then
185 #ifdef _DEBUG_HOMARD_
186 if ( nuroul.eq.0 ) then
187 write (ulsort,texte(langue,1))
188 write (ulsort,texte(langue,7))
189 if (lfichi.gt.0 .and. len(fichie).gt.0) then
190 write (ulsort,*) fichie(1:min(lfichi,len(fichie)))