Salome HOME
Homard executable
[modules/homard.git] / src / tool / Utilitaire / utpr05.F
1       subroutine utpr05 ( option, nnvapr, listpr,
2      >                    nbentn, nbentp,
3      >                    neneho, neneca, decala,
4      >                    lgneic, neneic, neneih,
5      >                    obpcan, obpcap,
6      >                    adpcan, adpcap,
7      >                    ulsort, langue, codret )
8 c ______________________________________________________________________
9 c
10 c                             H O M A R D
11 c
12 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
13 c
14 c Version originale enregistree le 18 juin 1996 sous le numero 96036
15 c aupres des huissiers de justice Simart et Lavoir a Clamart
16 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
17 c aupres des huissiers de justice
18 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
19 c
20 c    HOMARD est une marque deposee d'Electricite de France
21 c
22 c Copyright EDF 1996
23 c Copyright EDF 1998
24 c Copyright EDF 2002
25 c Copyright EDF 2020
26 c ______________________________________________________________________
27 c
28 c    UTilitaire - PRofil operation 05
29 c    --           --               --
30 c
31 c  Cree deux profils etendus pour les interpolations
32 c ______________________________________________________________________
33 c .        .     .        .                                            .
34 c .  nom   . e/s . taille .           description                      .
35 c .____________________________________________________________________.
36 c . option . e   .   1    . -1 : on cree l'etape n                     .
37 c .        .     .        .  0 : on cree les 2 etapes                  .
38 c .        .     .        .  1 : on cree l'etape p                     .
39 c . nnvapr . e   .   1    . nombre de valeurs du profil en entree      .
40 c .        .     .        . -1, si pas de profil                       .
41 c . listpr . e   .   *    . liste des numeros d'entites ou la fonction .
42 c .        .     .        . est definie.                               .
43 c . nbentn . e   .   1    . nombre d'entites calcul a l'etape n        .
44 c . nbentp . e   .   1    . nombre d'entites calcul a l'etape p        .
45 c . neneho . e   .    *   . numero des entites en entree dans HOMARD   .
46 c . neneca . e   .    *   . numero des entites dans Calcul (cf. vcmren).
47 c . decala . e   .   1    . decalage des numerotations selon le type   .
48 c . neneic . e   .    *   . numero des entites dans Calcul (cf. vcmren).
49 c . neneih . e   .    *   . reciproque de neneic                       .
50 c . obpcan .  s  . char*8 . nom de l'objet profil etendu a l'etape n   .
51 c . obpcap .  s  . char*8 . nom de l'objet profil etendu a l'etape p   .
52 c .        .     .        . ce profil est mis a 0 par defaut           .
53 c . adpcan .  s  .   1    . adresse du tableau entier associe a obpcan .
54 c . adpcap .  s  .   1    . adresse du tableau entier associe a obpcap .
55 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
56 c . langue . e   .    1   . langue des messages                        .
57 c .        .     .        . 1 : francais, 2 : anglais                  .
58 c . codret . es  .    1   . code de retour des modules                 .
59 c .        .     .        . 0 : pas de probleme                        .
60 c .        .     .        . autre : probleme dans l'allocation         .
61 c ______________________________________________________________________
62 c
63 c====
64 c 0. declarations et dimensionnement
65 c====
66 c
67 c 0.1. ==> generalites
68 c
69       implicit none
70       save
71 c
72       character*6 nompro
73       parameter ( nompro = 'UTPR05' )
74 c
75 #include "nblang.h"
76 c
77 c 0.2. ==> communs
78 c
79 #include "envex1.h"
80 c
81 #include "gmenti.h"
82 c
83 c 0.3. ==> arguments
84 c
85       integer option, nnvapr
86       integer nbentn, nbentp
87       integer listpr(*)
88       integer neneho(*)
89       integer neneca(*), decala
90       integer lgneic, neneic(*)
91       integer neneih(*)
92       integer adpcan, adpcap
93 c
94       character*8 obpcan, obpcap
95 c
96       integer ulsort, langue, codret
97 c
98 c 0.4. ==> variables locales
99 c
100       integer iaux
101       integer codre1, codre2
102       integer codre0
103 c
104       integer nbmess
105       parameter ( nbmess = 10 )
106       character*80 texte(nblang,nbmess)
107 c
108 c 0.5. ==> initialisations
109 c ______________________________________________________________________
110 c
111 c====
112 c 1. messages
113 c====
114 c
115 #include "impr01.h"
116 c
117 #ifdef _DEBUG_HOMARD_
118       write (ulsort,texte(langue,1)) 'Entree', nompro
119       call dmflsh (iaux)
120 #endif
121 c
122       texte(1,4) =
123      > '(''Longueur du profil etendu a l''''etape '',a1,'' : '',i10)'
124       texte(1,5) =
125      > '(''Creation du profil etendu a l''''etape '',a1,'' : '',a)'
126 c
127       texte(2,4) =
128      > '(''Longueur du profil etendu a l''''etape '',a1,'': '',i10)'
129       texte(2,5) =
130      > '(''Creation of long profile at stage '',a1,'': '',a)'
131 c
132 #include "impr03.h"
133 cgn      write (ulsort,*)nompro//'-neneic'
134 cgn      write (ulsort,91020)(neneic(iaux),iaux=1,lgneic/2)
135 c
136 c====
137 c 2. allocations des deux tableaux entiers des profils etendus
138 c====
139 c
140 #ifdef _DEBUG_HOMARD_
141 cgn      write (ulsort,90002) 'option', option
142       if ( option.le.0 ) then
143         write (ulsort,texte(langue,4)) 'n', nbentn
144       endif
145       if ( option.ge.0 ) then
146         write (ulsort,texte(langue,4)) 'p', nbentp
147       endif
148 #endif
149 c
150       if ( option.le.0 ) then
151         call gmalot ( obpcan, 'entier  ', nbentn, adpcan, codre1 )
152       else
153         codre1 = 0
154       endif
155 c
156       if ( option.ge.0 ) then
157         call gmalot ( obpcap, 'entier  ', nbentp, adpcap, codre2 )
158       else
159         codre2 = 0
160       endif
161 c
162       codre0 = min ( codre1, codre2 )
163       codret = max ( abs(codre0), codret,
164      >               codre1, codre2 )
165 c
166 #ifdef _DEBUG_HOMARD_
167       if ( option.le.0 ) then
168         write (ulsort,texte(langue,5)) 'n', obpcan
169       endif
170       if ( option.ge.0 ) then
171         write (ulsort,texte(langue,5)) 'p', obpcap
172       endif
173 #endif
174 c
175 c====
176 c 3. remplissage du tableau a l'etape n
177 c====
178 #ifdef _DEBUG_HOMARD_
179       write (ulsort,90002) '3. remplissage n ; codret', codret
180 #endif
181 c
182       if ( option.le.0 ) then
183 c
184         if ( codret.eq.0 ) then
185 c
186         iaux = 1
187 #ifdef _DEBUG_HOMARD_
188       write (ulsort,texte(langue,3)) 'UTPR02', nompro
189 #endif
190         call utpr02 ( iaux,
191      >                nbentn, nnvapr, listpr,
192      >                neneho, neneca, decala,
193      >                lgneic, neneic, neneih,
194      >                imem(adpcan),
195      >                ulsort, langue, codret )
196 c
197         endif
198 c
199 cgn      call gmprsx (nompro, obpcan )
200 c
201       endif
202 c
203 c====
204 c 4. remplissage du tableau a l'etape p : rien a priori
205 c====
206 #ifdef _DEBUG_HOMARD_
207       write (ulsort,90002) '4. remplissage p ; codret', codret
208 #endif
209 c
210       if ( option.ge.0 ) then
211 c
212        if ( codret.eq.0 ) then
213 c
214         do 41 , iaux = adpcap , adpcap+nbentp-1
215           imem(iaux) = 0
216    41   continue
217 c
218 cgn      call gmprsx (nompro, obpcap )
219 c
220         endif
221 c
222       endif
223 c
224 c====
225 c 5. la fin
226 c====
227 c
228       if ( codret.ne.0 ) then
229 c
230 #include "envex2.h"
231 c
232       write (ulsort,texte(langue,1)) 'Sortie', nompro
233       write (ulsort,texte(langue,2)) codret
234 c
235       endif
236 c
237 #ifdef _DEBUG_HOMARD_
238       write (ulsort,texte(langue,1)) 'Sortie', nompro
239       call dmflsh (iaux)
240 #endif
241 c
242       end