# Unittest_MEDlink_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 link module
    00020 C *
    00021 C *****************************************************************************
    00022       program MEDlink2
    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_MEDlink_1.med")
    00032       character*64 mname1, mname2,lname1,lname2
    00033       parameter(mname1 = "mesh name")
    00034       parameter(lname1 = "/local/study1/filename.med")
    00035       parameter(mname2 = "second mesh name")
    00036       parameter(lname2 = "/local/study2/filename.med")
    00037       integer lsize,lsize1,lsize2
    00038       parameter (lsize1=26, lsize2=26)
    00039       character*64 lname
    00040 C
    00041 C
    00042 C     open file
    00043       call mfiope(fid,fname,MED_ACC_RDONLY,cret)
    00044       print *,'Open file',cret
    00045       if (cret .ne. 0 ) then
    00046          print *,'ERROR : open file'
    00047          call efexit(-1)
    00048       endif
    00049 C
    00050 C
    00051 C     read link size
    00052       call mlnlai(fid, mname1, lsize, cret)
    00053       print *,'read link information',cret,lsize
    00054       if (cret .ne. 0 .or.
    00055      &    lsize .ne. lsize1 ) then
    00056          print *,'ERROR : link information'
    00057          call efexit(-1)
    00058       endif
    00059 c
    00060       call mlnlai(fid, mname2, lsize, cret)
    00061       print *,'read link information',cret,lsize
    00062       if (cret .ne. 0 .or.
    00063      &    lsize .ne. lsize2 ) then
    00064          print *,'ERROR : link information'
    00065          call efexit(-1)
    00066       endif
    00067 C
    00068 C
    00069 C     read links
    00070       call mlnlir(fid,mname1,lname,cret)
    00071       print *,'read link',cret,lname
    00072       if (cret .ne. 0 ) then
    00073          print *,'ERROR : read link'
    00074          call efexit(-1)
    00075       endif
    00076 c
    00077       call mlnlir(fid,mname2,lname,cret)
    00078       print *,'read link',cret,lname
    00079       if (cret .ne. 0 ) then
    00080          print *,'ERROR : read link'
    00081          call efexit(-1)
    00082       endif
    00083 C
    00084 C
    00085 C     close file
    00086       call mficlo(fid,cret)
    00087       print *,'Close file',cret
    00088       if (cret .ne. 0 ) then
    00089          print *,'ERROR :  close file'
    00090          call efexit(-1)
    00091       endif
    00092 C
    00093 C
    00094 C
    00095       end
    00096