MED fichier: Fichier source de Unittest_MEDlink_2.f

MED fichier

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

Unittest_MEDlink_2.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
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
40 C
41 C
42 C open file
43 call mfiope(fid,fname,med_acc_rdonly,cret)
44 print *,'Open file',cret
45 if (cret .ne. 0 ) then
46 print *,'ERROR : open file'
47 call efexit(-1)
48 endif
49 C
50 C
51 C read link size
52 call mlnlai(fid, mname1, lsize, cret)
53 print *,'read link information',cret,lsize
54 if (cret .ne. 0 .or.
55 & lsize .ne. lsize1 ) then
56 print *,'ERROR : link information'
57 call efexit(-1)
58 endif
59 c
60 call mlnlai(fid, mname2, lsize, cret)
61 print *,'read link information',cret,lsize
62 if (cret .ne. 0 .or.
63 & lsize .ne. lsize2 ) then
64 print *,'ERROR : link information'
65 call efexit(-1)
66 endif
67 C
68 C
69 C read links
70 call mlnlir(fid,mname1,lname,cret)
71 print *,'read link',cret,lname
72 if (cret .ne. 0 ) then
73 print *,'ERROR : read link'
74 call efexit(-1)
75 endif
76 c
77 call mlnlir(fid,mname2,lname,cret)
78 print *,'read link',cret,lname
79 if (cret .ne. 0 ) then
80 print *,'ERROR : read link'
81 call efexit(-1)
82 endif
83 C
84 C
85 C close file
86 call mficlo(fid,cret)
87 print *,'Close file',cret
88 if (cret .ne. 0 ) then
89 print *,'ERROR : close file'
90 call efexit(-1)
91 endif
92 C
93 C
94 C
95 end
96
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:80
medlink2
program medlink2
Definition: Unittest_MEDlink_2.f:22
mlnlir
subroutine mlnlir(fid, mname, lname, cret)
Cette routine permet de lire un lien dans un fichier MED.
Definition: medlink.f:98
mlnlai
subroutine mlnlai(fid, mname, lsize, cret)
Cette routine permet de lire les informations sur un lien dans un fichier MED.
Definition: medlink.f:75
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:41