# Unittest_MEDstructElement_6.f

Aller à la documentation de ce fichier.

    00001 C*  This file is part of MED.
    00002 C*
    00003 C*  COPYRIGHT (C) 1999 - 2011  EDF R&D, CEA/DEN
    00004 C*  MED is free software: you can redistribute it and/or modify
    00005 C*  it under the terms of the GNU Lesser General Public License as published by
    00006 C*  the Free Software Foundation, either version 3 of the License, or
    00007 C*  (at your option) any later version.
    00008 C*
    00009 C*  MED is distributed in the hope that it will be useful,
    00010 C*  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011 C*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012 C*  GNU Lesser General Public License for more details.
    00013 C*
    00014 C*  You should have received a copy of the GNU Lesser General Public License
    00015 C*  along with MED.  If not, see <http://www.gnu.org/licenses/>.
    00016 C*
    00017
    00018 C******************************************************************************
    00019 C * Tests for struct element module
    00020 C *
    00021 C *****************************************************************************
    00022       program MEDstructElement6
    00023 C
    00024       implicit none
    00025       include 'med.hf'
    00026 C
    00027 C
    00028       integer cret
    00029       integer fid
    00030       character*64  fname
    00031       parameter (fname = "Unittest_MEDstructElement_4.med")
    00032       character*64  mname2
    00033       parameter (mname2 = "model name 2")
    00034       integer dim2
    00035       parameter (dim2=2)
    00036       character*64  smname2
    00037       parameter (smname2="support mesh name")
    00038       integer setype2
    00039       parameter (setype2=MED_NODE)
    00040       integer sgtype2
    00041       parameter (sgtype2=MED_NO_GEOTYPE)
    00042       integer mtype2
    00043       integer sdim1
    00044       parameter (sdim1=2)
    00045       character*200 description1
    00046       parameter (description1="support mesh1 description")
    00047       character*64 aname1, aname2, aname3
    00048       parameter (aname1="integer constant attribute name")
    00049       parameter (aname2="real constant attribute name")
    00050       parameter (aname3="string constant attribute name")
    00051       integer atype1,atype2,atype3
    00052       parameter (atype1=MED_ATT_INT)
    00053       parameter (atype2=MED_ATT_FLOAT64)
    00054       parameter (atype3=MED_ATT_NAME)
    00055       integer anc1,anc2,anc3
    00056       parameter (anc1=2)
    00057       parameter (anc2=1)
    00058       parameter (anc3=1)
    00059 c
    00060       integer mgtype,mdim,setype,snnode,sncell
    00061       integer sgtype,ncatt,nvatt,profile
    00062       character*64 pname,smname,aname
    00063       integer      atype,anc,psize
    00064       integer i
    00065 C
    00066 C
    00067 C     file creation
    00068       call mfiope(fid,fname,MED_ACC_RDONLY,cret)
    00069       print *,'Open file',cret
    00070       if (cret .ne. 0 ) then
    00071          print *,'ERROR : file creation'
    00072          call efexit(-1)
    00073       endif
    00074 C
    00075 C     read information about struct model
    00076 C
    00077       call msesin(fid,mname2,mgtype,mdim,smname,
    00078      &            setype,snnode,sncell,sgtype,
    00079      &            ncatt,profile,nvatt,cret)
    00080       print *,'Read information about struct element (by name)',cret
    00081       if (cret .ne. 0 ) then
    00082          print *,'ERROR : information about struct element (by name) '
    00083          call efexit(-1)
    00084       endif
    00085 C
    00086 C     iteration on each constant attribute
    00087 C
    00088       do i=1,ncatt
    00089 C
    00090 C
    00091 C     read information about constant attribute
    00092 C
    00093       call msecai(fid,mname2,i,aname,atype,anc,
    00094      &            setype,pname,psize,cret)
    00095       print *,'Read information about constant attribute: ',aname1,cret
    00096       if (cret .ne. 0 ) then
    00097          print *,'ERROR : information about attribute'
    00098          call efexit(-1)
    00099       endif
    00100 c
    00101       if (i. eq. 1) then
    00102          if ( (atype .ne. atype1) .or.
    00103      &        (anc .ne. anc1) .or.
    00104      &        (setype .ne. setype2) .or.
    00105      &        (pname .ne. MED_NO_PROFILE) .or.
    00106      &        (psize .ne. 0)
    00107      &       )  then
    00108             print *,'ERROR : information about constant attribute '
    00109             call efexit(-1)
    00110          endif
    00111       endif
    00112 c
    00113       if (i .eq. 2) then
    00114          if ( (atype .ne. atype2) .or.
    00115      &        (anc .ne. anc2) .or.
    00116      &        (setype .ne. setype2) .or.
    00117      &        (pname .ne. MED_NO_PROFILE) .or.
    00118      &        (psize .ne. 0)
    00119      &        )  then
    00120             print *,'ERROR : information about constant attribute'
    00121             call efexit(-1)
    00122          endif
    00123       endif
    00124 c
    00125       if (i .eq. 3) then
    00126          if ( (atype .ne. atype3) .or.
    00127      &        (anc .ne. anc3) .or.
    00128      &        (setype .ne. setype2) .or.
    00129      &        (pname .ne. MED_NO_PROFILE) .or.
    00130      &        (psize .ne. 0)
    00131      &        )  then
    00132             print *,'ERROR : information about constant attribute'
    00133             call efexit(-1)
    00134          endif
    00135       endif
    00136 c
    00137       enddo
    00138 C
    00139 C
    00140 C     close file
    00141       call mficlo(fid,cret)
    00142       print *,'Close file',cret
    00143       if (cret .ne. 0 ) then
    00144          print *,'ERROR :  close file'
    00145          call efexit(-1)
    00146       endif
    00147 C
    00148 C
    00149 C
    00150       end
    00151