anchor.diff:      
       ! First channel of an EOF is >= 0
       do im = 1, nkeep 
  -        if(zeof(iselect(1), im)<0)then
  -            zeof(:, im) = -zeof(:, im)
  -            if(present(pc) .and. zusetpc) pc(:, im) = -pc(:, im)
  -        endif
  +        if(zuseteof==1 .and. zeof(iselect2(1), im)<0)then
  +            zeof(iselect2, im) = -zeof(iselect2, im)
  +            if(zusetpc) pc(iselect, im) = -pc(iselect, im)
  +        else if(zeof(iselect(1), im)<0)then
  +            zeof(iselect, im) = -zeof(iselect, im)
  +        endif        
       enddo
  +    if(zuseteof==1)deallocate(iselect2)
   
          
       ! Sum of all eigenvalues (useful for percentils)
       ! ----------------------------------------------
  -    if(present(ev_sum)) ev_sum = sum(zev)
  +    if(present(ev_sum)) ev_sum = zevsums
   
       ! Free eof array
       ! --------------
  
positive.code:     ! EOF decomposition
      ! =================
  
      ! Covariance
      ! -----------
      allocate(nn(nc,nc))
      allocate(cov(nc,nc))
      cov = 0d0
  
negative.code:             zuseteof=0
          endif
      endif
      zusetpc = present(pc) .and. zuseteof==1 .and. (.not. present(notpc) .or. notpc==0)
      znkeepmax=100
      if(zuseteof==1)then
          nc = ntv
  