2.3.6/test1.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 * - Nom du fichier : test1.f
00020 C *
00021 C * - Description : exemples d'ouverture/fermeture de fichiers MED 
00022 C *
00023 C *****************************************************************************
00024       program test1
00025 C     
00026       implicit none
00027       include 'med.hf'
00028 C
00029 C     
00030       integer cret
00031       integer fid
00032       character*200 des
00033       parameter (des = "Ceci est un courte description"
00034      1     // " du fichier test1.med")  
00035       
00036 C     Creation du fichier "test1.med"
00037       call efouvr(fid,'test1.med',MED_LECTURE_ECRITURE, cret)
00038       print *,cret
00039       if (cret .ne. 0 ) then
00040          print *,'Erreur à la création du fichier'
00041          call efexit(-1)
00042       endif      
00043 
00044 C     Ecriture d'un en-tete dans le fichier
00045       call effide (fid,des,cret)
00046       print *,cret
00047       if (cret .ne. 0 ) then
00048          print *,'Erreur à ecriture en-tete'
00049          call efexit(-1)
00050       endif      
00051       
00052 C     Fermeture du fichier
00053       call efferm (fid,cret)
00054       print *,cret
00055       if (cret .ne. 0 ) then
00056          print *,'Erreur à la fermeture du fichier'
00057          call efexit(-1)
00058       endif      
00059 
00060 C     Re-ouverture du fichier en lecture seule      
00061       call efouvr(fid,'test1.med',MED_LECTURE, cret)
00062       print *,cret
00063       if (cret .ne. 0 ) then
00064          print *,'Erreur ouverture du fichier en lecture'
00065          call efexit(-1)
00066       endif      
00067 
00068 C     Fermeture du fichier
00069       call efferm (fid,cret)
00070       print *,cret
00071       if (cret .ne. 0 ) then
00072          print *,'Erreur à la fermeture du fichier'
00073          call efexit(-1)
00074       endif      
00075 
00076       end

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