C**                                                                 ***
C**-----------------------------------------------------------------***
C**                                                                 ***
C**** the mesh is writen to the ensight geometry file :             ***
C**   ------------------------------------------------              ***
C**                                                                 ***
      IVEM(120)=LOUT
      IVEM(121)=CNTMSH*OUTFLG
      IVEM(125)=8
      TEXT1='%MESH_TITLE_'
      NAME='%MESH_FILEOUT_'
      IF (MYPROC.EQ.1) OPEN(8,FILE=NAME,STATUS= 'UNKNOWN',
     &                                               FORM='FORMATTED')
      CALL VEMENS (TEXT1,LIVEM,IVEM,LNEK,NEK,LRPARM,RPARM,LIPARM,IPARM,
     &             LDNOD,DNOD,LRDPRM,RDPARM,LIDPRM,IDPARM,LNODN,
     &             NODNUM,LNOD,NOD,LNOPRM,NOPARM,LBIG,RBIG,IBIG)
      IF (IVEM(2).NE.0) GOTO 9999
      IF (MYPROC.EQ.1) THEN
	CLOSE(8)
	WRITE(1,3010) 1,'ensight'
	WRITE(1,*) NAME(:INDEX(NAME,' '))
      ENDIF
