anchor.diff:      znkeepmax=100
       if(zuseteof==1)then
           nc = ntv
  -        ncf = nt
  -        no = ns
  -        nsv = ns
  +        no = nsv
           trflag = 'T'
           odim = 1
           cdim = 2
       else ! classic
           nc = nsv
  -        ncf = ns
  -        no = nt
  -        ntv = nt
  +        no = ntv
           trflag = 'N'
           odim = 2
           cdim = 1
  
positive.code:         endif
          return
      end if
  
      ! What does the user want?
      ! ------------------------
      if(.not.present(xeof).and..not.present(pc)&
        &.and..not.present(ev))then
          if(present(errmsg))&
  
negative.code:     ! Valid data in 2D space
      ! ----------------------
      
      ! Valid in the 2D space
      allocate(valid(ns, nt))
      if(present(zerofill).and.zerofill==1)then
          valid = 1
      else
          valid = merge(0, 1, abs((var-zmv)*zdmv)<=mvtol*100)
      endif
      if(all(valid==0))then
          if(present(errmsg))&
              & errmsg = sl_errmsg(ierr_warning, 'pca', 'All data are masked. Quit.')
          return
      endif
  
      ! Selections
      nsv = count( any(valid==1, dim=2) )
      ntv = count( any(valid==1, dim=1) )
      allocate(iselects(nsv),iselectt(ntv))
      iselects = pack((/(i,i=1,ns)/), any(valid==1, dim=2))
      iselectt = pack((/(i,i=1,nt)/), any(valid==1, dim=1))
      
      ! By default, T-EOF decompostion if nsv > ntv
      ! -------------------------------------------
      zuseteof = -1
      if(present(useteof))zuseteof = useteof
      if(zuseteof<0)then     
          if(nsv>ntv)then
              zuseteof=1
  