Salome HOME
Updated copyright comment
[modules/homard.git] / src / tool / ES_HOMARD / esle01.F
1       subroutine esle01 ( idfmed, nomamd, nomcha,
2      >                    nbcomp, nomcmp, unicmp,
3      >                    optio1, optio2,
4      >                    ulsort, langue, codret)
5 c
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  Entree-Sortie : LEcture noeud-maille - 01
27 c  -      -        --                     --
28 c ______________________________________________________________________
29 c .  nom   . e/s . taille .           description                      .
30 c .____________________________________________________________________.
31 c . idfmed . e   .   1    . identificateur du fichier MED              .
32 c . nomamd . e   . char64 . nom du maillage MED                        .
33 c . nomcha . e   . char64 . nom du champ MED voulu                     .
34 c . nbcomp .  s  .   1    . nombre de composantes du champ             .
35 c . nomcmp .  s  .   *    . nom des composantes du champ               .
36 c . unicmp .  s  .   *    . unite des composantes du champ             .
37 c . optio1 . e   .   *    . 0 : erreur si le champ n'est pas trouve    .
38 c .        .     .        . 1 : pas de probleme                        .
39 c . optio2 .  s  .   1    . 0 ou 1 selon la presence du champ          .
40 c . ulsort . e   .   1    . numero d'unite logique de la liste standard.
41 c . langue . e   .    1   . langue des messages                        .
42 c .        .     .        . 1 : francais, 2 : anglais                  .
43 c . codret . es  .    1   . code de retour des modules                 .
44 c .        .     .        . 0 : pas de probleme                        .
45 c ______________________________________________________________________
46 c
47 c====
48 c 0. declarations et dimensionnement
49 c====
50 c
51 c 0.1. ==> generalites
52 c
53       implicit none
54       save
55 c
56       character*6 nompro
57       parameter ( nompro = 'ESLE01' )
58 c
59 #include "nblang.h"
60 #include "consts.h"
61 c
62 c 0.2. ==> communs
63 c
64 #include "envex1.h"
65 c
66 c 0.3. ==> arguments
67 c
68       integer*8 idfmed
69       integer optio1, optio2
70       integer nbcomp
71 c
72       character*16 nomcmp(*), unicmp(*)
73       character*64 nomamd
74       character*64 nomcha
75 c
76       integer ulsort, langue, codret
77 c
78 c 0.4. ==> variables locales
79 c
80 #include "meddc0.h"
81 c
82       integer iaux, jaux
83       integer nbchfi, nrocha
84       integer typcha
85       integer nbseq
86 c
87       character*16 dtunit
88       character*64 nomch0
89 c
90       integer nbmess
91       parameter ( nbmess = 150 )
92       character*80 texte(nblang,nbmess)
93 c ______________________________________________________________________
94 c
95 c====
96 c 1. initialisations
97 c====
98 c 1.1. ==> messages
99 c
100 #include "impr01.h"
101 c
102 #ifdef _DEBUG_HOMARD_
103       write (ulsort,texte(langue,1)) 'Entree', nompro
104       call dmflsh (iaux)
105 #endif
106 c
107       texte(1,4) = '(/,''Lecture du champ : '',a64)'
108       texte(1,5) = '(''Type du champ : '',i2)'
109       texte(1,6) =
110      > '(''Numero !     Composante     !       Unite'',/,49(''-''))'
111       texte(1,7) = '(i6,'' !  '',a16,''  !  '',a16)'
112 c
113       texte(2,4) = '(/,''Readings of field: '',a64)'
114       texte(2,5) = '(''Type of field: '',i2)'
115       texte(2,6) =
116      > '(''  #    !     Component      !       Unit'',/,49(''-''))'
117       texte(2,7) = '(i6,'' !  '',a16,''  !  '',a16)'
118 c
119 #include "impr03.h"
120 c
121 #ifdef _DEBUG_HOMARD_
122       write (ulsort,texte(langue,4)) nomcha
123 #endif
124 c
125 #include "esimpr.h"
126 c
127 c 1.2. ==> champ absent a priori
128 c
129       optio2 = 0
130 c
131 c====
132 c 2. Lectures
133 c====
134 c 2.1. ==> nombre de champs dans le fichier
135 c
136       if ( codret.eq.0 ) then
137 c
138 #ifdef _DEBUG_HOMARD_
139       write (ulsort,texte(langue,3)) 'MFDNFD', nompro
140 #endif
141       call mfdnfd ( idfmed, nbchfi, codret )
142 #ifdef _DEBUG_HOMARD_
143       write (ulsort,90002) 'nbchfi', nbchfi
144 #endif
145 c
146       endif
147 c
148       do 20 , nrocha = 1 , nbchfi
149 c
150 c 2.2. ==> nombre de composantes du champ courant
151 c
152         if ( codret.eq.0 ) then
153 c
154 #ifdef _DEBUG_HOMARD_
155       write (ulsort,texte(langue,3)) 'MFDNFC', nompro
156 #endif
157         iaux = nrocha
158         call mfdnfc ( idfmed, iaux, nbcomp, codret )
159 c
160         endif
161 c
162 c 2.3. ==> lecture du nom du champ, des noms et des unites
163 c          de ses composantes
164 c
165         if ( codret.eq.0 ) then
166 c
167 #ifdef _DEBUG_HOMARD_
168       write (ulsort,texte(langue,3)) 'MFDFDI', nompro
169 #endif
170 c
171         nomch0 = blan64
172         iaux = nrocha
173         jaux = edtrue
174         call mfdfdi ( idfmed, iaux, nomch0, nomamd, jaux,
175      >                typcha, nomcmp, unicmp,
176      >                dtunit, nbseq, codret )
177 c
178         endif
179 c
180         if ( codret.eq.0 ) then
181 c
182 #ifdef _DEBUG_HOMARD_
183       if ( codret.eq.0 ) then
184       write (ulsort,93020) 'caracteristiques du champ', nomch0
185       write (ulsort,texte(langue,5)) typcha
186       write (ulsort,texte(langue,6))
187       do 231 , iaux = 1 , nbcomp
188         write (ulsort,texte(langue,7)) iaux, nomcmp(iaux), unicmp(iaux)
189   231 continue
190         endif
191 #endif
192 c
193         endif
194 c
195 c 2.4. ==> Si c'est le bon, on sort
196 c
197         if ( codret.eq.0 ) then
198 c
199         if ( nomch0.eq.nomcha ) then
200 c
201           if ( typcha.ne.edint ) then
202             codret = 231
203           endif
204           if ( nbseq.ne.1 ) then
205             write (ulsort,90002) 'nbseq ', nbseq
206             codret = 232
207             goto 30
208           endif
209 c
210           optio2 = 1
211           goto 40
212 c
213         endif
214 c
215         endif
216 c
217    20 continue
218 c
219 c====
220 c 2.5. ==> Impossible de trouver le bon champ
221 c====
222 c
223    30 continue
224 c
225       if ( optio1.eq.0 ) then
226 c
227         write (ulsort,texte(langue,32)) nomcha
228         write (ulsort,texte(langue,92))
229         write (ulsort,90002) 'Nombre de champs presents', nbchfi
230         do 301 , nrocha = 1 , nbchfi
231           iaux = nrocha
232           call mfdnfc ( idfmed, iaux, nbcomp, codret )
233           nomch0 = blan64
234           jaux = edtrue
235           call mfdfdi ( idfmed, iaux, nomch0, nomamd, jaux,
236      >                  typcha, nomcmp, unicmp,
237      >                  dtunit, nbseq, codret )
238         write (ulsort,texte(langue,32)) nomch0
239         write (ulsort,texte(langue,5)) typcha
240   301   continue
241         codret = 1
242 c
243       endif
244 c
245 c====
246 c 4. la fin
247 c====
248 c
249    40 continue
250 c
251       if ( codret.ne.0 ) then
252 c
253 #include "envex2.h"
254 c
255       write (ulsort,texte(langue,1)) 'Sortie', nompro
256       write (ulsort,texte(langue,2)) codret
257 c
258       endif
259 c
260 #ifdef _DEBUG_HOMARD_
261       write (ulsort,texte(langue,1)) 'Sortie', nompro
262       call dmflsh (iaux)
263 #endif
264 c
265       end