!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&      
      subroutine getDeta( deta )
!**********************************************************************
!                                                                     *
!        Read deta from input files                                   *
!                                                                     *
!**********************************************************************
!-----------------------------------------------------------------------
      implicit none
      include 'param_o.h'
      include 'const.h'
!-----------------------------------------------------------------------
      real deta(lm), ldt1(lm)
!-----------------------------------------------------------------------
!      character*80 Cname
      character(len=150):: Cname
      character(len=02):: fn
      real::sg(lm+1),x,dsgb
      integer::l
!-----------------------------------------------------------------------

      write(fn,900) lm
 900  format(i2.2)
!!      Cname="../data_in/static2/deta_"//fn
        Cname='deta_'//fn
!! 
!test Dragan 1dec2015-radi
!        Cname='/scratchin/grupos/eta/home/reta/tempo/GEF_tempo/gef_trunk/PRP/data_in/static2/deta_60_10'

!print
      print *,'CNAME=',Cname
!print

      if(.not.sigma)then
      if(hstst)then
        if(lm.eq.1)then
          deta(lm)=1.0
        else
          deta=1.0/lm
        endif
      else
        open(unit=21, file=Cname, form='unformatted')
        rewind(21)
!JBF        read(21) deta,ldt1  
        read(21) deta

	close(21)
      endif
      endif

      do l=1,lm
        print *,'L=',l,"DETA(L)=",deta(l)
      enddo

      if(sigma)then
         do l=1,lm-1
           x=float(l-1)/float(lm-1)
           sg(l)=0.8*x+1.03643*x**2-0.973*x**3+0.13673*x**4-0.00016*x**5
          end do
          dsgb=1.-sg(lm-1)
          sg(lm)=1.-dsgb/2

          sg(lm+1)=1.0

          do l=1,lm
          deta(l)=sg(l+1)-sg(l)
          enddo
      endif
        
!-----------------------------------------------------------------------
      end subroutine getDeta
