f/test2.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 C ******************************************************************************
00019 C * - Nom du fichier : test2.f
00020 C *
00021 C * - Description : exemples de creations de maillage MED
00022 C *
00023 C ******************************************************************************
00024       program test2
00025 C     
00026       implicit none
00027       include 'med.hf'
00028 C
00029 C
00030       integer cret,ret
00031       integer fid
00032       character*200 des
00033       integer hdfok, medok
00034       character*16 nomcoo(2)
00035       character*16 unicoo(2)
00036       data  nomcoo /"x","y"/, unicoo /"cm","cm"/
00037 
00038 C  ** verifie que le fichier test1.med est au bon format **
00039       call mficom('test1.med',hdfok,medok,cret)
00040       print *,hdfok, medok, cret
00041       if (cret .ne. 0 ) then
00042          print *,'Erreur à la vérification du format'
00043          call efexit(-1)
00044       endif      
00045 
00046 C  ** Ouverture en mode de lecture du fichier test1.med
00047       call mfiope(fid,'test1.med',MED_ACC_RDONLY, cret)
00048       print *,cret
00049       if (cret .ne. 0 ) then
00050          print *,'Erreur ouverture du fichier en lecture'
00051          call efexit(-1)
00052       endif      
00053 
00054 C  ** Lecture de l'en-tete du fichier
00055       call mficor(fid,des,cret)
00056       print *,cret
00057       if (cret .ne. 0 ) then
00058          print *,'Erreur lecture en-tete du fichier'
00059          call efexit(-1)
00060       endif      
00061       print *,"DESCRIPTEUR DE FICHIER : ",des
00062 
00063  
00064 C  ** Fermeture du fichier test1.med 
00065       call mficlo(fid,cret)
00066       print *,cret
00067       if (cret .ne. 0 ) then
00068          print *,'Erreur fermeture du fichier'
00069          call efexit(-1)
00070       endif      
00071 
00072       
00073 C  ** Ouverture en mode de creation du fichier test2.med
00074       call mfiope(fid,'test2.med',MED_ACC_RDWR, cret)
00075       print *,cret
00076       if (cret .ne. 0 ) then
00077          print *,'Erreur creation du fichier'
00078          call efexit(-1)
00079       endif      
00080       
00081 C  **  Creation du maillage maa1 de type non structure
00082 C  **  et de dimension 2
00083       call mmhcre(fid,'maa1',2,2,
00084      &     MED_UNSTRUCTURED_MESH,'un premier maillage', 
00085      &     "",MED_SORT_DTIT,MED_CARTESIAN,nomcoo,unicoo,ret)
00086       cret = cret + ret
00087 C     **  Creation du nom universel
00088       call mmhunw(fid,'maa1',ret)
00089       cret = cret + ret
00090       print *,cret
00091       if (cret .ne. 0 ) then
00092          print *,'Erreur creation du maillage'
00093          call efexit(-1)
00094       endif      
00095       
00096 C  **  Creation du maillage maa2 de type non structure
00097       call mmhcre(fid,'maa2',2,2,
00098      &     MED_UNSTRUCTURED_MESH,'un second maillage', 
00099      &     "",MED_SORT_DTIT,MED_CARTESIAN,nomcoo,unicoo,ret)
00100       cret = cret + ret 
00101       if (cret .ne. 0 ) then
00102          print *,'Erreur creation du maillage'
00103          call efexit(-1)
00104       endif      
00105     
00106 
00107 C  ** Creation du maillage maa3 de type structure
00108       call mmhcre(fid,'maa3',2,2,
00109      &     MED_STRUCTURED_MESH,'un troisieme maillage', 
00110      &     "",MED_SORT_DTIT,MED_CARTESIAN,nomcoo,unicoo,ret)
00111       cret = cret + ret
00112       print *,cret
00113       if (cret .ne. 0 ) then
00114          print *,'Erreur creation du maillage'
00115          call efexit(-1)
00116       endif      
00117 
00118 C **  Fermeture du fichier
00119       call mficlo(fid,cret)
00120       print *,cret
00121       if (cret .ne. 0 ) then
00122          print *,'Erreur fermeture du fichier'
00123          call efexit(-1)
00124       endif      
00125 C      
00126       end 
00127 
00128 
00129 
00130 
00131 

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