MED fichier
f/test18.f
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2017 EDF R&D, CEA/DEN
4 C* MED is free software: you can redistribute it and/or modify
5 C* it under the terms of the GNU Lesser General Public License as published by
6 C* the Free Software Foundation, either version 3 of the License, or
7 C* (at your option) any later version.
8 C*
9 C* MED is distributed in the hope that it will be useful,
10 C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11 C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 C* GNU Lesser General Public License for more details.
13 C*
14 C* You should have received a copy of the GNU Lesser General Public License
15 C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16 C*
17 
18 
19 C ******************************************************************************
20 C * - Nom du fichier : test18.f
21 C *
22 C * - Description : routines de test de la conformite d'une fichier MED.
23 C *
24 C ******************************************************************************
25  program test18
26 C
27  implicit none
28  include 'med.hf'
29 C
30 C
31  integer*8 fid
32  integer cret
33  integer maj,min,rel
34  integer hdfok, medok
35 
36 C ** Creation du fichier test18.med
37  call mfiope(fid,'test18.med',med_acc_rdwr, cret)
38  print *,cret
39  if (cret .ne. 0 ) then
40  print *,'Erreur creation du fichier'
41  call efexit(-1)
42  endif
43  print *,'- Creation du fichier'
44 
45 C ** Fermeture du fichier
46  call mficlo(fid,cret)
47  print *,cret
48  if (cret .ne. 0 ) then
49  print *,'Erreur fermeture du fichier'
50  call efexit(-1)
51  endif
52  print *,'- Fermeture du fichier'
53 
54 C ** Quelle version de la bibliotheque est utilisee ? **
55  call mlbnuv(maj,min,rel,cret)
56  print *,cret
57  if (cret .ne. 0 ) then
58  print *,'Erreur lecture version med'
59  call efexit(-1)
60  endif
61  print *,'- Version MED utilisee : ',maj,'.',min,'.',rel
62 
63 C ** Conformite du format HDF **
64  call mficom('test18.med',hdfok, medok,cret)
65  print *,cret
66  if (hdfok .eq. 1) then
67  print *,'- Format HDF conforme'
68  else
69  print *,'- Format HDF non conforme'
70  call efexit(-1)
71  endif
72  if (medok .eq. 1) then
73  print *,'- Version MED du fichier conforme'
74  else
75  print *,'- Version MED du fichier non conforme'
76  call efexit(-1)
77  endif
78 
79 C ** Ouverture du fichier test18.med en lecture seule
80  call mfiope(fid,'test18.med',med_acc_rdonly, cret)
81  if (cret .ne. 0 ) then
82  print *,'Erreur ouverture du fichier'
83  call efexit(-1)
84  endif
85  print *,'- Ouverture du fichier'
86 
87 C ** Lecture de la version de MED utilisee pour creer le fichier ? **
88  call mfinvr(fid,maj,min,rel,cret)
89  if (cret .ne. 0 ) then
90  print *,'Erreur lecture version med du fichier'
91  call efexit(-1)
92  endif
93  print *,cret
94  print *,'- Fichier cree avec MED V',maj,'.',min,'.',rel
95 
96 C ** Fermeture du fichier
97  call mficlo(fid,cret)
98  print *,cret
99  if (cret .ne. 0 ) then
100  print *,'Erreur fermeture du fichier'
101  call efexit(-1)
102  endif
103  print *,'- Fermeture du fichier'
104 C
105  end
106 
107