# f/test12.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
    00019 C ******************************************************************************
    00020 C * - Nom du fichier : test12.f
    00021 C *
    00022 C * - Description : ecriture d'une equivalence dans un maillage MED
    00023 C *
    00024 C ******************************************************************************
    00025         program test12
    00026 C
    00027         implicit none
    00028         include 'med.hf'
    00029 C
    00030 C
    00031         integer cret,fid
    00032         character*64 maa , equ
    00033         character*200 des
    00034         integer mdim ,ncor, sdim
    00035         integer cor(6)
    00036         character*16 nomcoo(3)
    00037         character*16 unicoo(3)
    00038
    00039         parameter (maa ="maa1",mdim = 3,ncor = 3 , sdim=3)
    00040         data cor /1,2,3,4,5,6/, equ / "equivalence"/
    00041         data des / "equivalence sur les mailles MED_TRIA3" /
    00042         data  nomcoo /"x","y","z"/, unicoo /"cm","cm","cm"/
    00043
    00044
    00045 C  ** Creation du fichier test12.med **
    00046         call mfiope(fid,'test12.med',MED_ACC_RDWR, cret)
    00047         print *,cret
    00048         if (cret .ne. 0 ) then
    00049            print *,'Erreur creation du fichier'
    00050            call efexit(-1)
    00051         endif
    00052
    00053
    00054 C  ** Creation du maillage **
    00055         call mmhcre(fid,maa,mdim,sdim,MED_UNSTRUCTURED_MESH,
    00056      &              'Un maillage pour test12',"",
    00057      &              MED_SORT_DTIT,MED_CARTESIAN,nomcoo,unicoo,cret)
    00058         print *,cret
    00059                 if (cret .ne. 0 ) then
    00060            print *,'Erreur creation du maillage'
    00061            call efexit(-1)
    00062         endif
    00063
    00064 C ** Creation de l'equivalence **
    00065         call meqcre(fid,maa,equ,des,cret)
    00066         print *,cret
    00067         if (cret .ne. 0 ) then
    00068            print *,'Erreur creation equivalence'
    00069            call efexit(-1)
    00070         endif
    00071
    00072 C ** Ecriture des correspondances sur les mailles MED_TRIA3 **
    00073         call meqcow(fid,maa,equ,MED_NO_DT,MED_NO_IT,MED_CELL,
    00074      &              MED_TRIA3,ncor,cor,cret)
    00075         print *,cret
    00076         if (cret .ne. 0 ) then
    00077            print *,'Erreur ecriture de correspondances'
    00078            call efexit(-1)
    00079         endif
    00080
    00081 C ** Fermeture du fichier                                **
    00082         call mficlo(fid,cret)
    00083         print *,cret
    00084         if (cret .ne. 0 ) then
    00085            print *,'Erreur fermeture du fichier'
    00086            call efexit(-1)
    00087         endif
    00088 C
    00089         end