MED fichier
f/2.3.6/test1.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
C******************************************************************************
19
C * - Nom du fichier : test1.f
20
C *
21
C * - Description : exemples d'ouverture/fermeture de fichiers MED
22
C *
23
C *****************************************************************************
24
program
test1
25
C
26
implicit none
27
include
'med.hf'
28
C
29
C
30
integer
cret
31
integer*8
fid
32
33
character*200
des
34
parameter(des =
"Ceci est un courte description"
35
1 //
" du fichier test1.med"
)
36
37
C Creation du fichier "test1.med"
38
call
efouvr(fid,
'test1.med'
,med_lecture_ecriture, cret)
39
print *,cret
40
if
(cret .ne. 0 )
then
41
print *,
'Erreur à la création du fichier'
42
call
efexit(-1)
43
endif
44
45
C Ecriture d'un en-tete dans le fichier
46
call
effide (fid,des,cret)
47
print *,cret
48
if
(cret .ne. 0 )
then
49
print *,
'Erreur à ecriture en-tete'
50
call
efexit(-1)
51
endif
52
53
C Fermeture du fichier
54
call
efferm (fid,cret)
55
print *,cret
56
if
(cret .ne. 0 )
then
57
print *,
'Erreur à la fermeture du fichier'
58
call
efexit(-1)
59
endif
60
61
C Re-ouverture du fichier en lecture seule
62
call
efouvr(fid,
'test1.med'
,med_lecture, cret)
63
print *,cret
64
if
(cret .ne. 0 )
then
65
print *,
'Erreur ouverture du fichier en lecture'
66
call
efexit(-1)
67
endif
68
69
C Fermeture du fichier
70
call
efferm (fid,cret)
71
print *,cret
72
if
(cret .ne. 0 )
then
73
print *,
'Erreur à la fermeture du fichier'
74
call
efexit(-1)
75
endif
76
77
end
Généré par
1.8.13