32 parameter(fname =
"Unittest_MEDfile_1.med")
34 parameter(cmt1 =
"My first comment")
36 parameter(cmt2 =
"My second comment")
40 integer major, minor, rel
44 call mfiope(fid,fname,med_acc_creat,cret)
47 if (cret .ne. 0 )
then
48 print *,
'ERROR : file creation'
56 if (cret .ne. 0 )
then
57 print *,
'ERROR : write a comment'
65 if (cret .ne. 0 )
then
66 print *,
'ERROR : close file'
72 call mfiope(fid,fname,med_acc_rdonly,cret)
75 if (cret .ne. 0 )
then
76 print *,
'ERROR : open file in READ_ONLY access mode'
82 call mfinvr(fid,major,minor,rel,cret)
84 print *,major,minor,rel
85 if (cret .ne. 0 )
then
86 print *,
'ERROR : read MED (num) version in the file'
90 call mfisvr(fid,version,cret)
93 if (cret .ne. 0 )
then
94 print *,
'ERROR : read MED (str) version in the file'
100 call mficor(fid,cmtrd,cret)
103 if (cret .ne. 0 )
then
104 print *,
'ERROR : read a comment'
107 if (cmtrd .ne. cmt1)
then
108 print *,
'ERROR : file comment is not the good one'
116 if (cret .ne. 0 )
then
117 print *,
'ERROR : close file'
123 call mfiope(fid,fname,med_acc_rdwr,cret)
126 if (cret .ne. 0 )
then
127 print *,
'ERROR : open file in READ and WRITE access mode'
133 call mficow(fid,cmt2,cret)
135 if (cret .ne. 0 )
then
136 print *,
'ERROR : write a comment'
144 if (cret .ne. 0 )
then
145 print *,
'ERROR : close file'
151 call mfiope(fid,fname,med_acc_rdext,cret)
154 if (cret .ne. 0 )
then
155 print *,
'ERROR : open file in READ and WRITE access mode'
161 call mficow(fid,cmt1,cret)
163 if (cret .eq. 0 )
then
164 print *,
'ERROR : write a comment has to be impossible'
172 if (cret .ne. 0 )
then
173 print *,
'ERROR : close file'
180 call mficom(fname,hdfok,medok,cret)
183 if (cret .ne. 0 )
then
184 print *,
'ERROR : file compatibility'
187 if (hdfok .ne. 1)
then
188 print *,
'ERROR : the file must be in hdf5 format'
191 if (medok .ne. 1)
then
192 print *,
'ERROR : the file must be compatible'