31 parameter(fname =
"Unittest_MEDfile_1.med")
33 parameter(cmt1 =
"My first comment")
35 parameter(cmt2 =
"My second comment")
39 integer major, minor, rel
43 call mfiope(fid,fname,med_acc_creat,cret)
46 if (cret .ne. 0 )
then 47 print *,
'ERROR : file creation' 55 if (cret .ne. 0 )
then 56 print *,
'ERROR : write a comment' 64 if (cret .ne. 0 )
then 65 print *,
'ERROR : close file' 71 call mfiope(fid,fname,med_acc_rdonly,cret)
74 if (cret .ne. 0 )
then 75 print *,
'ERROR : open file in READ_ONLY access mode' 81 call mfinvr(fid,major,minor,rel,cret)
83 print *,major,minor,rel
84 if (cret .ne. 0 )
then 85 print *,
'ERROR : read MED (num) version in the file' 89 call mfisvr(fid,version,cret)
92 if (cret .ne. 0 )
then 93 print *,
'ERROR : read MED (str) version in the file' 99 call mficor(fid,cmtrd,cret)
102 if (cret .ne. 0 )
then 103 print *,
'ERROR : read a comment' 106 if (cmtrd .ne. cmt1)
then 107 print *,
'ERROR : file comment is not the good one' 115 if (cret .ne. 0 )
then 116 print *,
'ERROR : close file' 122 call mfiope(fid,fname,med_acc_rdwr,cret)
125 if (cret .ne. 0 )
then 126 print *,
'ERROR : open file in READ and WRITE access mode' 132 call mficow(fid,cmt2,cret)
134 if (cret .ne. 0 )
then 135 print *,
'ERROR : write a comment' 143 if (cret .ne. 0 )
then 144 print *,
'ERROR : close file' 150 call mfiope(fid,fname,med_acc_rdext,cret)
153 if (cret .ne. 0 )
then 154 print *,
'ERROR : open file in READ and WRITE access mode' 160 call mficow(fid,cmt1,cret)
162 if (cret .eq. 0 )
then 163 print *,
'ERROR : write a comment has to be impossible' 171 if (cret .ne. 0 )
then 172 print *,
'ERROR : close file' 179 call mficom(fname,hdfok,medok,cret)
182 if (cret .ne. 0 )
then 183 print *,
'ERROR : file compatibility' 186 if (hdfok .ne. 1)
then 187 print *,
'ERROR : the file must be in hdf5 format' 190 if (medok .ne. 1)
then 191 print *,
'ERROR : the file must be compatible' subroutine mficlo(fid, cret)
subroutine mficow(fid, cmt, cret)
subroutine mficom(fname, hdfok, medok, cret)
Vérification de la compatibilité d'un fichier avec HDF et MED.
subroutine mficor(fid, cmt, cret)
subroutine mfinvr(fid, major, minor, rel, cret)
subroutine mfiope(fid, name, access, cret)
subroutine mfisvr(fid, version, cret)