MED fichier: Fichier source de Unittest_MEDlink_3.f

MED fichier

- Documentation MED
- Guides d'utilisation
- Guides de référence

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 - 2017 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 fid
30 character*64 fname
31 parameter(fname = "Unittest_MEDlink_1.med")
32 character*64 mname1, mname2,lname1,lname2,mname
33 parameter(mname1 = "mesh name")
34 parameter(lname1 = "/local/study1/filename.med")
35 parameter(mname2 = "second mesh name")
36 parameter(lname2 = "/local/study2/filename.med")
37 integer lsize,lsize1,lsize2
38 parameter(lsize1=26, lsize2=26)
39 character*64 lname(26)
40 integer nlink,n,i
41 parameter(nlink=2)
42 C
43 C
44 C open file
45 call mfiope(fid,fname,med_acc_rdonly,cret)
46 print *,'Open file',cret
47 if (cret .ne. 0 ) then
48 print *,'ERROR : open file'
49 call efexit(-1)
50 endif
51 C
52 C
53 C number of link
54 call mlnnln(fid,n,cret)
55 print *,'Number of link',cret
56 if ((cret .ne. 0) .or.
57 & (n .ne. nlink) ) then
58 print *,'ERROR : number of link'
59 call efexit(-1)
60 endif
61 C
62 C
63 C informations
64 do i=1,n
65 call mlnlni(fid,i,mname,lsize,cret)
66 print *,'Link information',cret
67 if (cret .ne. 0) then
68 print *,'ERROR : link information'
69 call efexit(-1)
70 endif
71 c
72 if (i .eq. 1) then
73 if ((mname .ne. mname1) .or.
74 & (lsize .ne. lsize1)) then
75 print *,'ERROR : link information'
76 call efexit(-1)
77 endif
78 endif
79 c
80 if (i .eq. 2) then
81 if ((mname .ne. mname2) .or.
82 & (lsize .ne. lsize2)) then
83 print *,'ERROR : link information'
84 call efexit(-1)
85 endif
86 endif
87 c
88 enddo
89 C
90 C
91 C close file
92 call mficlo(fid,cret)
93 print *,'Close file',cret
94 if (cret .ne. 0 ) then
95 print *,'ERROR : close file'
96 call efexit(-1)
97 endif
98 C
99 C
100 C
101 end
102
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:80
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:58
mlnnln
subroutine mlnnln(fid, n, cret)
Cette routine permet la lecture du nombre de lien dans un fichier MED.
Definition: medlink.f:37
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:41