MED fichier: Fichier source de Unittest_MEDsupportMesh_3.f

MED fichier

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

Unittest_MEDsupportMesh_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 support mesh module
20 C *
21 C *****************************************************************************
22 program medsupportmesh3
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_MEDsupportMesh_1.med")
32 character*64 smname1
33 integer sdim1,mdim1
34 parameter(sdim1=2, mdim1=2)
35 integer sdim2,mdim2
36 parameter(sdim2=3,mdim2=2)
37 parameter(smname1 = "supportMesh1")
38 character*64 smname2
39 parameter(smname2 = "supportMesh2")
40 character*200 description1
41 parameter(description1="support mesh1 description")
42 character*200 description2
43 parameter(description2="support mesh2 description")
44 character*16 nomcoo2D(2)
45 character*16 unicoo2D(2)
46 data nomcoo2d /"x","y"/, unicoo2d /"cm","cm"/
47 character*16 nomcoo3D(3)
48 character*16 unicoo3D(3)
49 data nomcoo3d /"x","y","z"/, unicoo3d /"cm","cm","cm"/
50 integer atype1, atype2
51 parameter(atype1=med_cartesian, atype2=med_cartesian)
52 integer nsmesh, i
53 character*64 smname
54 character*16 aunit(3), aname(3)
55 character*200 description
56 integer sdim, mdim, atype
57 C
58 C
59 C open file in read only access mode
60 call mfiope(fid,fname,med_acc_rdonly,cret)
61 print *,'Open file in RD_ONLY access mode',cret
62 if (cret .ne. 0 ) then
63 print *,'ERROR : open file in READ_ONLY access mode'
64 call efexit(-1)
65 endif
66 C
67 C How many mesh in the file ?
68 C
69 call msmnsm(fid,nsmesh,cret)
70 print *,'Read number of support mesh : ',nsmesh
71 print *,cret
72 if (cret .ne. 0 ) then
73 print *,'ERROR : read number of support mesh'
74 call efexit(-1)
75 endif
76 if (nsmesh .ne. 2) then
77 print *,'ERROR : number of support mesh'
78 call efexit(-1)
79 endif
80 C
81 C
82 C Read support mesh information and number of axis
83 C by iterator
84 do i=1,nsmesh
85 call msmnax(fid,i,sdim,cret)
86 if (cret .ne. 0 ) then
87 print *,'ERROR : read number of axis '
88 call efexit(-1)
89 endif
90 print *,'Number of axis : ',sdim
91 c
92 if (i .eq. 1) then
93 if (sdim .ne. sdim1) then
94 print *,'ERROR : support mesh information'
95 call efexit(-1)
96 endif
97 endif
98 if (i .eq. 2) then
99 if (sdim .ne. sdim2) then
100 print *,'ERROR : support mesh information'
101 call efexit(-1)
102 endif
103 endif
104 C
105 call msmsmi(fid,i,smname,sdim,mdim,
106 & description,
107 & atype,aname,aunit,cret)
108 print *,'Support mesh information',cret
109 if (cret .ne. 0 ) then
110 print *,'ERROR : read support mesh information'
111 call efexit(-1)
112 endif
113 c
114 if (i .eq. 1) then
115 if ((sdim .ne. sdim1) .or.
116 & (mdim .ne. mdim1) .or.
117 & (description .ne. description1) .or.
118 & (atype .ne. atype1) .or.
119 & (aunit(1) .ne. unicoo2d(1)) .or.
120 & (aunit(2) .ne. unicoo2d(2)) .or.
121 & (aname(1) .ne. nomcoo2d(1)) .or.
122 & (aname(2) .ne. nomcoo2d(2))
123 & ) then
124 print *,'ERROR : support mesh information by name'
125 call efexit(-1)
126 endif
127 endif
128 c
129 if (i .eq. 2) then
130 if ((sdim .ne. sdim2) .or.
131 & (mdim .ne. mdim2) .or.
132 & (description .ne. description2) .or.
133 & (atype .ne. atype2) .or.
134 & (aunit(1) .ne. unicoo3d(1)) .or.
135 & (aunit(2) .ne. unicoo3d(2)) .or.
136 & (aunit(3) .ne. unicoo3d(3)) .or.
137 & (aname(1) .ne. nomcoo3d(1)) .or.
138 & (aname(2) .ne. nomcoo3d(2)) .or.
139 & (aname(3) .ne. nomcoo3d(3))
140 & ) then
141 print *,'ERROR : support mesh information by name'
142 call efexit(-1)
143 endif
144 endif
145 c
146 enddo
147 C
148 C
149 C close file
150 call mficlo(fid,cret)
151 print *,'Close file',cret
152 if (cret .ne. 0 ) then
153 print *,'ERROR : close file'
154 call efexit(-1)
155 endif
156 C
157 C
158 C
159 end
160
msmsmi
subroutine msmsmi(fid, it, name, sdim, mdim, desc, atype, aname, aunit, cret)
Cette routine permet de lire les informations relatives à un maillage support dans un fichier...
Definition: medsupport.f:81
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:80
medsupportmesh3
program medsupportmesh3
Definition: Unittest_MEDsupportMesh_3.f:22
msmnsm
subroutine msmnsm(fid, n, cret)
Cette routine permet de lire le nombre de maillages support dans un fichier.
Definition: medsupport.f:39
msmnax
subroutine msmnax(fid, it, naxis, cret)
Cette routine permet de lire dans un maillage support le nombre d'axes du repère des coordonnées des ...
Definition: medsupport.f:99
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:41