1 subroutine ugstop ( appela, messul, guimp, gmimp, raison )
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 : arreter une execution apres avoir arrete les gestionnaires
23 c - gestionnaire de memoire
24 c - gestionnaire des mesures de temps de calcul
25 c - gestionnaire d'unites logiques
26 c - execution elle-meme
28 c ATTENTION : dans certains cas tordus d'arret de GM ou GU, il y a
29 c bouclage sur l'appel a ugstop. On empeche cela
30 c en ne faisant les impressions qu'au premier appel
31 c ______________________________________________________________________
33 c . nom . e/s . taille . description .
34 c .____________________________________________________________________.
35 c . appela . e . 1 . nom du programme appelant .
36 c . messul . e . 1 . unite logique pour les messages .
37 c . guimp . e . 1 . pilotage des impressions gu .
38 c . gmimp . e . 1 . pilotage des impressions gm .
39 c . raison . e . 1 . raison de l'appel : .
40 c . . . . 0 : arret normal, sans core .
41 c . . . . >0 : call abort -> core .
42 c . . . . <0 : arret des gestionnaires, puis sortie .
43 c ______________________________________________________________________
46 c 0. declarations et dimensionnement
49 c 0.1. ==> generalites
55 parameter ( nompro = 'UGSTOP' )
63 integer messul, raison, guimp, gmimp
67 c 0.4. ==> variables locales
70 parameter ( lgtage = 4 )
74 integer tabges(lgtage)
76 integer nropas, enstul, sostul, ulsort
86 parameter ( nbmess = 10 )
87 character*80 texte(nblang,nbmess)
89 c 0.5. ==> initialisations
93 c ______________________________________________________________________
99 if ( messul.le.0 ) then
100 call dmunit ( enstul, sostul )
108 texte(1,4) = ': A la demande du programme '
109 c 12345678901234567890123456789012345678
110 texte(1,5) = ': ARRET NORMAL :'
111 texte(1,6) = ': ARRET pour cause de probleme :'
112 texte(1,7) = ': ARRET sur bouclage dans '
114 texte(2,4) = ': Requested by subroutine '
115 texte(2,5) = ': NORMAL STOP :'
116 texte(2,6) = ': STOP because of problem :'
117 texte(2,7) = ': STOP because of loop in '
120 > 15x,'......................................')
124 > /,15x,':....................................:')
129 > /,15x,':....................................:')
132 c 2. recuperation de l'etat des differents gestionnaires
134 c (1): unites logiques (1 : initialise, 0 : non)
135 c (2): mesures de temps de calcul (1 : initialise, 0 : non)
136 c (3): memoire (1 : initialise, 0 : non)
137 c (4): langue (1: francais, 2:anglais)
140 #ifdef _DEBUG_HOMARD_
141 write (ulsort,texte(1,3)) 'UGTABL', nompro
144 call ugtabl ( code, tabges, ulsort )
148 #ifdef _DEBUG_HOMARD_
149 write (ulsort,texte(langue,1)) 'Entree', nompro
153 if ( langue.le.0 .or. langue.gt.nblang ) then
163 c recopie prudente du nom de l'appelant, appela dans appelo :
166 #ifdef _DEBUG_HOMARD_
167 write (ulsort,texte(langue,3)) 'DMCPCH', nompro
169 call dmcpch( appela, iaux, appelo, jaux )
171 if ( jaux.eq.0 ) then
176 #ifdef _DEBUG_HOMARD_
179 if ( raison.le.0 ) then
186 if ( raison.ne.0 ) then
189 if ( raison.le.0 ) then
190 write (ulsort,10001) texte(langue,5)
195 if ( jaux.le.6 ) then
196 saux06(1:iaux) = appelo(1:jaux)
197 do 311 , iaux = jaux+1 , 6
198 saux06(iaux:iaux) = ' '
200 write (ulsort,10001) texte(langue,4)(1:29)//saux06//' :'
203 saux38(3:iaux+2) = appelo(1:jaux)
204 do 312 , iaux = jaux+3 , 38
205 saux38(iaux:iaux) = ' '
208 write (ulsort,10002) texte(langue,4)(1:29)//' :',
212 if ( raison.gt.0 ) then
213 if ( nropas.eq.1 ) then
214 write (ulsort,10001) texte(langue,6)
216 write (ulsort,10001) texte(langue,7)(1:29)//nompro//' :'
225 c 4. arret de la gestion de la memoire, le cas echeant
228 if ( tabges(3).ne.0 .and. nropas.eq.1 ) then
229 #ifdef _DEBUG_HOMARD_
230 write (ulsort,texte(langue,3)) 'GMSTOP', nompro
232 call gmstop ( gmimp )
237 c 5. arret de la gestion des mesures de temps de calcul, le cas echeant
240 if ( tabges(2).ne.0 .and. nropas.eq.1 ) then
241 #ifdef _DEBUG_HOMARD_
242 write (ulsort,texte(langue,3)) 'GTBILA', nompro
249 c 6. arret de la gestion unites logiques, le cas echeant
250 c . en mode debug, on respecte la decision d'impression.
251 c . en mode optim, on n'imprime jamais.
254 if ( tabges(1).ne.0 .and. nropas.eq.1 ) then
255 #ifdef _DEBUG_HOMARD_
256 write (ulsort,texte(langue,3)) 'GUBILA', nompro
258 #ifdef _DEBUG_HOMARD_
268 c 7. arret general de l'execution :
271 c <0 : arret des gestionnaires, mais le programme continue
274 if ( raison.eq.0 ) then
276 elseif ( raison.gt.0 ) then