anchor.diff:           endif
         endif
      enddo
  -   
  +
      if (twodepths) then
   !  Extrapolate linearly to find density
         if (present(rho)) rho = den1 + (depth-dep1)*(den2-den1)/(dep2-dep1)
         if (present(vp))   vp = vp1  + (depth-dep1)*(vp2-vp1) / (dep2-dep1)
         if (present(vs))   vs = vs1  + (depth-dep1)*(vs2-vs1) / (dep2-dep1)
      endif
  -   
  +
      return
      end subroutine ak135
   !-------------------------------------------------------------------------------
  
positive.code:          endif
        endif
     enddo
     
     if (twodepths) then
  !  Extrapolate linearly to find density
        if (present(rho)) rho = den1 + (depth-dep1)*(den2-den1)/(dep2-dep1)
        if (present(vp))   vp = vp1  + (depth-dep1)*(vp2-vp1) / (dep2-dep1)
        if (present(vs))   vs = vs1  + (depth-dep1)*(vs2-vs1) / (dep2-dep1)
     endif
     
     return
     end subroutine prem
  !-------------------------------------------------------------------------------
  
negative.code:       integer, parameter, private :: i4 = selected_int_kind(9) ; ! long int
        integer, parameter, private :: r4 = selected_real_kind(6,37) ; ! SP
        integer, parameter, private :: r8 = selected_real_kind(15,307) ; ! DP
  
  !  ** precision selector
        integer, parameter, private :: rs = r8
  
  !  ** maths constants and other useful things
        real(rs), parameter, private :: pi = 3.141592653589793238462643 ;
        real(rs), parameter, private :: to_rad = 1.74532925199433e-002 ;  
  