anchor.diff:  	!INITIALIZATION 
       
       IF(ISEXCA2D/=0) THEN
  -        CALL GenElement_EXCA2()
  -        solver_control.bfgm=continuum
           !CHECKDATA
  -        DO I=1,NSOILPROFILE
  +         DO I=1,NSOILPROFILE
  +            
  +            ar1=-9.99999D20
   		    do j=1,soilprofile(i).nasoil
   			    IF(KPOINT(NDIMENSION,soilprofile(i).asoil(j).z(1))<KPOINT(NDIMENSION,soilprofile(i).asoil(j).z(2))) THEN
                       PRINT *, "Z1 IS SMALLER THAN Z2.PLEASE CKECK. SOILPROFILE=, ACTIVE SIDE SOILLAYER=",I,J
                       STOP
                   ENDIF
  -		    enddo
  +                DO K=1,NSTEP
  +                    IF(ABS(SF(soilprofile(i).asoil(j).SF).FACTOR(K))>1E-6) THEN
  +                        IF(AR1(K)/=-9.99999D20)THEN
  +                            IF(ABS(AR1(K)-KPOINT(NDIMENSION,soilprofile(i).asoil(j).Z(1)))<1E-6) THEN
  +                                AR1(K)=KPOINT(NDIMENSION,soilprofile(i).asoil(j).Z(2))
  +                            ELSE
  +                                PRINT *, "THE ELEVATIONS ARE NOT CONTINUOUS BETWEEN ASOIL LAYER J-1 AND J IN STEP K,OF SOILPROFILE I. (J-1,J,K,I)=", J-1,J,K,I
  +                                STOP "INPUT ERROR IN SOILPROFILE1."
  +                            ENDIF                            
  +                        ELSE
  +                            AR1(K)=KPOINT(NDIMENSION,soilprofile(i).asoil(j).Z(2))
  +                        ENDIF                        
  +                    ENDIF                    
  +                ENDDO
  +                               
  +            enddo
  +            
  +            ar1=-9.99999D20
   		    do j=1,soilprofile(i).npsoil
                  IF(KPOINT(NDIMENSION,soilprofile(i).Psoil(j).z(1))<KPOINT(NDIMENSION,soilprofile(i).Psoil(j).z(2))) THEN
                       PRINT *, "Z1 IS SMALLER THAN Z2.PLEASE CHECK. SOILPROFILE=, PASSIVE SIDE SOILLAYER=",I,J
                       STOP
  -                ENDIF
  +               ENDIF
  +               DO K=1,NSTEP
  +                    IF(ABS(SF(soilprofile(i).Psoil(j).SF).FACTOR(K))>1E-6) THEN
  +                        IF(AR1(K)/=-9.99999D20)THEN
  +                            IF(ABS(AR1(K)-KPOINT(NDIMENSION,soilprofile(i).Psoil(j).Z(1)))<1E-6) THEN
  +                                AR1(K)=KPOINT(NDIMENSION,soilprofile(i).Psoil(j).Z(2))
  +                            ELSE
  +                                PRINT *, "THE ELEVATIONS ARE NOT CONTINUOUS BETWEEN PSOIL LAYER J-1 AND J IN STEP K,OF SOILPROFILE I. (J-1,J,K,I)=", J-1,J,K,I
  +                                STOP "INPUT ERROR IN SOILPROFILE2."
  +                            ENDIF                            
  +                        ELSE
  +                            AR1(K)=KPOINT(NDIMENSION,soilprofile(i).Psoil(j).Z(2))
  +                        ENDIF                        
  +                    ENDIF                    
  +                ENDDO
  +               
               enddo 
               
           ENDDO
  +        
  +        CALL GenElement_EXCA2()
  +        solver_control.bfgm=continuum
  +        
           msg=INSERTMENUQQ (5, 0, $MENUENABLED, 'GraphSetting'c,NUL)
   		msg=INSERTMENUQQ (5, 1, $MENUENABLED, 'Gray'c, SetLineColor)
   		msg=INSERTMENUQQ (5, 2, $MENUENABLED, 'NoMarker'c, Marker)
  
positive.code: 
  
   subroutine readin(itype)
  	use SOLVERLIB
      use ds_hyjump
  
negative.code: 	CHARACTER(1024)      ext
  	type(qwinfo) winfo
  	integer(4)::length,msg
      real(DPN)::AR1(100)
  	type(bc_tydef),allocatable::bf1(:),bf2(:)
      EXTERNAL::SetLineColor,Marker,LineStyle,SETBGCOLOR
      
  