MED fichier
f/2.3.6/test18.f
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2019 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 
33  integer cret
34  integer maj,min,rel
35 
36 C ** Creation du fichier test18.med
37  call efouvr(fid,'test18.med',med_lecture_ecriture, 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 efferm (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 efvedo(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 effoco('test18.med',cret)
65  print *,cret
66  if (cret .eq. 0) then
67  print *,'- Format HDF conforme'
68  else
69  print *,'- Format HDF non conforme'
70  call efexit(-1)
71  endif
72 
73 C ** Conformite de la bibliotheque MED
74  call efveco('test18.med',cret)
75  print *,cret
76  if (cret .eq. 0) then
77  print *,'- Version MED du fichier conforme'
78  else
79  print *,'- Version MED du fichier non conforme'
80  call efexit(-1)
81  endif
82 
83 C ** Ouverture du fichier test18.med en lecture seule
84  call efouvr(fid,'test18.med',med_lecture, cret)
85  if (cret .ne. 0 ) then
86  print *,'Erreur ouverture du fichier'
87  call efexit(-1)
88  endif
89  print *,'- Ouverture du fichier'
90 
91 C ** Lecture de la version de MED utilisee pour creer le fichier ? **
92  call efveli(fid,maj,min,rel,cret)
93  if (cret .ne. 0 ) then
94  print *,'Erreur lecture version med du fichier'
95  call efexit(-1)
96  endif
97  print *,cret
98  print *,'- Fichier cree avec MED V',maj,'.',min,'.',rel
99 
100 C ** Fermeture du fichier
101  call efferm (fid,cret)
102  print *,cret
103  if (cret .ne. 0 ) then
104  print *,'Erreur fermeture du fichier'
105  call efexit(-1)
106  endif
107  print *,'- Fermeture du fichier'
108 C
109  end
110 
111