       subroutine rgtran(new,old,ldr)  
       type(ADAPTIVE_MESH), pointer :: new
       type(ADAPTIVE_MESH), pointer :: old
       real(SP), dimension(3) :: ldr

       type(ADAPTIVE_MESH), pointer :: o
       real(SP) dr
       integer(I4B) lev
                
       nullify(o)

       o=>old
       lev=new%level
       dr=ldr(1)
       nr=new%gnr(1)
 

!      ------------------------------------------------------------
!      FOR EACH GRID IN OLD LIST ...
!      ------------------------------------------------------------
        
       DO WHILE(associated(o))
          
!        ----------------------------------------------------------
!        ... IF THERE IS ANY OVERLAP WITH GRID G ...
!        ----------------------------------------------------------
    if(o%grmax(1).ge.new%grmax(1) .and. o%grmin(1).le.new%grmin(1)) then  

!          --------------------------------------------------------
!          ... COMPUTE OVERLAP INDICES ...
!          --------------------------------------------------------
           if(new%grmin(1).ge.o%grmin(1)) then
             ig1 = 1
             itg1= align_m(new%grmin(1),o%grmin(1),dr)
           else
             ig1= align_m(o%grmin(1),new%grmin(1),dr)
             igt1=1
           endif
        
           if(new%grmax(1).ge.o%grmax(1)) then
             ig2=nr+1-align_m(new%grmax(1),o%grmax(1),dr) 
           else
             ig2=nr
           endif
           ig2=ig2+1

!          --------------------------------------------------------
!          ... AND COPY ALL FCNS, WHICH NEED TO BE COPIED
!          --------------------------------------------------------

          ntran=6 !all grid functions but ESTRE,R2 and R3

          do i=1,ntran
           do it=1,new%grid%gfcn(i)%n_t 
           new%grid%gfcn(i)%tlev(it)%data(itg1:ig2,1,1) & 
           =o%grid%gfcn(i)%tlev(it)%data(ig1:ig2,1,1) 
           enddo
          enddo

          endif 

          o=>o%neighbor               
        

       ENDDO

       return
       end subroutine rgtran
! ---------------------------------------------------------------------
 

       integer(I4B) function align_m(a1,a2,ainc)
       real(SP) a1,a2,ainc
       real(SP), parameter :: tol=1.0d-06
    
          align_m=int((a1-a2)/ainc) + 1
          if(a1-(a2+align_m*ainc).gt.tol*ainc) then
            write(6,*) 'align: bad parameters'
            stop
          endif
      return
      end function align_m


!      =============================================================
!      INTERPOLATION ROUTINES   (Mark Miller) 
!      =============================================================


!      ------------------------------------------------------------
!      interpolation driver
!      NOTE: HCODE SPECIFIC !!!
!      ------------------------------------------------------------


