Unittest_MEDstructElement_6.f
Aller à la documentation de ce fichier.
C* This file is part of MED.
C*
C* COPYRIGHT (C) 1999 - 2021 EDF R&D, CEA/DEN
C* MED is free software: you can redistribute it and/or modify
C* it under the terms of the GNU Lesser General Public License as published by
C* the Free Software Foundation, either version 3 of the License, or
C* (at your option) any later version.
C*
C* MED is distributed in the hope that it will be useful,
C* but WITHOUT ANY WARRANTY; without even the implied warranty of
C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
C* GNU Lesser General Public License for more details.
C*
C* You should have received a copy of the GNU Lesser General Public License
C* along with MED. If not, see <http://www.gnu.org/licenses/>.
C*
C******************************************************************************
C * Tests for struct element module
C *
C *****************************************************************************
program medstructelement6
C
implicit none
include 'med.hf'
C
C
integer cret
integer*8 fid
character*64 fname
parameter(fname = "Unittest_MEDstructElement_4.med")
character*64 mname2
parameter(mname2 = "model name 2")
integer dim2
parameter(dim2=2)
character*64 smname2
parameter(smname2="support mesh name")
integer setype2
parameter(setype2=med_node)
integer sgtype2
parameter(sgtype2=med_no_geotype)
integer mtype2
integer sdim1
parameter(sdim1=2)
character*200 description1
parameter(description1="support mesh1 description")
character*64 aname1, aname2, aname3
parameter(aname1="integer constant attribute name")
parameter(aname2="real constant attribute name")
parameter(aname3="string constant attribute name")
integer atype1,atype2,atype3
parameter(atype1=med_att_int)
parameter(atype2=med_att_float64)
parameter(atype3=med_att_name)
integer anc1,anc2,anc3
parameter(anc1=2)
parameter(anc2=1)
parameter(anc3=1)
c
integer mgtype,mdim,setype,snnode,sncell
integer sgtype,ncatt,nvatt,profile
character*64 pname,smname,aname
integer atype,anc,psize
integer i
C
C
C file creation
call mfiope(fid,fname,med_acc_rdonly,cret)
print *,'Open file',cret
if (cret .ne. 0 ) then
print *,'ERROR : file creation'
call efexit(-1)
endif
C
C read information about struct model
C
call msesin(fid,mname2,mgtype,mdim,smname,
& setype,snnode,sncell,sgtype,
& ncatt,profile,nvatt,cret)
print *,'Read information about struct element (by name)',cret
if (cret .ne. 0 ) then
print *,'ERROR : information about struct element (by name) '
call efexit(-1)
endif
C
C iteration on each constant attribute
C
do i=1,ncatt
C
C
C read information about constant attribute
C
call msecai(fid,mname2,i,aname,atype,anc,
& setype,pname,psize,cret)
print *,'Read information about constant attribute: ',aname1,cret
if (cret .ne. 0 ) then
print *,'ERROR : information about attribute'
call efexit(-1)
endif
c
if (i. eq. 1) then
if ( (atype .ne. atype1) .or.
& (anc .ne. anc1) .or.
& (setype .ne. setype2) .or.
& (pname .ne. med_no_profile) .or.
& (psize .ne. 0)
& ) then
print *,'ERROR : information about constant attribute '
call efexit(-1)
endif
endif
c
if (i .eq. 2) then
if ( (atype .ne. atype2) .or.
& (anc .ne. anc2) .or.
& (setype .ne. setype2) .or.
& (pname .ne. med_no_profile) .or.
& (psize .ne. 0)
& ) then
print *,'ERROR : information about constant attribute'
call efexit(-1)
endif
endif
c
if (i .eq. 3) then
if ( (atype .ne. atype3) .or.
& (anc .ne. anc3) .or.
& (setype .ne. setype2) .or.
& (pname .ne. med_no_profile) .or.
& (psize .ne. 0)
& ) then
print *,'ERROR : information about constant attribute'
call efexit(-1)
endif
endif
c
enddo
C
C
C close file
call mficlo(fid,cret)
print *,'Close file',cret
if (cret .ne. 0 ) then
print *,'ERROR : close file'
call efexit(-1)
endif
C
C
C
end
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:82
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:42
medstructelement6
program medstructelement6
Definition: Unittest_MEDstructElement_6.f:22
msesin
subroutine msesin(fid, mname, mgtype, mdim, smname, setype, snnode, sncell, sgtype, ncatt, ap, nvatt, cret)
Cette routine décrit les caractéristiques d'un modèle d'élément de structure à partir de son nom.
Definition: medstructelement.f:90
msecai
subroutine msecai(fid, mname, it, aname, atype, anc, setype, pname, psize, cret)
Cette routine décrit les caractéristiques d'un attribut constant de modèle d'élément de structure par...
Definition: medstructelement.f:377