         SUBROUTINE WRITE_eERROR
         
	 include 'CASCO.DIM'
         include 'observes.h'
	 include 'errors.h'
         include 'misc.h'

	 integer iyear, ncol
	 real    YDAYUTC0

	 integer ii

         character*132 uxefile
         character*30  mesh, obsfile

         mesh = meshname
         obsfile = 'unknown' 

         if(n_eobs.gt.0) then 
            CALL GDAY_UTC0(KD_eOBS(1),SEC_eOBS(1),IYEAR,YDAYUTC0)
	    ncol = 4
         else
            IYEAR = 0 
         endif

         write(*,*)'Name for final elevation error file'
         read(*,'(a)') uxefile
         write(*,'(a)')uxefile

         open(1,file=uxefile,status='unknown')
         write(1,'(A)')'XXXX'
         write(1,'(A)')MESH
         write(1,'(A)')OBSFILE
         write(1,'(I4)')IYEAR
         write(1,'(I4)')ncol

         do ii = 1, n_eobs
            CALL GDAY_UTC0(KD_eOBS(ii),SEC_eOBS(ii),IYEAR,YDAYUTC0)
            WRITE(1,'(F10.4, F10.0, F10.0, E14.6)') YDAYUTC0, 
     &        x_eobs(ii),y_eobs(ii),eerr_best(ii)
         enddo
         close(1)

      RETURN
      END
