MED fichier
f/2.3.6/test31.f
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2019 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*8 fid
32  integer cret
33  character*32 maa
34  character*200 des
35  integer nmaa, mdim , nnoe, type, ind
36  integer numglb(100),i
37 
38 
39 C ** Ouverture du fichier test31.med **
40  call efouvr(fid,'test31.med',med_lecture_ecriture, cret)
41  print *,cret
42  if (cret .ne. 0 ) then
43  print *,'Erreur ouverture du fichier test31.med'
44  call efexit(-1)
45  endif
46 
47 
48 C ** lecture du nombre de maillage **
49 
50  call efnmaa(fid,nmaa,cret)
51  print *,cret
52  if (cret .ne. 0 ) then
53  print *,'Erreur lecture du nombre de maillage'
54  call efexit(-1)
55  endif
56  print *,'Nombre de maillages = ',nmaa
57 
58 C ** lecture des infos pour le premier maillage
59 
60  ind=1
61  call efmaai(fid,ind,maa,mdim,type,des,cret)
62  print *,cret
63  if (cret .ne. 0 ) then
64  print *,'Erreur acces au premier maillage'
65  call efexit(-1)
66  endif
67 
68  nnoe = 0
69  call efnema(fid,maa,med_coor,med_noeud,0,0,nnoe,cret)
70  if (cret .ne. 0 ) then
71  print *,'Erreur acces au nombre de noeud du premier maillage'
72  call efexit(-1)
73  endif
74 
75 
76  print '(A,I1,A,A4,A,I1,A,I4)','maillage '
77  & ,ind,' de nom ',maa,' et de dimension ',mdim,
78  & ' comportant le nombre de noeud ',nnoe
79 
80 C ** construction des numeros globaux
81 
82  if (nnoe.gt.100) nnoe=100
83 
84  do i=1,nnoe
85  numglb(i)=i+100
86  enddo
87 
88 C ** ecriture de la numerotation globale
89 
90  call efgnme(fid,maa,numglb,nnoe,med_noeud,0,cret)
91 
92  if (cret .ne. 0 ) then
93  print *,'Erreur ecriture numerotation globale '
94  call efexit(-1)
95  endif
96 C ** Fermeture du fichier **
97  call efferm (fid,cret)
98  print *,cret
99  if (cret .ne. 0 ) then
100  print *,'Erreur fermeture du fichier'
101  call efexit(-1)
102  endif
103 C
104  end
test31
program test31
Definition: test31.f:25