# Unittest_MEDlocalization_2.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 localization module
    00020 C *
    00021 C *****************************************************************************
    00022       program MEDloc2
    00023 C
    00024       implicit none
    00025       include 'med.hf'
    00026 C
    00027 C
    00028       integer cret
    00029       integer fid
    00030       character*64  fname,lname1,giname1,isname1
    00031       character*64  giname,isname
    00032       parameter (fname="Unittest_MEDlocalization_1.med")
    00033       parameter (lname1 = "Localization name")
    00034       parameter (giname1=MED_NO_INTERPOLATION)
    00035       parameter (isname1=MED_NO_MESH_SUPPORT)
    00036       integer gtype1,sdim1,nip1
    00037       integer gtype,sdim,nip
    00038       parameter(gtype1=MED_TRIA3)
    00039       parameter(sdim1=2)
    00040       parameter(nip1=3)
    00041       real*8 ecoo1(6), ipcoo1(6), wght1(3)
    00042       real*8 ecoo(6), ipcoo(6), wght(3)
    00043       data ecoo1   / 0.0, 0.0,  1.0, 0.0,  0.0,1.0 /
    00044       data ipcoo1  / 0.166666, 0.166666,  0.66666, 0.166666,
    00045      &               0.166666, 0.666666 /
    00046       data wght1   / 0.166666, 0.166666, 0.166666 /
    00047       integer nsmc, nsmc1
    00048       parameter (nsmc1=0)
    00049       integer sgtype,sgtype1
    00050       parameter (sgtype1=MED_UNDEF_GEOTYPE)
    00051 C
    00052 C
    00053 C     open file
    00054       call mfiope(fid,fname,MED_ACC_RDONLY,cret)
    00055       print *,cret
    00056       if (cret .ne. 0 ) then
    00057          print *,'ERROR : open file'
    00058          call efexit(-1)
    00059       endif
    00060 C
    00061 C
    00062 C     read information
    00063       call  mlclni(fid, lname1, gtype, sdim, nip,
    00064      &     giname, isname, nsmc, sgtype, cret)
    00065       print *,cret
    00066       if (cret .ne. 0 ) then
    00067          print *,'ERROR : read information'
    00068          call efexit(-1)
    00069       endif
    00070       if ((gtype .ne. gtype1) .or.
    00071      &    (sdim .ne. sdim1) .or.
    00072      &    (nip .ne. nip1) .or.
    00073      &    (giname .ne. giname1) .or.
    00074      &    (isname .ne. isname1) .or.
    00075      &    (nsmc .ne. nsmc1) .or.
    00076      &    (sgtype .ne. sgtype1) ) then
    00077          print *,cret
    00078          print *,gtype1,sdim1,nip1,"|",giname1,"|","|",
    00079      &        isname1,"|",nsmc1,sgtype1
    00080          print *,gtype,sdim,nip,"|",giname,"|","|",isname,"|",
    00081      &        nsmc,sgtype
    00082          print *,'ERROR : read information'
    00083          call efexit(-1)
    00084       endif
    00085 C
    00086 C
    00087 C     read localization
    00088       call mlclor(fid,lname1,MED_FULL_INTERLACE,
    00089      &            ecoo,ipcoo,wght,cret)
    00090       print *,cret
    00091       if (cret .ne. 0 ) then
    00092          print *,'ERROR : read localization'
    00093          call efexit(-1)
    00094       endif
    00095 c
    00096       if ((ecoo(1) .ne. ecoo1(1)) .or.
    00097      &    (ecoo(2) .ne. ecoo1(2)) .or.
    00098      &    (ecoo(3) .ne. ecoo1(3)) .or.
    00099      &    (ecoo(4) .ne. ecoo1(4)) .or.
    00100      &    (ecoo(5) .ne. ecoo1(5)) .or.
    00101      &    (ecoo(6) .ne. ecoo1(6))) then
    00102          print *,'ERROR : read localization'
    00103          call efexit(-1)
    00104       endif
    00105 c
    00106       if ((ipcoo(1) .ne. ipcoo1(1)) .or.
    00107      &    (ipcoo(2) .ne. ipcoo1(2)) .or.
    00108      &    (ipcoo(3) .ne. ipcoo1(3)) .or.
    00109      &    (ipcoo(4) .ne. ipcoo1(4)) .or.
    00110      &    (ipcoo(5) .ne. ipcoo1(5)) .or.
    00111      &    (ipcoo(6) .ne. ipcoo1(6))) then
    00112          print *,'ERROR : read localization'
    00113          call efexit(-1)
    00114       endif
    00115 c
    00116       if ((wght(1) .ne. wght1(1)) .or.
    00117      &    (wght(2) .ne. wght1(2)) .or.
    00118      &    (wght(3) .ne. wght1(3)))  then
    00119          print *,'ERROR : read localization'
    00120          call efexit(-1)
    00121       endif
    00122 C
    00123 C
    00124 C     close file
    00125       call mficlo(fid,cret)
    00126       print *,cret
    00127       if (cret .ne. 0 ) then
    00128          print *,'ERROR :  close file'
    00129          call efexit(-1)
    00130       endif
    00131 C
    00132 C
    00133 C
    00134       end
    00135