# Unittest_MEDstructElement_7.f

Aller à la documentation de ce fichier.

    00001 C*  This file is part of MED.
    00002 C*
    00003 C*  COPYRIGHT (C) 1999 - 2012  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 MEDstructElement7
    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_7.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*16 nomcoo2D(2)
    00048       character*16 unicoo2D(2)
    00049       data  nomcoo2D /"x","y"/, unicoo2D /"cm","cm"/
    00050       real*8 coo(2*3)
    00051       data coo / 0.0, 0.0, 1.0,1.0, 2.0,2.0 /
    00052       integer nnode
    00053       parameter (nnode=3)
    00054       integer nseg2
    00055       parameter (nseg2=2)
    00056       integer seg2(4)
    00057       data seg2 /1,2, 2,3/
    00058       character*64 aname1, aname2, aname3
    00059       parameter (aname1="integer constant attribute name")
    00060       parameter (aname2="real constant attribute name")
    00061       parameter (aname3="string constant attribute name")
    00062       integer atype1,atype2,atype3
    00063       parameter (atype1=MED_ATT_INT)
    00064       parameter (atype2=MED_ATT_FLOAT64)
    00065       parameter (atype3=MED_ATT_NAME)
    00066       integer anc1,anc2,anc3
    00067       parameter (anc1=2)
    00068       parameter (anc2=1)
    00069       parameter (anc3=1)
    00070       integer aval1(2*2)
    00071       data aval1 /1,2,5,6/
    00072       real*8 aval2(2*1)
    00073       data aval2 /1., 3. /
    00074       character*64 aval3(2*1)
    00075       data aval3 /"VAL1","VAL3"/
    00076       character*64 pname
    00077       parameter (pname="profil name")
    00078       integer psize
    00079       parameter (psize=2)
    00080       integer profil(2)
    00081       data profil / 1,3 /
    00082 C
    00083 C
    00084 C     file creation
    00085       call mfiope(fid,fname,MED_ACC_CREAT,cret)
    00086       print *,'Open file',cret
    00087       if (cret .ne. 0 ) then
    00088          print *,'ERROR : file creation'
    00089          call efexit(-1)
    00090       endif
    00091 C
    00092 C
    00093 C     support mesh creation : 2D
    00094       call msmcre(fid,smname2,dim2,dim2,description1,
    00095      &            MED_CARTESIAN,nomcoo2D,unicoo2D,cret)
    00096       print *,'Support mesh creation : 2D space dimension',cret
    00097       if (cret .ne. 0 ) then
    00098          print *,'ERROR : support mesh creation'
    00099         call efexit(-1)
    00100       endif
    00101 c
    00102       call mmhcow(fid,smname2,MED_NO_DT,MED_NO_IT,
    00103      &            MED_UNDEF_DT,MED_FULL_INTERLACE,
    00104      &            nnode,coo,cret)
    00105 c
    00106       call mmhcyw(fid,smname2,MED_NO_DT,MED_NO_IT,
    00107      &            MED_UNDEF_DT,MED_CELL,MED_SEG2,
    00108      &            MED_NODAL,MED_FULL_INTERLACE,
    00109      &            nseg2,seg2,cret)
    00110 C
    00111 C     struct element creation
    00112 C
    00113       call msecre(fid,mname2,dim2,smname2,setype2,
    00114      &            sgtype2,mtype2,cret)
    00115       print *,'Create struct element',mtype2, cret
    00116       if ((cret .ne. 0) .or. (mtype2 .lt. 0) ) then
    00117          print *,'ERROR : struct element creation'
    00118          call efexit(-1)
    00119       endif
    00120 C
    00121 C     write profile
    00122 C
    00123       call mpfprw(fid,pname,psize,profil,cret)
    00124       print *,'Create a profile : ',pname, cret
    00125       if (cret .ne. 0) then
    00126          print *,'ERROR : profile creation'
    00127          call efexit(-1)
    00128       endif
    00129 C
    00130 C     write constant attributes with profiles
    00131 C
    00132       call  mseipw(fid,mname2,aname1,atype1,anc1,
    00133      &             setype2,pname,aval1,cret)
    00134       print *,'Create a constant attribute with profile : ',aname1, cret
    00135       if (cret .ne. 0) then
    00136          print *,'ERROR : constant attribute with profile creation'
    00137          call efexit(-1)
    00138       endif
    00139 c
    00140       call  mserpw(fid,mname2,aname2,atype2,anc2,
    00141      &             setype2,pname,aval2,cret)
    00142       print *,'Create a constant attribute with profile : ',aname2, cret
    00143       if (cret .ne. 0) then
    00144          print *,'ERROR : constant attribute with profile creation'
    00145          call efexit(-1)
    00146       endif
    00147 c
    00148       call  msespw(fid,mname2,aname3,atype3,anc3,
    00149      &             setype2,pname,aval3,cret)
    00150       print *,'Create a constant attribute with profile : ',aname3, cret
    00151       if (cret .ne. 0) then
    00152          print *,'ERROR : constant attribute with profile creation'
    00153          call efexit(-1)
    00154       endif
    00155 C
    00156 C
    00157 C     close file
    00158       call mficlo(fid,cret)
    00159       print *,'Close file',cret
    00160       if (cret .ne. 0 ) then
    00161          print *,'ERROR :  close file'
    00162          call efexit(-1)
    00163       endif
    00164 C
    00165 C
    00166 C
    00167       end
    00168