Unittest_MEDparameter_2.f

Aller à la documentation de ce fichier.
00001 C*  This file is part of MED.
00002 C*
00003 C*  COPYRIGHT (C) 1999 - 2015  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 parameter module
00020 C *
00021 C *****************************************************************************
00022       program MEDparameter2
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_MEDparameter_1.med")
00032       character*64 pname1,pname2,pname
00033       parameter (pname1="first parameter name") 
00034       parameter (pname2="second parameter name") 
00035       integer type1,type2,type
00036       parameter (type1=MED_FLOAT64, type2=MED_INT)
00037       character*200 desc1,desc2,desc
00038       parameter (desc1="First parameter description")
00039       parameter (desc2="Second parameter description")
00040       character*16 dtunit1,dtunit2,dtunit
00041       parameter (dtunit1="unit1")
00042       parameter (dtunit2="unit2")
00043       integer nstep1,nstep2,nstep
00044       parameter (nstep1=2,nstep2=2)
00045 C 
00046 C
00047 C     open file
00048       call mfiope(fid,fname,MED_ACC_RDONLY,cret)
00049       print *,'Open file',cret
00050       if (cret .ne. 0 ) then
00051          print *,'ERROR : open file'
00052          call efexit(-1)
00053       endif 
00054 C
00055 C
00056 C     read information
00057       call mprpin(fid,pname1,type,desc,dtunit,
00058      &            nstep,cret)
00059       print *,'read information',cret
00060       if (cret .ne. 0 ) then
00061          print *,'ERROR : read information'
00062          call efexit(-1)
00063       endif 
00064 c
00065 c      if ( (type .ne. type1) .or.
00066 c     &     (desc .ne. desc1) .or.
00067 c     &     (dtunit .ne. dtunit1) .or.
00068 c     &     (nstep .ne. nstep1) ) then
00069 c         print *,'ERROR : read information'
00070 c         call efexit(-1)
00071 c      endif 
00072 C
00073 C     read information
00074 C
00075       call mprpin(fid,pname2,type,desc,dtunit,
00076      &            nstep,cret)
00077       print *,'read information',cret
00078       if (cret .ne. 0 ) then
00079          print *,'ERROR : read information'
00080         call efexit(-1)
00081       endif 
00082 c
00083 c      if ((type .ne. type2) .or.
00084 c     &    (desc .ne. desc2) .or.
00085 c     &    (dtunit .ne. dtunit2) .or.
00086 c     &    (nstep .ne. nstep2)) then
00087 c         print *,'ERROR : read information'
00088 c         call efexit(-1)
00089 c      endif 
00090 C
00091 C
00092 C     close file
00093       call mficlo(fid,cret)
00094       print *,'Close file',cret
00095       if (cret .ne. 0 ) then
00096          print *,'ERROR :  close file'
00097          call efexit(-1)
00098       endif  
00099 C
00100 C
00101 C
00102       end

Généré le Thu Oct 8 14:26:17 2015 pour MED fichier par  doxygen 1.6.1