# 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 - 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 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 *,'ERROR : read information'
    00079          call efexit(-1)
    00080       endif
    00081 C
    00082 C
    00083 C     read localization
    00084       call mlclor(fid,lname1,MED_FULL_INTERLACE,
    00085      &            ecoo,ipcoo,wght,cret)
    00086       print *,cret
    00087       if (cret .ne. 0 ) then
    00088          print *,'ERROR : read localization'
    00089          call efexit(-1)
    00090       endif
    00091 c
    00092       if ((ecoo(1) .ne. ecoo1(1)) .or.
    00093      &    (ecoo(2) .ne. ecoo1(2)) .or.
    00094      &    (ecoo(3) .ne. ecoo1(3)) .or.
    00095      &    (ecoo(4) .ne. ecoo1(4)) .or.
    00096      &    (ecoo(5) .ne. ecoo1(5)) .or.
    00097      &    (ecoo(6) .ne. ecoo1(6))) then
    00098          print *,'ERROR : read localization'
    00099          call efexit(-1)
    00100       endif
    00101 c
    00102       if ((ipcoo(1) .ne. ipcoo1(1)) .or.
    00103      &    (ipcoo(2) .ne. ipcoo1(2)) .or.
    00104      &    (ipcoo(3) .ne. ipcoo1(3)) .or.
    00105      &    (ipcoo(4) .ne. ipcoo1(4)) .or.
    00106      &    (ipcoo(5) .ne. ipcoo1(5)) .or.
    00107      &    (ipcoo(6) .ne. ipcoo1(6))) then
    00108          print *,'ERROR : read localization'
    00109          call efexit(-1)
    00110       endif
    00111 c
    00112       if ((wght(1) .ne. wght1(1)) .or.
    00113      &    (wght(2) .ne. wght1(2)) .or.
    00114      &    (wght(3) .ne. wght1(3)))  then
    00115          print *,'ERROR : read localization'
    00116          call efexit(-1)
    00117       endif
    00118 C
    00119 C
    00120 C     close file
    00121       call mficlo(fid,cret)
    00122       print *,cret
    00123       if (cret .ne. 0 ) then
    00124          print *,'ERROR :  close file'
    00125          call efexit(-1)
    00126       endif
    00127 C
    00128 C
    00129 C
    00130       end
    00131