Debian Codegraph @

tests/unittests/f/Unittest_MEDsupportMesh_2.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 support mesh module
20 C *
21 C *****************************************************************************
22 program MEDsupportMesh2
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_MEDsupportMesh_1.med")
33 character*64 smname1
34 integer sdim1,mdim1
35 parameter (sdim1=2, mdim1=2)
36 integer sdim2,mdim2
37 parameter (sdim2=3,mdim2=2)
38 parameter (smname1 = "supportMesh1")
39 character*64 smname2
40 parameter (smname2 = "supportMesh2")
41 character*200 description1
42 parameter (description1="support mesh1 description")
43 character*200 description2
44 parameter (description2="support mesh2 description")
45 character*16 nomcoo2D(2)
46 character*16 unicoo2D(2)
47 data nomcoo2D /"x","y"/, unicoo2D /"cm","cm"/
48 character*16 nomcoo3D(3)
49 character*16 unicoo3D(3)
50 data nomcoo3D /"x","y","z"/, unicoo3D /"cm","cm","cm"/
51 integer atype1, atype2
52 parameter (atype1=MED_CARTESIAN, atype2=MED_CARTESIAN)
53 integer nsmesh, i
54 character*64 smname
55 character*16 aunit(3), aname(3)
56 character*200 description
57 integer sdim, mdim, atype
58 C
59 C
60 C open file in read only access mode
61 call mfiope(fid,fname,MED_ACC_RDONLY,cret)
62 print *,'Open file in RD_ONLY access mode',cret
63 if (cret .ne. 0 ) then
64 print *,'ERROR : open file in READ_ONLY access mode'
65 call efexit(-1)
66 endif
67 C
68 C Read number of axis by name
69 C
70 call msmnan(fid,smname1,sdim,cret)
71 print *,'Number of axis (by name) : ',sdim
72 if (cret .ne. 0 ) then
73 print *,'ERROR : read number of axis (by name)'
74 call efexit(-1)
75 endif
76 if (sdim .ne. sdim1) then
77 print *,'ERROR : number of axis (by name)'
78 call efexit(-1)
79 endif
80
81 call msmnan(fid,smname2,sdim,cret)
82 print *,'Number of axis (by name) : ',sdim
83 if (cret .ne. 0 ) then
84 print *,'ERROR : read number of axis (by name)'
85 call efexit(-1)
86 endif
87 if (sdim .ne. sdim2) then
88 print *,'ERROR : number of axis (by name)'
89 call efexit(-1)
90 endif
91 C
92 C Read support mesh information by name
93 C
94 call msmsni(fid,smname1,sdim,mdim,
95 & description,atype,
96 & aname, aunit, cret)
97 print *,'Support mesh information by name',cret
98 if (cret .ne. 0 ) then
99 print *,'ERROR : read support mesh information by name'
100 call efexit(-1)
101 endif
102 if ((sdim .ne. sdim1) .or.
103 & (mdim .ne. mdim1) .or.
104 & (description .ne. description1) .or.
105 & (atype .ne. atype1) .or.
106 & (aunit(1) .ne. unicoo2D(1)) .or.
107 & (aunit(2) .ne. unicoo2D(2)) .or.
108 & (aname(1) .ne. nomcoo2D(1)) .or.
109 & (aname(2) .ne. nomcoo2D(2))
110 & ) then
111 print *,'ERROR : support mesh information by name'
112 call efexit(-1)
113 endif
114 C
115 C
116 C
117 call msmsni(fid,smname2,sdim,mdim,
118 & description,atype,
119 & aname, aunit, cret)
120 print *,'Support mesh information by name',cret
121 if (cret .ne. 0 ) then
122 print *,'ERROR : read support mesh information by name'
123 call efexit(-1)
124 endif
125 if ((sdim .ne. sdim2) .or.
126 & (mdim .ne. mdim2) .or.
127 & (description .ne. description2) .or.
128 & (atype .ne. atype2) .or.
129 & (aunit(1) .ne. unicoo3D(1)) .or.
130 & (aunit(2) .ne. unicoo3D(2)) .or.
131 & (aunit(3) .ne. unicoo3D(3)) .or.
132 & (aname(1) .ne. nomcoo3D(1)) .or.
133 & (aname(2) .ne. nomcoo3D(2)) .or.
134 & (aname(3) .ne. nomcoo3D(3))
135 & ) then
136 print *,'ERROR : support mesh information by name'
137 call efexit(-1)
138 endif
139 C
140 C
141 C close file
142 call mficlo(fid,cret)
143 print *,'Close file',cret
144 if (cret .ne. 0 ) then
145 print *,'ERROR : close file'
146 call efexit(-1)
147 endif
148 C
149 C
150 C
151 end
152