Debian Codegraph @

tests/unittests/f/Unittest_MEDstructElement_11.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 struct element module
20 C *
21 C *****************************************************************************
22 program MEDstructElement11
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_MEDstructElement_9.med")
33 character*64 mname2
34 parameter (mname2 = "model name 2")
35 integer mtype2
36 character*64 aname1, aname2, aname3
37 parameter (aname1="integer attribute name")
38 parameter (aname2="real attribute name")
39 parameter (aname3="string attribute name")
40 integer atype1,atype2,atype3
41 parameter (atype1=MED_ATT_INT)
42 parameter (atype2=MED_ATT_FLOAT64)
43 parameter (atype3=MED_ATT_NAME)
44 integer anc1,anc2,anc3
45 parameter (anc1=2)
46 parameter (anc2=1)
47 parameter (anc3=2)
48 c
49 integer atype,anc
50 character*64 aname
51 integer it,natt
52 parameter (natt=3)
53 C
54 C
55 C open file
56 call mfiope(fid,fname,MED_ACC_RDONLY,cret)
57 print *,'Open file',cret
58 if (cret .ne. 0 ) then
59 print *,'ERROR : file creation'
60 call efexit(-1)
61 endif
62 C
63 C
64 C
65 do it=1,natt
66 call msevai(fid,mname2,it,aname,atype,anc,cret)
67 print *,'Read informations about attribute : ',aname,cret
68 if (cret .ne. 0) then
69 print *,'ERROR : attribute information'
70 call efexit(-1)
71 endif
72 c
73 if (it .eq. 1) then
74 if ( (atype .ne. atype1) .or.
75 & (anc .ne. anc1)
76 & ) then
77 print *,'ERROR : attribute information'
78 call efexit(-1)
79 endif
80 endif
81 c
82 if (it .eq. 2) then
83 if ( (atype .ne. atype2) .or.
84 & (anc .ne. anc2)
85 & ) then
86 print *,'ERROR : attribute information'
87 call efexit(-1)
88 endif
89 endif
90 c
91 if (it .eq. 3) then
92 if ( (atype .ne. atype3) .or.
93 & (anc .ne. anc3)
94 & ) then
95 print *,'ERROR : attribute information'
96 call efexit(-1)
97 endif
98 endif
99 c
100 enddo
101 C
102 C
103 C close file
104 call mficlo(fid,cret)
105 print *,'Close file',cret
106 if (cret .ne. 0 ) then
107 print *,'ERROR : close file'
108 call efexit(-1)
109 endif
110 C
111 C
112 C
113 end
114