MED fichier: Fichier source de Unittest_MEDsupportMesh_2.f

MED fichier

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

Unittest_MEDsupportMesh_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 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 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 Read number of axis by name
68 C
69 call msmnan(fid,smname1,sdim,cret)
70 print *,'Number of axis (by name) : ',sdim
71 if (cret .ne. 0 ) then
72 print *,'ERROR : read number of axis (by name)'
73 call efexit(-1)
74 endif
75 if (sdim .ne. sdim1) then
76 print *,'ERROR : number of axis (by name)'
77 call efexit(-1)
78 endif
79
80 call msmnan(fid,smname2,sdim,cret)
81 print *,'Number of axis (by name) : ',sdim
82 if (cret .ne. 0 ) then
83 print *,'ERROR : read number of axis (by name)'
84 call efexit(-1)
85 endif
86 if (sdim .ne. sdim2) then
87 print *,'ERROR : number of axis (by name)'
88 call efexit(-1)
89 endif
90 C
91 C Read support mesh information by name
92 C
93 call msmsni(fid,smname1,sdim,mdim,
94 & description,atype,
95 & aname, aunit, cret)
96 print *,'Support mesh information by name',cret
97 if (cret .ne. 0 ) then
98 print *,'ERROR : read support mesh information by name'
99 call efexit(-1)
100 endif
101 if ((sdim .ne. sdim1) .or.
102 & (mdim .ne. mdim1) .or.
103 & (description .ne. description1) .or.
104 & (atype .ne. atype1) .or.
105 & (aunit(1) .ne. unicoo2d(1)) .or.
106 & (aunit(2) .ne. unicoo2d(2)) .or.
107 & (aname(1) .ne. nomcoo2d(1)) .or.
108 & (aname(2) .ne. nomcoo2d(2))
109 & ) then
110 print *,'ERROR : support mesh information by name'
111 call efexit(-1)
112 endif
113 C
114 C
115 C
116 call msmsni(fid,smname2,sdim,mdim,
117 & description,atype,
118 & aname, aunit, cret)
119 print *,'Support mesh information by name',cret
120 if (cret .ne. 0 ) then
121 print *,'ERROR : read support mesh information by name'
122 call efexit(-1)
123 endif
124 if ((sdim .ne. sdim2) .or.
125 & (mdim .ne. mdim2) .or.
126 & (description .ne. description2) .or.
127 & (atype .ne. atype2) .or.
128 & (aunit(1) .ne. unicoo3d(1)) .or.
129 & (aunit(2) .ne. unicoo3d(2)) .or.
130 & (aunit(3) .ne. unicoo3d(3)) .or.
131 & (aname(1) .ne. nomcoo3d(1)) .or.
132 & (aname(2) .ne. nomcoo3d(2)) .or.
133 & (aname(3) .ne. nomcoo3d(3))
134 & ) then
135 print *,'ERROR : support mesh information by name'
136 call efexit(-1)
137 endif
138 C
139 C
140 C close file
141 call mficlo(fid,cret)
142 print *,'Close file',cret
143 if (cret .ne. 0 ) then
144 print *,'ERROR : close file'
145 call efexit(-1)
146 endif
147 C
148 C
149 C
150 end
151
msmnan
subroutine msmnan(fid, name, 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:120
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:80
medsupportmesh2
program medsupportmesh2
Definition: Unittest_MEDsupportMesh_2.f:22
msmsni
subroutine msmsni(fid, name, sdim, mdim, desc, atype, aname, aunit, cret)
Cette routine permet de lire les informations relatives à un maillage support en précisant son nom...
Definition: medsupport.f:62
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:41