Salome HOME
Homard executable
[modules/homard.git] / src / tool / Utilitaire / utcach.F
1       subroutine utcach ( nocham,
2      >                    nomcha,
3      >                    nbcomp, nbtvch, typcha,
4      >                    adnocp, adcaen, adcare, adcaca,
5      >                    ulsort, langue, codret )
6 c ______________________________________________________________________
7 c
8 c                             H O M A R D
9 c
10 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
11 c
12 c Version originale enregistree le 18 juin 1996 sous le numero 96036
13 c aupres des huissiers de justice Simart et Lavoir a Clamart
14 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
15 c aupres des huissiers de justice
16 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
17 c
18 c    HOMARD est une marque deposee d'Electricite de France
19 c
20 c Copyright EDF 1996
21 c Copyright EDF 1998
22 c Copyright EDF 2002
23 c Copyright EDF 2020
24 c ______________________________________________________________________
25 c
26 c    UTilitaire - CAracteristiques d'un CHamp
27 c    --           --                    --
28 c ______________________________________________________________________
29 c .        .     .        .                                            .
30 c .  nom   . e/s . taille .           description                      .
31 c .____________________________________________________________________.
32 c . nocham . e   . char8  . nom de l'objet champ                       .
33 c . nomcha .   s . char64 . nom du champ                               .
34 c . nbcomp .   s .   1    . nombre de composantes                      .
35 c . nbtvch .   s .   1    . nombre de tableaux du champ                .
36 c . typcha .   s .   1    . edin64/edfl64 selon entier/reel            .
37 c . adnocp .   s .   1    . adresse des noms des champ et composantes  .
38 c . adcaen .   s .   1    . adresse des caracteristiques entieres      .
39 c . adcare .   s .   1    . adresse des caracteristiques reelles       .
40 c . adcaca .   s .   1    . adresse des caracteristiques caracteres    .
41 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
42 c . langue . e   .    1   . langue des messages                        .
43 c .        .     .        . 1 : francais, 2 : anglais                  .
44 c . codret . es  .    1   . code de retour des modules                 .
45 c .        .     .        . 0 : pas de probleme                        .
46 c .        .     .        . 1 : probleme                               .
47 c ______________________________________________________________________
48 c
49 c====
50 c 0. declarations et dimensionnement
51 c====
52 c
53 c 0.1. ==> generalites
54 c
55       implicit none
56       save
57 c
58       character*6 nompro
59       parameter ( nompro = 'UTCACH' )
60 c
61 #include "nblang.h"
62 c
63 c 0.2. ==> communs
64 c
65 #include "envex1.h"
66 c
67 #include "gmstri.h"
68 c
69 c 0.3. ==> arguments
70 c
71       character*8 nocham
72       character*64 nomcha
73 c
74       integer nbcomp, nbtvch, typcha
75       integer adnocp, adcaen, adcare, adcaca
76 c
77       integer ulsort, langue, codret
78 c
79 c 0.4. ==> variables locales
80 c
81       integer iaux
82       integer codre1, codre2, codre3, codre4, codre5
83       integer codre6, codre7
84       integer codre0
85 c
86       integer nbmess
87       parameter ( nbmess = 10 )
88       character*80 texte(nblang,nbmess)
89 c
90 c 0.5. ==> initialisations
91 c ______________________________________________________________________
92 c
93 c====
94 c 1. initialisations
95 c====
96 c
97 c 1.1. ==> messages
98 c
99 #include "impr01.h"
100 c
101 #ifdef _DEBUG_HOMARD_
102       write (ulsort,texte(langue,1)) 'Entree', nompro
103       call dmflsh (iaux)
104 #endif
105 c
106       texte(1,4) = '(''Nom du champ : '',a32)'
107       texte(1,5) =
108      >'(''. Composante '',i2,'' : '',a16,''(unite : '',a16,'')'')'
109 c
110       texte(2,4) = '(''Name of the field : '',a32)'
111       texte(2,5) =
112      >'(''. Component '',i2,'' : '',a8,''(unit : '',a8,'')'')'
113 c
114 #ifdef _DEBUG_HOMARD_
115       call gmprsx (nompro, nocham )
116       call gmprsx (nompro, nocham//'.Nom_Comp' )
117       call gmprsx (nompro, nocham//'.Cham_Ent' )
118       call gmprsx (nompro, nocham//'.Cham_Ree' )
119       call gmprsx (nompro, nocham//'.Cham_Car' )
120 #endif
121 c
122 c====
123 c 2. caracteristiques de l'objet contenant le champ
124 c====
125 c
126       if ( codret.eq.0 ) then
127 c
128       call gmliat ( nocham, 1, nbcomp, codre1 )
129       call gmliat ( nocham, 2, nbtvch, codre2 )
130       call gmliat ( nocham, 3, typcha, codre3 )
131       call gmadoj ( nocham//'.Nom_Comp', adnocp, iaux, codre4 )
132       call gmadoj ( nocham//'.Cham_Ent', adcaen, iaux, codre5 )
133       call gmadoj ( nocham//'.Cham_Ree', adcare, iaux, codre6 )
134       call gmadoj ( nocham//'.Cham_Car', adcaca, iaux, codre7 )
135 c
136       codre0 = min ( codre1, codre2, codre3, codre4, codre5,
137      >               codre6, codre7 )
138       codret = max ( abs(codre0), codret,
139      >               codre1, codre2, codre3, codre4, codre5,
140      >               codre6, codre7 )
141 c
142       endif
143 c
144 c====
145 c 3. le nom du champ
146 c====
147 c
148       if ( codret.eq.0 ) then
149 c
150       iaux = 64
151       call uts8ch ( smem(adnocp), iaux, nomcha,
152      >              ulsort, langue, codret )
153 c
154       endif
155 c
156 #ifdef _DEBUG_HOMARD_
157       write (ulsort,texte(langue,4)) nomcha
158       do 31 , iaux = 1 , nbcomp
159         write (ulsort,texte(langue,5)) iaux,
160      >        smem(adnocp+3+iaux)//smem(adnocp+4+iaux),
161      >        smem(adnocp+2*nbcomp+3+iaux)//smem(adnocp+2*nbcomp+4+iaux)
162    31 continue
163 #endif
164 c
165 c====
166 c 4. la fin
167 c====
168 c
169       if ( codret.ne.0 ) then
170 c
171 #include "envex2.h"
172 c
173       write (ulsort,texte(langue,1)) 'Sortie', nompro
174       write (ulsort,texte(langue,2)) codret
175 c
176       endif
177 c
178 #ifdef _DEBUG_HOMARD_
179       write (ulsort,texte(langue,1)) 'Sortie', nompro
180       call dmflsh (iaux)
181 #endif
182 c
183       end