anchor.diff:      integer :: MatrixSize,NonZeros,submatrixsize,ngen,i
       real(dp) :: area,Q01_mthrees,sheet_number
       character(len=60) :: sub_name
  -    real(dp) :: ha,hv,omega
  +
       
       sub_name = 'cap_flow_ladder'
       call enter_exit(sub_name,1)
   
  -    ha = 4.0
  -    hv = 1.0
  -    omega = 10.0
  -    call calc_cap_imped(ha,hv,omega)
   !     Number of non-zero entries in solution matrix. 
         NonZeros=3
         do i=2,cap_param%num_symm_gen
  
positive.code: real(dp), intent(in) :: ha,hv,omega
  
  ! Local Variables:
  integer, parameter :: N_nodes = 2000
  integer :: n,ldb
  integer :: iopt, info
  real(dp),  allocatable :: sparseval(:)
  
negative.code: real(dp) :: stiff1(2*N_nodes+2,2*N_nodes+2), stiff2(2*N_nodes+2,2*N_nodes+2)
  real(dp) :: RHS1(2*N_nodes+2), RHS2(2*N_nodes+2)
  integer :: nrhs
  real(dp) :: deriv1(2),deriv2(2),dx,h(5),rep
  integer :: i
  integer :: factors(8)
  integer :: NonZeros
  
  rep = ha**4 - hv**4
  dx = 1.0/(N_nodes - 1.0)
  h(1) = ha**3
  h(2) = (ha**4 - 2*rep*dx)**(0.75)
  !h(3) = (ha**4 - (N_nodes)*rep*dx)**(0.75)
  h(3) = (ha**4 - (N_nodes-1)*rep*dx)**(0.75)
  h(4) = (ha**4 - (N_nodes-2)*rep*dx)**(0.75)
  h(5) = (ha**4 - (N_nodes-3)*rep*dx)**(0.75)
  !write(*,*) 'h1 = ', h(1)
  !write(*,*) 'h2 = ', h(2)
  !write(*,*) 'h3 = ', h(3)
  !write(*,*) 'h4 = ', h(4)
  !write(*,*) 'h5 = ', h(5)
  !write(*,*) 'h6 = ', h(6)
  !c = (h(nn+1) * H2R(nn) - h(nn-1) * H2R(nn-2))/(2*dx)
  !c = (h(nn) * H2I(nn) - h(nn-2) * H2I(nn-2))/(2*dx)
  n = N_Nodes*2 + 2
  call Matrix(N_nodes, ha, hv, omega, stiff1, stiff2, RHS1, RHS2)
  !call Mat_to_CSR(stiff1,N_nodes,sparsecol,sparserow,sparseval,NonZeros)
  