c23456789012345678901234567890123456789012345678901234567890123456789012


      SUBROUTINE Cfxxxxx

c     ******************************************************************
c
c     This routine sets the error covariance matrices for nonlinear
c     equations
c
c     ******************************************************************

c     -------------
c     Declarations
c     -------------

c     ''''''''''''''''''''''
      implicit none
      include 'commonvar.f'      
c     ''''''''''''''''''''''

c---- Local variables

      integer	n,i,j,k,kcomp




c     ---------------------
c     Covariance matrix Cf 
c     ---------------------

c---- Initialization of matrix order 

      kcomp = 0


c---- Density equation

      do i=1,itot
      do j=1,jtot
      do k=1,ktot

         if (flag_den(i,j,k)) then
           kcomp       = kcomp + 1
           Cf_1(kcomp) = e_den**2 
         endif

      enddo 
      enddo
      enddo


c---- Tracer equation

      do i=1,itot
      do j=1,jtot
      do k=1,ktot

         if (flag_pos(i,j,k)) then
           kcomp       = kcomp + 1
           Cf_1(kcomp) = e_pos**2
         endif

      enddo
      enddo
      enddo


c---- Order of matrix Cf 
 
      n_nl = kcomp




c     --------------------------
c     Covariance matrix Cf^{-1}
c     --------------------------

      do n=1,n_nl
         Cf_1(n) = 1.d0 / Cf_1(n)
      enddo




c     -------------------
c     End of the routine
c     -------------------

      return

      end

c     ******************************************************************

