1 C*************************************************************************
2 C COPYRIGHT (C) 1999 - 2007 EDF R&D, CEA/DEN
3 C THIS LIBRARY IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
4 C IT UNDER THE TERMS OF THE GNU LESSER GENERAL PUBLIC LICENSE
5 C AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
6 C EITHER VERSION 2.1 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
7 C
8 C THIS LIBRARY IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
9 C WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
10 C MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
11 C LESSER GENERAL PUBLIC LICENSE FOR MORE DETAILS.
12 C
13 C YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE
14 C ALONG WITH THIS LIBRARY; IF NOT, WRITE TO THE FREE SOFTWARE FOUNDATION,
15 C INC., 59 TEMPLE PLACE, SUITE 330, BOSTON, MA 02111-1307 USA
16 C
17 C**************************************************************************
18
19
20 C ******************************************************************************
21 C * - Nom du fichier : test18.f
22 C *
23 C * - Description : routines de test de la conformite d'une fichier MED.
24 C *
25 C ******************************************************************************
26 program test18
27 C
28 implicit none
29 include 'med.hf'
30 C
31 C
32 integer fid
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