C*************************************************************************
C COPYRIGHT (C) 1999 - 2003  EDF R&D
C THIS LIBRARY IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
C IT UNDER THE TERMS OF THE GNU LESSER GENERAL PUBLIC LICENSE 
C AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
C EITHER VERSION 2.1 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
C
C THIS LIBRARY IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
C WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
C MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
C LESSER GENERAL PUBLIC LICENSE FOR MORE DETAILS.
C
C YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE
C ALONG WITH THIS LIBRARY; IF NOT, WRITE TO THE FREE SOFTWARE FOUNDATION,
C INC., 59 TEMPLE PLACE, SUITE 330, BOSTON, MA 02111-1307 USA
C
C**************************************************************************


C ******************************************************************************
C * - Nom du fichier : test12.f
C *
C * - Description : ecriture d'une equivalence dans un maillage MED 
C *
C ******************************************************************************
	program test12
C     
	implicit none
	include 'med.hf'
C
C
        integer cret,fid
        character*32 maa , equ 
        character*200 des
        integer mdim ,ncor
        integer cor(6)

        parameter (maa ="maa1",mdim = 3,ncor = 3 )
        data cor /1,2,3,4,5,6/, equ / "equivalence"/
        data des / "equivalence sur les mailles MED_TRIA3" /

C  ** Creation du fichier test12.med **
	call efouvr(fid,'test12.med',MED_CREATION, cret)
	print *,cret

  
C  ** Creation du maillage **
	if (cret .eq. 0) then
	   call efmaac(fid,maa,mdim,MED_NON_STRUCTURE,
     &                 'Un maillage pour test12',cret)
	endif
	print *,cret  
  
C ** Creation de l'equivalence **
	if (cret .eq. 0) then
           call efequc(fid,maa,equ,des,cret)
	endif
	print *,cret  
        
C ** Ecriture des correspondances sur les mailles MED_TRIA3 **
 	if (cret .eq. 0) then
          call efeque(fid,maa,equ,cor,ncor,
     &          MED_MAILLE,MED_TRIA3,cret)
	endif
	print *,cret  
        
C ** Fermeture du fichier                                **
 	call efferm (fid,cret)
	print *,cret
     
	end
