Debian Codegraph @

tests/unittests/f/Unittest_MEDprofile_1.f

raw
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2020 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 * Tests for file module
20 C *
21 C *****************************************************************************
22 program MEDprofile1
23 C
24 implicit none
25 include 'med.hf'
26 C
27 C
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/
40 C
41 C
42 C 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
50 C
51 C
52 C 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
59 C
60 C
61 C 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
68 C
69 C
70 C 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
77 C
78 C
79 C
80 end
81