UsesCase_MEDmesh_4.f

Aller à la documentation de ce fichier.
00001 C*  This file is part of MED.
00002 C*
00003 C*  COPYRIGHT (C) 1999 - 2011  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 * How to create an structured mesh
00020 C * Use case 4 : write a 2D structured mesh (5x3 cartesian grid)
00021 C * - Computation step : NO
00022 C *
00023 C *****************************************************************************
00024       program UsesCase_MEDmesh_4
00025 C     
00026       implicit none
00027       include 'med.hf'
00028 C
00029 C     
00030       integer cret
00031       integer fid
00032       integer sdim, mdim, stype, mtype, atype
00033       character*200 mdesc
00034       character*64  fname
00035       character*64 mname
00036       character*16 nomcoo(2)
00037       character*16 unicoo(2)
00038       character*16 dtunit
00039       parameter (fname = "UsesCase_MEDmesh_4.med")  
00040       parameter (mdesc = "A 2D structured mesh")
00041       parameter (mname = "2D unstructured mesh")  
00042       parameter (sdim = 2, mdim = 2)
00043       parameter (stype=MED_SORT_DTIT, mtype=MED_STRUCTURED_MESH)
00044       parameter (atype=MED_CARTESIAN_GRID)
00045       data  dtunit /""/
00046       data  nomcoo /"x               ","y               "/
00047       data  unicoo /"cm              ","cm              "/
00048 C 
00049 C
00050 C     file creation
00051       call mfiope(fid,fname,MED_ACC_CREAT,cret)
00052       print *,cret
00053       print *,fid
00054       if (cret .ne. 0 ) then
00055          print *,'ERROR : file creation'
00056          call efexit(-1)
00057       endif  
00058 C
00059 C
00060 C     mesh creation
00061       call mmhcre(fid, mname, sdim, mdim, mtype,mdesc,
00062      &            dtunit, stype, atype, nomcoo, unicoo, cret)
00063       print *,cret
00064       if (cret .ne. 0 ) then
00065          print *,'ERROR : mesh creation'
00066          call efexit(-1)
00067       endif  
00068 C
00069 C
00070 C     specify grid type
00071       call mmhgtw(fid,mname,MED_CARTESIAN_GRID,cret)
00072       print *,cret
00073       if (cret .ne. 0 ) then
00074          print *,'ERROR : write grid type'
00075          call efexit(-1)
00076       endif  
00077 C
00078 C
00079 C     close file
00080       call mficlo(fid,cret)
00081       print *,cret
00082       if (cret .ne. 0 ) then
00083          print *,'ERROR :  close file'
00084          call efexit(-1)
00085       endif        
00086 C
00087 C
00088 C
00089       end
00090 

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