MED fichier
f/2.3.6/test16.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 : test16.f
21 C *
22 C * - Description : ecriture d'elements d'un maillage MED
23 C * via les routines de niveau 2
24 C * - equivalent a test6.f
25 C *
26 C ******************************************************************************
27  program test16
28 C
29  implicit none
30  include 'med.hf'
31 C
32 C
33  integer cret, fid, mdim, nse2, ntr3
34  character*32 maa
35  parameter(mdim = 2,nse2 = 5,maa = "maa1", ntr3 = 2)
36  integer se2 (2*nse2)
37  character*16 nomse2(nse2)
38  integer numse2(nse2),nufase2(nse2)
39  integer tr3 (3*ntr3)
40  character*16 nomtr3(ntr3)
41  integer numtr3(ntr3), nufatr3(ntr3)
42  data se2 /1,2,1,3,2,4,3,4,2,3/
43  data nomse2 /"se1","se2","se3","se4","se5"/
44  data numse2 /1,2,3,4,5/, nufase2 /-1,-1,0,-2,-3/
45  data tr3 /1,2,-5,-5,3,-4/
46  data nomtr3 /"tr1","tr2"/,numtr3/4,5/,nufatr3/0,-1/
47 
48 C ** Creation du fichier test16.med **
49  call efouvr(fid,'test16.med',med_lecture_ecriture, cret)
50  print *,cret
51  if (cret .ne. 0 ) then
52  print *,'Erreur creation du fichier'
53  call efexit(-1)
54  endif
55 
56 C ** Creation du maillage **
57  call efmaac(fid,maa,mdim,med_non_structure,
58  c 'Un maillage pour test16',cret)
59  print *,cret
60  if (cret .ne. 0 ) then
61  print *,'Erreur creation du maillage'
62  call efexit(-1)
63  endif
64 
65 C ** Ecriture des aretes segments MED_SEG2 :
66 C - Connectivite
67 C - Noms (optionnel)
68 C - Numeros (optionnel)
69 C - Numeros des familles **
70  call efelee(fid,maa,mdim,se2,med_no_interlace,
71  c nomse2,med_vrai,numse2,med_vrai,
72  c nufase2,nse2,med_arete,med_seg2,med_desc,cret)
73  print *,cret
74  if (cret .ne. 0 ) then
75  print *,'Erreur des elements'
76  call efexit(-1)
77  endif
78 
79 C ** Ecriture des mailles MED_TRIA3 :
80 C - Connectivite
81 C - Noms (optionnel)
82 C - Numeros (optionnel)
83 C - Numeros des familles **
84  call efelee(fid,maa,mdim,tr3,med_no_interlace,
85  c nomtr3,med_vrai,numtr3,med_vrai,
86  c nufatr3,ntr3,med_maille,med_tria3,med_desc,cret)
87  print *,cret
88  if (cret .ne. 0 ) then
89  print *,'Erreur ecriture des elements'
90  call efexit(-1)
91  endif
92 
93 C ** Fermeture du fichier **
94  call efferm (fid,cret)
95  print *,cret
96  if (cret .ne. 0 ) then
97  print *,'Erreur fermeture du fichier'
98  call efexit(-1)
99  endif
100 C
101  end
102