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 * - Description : open/close med files
00020 C *
00021 C *****************************************************************************
00022       program test1
00023 C     
00024       implicit none
00025       include 'med.hf'
00026 C
00027 C     
00028       integer cret
00029       integer fid
00030       character*255 fname
00031       character*200 des
00032       parameter (des = "Ceci est un courte description"
00033      1     // " du fichier test1.med")  
00034       
00035 C     Creation du fichier "test1.med"
00036       call mfiope(fid,'test1.med',MED_ACC_RDWR, cret)
00037       print *,cret
00038       if (cret .ne. 0 ) then
00039          print *,'Erreur à la création du fichier'
00040          call efexit(-1)
00041       endif      
00042 
00043 C     Ecriture d'un en-tete dans le fichier
00044       call mficow(fid,des,cret)
00045       print *,cret
00046       if (cret .ne. 0 ) then
00047          print *,'Erreur à ecriture en-tete'
00048          call efexit(-1)
00049       endif      
00050       
00051 C     Lecture de la taille du nom de fichier "test1.med"
00052       call mfinam(fid,"", cret)
00053       print *,cret
00054       if (cret .le. 0 ) then
00055          print *,'Erreur à la lecture de la taille du nom de fichier'
00056          call efexit(-1)
00057       endif      
00058 
00059 C     Lecture du nom de fichier "test1.med"
00060       call mfinam(fid,fname, cret)
00061       print *,cret
00062       if (cret .le. 0 ) then
00063          print *,'Erreur à la lecture du nom de fichier'
00064          call efexit(-1)
00065       endif      
00066       print *,fname
00067 
00068 C     Fermeture du fichier
00069       call mficlo(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 C     Re-ouverture du fichier en lecture seule      
00077       call mfiope(fid,'test1.med',MED_ACC_RDONLY, cret)
00078       print *,cret
00079       if (cret .ne. 0 ) then
00080          print *,'Erreur ouverture du fichier en lecture'
00081          call efexit(-1)
00082       endif      
00083 
00084 C     Fermeture du fichier
00085       call mficlo(fid,cret)
00086       print *,cret
00087       if (cret .ne. 0 ) then
00088          print *,'Erreur à la fermeture du fichier'
00089          call efexit(-1)
00090       endif      
00091 
00092       end

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