
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% 	private_210_ROUTINE
%
%
%  Ported to Matlab by Jason Lott
%  Jason Lott, University of Alabama at Birmingham
%  CONTACT: hoffa@uab.edu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


function a = private_210_ROUTINE(b)

global X
global XMAX
global XMIN
global DELTX
global DELMIN
global ERR
global FOBJ
global VEC
global DLX
global XS
global FSTORE
global DX
global SALVO
global XOSC
global FOSC
global ARG
global STCUT
global ACK
global FACUP
global RZERO
global XPLUS
global FSAVE
global FBEST
global XSAVE
global ABSDX
global FPREV
global DENOM
global DEL
global DXZ
global DXU
global DFZ
global DFU
global ABSVEC
global SUMV
global CINDER
global COXCOM
global COSIN
global STEPS
global J
global JFLAT
global JFLMIN
global JOCK
global JUMP
global JVARY
global JX
global K
global KERFEL
global KL
global KW
global MASK
global MATRX
global MINSOC
global MAXOSC
global MAXSTP
global NACK
global NACTIV
global NAH
global NCIRC
global NEQUAL
global NF
global NFLAT
global NFMAX
global NFSAV
global NGATE
global NGIANT
global NONZER
global NOREP
global NOSC
global NOUT
global NRETRY
global NSSW
global NSTEPS
global NT
global NTRACE
global NV
global NEXTRA
global NZIP
global NVMAX
global tag_380
global tag_390
global wtag
global tag
global continueflag
global T
global Y
global YSIG
global grandtag
global KFLAG
global DX
global XS
global DLX
global fortag
global KFLAGENCOUNTER



if (NZIP<=0 & NACK<=1) | (VEC(JX) == RZERO)
   
   FSTORE(JX) = FBEST;
   
   if NF>NFMAX
      
      KFLAG = -2
      %disp('ENTERING KFLAG from 210 1')
      %pause
      private_KFLAG_EXIT(KFLAG);
      
   end
   %disp('EXITING 210')%%%CONTINUE IN BIG FOR LOOP
else
   
   ABSVEC = VEC(JX);
   
   if ABSVEC<RZERO
      
      ABSVEC = -ABSVEC;
      
   end
   
   if ABSVEC<FACUP
      
     % disp('ENTERING 530 from 210 1')
     % pause
      private_530_ROUTINE(1)
      
   else
      
      DX(JX) = DX(JX)*ACK;
      VEC(JX) = VEC(JX)/ACK;
      tag = 1;
      
      if NOSC>0
         
         for J=1:NOSC
            
            ERR(JX,J) = ERR(JX,J)/ACK;
            
         end
         
      end
      
      if tag == 1 & NTRACE>=1
         
         disp('STEP SIZE '),disp(JX),disp(' INCREASED TO '),disp(DX(JX))
         
      end
      
      %disp('ENTERING 530 from 210 2')
      %pause
      private_530_ROUTINE(1);
      
   end
   
end
