MED fichier

Unittest_MEDlink_3.f
Aller à la documentation de ce fichier.
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2021 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 link module
20 C *
21 C *****************************************************************************
22 program medlink2
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
32 parameter(fname = "Unittest_MEDlink_1.med")
33 character*64 mname1, mname2,lname1,lname2,mname
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(26)
41 integer nlink,n,i
42 parameter(nlink=2)
43 C
44 C
45 C open file
46 call mfiope(fid,fname,med_acc_rdonly,cret)
47 print *,'Open file',cret
48 if (cret .ne. 0 ) then
49 print *,'ERROR : open file'
50 call efexit(-1)
51 endif
52 C
53 C
54 C number of link
55 call mlnnln(fid,n,cret)
56 print *,'Number of link',cret
57 if ((cret .ne. 0) .or.
58 & (n .ne. nlink) ) then
59 print *,'ERROR : number of link'
60 call efexit(-1)
61 endif
62 C
63 C
64 C informations
65 do i=1,n
66 call mlnlni(fid,i,mname,lsize,cret)
67 print *,'Link information',cret
68 if (cret .ne. 0) then
69 print *,'ERROR : link information'
70 call efexit(-1)
71 endif
72 c
73 if (i .eq. 1) then
74 if ((mname .ne. mname1) .or.
75 & (lsize .ne. lsize1)) then
76 print *,'ERROR : link information'
77 call efexit(-1)
78 endif
79 endif
80 c
81 if (i .eq. 2) then
82 if ((mname .ne. mname2) .or.
83 & (lsize .ne. lsize2)) then
84 print *,'ERROR : link information'
85 call efexit(-1)
86 endif
87 endif
88 c
89 enddo
90 C
91 C
92 C close file
93 call mficlo(fid,cret)
94 print *,'Close file',cret
95 if (cret .ne. 0 ) then
96 print *,'ERROR : close file'
97 call efexit(-1)
98 endif
99 C
100 C
101 C
102 end
103
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:82
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:42
medlink2
program medlink2
Definition: Unittest_MEDlink_2.f:22
mlnlni
subroutine mlnlni(fid, it, mname, lsize, cret)
Cette routine permet de lire les informations sur un lien dans un fichier MED.
Definition: medlink.f:60
mlnnln
subroutine mlnnln(fid, n, cret)
Cette routine permet la lecture du nombre de lien dans un fichier MED.
Definition: medlink.f:38