f/test18.f

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 
00019 C ******************************************************************************
00020 C * - Nom du fichier : test18.f
00021 C *
00022 C * - Description : routines de test de la conformite d'une fichier MED.
00023 C *
00024 C ******************************************************************************
00025       program test18
00026 C     
00027       implicit none
00028       include 'med.hf'
00029 C
00030 C
00031       integer      fid
00032       integer      cret
00033       integer      maj,min,rel
00034       integer hdfok, medok
00035       
00036 C **  Creation du fichier test18.med
00037       call mfiope(fid,'test18.med',MED_ACC_RDWR, cret)
00038       print *,cret
00039       if (cret .ne. 0 ) then
00040          print *,'Erreur creation du fichier'
00041          call efexit(-1)
00042       endif      
00043       print *,'- Creation du fichier'
00044 
00045 C **  Fermeture du fichier
00046       call mficlo(fid,cret)
00047       print *,cret
00048       if (cret .ne. 0 ) then
00049          print *,'Erreur fermeture du fichier'
00050          call efexit(-1)
00051       endif      
00052       print *,'- Fermeture du fichier'
00053 
00054 C ** Quelle version de la bibliotheque est utilisee ? **
00055       call mlbnuv(maj,min,rel,cret)
00056       print *,cret
00057       if (cret .ne. 0 ) then
00058          print *,'Erreur lecture version med'
00059          call efexit(-1)
00060       endif      
00061       print *,'- Version MED utilisee : ',maj,'.',min,'.',rel
00062  
00063 C ** Conformite du format HDF  **
00064       call mficom('test18.med',hdfok, medok,cret)
00065       print *,cret
00066       if (hdfok .eq. 1) then
00067          print *,'- Format HDF conforme'
00068       else
00069          print *,'- Format HDF non conforme'
00070          call efexit(-1)
00071       endif   
00072       if (medok .eq. 1) then
00073          print *,'- Version MED du fichier conforme'
00074       else
00075          print *,'- Version MED du fichier non conforme'
00076          call efexit(-1)
00077       endif           
00078 
00079 C **  Ouverture du fichier test18.med en lecture seule
00080       call mfiope(fid,'test18.med',MED_ACC_RDONLY, cret)
00081       if (cret .ne. 0 ) then
00082          print *,'Erreur ouverture du fichier'
00083          call efexit(-1)
00084       endif      
00085       print *,'- Ouverture du fichier'
00086 
00087 C **  Lecture de la version de MED utilisee pour creer le fichier ? **
00088       call  mfinvr(fid,maj,min,rel,cret)
00089       if (cret .ne. 0 ) then
00090          print *,'Erreur lecture version med du fichier'
00091          call efexit(-1)
00092       endif      
00093       print *,cret
00094       print *,'- Fichier cree avec MED V',maj,'.',min,'.',rel
00095          
00096 C **  Fermeture du fichier
00097       call mficlo(fid,cret)
00098       print *,cret
00099       if (cret .ne. 0 ) then
00100          print *,'Erreur fermeture du fichier'
00101          call efexit(-1)
00102       endif      
00103       print *,'- Fermeture du fichier'
00104 C 
00105       end 
00106 
00107 

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