MED fichier
test23.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
18C *******************************************************************************
19C * - Nom du fichier : test23.f
20C *
21C * - Description : ecriture de mailles MED_POLYGONE dans un maillage MED
22C *
23C ******************************************************************************
24 program test23
25C
26 implicit none
27 include 'med.hf'
28C
29 integer*8 fid
30 integer cret,mdim,sdim
31 parameter(mdim = 2, sdim = 2)
32 character*64 maa
33 integer ni, n
34 parameter(ni=4, n=3)
35 integer index(ni)
36 character*16 nom(n)
37 integer num(n),fam(n)
38 integer con(16)
39C ** tables des noms et des unites des coordonnees **
40C profil : (dimension) **
41 character*16 nomcoo(2)
42 character*16 unicoo(2)
43C
44 data con / 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 /
45 data nom / "poly1", "poly2", "poly3"/
46 data num / 1,2,3 /, fam /0,-1,-2/
47 data index /1,6,12,17/
48 data maa /"maa1"/
49 data nomcoo /"x","y"/, unicoo /"cm","cm"/
50
51C ** Creation du fichier test23.med **
52 call mfiope(fid,'test23.med',med_acc_rdwr, cret)
53 print *,cret
54 if (cret .ne. 0 ) then
55 print *,'Erreur creation du fichier'
56 call efexit(-1)
57 endif
58 print *,'Creation du fichier test23.med'
59
60C ** Creation du maillage **
61 call mmhcre(fid,maa,mdim,sdim,
62 & med_unstructured_mesh,'un maillage pour test 23',
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 print *,'Creation du maillage'
70
71C ** Ecriture de la connectivite des mailles polygones **
72 call mmhpgw(fid,maa,med_no_dt,med_no_it,med_undef_dt,med_cell,
73 & med_nodal,ni,index,con,cret)
74 if (cret .ne. 0 ) then
75 print *,'Erreur ecriture des connectivite polygones'
76 call efexit(-1)
77 endif
78 print *,cret
79 print *,'Ecriture des connectivites des mailles de type
80 & MED_POLYGONE'
81
82C ** Ecriture des noms des mailles polygones **
83 call mmheaw(fid,maa,med_no_dt,med_no_it,med_cell,
84 & med_polygon,n,nom,cret)
85 print *,cret
86 if (cret .ne. 0 ) then
87 print *,'Erreur ecriture des noms polygones'
88 call efexit(-1)
89 endif
90 print *,'Ecriture des noms des polygones'
91
92C ** Ecriture des numeros des mailles polygones **
93 call mmhenw(fid,maa,med_no_dt,med_no_it,med_cell,
94 & med_polygon,n,num,cret)
95 if (cret .ne. 0 ) then
96 print *,'Erreur ecriture des numeros polygones'
97 call efexit(-1)
98 endif
99 print *,cret
100 print *,'Ecriture des numeros des polygones'
101
102C ** Ecriture des numeros des familles des mailles polygones **
103 call mmhfnw(fid,maa,med_no_dt,med_no_it,med_cell,
104 & med_polygon,n,fam,cret)
105 if (cret .ne. 0 ) then
106 print *,'Erreur ecriture des numeros de famille polygones'
107 call efexit(-1)
108 endif
109 print *,cret
110 print *,'Ecriture des numeros de familles des polygones'
111
112C ** Fermeture du fichier **
113 call mficlo(fid,cret)
114 print *,cret
115 if (cret .ne. 0 ) then
116 print *,'Erreur fermeture du fichier'
117 call efexit(-1)
118 endif
119 print *,'Fermeture du fichier'
120C
121 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 mmheaw(fid, mname, numdt, numit, entype, geotype, n, ename, cret)
Cette routine permet d'écrire les noms d'un type d'entité d'un maillage.
Definition: medmesh.f:508
subroutine mmhpgw(fid, name, numdt, numit, dt, entype, cmode, isize, index, con, cret)
Definition: medmesh.f:890
subroutine mmhfnw(fid, name, numdt, numit, entype, geotype, n, num, cret)
Definition: medmesh.f:466
subroutine mmhenw(fid, name, numdt, numit, entype, geotype, n, num, cret)
Definition: medmesh.f:424
program test23
Definition: test23.f:24