1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
25
26 implicit none
27 include 'med.hf'
28
29
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
41
42 call mfiexi(
'test1.med', med_acc_rdonly, fexist, accok, cret)
43 print *,"fexistf :",fexist, " ; accok :", accok
44
45
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
53
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
61
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
71
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
83
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
91
92
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
98
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
107
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
118
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
129
131 print *,cret
132 if (cret .ne. 0 ) then
133 print *,'Erreur fermeture du fichier'
134 call efexit(-1)
135 endif
136
137 end
138
139
140
141
142
subroutine mfiexi(fname, access, fexist, accok, cret)
subroutine mfiope(fid, name, access, cret)
subroutine mficor(fid, cmt, cret)
subroutine mficlo(fid, cret)
subroutine mficom(fname, hdfok, medok, cret)
subroutine mmhcre(fid, name, sdim, mdim, mtype, desc, dtunit, stype, atype, aname, aunit, cret)
subroutine mmhunw(fid, name, cret)