c23456789012345678901234567890123456789012345678901234567890123456789012


      SUBROUTINE x_ident

c     ******************************************************************
c
c     This routine assigns a character string to each component of the 
c     state vector 
c
c     ******************************************************************

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

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

c---- Local variables

      integer	i,j,k,kcomp


c---- Local variables

      character	stringx*12




c     --------------------------------
c     Assignation of character string
c     --------------------------------

c---- Initialization

      kcomp = 0

      n_r   = 0
      n_U   = 0
      n_V   = 0
      n_W   = 0
      n_p   = 0


c---- Density

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

         if (flag_r(i,j,k)) then
           kcomp         = kcomp + 1
           n_r           = n_r   + 1
c          -----------------------------------
           string(kcomp) = stringx('rr',i,j,k)
c          -----------------------------------
         endif

      enddo
      enddo
      enddo


c---- Transport component U

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

         if (flag_U(i,j,k)) then
           kcomp         = kcomp + 1
           n_U           = n_U   + 1
c          -----------------------------------
           string(kcomp) = stringx('UU',i,j,k)
c          -----------------------------------
         endif

      enddo
      enddo
      enddo


c---- Transport component V

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

         if (flag_V(i,j,k)) then
           kcomp         = kcomp + 1
           n_V           = n_V   + 1
c          -----------------------------------
           string(kcomp) = stringx('VV',i,j,k)
c          -----------------------------------
         endif

      enddo
      enddo
      enddo


c---- Transport component W

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

         if (flag_W(i,j,k)) then
           kcomp         = kcomp + 1
           n_W           = n_W   + 1 
c          -----------------------------------
           string(kcomp) = stringx('WW',i,j,k)
c          -----------------------------------
         endif

      enddo
      enddo
      enddo


c---- Tracer 

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

         if (flag_p(i,j,k)) then
           kcomp         = kcomp + 1
           n_p           = n_p   + 1
c          -----------------------------------
           string(kcomp) = stringx('pp',i,j,k)
c          -----------------------------------
         endif

      enddo
      enddo
      enddo


c---- Size of the state vector

      n_o = kcomp


c---- Writing strings

      open (50,file='string.'//tag)

      write(50,*)
      write(50,*) 'COMPONENTS OF STATE VECTOR'
      write(50,*) 

      do k=1,n_o
         write(50,*) string(k)
      enddo
      
      close (50)

c      stop 'COMPONENTS OF STATE VECTOR IN string' 




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

      return

      end

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

