MED fichier
Unittest_MEDprofile_1.f
Aller à la documentation de ce fichier.
1C* This file is part of MED.
2C*
3C* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
4C* MED is free software: you can redistribute it and/or modify
5C* it under the terms of the GNU Lesser General Public License as published by
6C* the Free Software Foundation, either version 3 of the License, or
7C* (at your option) any later version.
8C*
9C* MED is distributed in the hope that it will be useful,
10C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12C* GNU Lesser General Public License for more details.
13C*
14C* You should have received a copy of the GNU Lesser General Public License
15C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16C*
17
18C******************************************************************************
19C * Tests for file module
20C *
21C *****************************************************************************
23C
24 implicit none
25 include 'med.hf'
26C
27C
28 integer cret
29 integer*8 fid
30
31 character*64 fname, pname1, pname2
32 parameter(fname="Unittest_MEDprofile_1.med")
33 parameter(pname1="Profile name1")
34 parameter(pname2="Profile name 2")
35 integer psize1,psize2
36 parameter(psize1=4, psize2=2)
37 integer profile1(4), profile2(2)
38 data profile1 /1,2, 3,4/
39 data profile2 /5,6/
40C
41C
42C file creation
43 call mfiope(fid,fname,med_acc_creat,cret)
44 print *,cret
45 print *,fid
46 if (cret .ne. 0 ) then
47 print *,'ERROR : file creation'
48 call efexit(-1)
49 endif
50C
51C
52C write a first profile
53 call mpfprw(fid,pname1,psize1,profile1,cret)
54 print *,cret
55 if (cret .ne. 0 ) then
56 print *,'ERROR : profile creation'
57 call efexit(-1)
58 endif
59C
60C
61C write a second profile
62 call mpfprw(fid,pname2,psize2,profile2,cret)
63 print *,cret
64 if (cret .ne. 0 ) then
65 print *,'ERROR : profile creation'
66 call efexit(-1)
67 endif
68C
69C
70C close file
71 call mficlo(fid,cret)
72 print *,cret
73 if (cret .ne. 0 ) then
74 print *,'ERROR : close file'
75 call efexit(-1)
76 endif
77C
78C
79C
80 end
81
program medprofile1
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:42
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:82
subroutine mpfprw(fid, pname, psize, profil, cret)
Definition: medprofile.f:21