anchor.diff:  	END SUBROUTINE dfpmin
   
   	SUBROUTINE lnsrch(xold,fold,g,p,x,f,stpmax,check,func)
  -	IMPLICIT NONE
   	REAL(SP), DIMENSION(:), INTENT(IN) :: xold,g
   	REAL(SP), DIMENSION(:), INTENT(INOUT) :: p
   	REAL(SP), INTENT(IN) :: fold,stpmax
  
positive.code: 
  	IMPLICIT NONE
  
  	
  	INTERFACE outerprod
  		MODULE PROCEDURE outerprod_r
  	END INTERFACE
  
  	INTERFACE assert_eq
  		MODULE PROCEDURE assert_eq2,assert_eq3,assert_eq4,assert_eqn
  	END INTERFACE
  
  
  CONTAINS
  
  		FUNCTION assert_eq2(n1,n2,string)
  	CHARACTER(LEN=*), INTENT(IN) :: string
  	INTEGER, INTENT(IN) :: n1,n2
  	INTEGER :: assert_eq2
  	if (n1 == n2) then
  		assert_eq2=n1
  	else
  		write (*,*) 'nrerror: an assert_eq failed with this tag:', &
  			string
  		STOP 'program terminated by assert_eq2'
  	end if
  	END FUNCTION assert_eq2
  !BL
  	FUNCTION assert_eq3(n1,n2,n3,string)
  	CHARACTER(LEN=*), INTENT(IN) :: string
  	INTEGER, INTENT(IN) :: n1,n2,n3
  	INTEGER :: assert_eq3
  	if (n1 == n2 .and. n2 == n3) then
  		assert_eq3=n1
  	else
  		write (*,*) 'nrerror: an assert_eq failed with this tag:', &
  			string
  		STOP 'program terminated by assert_eq3'
  	end if
  	END FUNCTION assert_eq3
  !BL
  	FUNCTION assert_eq4(n1,n2,n3,n4,string)
  	CHARACTER(LEN=*), INTENT(IN) :: string
  	INTEGER, INTENT(IN) :: n1,n2,n3,n4
  	INTEGER :: assert_eq4
  	if (n1 == n2 .and. n2 == n3 .and. n3 == n4) then
  		assert_eq4=n1
  	else
  		write (*,*) 'nrerror: an assert_eq failed with this tag:', &
  			string
  		STOP 'program terminated by assert_eq4'
  	end if
  	END FUNCTION assert_eq4
  !BL
  	FUNCTION assert_eqn(nn,string)
  	CHARACTER(LEN=*), INTENT(IN) :: string
  	INTEGER, DIMENSION(:), INTENT(IN) :: nn
  	INTEGER :: assert_eqn
  	if (all(nn(2:) == nn(1))) then
  		assert_eqn=nn(1)
  	else
  		write (*,*) 'nrerror: an assert_eq failed with this tag:', &
  			string
  		STOP 'program terminated by assert_eqn'
  	end if
  	END FUNCTION assert_eqn
  
  	FUNCTION vabs(v)
  	REAL(SP), DIMENSION(:), INTENT(IN) :: v
  
negative.code: 	STOP 'program terminated by nrerror'
  	END SUBROUTINE nrerror
  
  
  	FUNCTION outerprod(a,b)
  	REAL(SP), DIMENSION(:), INTENT(IN) :: a,b
  	REAL(SP), DIMENSION(size(a),size(b)) :: outerprod
  	outerprod = spread(a,dim=2,ncopies=size(b)) * &
  		spread(b,dim=1,ncopies=size(a))
  	END FUNCTION outerprod
  
  
  
  
  
  
  
  !BL
  	SUBROUTINE unit_matrix(mat)
  	REAL(SP), DIMENSION(:,:), INTENT(OUT) :: mat
  