anchor.diff:  			zuseteof=0
   		endif
   	endif
  +	if(zuseteof)then
  +			if(nkeep>znkeepmax)then
  +			print*,'[pca] You want to keep a number of PCs '//&
  +				&'greater than the number of EOF:',nt
  +			return
  +		end if
  +	else
  +		if(nkeep>znkeepmax)then
  +		print*,'[pca] You want to keep a number of PCs '//&
  +			&'greater than the number of EOF:',ns
  +		return
  +	end if
  +
   
   	! Remove the mean
   	! ---------------
  
positive.code: 
  	! External
  	! --------
  	real,    intent(in)                        :: ff(:,:)
  	integer, intent(in)	             :: nkeep
  	real,    intent(out),optional :: pc(size(ff,2),nkeep), xeof(size(ff,1),nkeep), ev(nkeep)
  	real,    intent(in),	optional              :: weights(:)
  	integer, intent(in),	optional              :: useteof
  
  	! Internal
  	! --------
  
negative.code: 
  	! External
  	! --------
  	real,   intent(in)           :: steof(:,:), stpc(:,:)
  	real,   intent(out)          :: ffrec(size(steof, 1)/nwindow,size(stpc, 1)+nwindow-1)
  	integer,intent(in)           :: nwindow
  	integer,intent(in), optional :: istart, iend
  
  	! Internal
  	! --------
  