anchor.diff:    100 CONTINUE
         DO 120 JK=KTOPM2,KLEV
         IK=JK-1
  +      IF(JK.EQ.1) IK=1 !edg
         DO 110 JL=1,KLON
         IF(LDCUM(JL)) THEN
           ZMFUU(JL,JK)=PMFU(JL,JK)*(PUU(JL,JK)-PUEN(JL,IK))
  
positive.code:          PMFUQ(JL,JK)=0.
           PMFDQ(JL,JK)=0.
           PMFUL(JL,JK)=0.
           PDMFUP(JL,JK-1)=0.
           PDMFDP(JL,JK-1)=0.
           PLUDE(JL,JK-1)=0.
        END IF
    115 CONTINUE
    120 CONTINUE
  
negative.code: !*    1.      CALCULATE ENTRAINMENT AND DETRAINMENT RATES
  ! -------------------------------------------------------
    100 CONTINUE
           if (kk.eq.0) write(*,*) "KK=0!" !edg
           DO 150 JL=1,KLON
            IF( .NOT. LDCUM(JL).AND.KLAB(JL,KK+1).EQ.0.0.AND.  &
               PQEN(JL,KK).GT.0.80*PQSEN(JL,KK)) THEN
  