# Unittest_MEDprofile_1.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 file module
    00020 C *
    00021 C *****************************************************************************
    00022       program MEDprofile1
    00023 C
    00024       implicit none
    00025       include 'med.hf'
    00026 C
    00027 C
    00028       integer cret
    00029       integer fid
    00030       character*64  fname, pname1, pname2
    00031       parameter (fname="Unittest_MEDprofile_1.med")
    00032       parameter (pname1="Profile name1")
    00033       parameter (pname2="Profile name 2")
    00034       integer psize1,psize2
    00035       parameter (psize1=4, psize2=2)
    00036       integer profile1(4), profile2(2)
    00037       data profile1 /1,2, 3,4/
    00038       data profile2 /5,6/
    00039 C
    00040 C
    00041 C     file creation
    00042       call mfiope(fid,fname,MED_ACC_CREAT,cret)
    00043       print *,cret
    00044       print *,fid
    00045       if (cret .ne. 0 ) then
    00046          print *,'ERROR : file creation'
    00047          call efexit(-1)
    00048       endif
    00049 C
    00050 C
    00051 C     write a first profile
    00052       call  mpfprw(fid,pname1,psize1,profile1,cret)
    00053       print *,cret
    00054       if (cret .ne. 0 ) then
    00055          print *,'ERROR : profile creation'
    00056          call efexit(-1)
    00057       endif
    00058 C
    00059 C
    00060 C     write a second profile
    00061       call  mpfprw(fid,pname2,psize2,profile2,cret)
    00062       print *,cret
    00063       if (cret .ne. 0 ) then
    00064          print *,'ERROR : profile creation'
    00065          call efexit(-1)
    00066       endif
    00067 C
    00068 C
    00069 C     close file
    00070       call mficlo(fid,cret)
    00071       print *,cret
    00072       if (cret .ne. 0 ) then
    00073          print *,'ERROR :  close file'
    00074          call efexit(-1)
    00075       endif
    00076 C
    00077 C
    00078 C
    00079       end
    00080