MED fichier
test31.f
Aller à la documentation de ce fichier.
1C* This file is part of MED.
2C*
3C* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
4C* MED is free software: you can redistribute it and/or modify
5C* it under the terms of the GNU Lesser General Public License as published by
6C* the Free Software Foundation, either version 3 of the License, or
7C* (at your option) any later version.
8C*
9C* MED is distributed in the hope that it will be useful,
10C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12C* GNU Lesser General Public License for more details.
13C*
14C* You should have received a copy of the GNU Lesser General Public License
15C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16C*
17
18
19C ******************************************************************************
20C * - Nom du fichier : test31.f
21C *
22C * - Description : ecriture d'une numerotation globale dans un maillage MED
23C *
24C ******************************************************************************
25 program test31
26C
27 implicit none
28 include 'med.hf'
29C
30C
31 integer*8 fid
32 integer cret
33 character*64 maa
34 character*200 des
35 integer nmaa, mdim , nnoe, type, ind,sdim
36 integer numglb(100),i
37 character*16 nomcoo(2)
38 character*16 unicoo(2)
39 character(16) :: dtunit
40 real*8 coo(8)
41 integer nstep, stype, atype,chgt,tsf
42 real*8 dt
43 parameter(mdim = 2, maa = "maa1",sdim=2)
44 parameter(dt = 0.0)
45 data coo /0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0/
46 data nomcoo /"x","y"/, unicoo /"cm","cm"/
47
48
49C ** Ouverture du fichier test4.med **
50 call mfiope(fid,'test31.med',med_acc_rdwr, cret)
51 print *,cret
52 if (cret .ne. 0 ) then
53 print *,'Erreur ouverture du fichier test31.med'
54 call efexit(-1)
55 endif
56
57C ** Creation du maillage maa de dimension 2 **
58C ** et de type non structure **
59 nnoe=4
60 call mmhcre(fid,maa,mdim,sdim,
61 & med_unstructured_mesh,
62 & 'un premier maillage pour test4',
63 & "",med_sort_dtit,med_cartesian,nomcoo,unicoo,cret)
64 print *,cret
65 if (cret .ne. 0 ) then
66 print *,'Erreur creation du maillage'
67 call efexit(-1)
68 endif
69
70C ** Ecriture des coordonnees en mode MED_FULL_INTERLACE : **
71C ** (X1,Y1, X2,Y2, X3,Y3, ...) dans un repere cartesien **
72 call mmhcow(fid,maa,med_no_dt,med_no_it,dt,
73 & med_full_interlace,nnoe,coo,cret)
74 print *,cret
75 if (cret .ne. 0 ) then
76 print *,'Erreur ecriture des coordonnees des noeuds'
77 call efexit(-1)
78 endif
79
80 print '(A,I1,A,A4,A,I1,A,I4)','maillage '
81 & ,ind,' de nom ',maa,' et de dimension ',mdim,
82 & ' comportant le nombre de noeud ',nnoe
83
84C ** construction des numeros globaux
85
86 if (nnoe.gt.100) nnoe=100
87
88 do i=1,nnoe
89 numglb(i)=i+100
90 enddo
91
92C ** ecriture de la numerotation globale
93 call mmhgnw(fid,maa,med_no_dt,med_no_it,med_node,med_none,
94 & nnoe,numglb,cret)
95
96 if (cret .ne. 0 ) then
97 print *,'Erreur ecriture numerotation globale '
98 call efexit(-1)
99 endif
100C ** Fermeture du fichier **
101 call mficlo(fid,cret)
102 print *,cret
103 if (cret .ne. 0 ) then
104 print *,'Erreur fermeture du fichier'
105 call efexit(-1)
106 endif
107C
108 end
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition medfile.f:42
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition medfile.f:82
subroutine mmhcre(fid, name, sdim, mdim, mtype, desc, dtunit, stype, atype, aname, aunit, cret)
Cette routine permet de créer un maillage dans un fichier.
Definition medmesh.f:20
subroutine mmhgnw(fid, name, numdt, numit, entype, geotype, n, num, cret)
Definition medmesh.f:976
subroutine mmhcow(fid, name, numdt, numit, dt, swm, n, coo, cret)
Definition medmesh.f:299
program test31
Definition test31.f:25