UsesCase_MEDmesh_5.f90

Aller à la documentation de ce fichier.
00001 !*  This file is part of MED.
00002 !*
00003 !*  COPYRIGHT (C) 1999 - 2011  EDF R&D, CEA/DEN
00004 !*  MED is free software: you can redistribute it and/or modify
00005 !*  it under the terms of the GNU Lesser General Public License as published by
00006 !*  the Free Software Foundation, either version 3 of the License, or
00007 !*  (at your option) any later version.
00008 !*
00009 !*  MED is distributed in the hope that it will be useful,
00010 !*  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 !*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 !*  GNU Lesser General Public License for more details.
00013 !*
00014 !*  You should have received a copy of the GNU Lesser General Public License
00015 !*  along with MED.  If not, see <http://www.gnu.org/licenses/>.
00016 !*
00017 
00018 !*
00019 !*  Use case 5 : read a 2D structured mesh
00020 !*
00021 
00022 program UsesCase_MEDmesh_5
00023 
00024     implicit none
00025   include 'med.hf'
00026 
00027   integer cret
00028   integer fid, nmesh, it, naxis
00029   character(64)  :: mname = "2D unstructured mesh"
00030   character(200) :: desc
00031   character(16)  :: dtunit
00032   integer nstep, mdim, sdim, stype, mtype, atype
00033   character(16), dimension(:), allocatable :: aname
00034   character(16), dimension (:), allocatable :: aunit
00035   integer gtype
00036 
00037   ! open file             **
00038   call mfiope(fid,'UsesCase_MEDmesh_4.med',MED_ACC_RDONLY, cret)
00039   print *,cret
00040   print *,fid
00041   if (cret .ne. 0 ) then
00042      print *,'ERROR : open file'
00043      call efexit(-1)
00044   endif
00045 
00046   ! ... we know that the MED file has only one mesh, 
00047   ! a real code working would check ... 
00048 
00049   ! read computation space dimension **
00050   call mmhnan(fid,mname,naxis,cret)
00051   print *,cret
00052   if (cret .ne. 0 ) then
00053      print *,'Read number of axis in the mesh'
00054      call efexit(-1)
00055   endif
00056   print *,'Number of axis in the mesh  = ',naxis
00057      
00058   allocate ( aname(naxis), aunit(naxis) ,STAT=cret )
00059   if (cret > 0) then
00060      print *,'Memory allocation'
00061      call efexit(-1)
00062   endif
00063   ! read mesh informations **
00064   call  mmhmin(fid, mname, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
00065   print *,cret
00066   if (cret .ne. 0 ) then
00067      print *,'Read mesh informations'
00068      call efexit(-1)
00069   endif
00070   print *,"mesh name =", mname
00071   print *,"space dim =", sdim
00072   print *,"mesh dim =", mdim
00073   print *,"mesh type =", mtype
00074   print *,"mesh description =", desc
00075   print *,"dt unit = ", dtunit
00076   print *,"sorting type =", stype
00077   print *,"number of computing step =", nstep
00078   print *,"coordinates axis type =", atype
00079   print *,"coordinates axis name =", aname
00080   print *,"coordinates axis units =", aunit
00081   deallocate(aname, aunit)
00082 
00083   ! read grid type
00084   call mmhgtr(fid,mname,gtype,cret)
00085   print *,cret
00086   if (cret .ne. 0 ) then
00087      print *,'Read grid type'
00088      call efexit(-1)
00089   endif
00090   print *,"grid type =", gtype
00091 
00092   ! close file **
00093   call mficlo(fid,cret)
00094   print *,cret
00095   if (cret .ne. 0 ) then
00096      print *,'ERROR :  close file'
00097      call efexit(-1)
00098   endif
00099 
00100 end program UsesCase_MEDmesh_5
00101 
00102 

Généré le Mon May 16 17:10:24 2011 pour MED fichier par  doxygen 1.6.1