c23456789012345678901234567890123456789012345678901234567890123456789012


      CHARACTER*12 FUNCTION stringx(var,i,j,k)

c     ******************************************************************
c
c     This routine returns a character string for a variable at point ijk 
c
c     ******************************************************************

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

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

c---- Argument variables

      character	var*2

      integer	i,j,k




c     ----------------
c     Character string 
c     ----------------

c---- Tests

c--
      if (i.lt.10) then
c--         

         if (j.lt.10) then

           if (k.lt.10) then
              write(stringx,100) var,i,j,k 
           else
              write(stringx,101) var,i,j,k 
           endif

         else
       
           if (k.lt.10) then
              write(stringx,200) var,i,j,k
           else
              write(stringx,201) var,i,j,k
           endif 

         endif

c--
      else
c--

         if (j.lt.10) then

           if (k.lt.10) then
              write(stringx,300) var,i,j,k
           else
              write(stringx,301) var,i,j,k
           endif

         else

           if (k.lt.10) then
              write(stringx,400) var,i,j,k
           else
              write(stringx,401) var,i,j,k
           endif

         endif

c--
      endif  
c--         


c---- Formats

100   format(a2,'(0',i1,'-0',i1,'-0',i1,')')
101   format(a2,'(0',i1,'-0',i1,'-' ,i2,')')
    
200   format(a2,'(0',i1,'-',i2,'-0',i1,')')
201   format(a2,'(0',i1,'-',i2,'-' ,i2,')')

300   format(a2,'(',i2,'-0',i1,'-0',i1,')')
301   format(a2,'(',i2,'-0',i1,'-' ,i2,')')

400   format(a2,'(',i2,'-',i2,'-0',i1,')')
401   format(a2,'(',i2,'-',i2,'-' ,i2,')')




c     --------------------
c     End of the function
c     --------------------

      return

      end

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



