MED fichier
test2.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 : test2.f
20C *
21C * - Description : exemples de creations de maillage MED
22C *
23C ******************************************************************************
24 program test2
25C
26 implicit none
27 include 'med.hf'
28C
29C
30 integer cret,ret
31 integer*8 fid
32
33 character*200 des
34 integer hdfok, medok
35 integer fexist, accok
36 character*16 nomcoo(2)
37 character*16 unicoo(2)
38 data nomcoo /"x","y"/, unicoo /"cm","cm"/
39
40
41C ** verifie que le fichier test1.med existe et est accessible **
42 call mfiexi('test1.med', med_acc_rdonly, fexist, accok, cret)
43 print *,"fexistf :",fexist, " ; accok :", accok
44
45C ** verifie que le fichier test1.med est au bon format **
46 call mficom('test1.med',hdfok,medok,cret)
47 print *,hdfok, medok, cret
48 if (cret .ne. 0 ) then
49 print *,àé'Erreur la vrification du format'
50 call efexit(-1)
51 endif
52
53C ** Ouverture en mode de lecture du fichier test1.med
54 call mfiope(fid,'test1.med',med_acc_rdonly, cret)
55 print *,cret
56 if (cret .ne. 0 ) then
57 print *,'Erreur ouverture du fichier en lecture'
58 call efexit(-1)
59 endif
60
61C ** Lecture de l'en-tete du fichier
62 call mficor(fid,des,cret)
63 print *,cret
64 if (cret .ne. 0 ) then
65 print *,'Erreur lecture en-tete du fichier'
66 call efexit(-1)
67 endif
68 print *,"DESCRIPTEUR DE FICHIER : ",des
69
70
71C ** Fermeture du fichier test1.med
72 call mficlo(fid,cret)
73 print *,cret
74 if (cret .ne. 0 ) then
75 print *,'Erreur fermeture du fichier'
76 call efexit(-1)
77 endif
78
79
80 call mfiexi('test2.med', med_acc_rdwr, fexist, accok, cret)
81 print *,"fexistf :",fexist, " ; accok :", accok
82
83C ** Ouverture en mode de creation du fichier test2.med
84 call mfiope(fid,'test2.med',med_acc_rdwr, cret)
85 print *,cret
86 if (cret .ne. 0 ) then
87 print *,'Erreur creation du fichier'
88 call efexit(-1)
89 endif
90
91C ** Creation du maillage maa1 de type non structure
92C ** et de dimension 2
93 call mmhcre(fid,'maa1',2,2,
94 & med_unstructured_mesh,'un premier maillage',
95 & "",med_sort_dtit,med_cartesian,nomcoo,unicoo,ret)
96 print *,cret
97 cret = cret + ret
98C ** Creation du nom universel
99 call mmhunw(fid,'maa1',ret)
100 cret = cret + ret
101 print *,cret
102 if (cret .ne. 0 ) then
103 print *,'Erreur creation du maillage'
104 call efexit(-1)
105 endif
106
107C ** Creation du maillage maa2 de type non structure
108 call mmhcre(fid,'maa2',2,2,
109 & med_unstructured_mesh,'un second maillage',
110 & "",med_sort_dtit,med_cartesian,nomcoo,unicoo,ret)
111 cret = cret + ret
112 if (cret .ne. 0 ) then
113 print *,'Erreur creation du maillage'
114 call efexit(-1)
115 endif
116
117
118C ** Creation du maillage maa3 de type structure
119 call mmhcre(fid,'maa3',2,2,
120 & med_structured_mesh,'un troisieme maillage',
121 & "",med_sort_dtit,med_cartesian,nomcoo,unicoo,ret)
122 cret = cret + ret
123 print *,cret
124 if (cret .ne. 0 ) then
125 print *,'Erreur creation du maillage'
126 call efexit(-1)
127 endif
128
129C ** Fermeture du fichier
130 call mficlo(fid,cret)
131 print *,cret
132 if (cret .ne. 0 ) then
133 print *,'Erreur fermeture du fichier'
134 call efexit(-1)
135 endif
136C
137 end
138
139
140
141
142
subroutine mfiexi(fname, access, fexist, accok, cret)
Definition medfile.f:244
subroutine mfiope(fid, name, access, cret)
Definition medfile.f:42
subroutine mficor(fid, cmt, cret)
Definition medfile.f:116
subroutine mficlo(fid, cret)
Definition medfile.f:82
subroutine mficom(fname, hdfok, medok, cret)
Definition medfile.f:170
subroutine mmhcre(fid, name, sdim, mdim, mtype, desc, dtunit, stype, atype, aname, aunit, cret)
Definition medmesh.f:20
subroutine mmhunw(fid, name, cret)
Definition medmesh.f:150
program test2
Definition test2.f:24