Salome HOME
Updated copyright comment
[modules/homard.git] / src / tool / Suivi_Frontiere / sfgrfa.F
1       subroutine sfgrfa ( nocmaf, ncafdg,
2      >                    nblign, nbf, nbgrmx,
3      >                    ulsort, langue, codret)
4 c ______________________________________________________________________
5 c
6 c                             H O M A R D
7 c
8 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
9 c
10 c Version originale enregistree le 18 juin 1996 sous le numero 96036
11 c aupres des huissiers de justice Simart et Lavoir a Clamart
12 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
13 c aupres des huissiers de justice
14 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
15 c
16 c    HOMARD est une marque deposee d'Electricite de France
17 c
18 c Copyright EDF 1996
19 c Copyright EDF 1998
20 c Copyright EDF 2002
21 c Copyright EDF 2020
22 c ______________________________________________________________________
23 c
24 c   Suivi de Frontiere - GRoupes de la Frontiere - phase A
25 c   -        -           --            -                 -
26 c remarque : sfgrfa et sfgrfb sont des clones
27 c ______________________________________________________________________
28 c .  nom   . e/s . taille .           description                      .
29 c .____________________________________________________________________.
30 c . nocmaf . e   . char*8 . nom de l'objet maillage de la frontiere    .
31 c . ncafdg . es  . char*8 . nom de l'objet groupes pour la frontiere   .
32 c . nblign .   s .    1   . nombre de lignes a considerer              .
33 c . nbf    . e   .   1    . nombre de familles du maillage frontiere   .
34 c . nbgrmx . e   .   1    . nombre maxi de groupes dans les familles   .
35 c . langue . e   .    1   . langue des messages                        .
36 c .        .     .        . 1 : francais, 2 : anglais                  .
37 c . codret . es  .    1   . code de retour des modules                 .
38 c .        .     .        . 0 : pas de probleme                        .
39 c .        .     .        . 2 : probleme avec la memoire               .
40 c .        .     .        . 3 : probleme avec le fichier               .
41 c .        .     .        . 5 : contenu incorrect                      .
42 c ______________________________________________________________________
43 c
44 c====
45 c 0. declarations et dimensionnement
46 c====
47 c
48 c 0.1. ==> generalites
49 c
50       implicit none
51       save
52 c
53       character*6 nompro
54       parameter ( nompro = 'SFGRFA' )
55 c
56 #include "nblang.h"
57 c
58 c 0.2. ==> communs
59 c
60 #include "envex1.h"
61 c
62 #include "gmenti.h"
63 #include "gmstri.h"
64 c
65 c 0.3. ==> arguments
66 c
67       integer nblign, nbf, nbgrmx
68 c
69       character*8 nocmaf, ncafdg
70 c
71       integer ulsort, langue, codret
72 c
73 c 0.4. ==> variables locales
74 c
75       integer iaux, jaux, kaux
76       integer lgtabl
77       integer adtyel, adfael
78       integer pointl, pttgrl, ptngrl
79       integer adgrtb, adgrpo, adnufa
80       integer nbmail, nbfmed
81       integer ptrav1
82 c
83       character*8 ntrav1
84 c
85       integer nbmess
86       parameter ( nbmess = 10 )
87       character*80 texte(nblang,nbmess)
88 c
89 c 0.5. ==> initialisations
90 c ______________________________________________________________________
91 c
92 c====
93 c 1. messages
94 c====
95 c
96 #include "impr01.h"
97 c
98 #ifdef _DEBUG_HOMARD_
99       write (ulsort,texte(langue,1)) 'Entree', nompro
100       call dmflsh (iaux)
101 #endif
102 c
103 #include "impr03.h"
104 #ifdef _DEBUG_HOMARD_
105       write (ulsort,90002) 'nbgrmx', nbgrmx
106 #endif
107 c
108       codret = 0
109 c
110 c====
111 c 2. recuperation des adresses
112 c====
113 #ifdef _DEBUG_HOMARD_
114       write (ulsort,90002) '2. adresses et reperage ; codret', codret
115 #endif
116 c
117 c 2.1. ==> le tableau trav1 contiendra la liste des familles du maillage
118 c          frontiere qui contiennent au moins un groupe. Il est alloue
119 c          au maximum theorique qui vaut le nombre total de groupes
120 c          constituant les familles + 1 pour la famille nulle
121 c
122       if ( codret.eq.0 ) then
123 c
124       iaux = nbgrmx + 1
125       call gmalot ( ntrav1, 'entier  ', iaux, ptrav1, codret )
126 c
127       endif
128 c
129 c 2.2. ==> adresses et filtrage
130 c
131       if ( codret.eq.0 ) then
132 c
133 #ifdef _DEBUG_HOMARD_
134       call gmprsx (nompro//' - maillage frontiere',nocmaf )
135 #endif
136 c
137 #ifdef _DEBUG_HOMARD_
138       write (ulsort,texte(langue,3)) 'SFGRF0', nompro
139 #endif
140       call sfgrf0 ( nocmaf,
141      >              nbmail,
142      >              adtyel, adfael,
143      >              adnufa, adgrpo, adgrtb,
144      >              nbfmed, imem(ptrav1),
145      >              ulsort, langue, codret)
146 c
147 #ifdef _DEBUG_HOMARD_
148       call gmprsx (nompro//' - ntrav1 (lifami)',ntrav1 )
149 #endif
150 c
151       endif
152 c
153 c====
154 c 3. on alloue les tableaux decrivant les groupes a suivre
155 c    au maximum theorique qui est le nombre total de groupes
156 c    constituant les familles
157 c====
158 #ifdef _DEBUG_HOMARD_
159       write (ulsort,90002) '3. Allocation ; codret', codret
160 #endif
161 #ifdef _DEBUG_HOMARD_
162       write (ulsort,*) 'ncafdg ', ncafdg
163       call gmprsx (nompro,ncafdg )
164 #endif
165 c
166       if ( codret.eq.0 ) then
167 c
168       jaux = 3
169       kaux = 10*nbgrmx
170 #ifdef _DEBUG_HOMARD_
171       write (ulsort,texte(langue,3)) 'UTATPC', nompro
172 #endif
173       call utaptc ( ncafdg, iaux, jaux,
174      >              nbgrmx, kaux,
175      >              pointl, pttgrl, ptngrl,
176      >              ulsort, langue, codret )
177 c
178       endif
179 c
180 c====
181 c 4. on remplit les tableaux
182 c====
183 #ifdef _DEBUG_HOMARD_
184       write (ulsort,90002) '4. remplissage ; codret', codret
185 #endif
186 c
187       if ( codret.eq.0 ) then
188 c
189 cgn      call gmprsx (nompro, nocmaf//'.Famille.Groupe.Pointeur' )
190 cgn      call gmprsx (nompro, nocmaf//'.Famille.Groupe.Table' )
191 cgn      call gmprsx (nompro, nocmaf//'.Famille.Numero' )
192 #ifdef _DEBUG_HOMARD_
193       write (ulsort,texte(langue,3)) 'SFGRF2', nompro
194 #endif
195       call sfgrf2 ( nbfmed,
196      >              nbf, nbgrmx, nblign, lgtabl,
197      >              imem(pointl), imem(pttgrl), smem(ptngrl),
198      >              imem(adgrpo), smem(adgrtb), imem(adnufa),
199      >              imem(ptrav1),
200      >              ulsort, langue, codret )
201 c
202 #ifdef _DEBUG_HOMARD_
203       call gmprsx (nompro,ncafdg )
204       call gmprsx (nompro,ncafdg//'.Pointeur' )
205       call gmprsx (nompro,ncafdg//'.Table' )
206       call gmprsx (nompro,ncafdg//'.Taille' )
207 #endif
208 c
209       endif
210 c
211 c====
212 c 5. ajustement des longueurs des tableaux
213 c====
214 #ifdef _DEBUG_HOMARD_
215       write (ulsort,90002) '5. Ajustement ; codret', codret
216 #endif
217 c
218       if ( codret.eq.0 ) then
219 c
220       jaux = 3
221 #ifdef _DEBUG_HOMARD_
222       write (ulsort,texte(langue,3)) 'UTATPC', nompro
223 #endif
224       call utaptc ( ncafdg, iaux, jaux,
225      >              nblign, lgtabl,
226      >              pointl, pttgrl, ptngrl,
227      >              ulsort, langue, codret )
228 c
229 #ifdef _DEBUG_HOMARD_
230       call gmprsx (nompro,ncafdg )
231       call gmprsx (nompro,ncafdg//'.Pointeur' )
232       call gmprsx (nompro,ncafdg//'.Table' )
233       call gmprsx (nompro,ncafdg//'.Taille' )
234 #endif
235 c
236       endif
237 c
238 c====
239 c 6. menage
240 c====
241 c
242       if ( codret.eq.0 ) then
243 c
244       call gmlboj ( ntrav1 , codret )
245 c
246       endif
247 c
248 c====
249 c 7. la fin
250 c====
251 c
252       if ( codret.ne.0 ) then
253 c
254 #include "envex2.h"
255 c
256       write (ulsort,texte(langue,1)) 'Sortie', nompro
257       write (ulsort,texte(langue,2)) codret
258 c
259       endif
260 c
261 #ifdef _DEBUG_HOMARD_
262       write (ulsort,texte(langue,1)) 'Sortie', nompro
263       call dmflsh (iaux)
264 #endif
265 c
266       end