MED fichier
Unittest_MEDstructElement_11.f
Aller à la documentation de ce fichier.
1C* This file is part of MED.
2C*
3C* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
4C* MED is free software: you can redistribute it and/or modify
5C* it under the terms of the GNU Lesser General Public License as published by
6C* the Free Software Foundation, either version 3 of the License, or
7C* (at your option) any later version.
8C*
9C* MED is distributed in the hope that it will be useful,
10C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12C* GNU Lesser General Public License for more details.
13C*
14C* You should have received a copy of the GNU Lesser General Public License
15C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16C*
17
18C******************************************************************************
19C * Tests for struct element module
20C *
21C *****************************************************************************
23C
24 implicit none
25 include 'med.hf'
26C
27C
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)
48c
49 integer atype,anc
50 character*64 aname
51 integer it,natt
52 parameter(natt=3)
53C
54C
55C 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
62C
63C
64C
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
72c
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
81c
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
90c
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
99c
100 enddo
101C
102C
103C 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
110C
111C
112C
113 end
114
program medstructelement11
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition medfile.f:42
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition medfile.f:82
subroutine msevai(fid, mname, it, aname, atype, anc, cret)
Cette routine décrit les caractéristiques d'un attribut variable de modèle d'élément de structure par...