MED fichier
Unittest_MEDlink_2.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 link module
20C *
21C *****************************************************************************
22 program medlink2
23C
24 implicit none
25 include 'med.hf'
26C
27C
28 integer cret
29 integer*8 fid
30
31 character*64 fname
32 parameter(fname = "Unittest_MEDlink_1.med")
33 character*64 mname1, mname2,lname1,lname2
34 parameter(mname1 = "mesh name")
35 parameter(lname1 = "/local/study1/filename.med")
36 parameter(mname2 = "second mesh name")
37 parameter(lname2 = "/local/study2/filename.med")
38 integer lsize,lsize1,lsize2
39 parameter(lsize1=26, lsize2=26)
40 character*64 lname
41C
42C
43C open file
44 call mfiope(fid,fname,med_acc_rdonly,cret)
45 print *,'Open file',cret
46 if (cret .ne. 0 ) then
47 print *,'ERROR : open file'
48 call efexit(-1)
49 endif
50C
51C
52C read link size
53 call mlnlai(fid, mname1, lsize, cret)
54 print *,'read link information',cret,lsize
55 if (cret .ne. 0 .or.
56 & lsize .ne. lsize1 ) then
57 print *,'ERROR : link information'
58 call efexit(-1)
59 endif
60c
61 call mlnlai(fid, mname2, lsize, cret)
62 print *,'read link information',cret,lsize
63 if (cret .ne. 0 .or.
64 & lsize .ne. lsize2 ) then
65 print *,'ERROR : link information'
66 call efexit(-1)
67 endif
68C
69C
70C read links
71 call mlnlir(fid,mname1,lname,cret)
72 print *,'read link',cret,lname
73 if (cret .ne. 0 ) then
74 print *,'ERROR : read link'
75 call efexit(-1)
76 endif
77c
78 call mlnlir(fid,mname2,lname,cret)
79 print *,'read link',cret,lname
80 if (cret .ne. 0 ) then
81 print *,'ERROR : read link'
82 call efexit(-1)
83 endif
84C
85C
86C close file
87 call mficlo(fid,cret)
88 print *,'Close file',cret
89 if (cret .ne. 0 ) then
90 print *,'ERROR : close file'
91 call efexit(-1)
92 endif
93C
94C
95C
96 end
97
subroutine mfiope(fid, name, access, cret)
Definition medfile.f:42
subroutine mficlo(fid, cret)
Definition medfile.f:82