c23456789012345678901234567890123456789012345678901234567890123456789012


      SUBROUTINE fffffff 

c     ******************************************************************
c
c     This routine sets the vector of nonlinear functions f 
c
c     ******************************************************************

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

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

c---- Local variables

      integer	i,j,k,kcomp

      real*8	conse_r,
     >		conse_p




c     -----------------
c     Fill the vector f 
c     -----------------

c---- Initialization

      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
c          -----------------------------
           f(kcomp) = conse_r('R',i,j,k)
c          -----------------------------
         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
c          -----------------------------
           f(kcomp) = conse_p('R',i,j,k)
c          -----------------------------
         endif

      enddo
      enddo
      enddo


c---- Test the dimension of f

      if (kcomp.ne.n_nl) then
         write(*,*)
         write(*,*) 'f and Cf are not conformable'
         write(*,*)
         stop 'STOP'
      endif




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

      return

      end

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

