f/test3.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 : test3.f
00020 C *
00021 C * - Description : lecture des informations sur les maillages dans un fichier
00022 C*                  MED.
00023 C *
00024 C ******************************************************************************
00025       program test3
00026 C     
00027       implicit none
00028       include 'med.hf'
00029 C
00030 C
00031       integer       cret,fid,cres,type,cnu
00032       character*64  maa
00033       character*80  nomu
00034       character*200 desc
00035       integer       nmaa,i,mdim,edim,nstep,stype,atype
00036 C  ** chgt de dim 2->3 car le fichier dump.ref/test2.med en 2.3.6 est utilisé comme référence
00037 C  ** (il constient un maillage de dimension 3 et un espace induit de dimension 3
00038 C  **   car pas de coordonée stockée) 
00039 C  ** dans 2.3v3.0 qui utilise ce test3 en v3.0 qui défini nomcoo et unicoo en dimension 2
00040 C      character*16 nomcoo(2)
00041 C      character*16 unicoo(2)
00042       character*16 nomcoo(3)
00043       character*16 unicoo(3)
00044       character*16 dtunit
00045       
00046 C ** Ouverture du fichier en lecture seule
00047       call mfiope(fid,'test2.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 du nombre de maillage                      **
00055       call mmhnmh(fid,nmaa,cret)
00056       print *,cret
00057       if (cret .ne. 0 ) then
00058          print *,'Erreur lecture du nombre de maillage'
00059          call efexit(-1)
00060       endif      
00061       print *,'Nombre de maillages = ',nmaa
00062 
00063 C ** lecture des infos sur les maillages : **
00064 C ** - nom, dimension, type,description
00065 C ** - options : nom universel, dimension de l'espace
00066       do i=1,nmaa  
00067          call mmhmii(fid,i,maa,edim,mdim,type,desc,
00068      &               dtunit,stype,nstep,atype,
00069      &               nomcoo,unicoo,cret)
00070          call mmhunr(fid,maa,nomu,cnu)
00071          print *,cret
00072          if (cret .ne. 0 ) then
00073             print *,'Erreur acces au maillage'
00074             call efexit(-1)
00075          endif      
00076          print '(A,I1,A,A4,A,I1,A,A65,A65)','maillage '
00077      &        ,i,' de nom ',maa,' et de dimension ',mdim,
00078      &        ' de description ',desc
00079          if (type.eq.MED_UNSTRUCTURED_MESH) then
00080             print *,'Maillage non structure'
00081          else
00082             print *,'Maillage structure'
00083          endif
00084          print *,'Dimension espace   ', edim
00085          print *,'Dimension maillage ', mdim
00086          if (cnu.eq.0) then
00087             print *,'Nom universel : ',nomu
00088          else
00089             print *,'Pas de nom universel'
00090          endif
00091          print *,'dt unit = ', dtunit
00092          print *,'sorting type =', stype
00093          print *,'number of computing step =', nstep
00094          print *,'coordinates axis type =', atype
00095          print *,'coordinates axis name =', nomcoo(1:2)
00096          print *,'coordinates axis units =', unicoo(1:2)
00097       enddo         
00098          
00099 C **  fermeture du fichier
00100       call mficlo(fid,cret)
00101       print *,cret
00102       if (cret .ne. 0 ) then
00103          print *,'Erreur fermeture du fichier'
00104          call efexit(-1)
00105       endif      
00106 C
00107       end 
00108 

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