# f/test3.f

    00001 C*  This file is part of MED.
    00002 C*
    00003 C*  COPYRIGHT (C) 1999 - 2012  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       character*16 nomcoo(2)
    00037       character*16 unicoo(2)
    00038       character*16 dtunit
    00039
    00040 C ** Ouverture du fichier en lecture seule
    00041       call mfiope(fid,'test2.med',MED_ACC_RDONLY, cret)
    00042       print *,cret
    00043       if (cret .ne. 0 ) then
    00044          print *,'Erreur ouverture du fichier en lecture'
    00045          call efexit(-1)
    00046       endif
    00047
    00048 C ** lecture du nombre de maillage                      **
    00049       call mmhnmh(fid,nmaa,cret)
    00050       print *,cret
    00051       if (cret .ne. 0 ) then
    00052          print *,'Erreur lecture du nombre de maillage'
    00053          call efexit(-1)
    00054       endif
    00055       print *,'Nombre de maillages = ',nmaa
    00056
    00057 C ** lecture des infos sur les maillages : **
    00058 C ** - nom, dimension, type,description
    00059 C ** - options : nom universel, dimension de l'espace
    00060       do i=1,nmaa
    00061          call mmhmii(fid,i,maa,edim,mdim,type,desc,
    00062      &               dtunit,stype,nstep,atype,
    00063      &               nomcoo,unicoo,cret)
    00064          call mmhunr(fid,maa,nomu,cnu)
    00065          print *,cret
    00066          if (cret .ne. 0 ) then
    00067             print *,'Erreur acces au maillage'
    00068             call efexit(-1)
    00069          endif
    00070          print '(A,I1,A,A4,A,I1,A,A65,A65)','maillage '
    00071      &        ,i,' de nom ',maa,' et de dimension ',mdim,
    00072      &        ' de description ',desc
    00073          if (type.eq.MED_UNSTRUCTURED_MESH) then
    00074             print *,'Maillage non structure'
    00075          else
    00076             print *,'Maillage structure'
    00077          endif
    00078          print *,'Dimension espace ', edim
    00079          print *,'Dimension espace ', mdim
    00080          if (cnu.eq.0) then
    00081             print *,'Nom universel : ',nomu
    00082          else
    00083             print *,'Pas de nom universel'
    00084          endif
    00085          print *,'dt unit = ', dtunit
    00086          print *,'sorting type =', stype
    00087          print *,'number of computing step =', nstep
    00088          print *,'coordinates axis type =', atype
    00089          print *,'coordinates axis name =', nomcoo
    00090          print *,'coordinates axis units =', unicoo
    00091       enddo
    00092
    00093 C **  fermeture du fichier
    00094       call mficlo(fid,cret)
    00095       print *,cret
    00096       if (cret .ne. 0 ) then
    00097          print *,'Erreur fermeture du fichier'
    00098          call efexit(-1)
    00099       endif
    00100 C
    00101       end
    00102