2.3.6/test21.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 : test21.f
00020 C*
00021 C* - Description : ecriture de valeurs scalaires numeriques dans un fichier MED
00022 C*
00023 C ******************************************************************************
00024       program test21
00025 C     
00026       implicit none
00027       include 'med.hf'
00028 C
00029       integer cret, fid
00030       character*16 edtuni,dtunit1
00031       character*32 nom1, nom2
00032       character*200 desc1, desc2
00033       integer vali1, vali2
00034       real*8 valr1,dt
00035 C
00036       parameter (nom1="VariableEntiere")
00037       parameter (nom2="VariableFlottante")
00038       data desc1 / "Une premiere description" /
00039       data desc2 / "Une seconde description" /
00040       parameter (vali1 = 56,vali2 = -789)
00041       parameter (valr1 = 67.98D0)
00042     
00043       parameter (edtuni="                "
00044      1         ,dtunit1="ms")
00045 C
00046 C     
00047 C     Creation du fichier test21.med
00048 C
00049       call efouvr(fid,'test21.med',MED_LECTURE_ECRITURE,cret)
00050       print *,cret
00051       if (cret .ne. 0 ) then
00052          print *,'Erreur creation du fichier'
00053          call efexit(-1)
00054       endif      
00055       print *,'Creation du fichier test21.med'
00056 C
00057 C     Creation d'une variable scalaire entiere 
00058 C
00059       call efscac(fid,nom1,MED_INT,desc1,cret)
00060       print *,cret
00061       if (cret .ne. 0 ) then
00062          print *,'Erreur creation variable scalaire'
00063          call efexit(-1)
00064       endif      
00065       print *,'Creation d une variable scalaire entiere'
00066 C
00067 C     Ecriture d'une valeur sans pas de temps ni numero d'ordre
00068 C
00069       dt =0.0D0
00070       call efscee(fid,nom1,vali1,MED_NOPDT,edtuni,dt,MED_NONOR,cret)
00071       print *,cret
00072       if (cret .ne. 0 ) then
00073          print *,'Erreur ecriture valeur scalaire'
00074          call efexit(-1)
00075       endif      
00076       print *,'Ecriture valeur entiere sans pas de temps'
00077 C
00078 C     Ecriture d'une valeur avec pas de temps et sans numero d'ordre
00079 C
00080       dt = 5.5D0
00081       call efscee(fid,nom1,vali2,1,dtunit1,dt,MED_NONOR,cret)
00082       print *,cret
00083       if (cret .ne. 0 ) then
00084          print *,'Erreur ecriture valeur scalaire'
00085          call efexit(-1)
00086       endif      
00087       print *,'Ecriture valeur entiere avec pas de temps'
00088 C
00089 C     Creation d'une variable scalaire flottante
00090 C
00091       call efscac(fid,nom2,MED_FLOAT64,desc2,cret)
00092       print *,cret
00093       if (cret .ne. 0 ) then
00094          print *,'Erreur creation variable sclaire'
00095          call efexit(-1)
00096       endif      
00097       print *,'Creation d une variable scalaire flottante'
00098 C
00099 C     Ecriture d'une valeur flottante avec pas de temps et numero d'ordre
00100 C
00101       call efscfe(fid,nom2,valr1,1,dtunit1,dt,2,cret)
00102       print *,cret
00103       if (cret .ne. 0 ) then
00104          print *,'Erreur ecriture valeur scalaire'
00105          call efexit(-1)
00106       endif      
00107       print *,'Ecriture valeur entiere avec pas de temps'
00108 C
00109 C     Fermeture du fichier      
00110 C
00111       call efferm(fid,cret)
00112       if (cret .ne. 0 ) then
00113          print *,'Erreur fermeture du fichier'
00114          call efexit(-1)
00115       endif      
00116       print *,cret
00117       print *,'Fermeture du fichier test21.med'
00118 C
00119       end
00120 C

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