MED fichier
f/test31.f
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2016 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*64 maa
33  character*200 des
34  integer nmaa, mdim , nnoe, type, ind,sdim
35  integer numglb(100),i
36  character*16 nomcoo(2)
37  character*16 unicoo(2)
38  character(16) :: dtunit
39  real*8 coo(8)
40  integer nstep, stype, atype,chgt,tsf
41  real*8 dt
42  parameter(mdim = 2, maa = "maa1",sdim=2)
43  parameter(dt = 0.0)
44  data coo /0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0/
45  data nomcoo /"x","y"/, unicoo /"cm","cm"/
46 
47 
48 C ** Ouverture du fichier test4.med **
49  call mfiope(fid,'test31.med',med_acc_rdwr, cret)
50  print *,cret
51  if (cret .ne. 0 ) then
52  print *,'Erreur ouverture du fichier test31.med'
53  call efexit(-1)
54  endif
55 
56 C ** Creation du maillage maa de dimension 2 **
57 C ** et de type non structure **
58  nnoe=4
59  call mmhcre(fid,maa,mdim,sdim,
60  & med_unstructured_mesh,
61  & 'un premier maillage pour test4',
62  & "",med_sort_dtit,med_cartesian,nomcoo,unicoo,cret)
63  print *,cret
64  if (cret .ne. 0 ) then
65  print *,'Erreur creation du maillage'
66  call efexit(-1)
67  endif
68 
69 C ** Ecriture des coordonnees en mode MED_FULL_INTERLACE : **
70 C ** (X1,Y1, X2,Y2, X3,Y3, ...) dans un repere cartesien **
71  call mmhcow(fid,maa,med_no_dt,med_no_it,dt,
72  & med_full_interlace,nnoe,coo,cret)
73  print *,cret
74  if (cret .ne. 0 ) then
75  print *,'Erreur ecriture des coordonnees des noeuds'
76  call efexit(-1)
77  endif
78 
79  print '(A,I1,A,A4,A,I1,A,I4)','maillage '
80  & ,ind,' de nom ',maa,' et de dimension ',mdim,
81  & ' comportant le nombre de noeud ',nnoe
82 
83 C ** construction des numeros globaux
84 
85  if (nnoe.gt.100) nnoe=100
86 
87  do i=1,nnoe
88  numglb(i)=i+100
89  enddo
90 
91 C ** ecriture de la numerotation globale
92  call mmhgnw(fid,maa,med_no_dt,med_no_it,med_node,med_none,
93  & nnoe,numglb,cret)
94 
95  if (cret .ne. 0 ) then
96  print *,'Erreur ecriture numerotation globale '
97  call efexit(-1)
98  endif
99 C ** Fermeture du fichier **
100  call mficlo(fid,cret)
101  print *,cret
102  if (cret .ne. 0 ) then
103  print *,'Erreur fermeture du fichier'
104  call efexit(-1)
105  endif
106 C
107  end