anchor.diff:        endif
         KLzerosscat(1:size(KLzeros),j) = KLzeros
       endif
  +    !store zeros in totaln module array
  +    if(chxstype .eq. 'totaln') then
  +      if(.not.allocated(KLzerostotn)) allocate(KLzerostotn(KLrmaxnumzeros,numRealz))
  +      if(size(KLzerostotn(:,1))<KLrmaxnumzeros) then
  +        call move_alloc(KLzerostotn,KLzerostotn_)
  +        allocate(KLzerostotn(KLrmaxnumzeros,numRealz))
  +        KLzerostotn( 1:size(KLzerostotn_(:,1)) , 1:size(KLzerostotn_(1,:)) ) = KLzerostotn_
  +        deallocate(KLzerostotn_)
  +      endif
  +      KLzerostotn(1:size(KLzeros),j) = KLzeros
  +    endif
  +
   
       deallocate(zlocmaster)
       deallocate(zvalmaster)
  
positive.code:     tsigscatave     = sigscatave
      tsigabsave      = sigabsave
    else
      tmeanadjust     = 0
      tsigsmeanadjust = 0
      tsigameanadjust = 0
      tsigave         = 0
      tsigscatave     = 0
      tsigabsave      = 0
    endif
  
    end subroutine KLr_setmeans
  
negative.code:   !first sighting of negativity.  Otherwise it will then cycle through each set of bounds on
    !a zero and find and store the zeros.
    use genRealzvars, only: s, numRealz
    use KLvars, only: KLzerostot, KLzerosabs, KLzerosscat, KLzerostotn, numEigs, numrefinesameiter, KLrmaxnumzeros
    use utilities, only: arithmaticsum, geometricsum
    integer :: j
    character(*) :: chxstype
  