anchor.diff:  
   use io, only: stderr
   
  +#ifndef USE_LAPACK
  +! Without LAPACK, we need the eigen routines from the algebra module
  +use algebra, only: jacobi, eig_sort
  +#endif
  +
  +
   implicit none
   
   ! Arguments
   double precision :: mrr, mtt, mpp, mrt, mrp, mtp, pnt(12)
   
   ! Local variables
  -double precision :: m_enz(3,3)
  +double precision :: m_enz(3,3), eigvals(3)
  +
   
   #ifdef USE_LAPACK
   
  +! Variables for running LAPACK dysev (double precision symmetric matrix eigen analysis)
   integer :: info, lwork
  -double precision :: w(3)
   double precision, allocatable :: work(:)
  +
  +#else
  +
  +! Variables for running Numerical Recipes jacobi (symmetric matrix eigen analysis) and eig_sort
  +integer :: nrot, ierr
  +double precision :: eigvecs(3,3)
   
   #endif
   
  
positive.code: m_enz(1,2) = -mtp     ! mtp = -men
  m_enz(2,1) = -mtp
  
  ! Query the optimal workspace
  allocate(work(1))
  lwork = -1
  call dsyev('Vectors','Upper',3,m_enz,3,w,work,lwork,info)
  lwork = int(work(1))
  deallocate(work)
  allocate(work(lwork))
  
  ! Solve eigenproblem
  call dsyev('Vectors','Upper',3,m_enz,3,w,work,lwork,info)
  
  if (info.ne.0) then
      write(stderr,*) 'mij2pnt: error in dsyev; returning pnt with zeros'
  
negative.code: ! Initialize PNT
  pnt = 0.0d0
  
  
  ! Convert moment tensor from spherical coordinates to local east-north-vertical coordinates, where
  ! r=up, t=south, and p=east
  