1 subroutine guferm ( 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 Gestionnaire des Unites logiques - FERMeture d'une unite logique
24 c ______________________________________________________________________
26 c . nom . e/s . taille . description .
27 c .____________________________________________________________________.
28 c . fichie . e . ch<200 . nom du fichier a fermer .
29 c . lfichi . e . 1 . longueur du nom du fichier a fermer .
30 c . nuroul . e . 1 . numero de l'unite logique a fermer .
31 c . codret . s . 1 . 0 : tout va bien .
32 c . . . . non nul : probleme .
33 c ______________________________________________________________________
36 c 0. declarations et dimensionnement
39 c 0.1. ==> generalites
45 parameter ( nompro = 'GUFERM' )
55 integer lfichi, nuroul, codret
59 c 0.4. ==> variables locales
64 integer iaux, code, statfi, l200
65 integer gunmbr(lgunmb)
66 integer statut(mbmxul), lnomfi(mbmxul)
67 integer ulsort, langue
70 character*200 ficloc, nomfic(mbmxul)
73 double precision rindef
77 parameter ( nbmess = 3 )
78 character*80 texte(nblang,nbmess)
80 c 0.5. ==> initialisations
82 c ______________________________________________________________________
85 c 1. recuperation de l'information
91 call gutabl ( code, gunmbr, statut, nomfic, lnomfi )
98 write (ulsort,texte(langue,1)) 'Entree', nompro
108 if (nuroul.gt.0 .and. nuroul.le.mbmxul) then
109 statfi = statut(nuroul)
116 c 2.1. ==> fermeture proprement dite
118 if ( statfi.ge.3 .and. statfi.le.4 ) then
120 close ( unit=nuroul, err=2100, iostat=codret )
123 if ( codret.eq.0 ) then
130 write (ulsort,texte(langue,1)) 'Sortie', nompro
131 l200 = max(0, min( 200, lfichi, len(fichie) ) )
133 ficloc(1:l200) = fichie(1:l200)
135 do 210 iaux = l200 + 1, 200
136 ficloc(iaux:iaux) = ' '
138 write (ulsort,21000) nuroul, ficloc
139 if ( typarr.eq.0 ) then
142 call gustop ( nompro, ulsort, guimp, raison )
149 if (codret.ne.0.and.l200.lt.0) then
150 write (ulsort,texte(langue,1)) 'Sortie', nompro
151 l200 = max(0, min( 200, lfichi, len(fichie) ) )
153 ficloc(1:l200) = fichie(1:l200)
155 do 211 iaux = l200 + 1, 200
156 ficloc(iaux:iaux) = ' '
158 write(ulsort,22000) nuroul, ficloc
159 if ( typarr.eq.0 ) then
162 call gustop ( nompro, ulsort, guimp, raison )
166 c 2.2. ==> inscription dans les listes
168 if ( codret.eq.0 ) then
172 call dmindf ( iindef, rindef, sindef )
174 do 22 , iaux = 1 , 25
175 nomfic(nuroul)(8*(iaux-1)+1:8*iaux) = sindef
178 lnomfi(nuroul) = iindef
183 c 3. archivage de l'information
186 c (9): nb actuel d'unites ouvertes form/sequ
187 c (10): nb actuel d'unites ouvertes bina/sequ
188 c (11): nb actuel d'unites ouvertes form/dire
189 c (12): nb actuel d'unites ouvertes form/dire
191 if ( codret.eq.0 ) then
193 gunmbr(statfi+6) = gunmbr(statfi+6) - 1
196 call gutabl ( code, gunmbr, statut, nomfic, lnomfi )
205 >/,'Erreur lors de la fermeture de l''unite ',i2,
208 >/,'Ce fichier n''a jamais ete ouvert ...',//)
211 >/,'Erreur lors de la fermeture de l''unite ',i2,