MED fichier
f/2.3.6/test31.f
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2017 EDF R&D, CEA/DEN
4 C* MED is free software: you can redistribute it and/or modify
5 C* it under the terms of the GNU Lesser General Public License as published by
6 C* the Free Software Foundation, either version 3 of the License, or
7 C* (at your option) any later version.
8 C*
9 C* MED is distributed in the hope that it will be useful,
10 C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11 C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 C* GNU Lesser General Public License for more details.
13 C*
14 C* You should have received a copy of the GNU Lesser General Public License
15 C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16 C*
17 
18 
19 C ******************************************************************************
20 C * - Nom du fichier : test31.f
21 C *
22 C * - Description : ecriture d'une numerotation globale dans un maillage MED
23 C *
24 C ******************************************************************************
25  program test31
26 C
27  implicit none
28  include 'med.hf'
29 C
30 C
31  integer cret,fid
32  character*32 maa
33  character*200 des
34  integer nmaa, mdim , nnoe, type, ind
35  integer numglb(100),i
36 
37 
38 C ** Ouverture du fichier test31.med **
39  call efouvr(fid,'test31.med',med_lecture_ecriture, cret)
40  print *,cret
41  if (cret .ne. 0 ) then
42  print *,'Erreur ouverture du fichier test31.med'
43  call efexit(-1)
44  endif
45 
46 
47 C ** lecture du nombre de maillage **
48 
49  call efnmaa(fid,nmaa,cret)
50  print *,cret
51  if (cret .ne. 0 ) then
52  print *,'Erreur lecture du nombre de maillage'
53  call efexit(-1)
54  endif
55  print *,'Nombre de maillages = ',nmaa
56 
57 C ** lecture des infos pour le premier maillage
58 
59  ind=1
60  call efmaai(fid,ind,maa,mdim,type,des,cret)
61  print *,cret
62  if (cret .ne. 0 ) then
63  print *,'Erreur acces au premier maillage'
64  call efexit(-1)
65  endif
66 
67  nnoe = 0
68  call efnema(fid,maa,med_coor,med_noeud,0,0,nnoe,cret)
69  if (cret .ne. 0 ) then
70  print *,'Erreur acces au nombre de noeud du premier maillage'
71  call efexit(-1)
72  endif
73 
74 
75  print '(A,I1,A,A4,A,I1,A,I4)','maillage '
76  & ,ind,' de nom ',maa,' et de dimension ',mdim,
77  & ' comportant le nombre de noeud ',nnoe
78 
79 C ** construction des numeros globaux
80 
81  if (nnoe.gt.100) nnoe=100
82 
83  do i=1,nnoe
84  numglb(i)=i+100
85  enddo
86 
87 C ** ecriture de la numerotation globale
88 
89  call efgnme(fid,maa,numglb,nnoe,med_noeud,0,cret)
90 
91  if (cret .ne. 0 ) then
92  print *,'Erreur ecriture numerotation globale '
93  call efexit(-1)
94  endif
95 C ** Fermeture du fichier **
96  call efferm (fid,cret)
97  print *,cret
98  if (cret .ne. 0 ) then
99  print *,'Erreur fermeture du fichier'
100  call efexit(-1)
101  endif
102 C
103  end