anchor.diff:  !*    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
  
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:          IF(LMFDUDV) THEN
              DO 224 JL=1,KLON
              IF(PMFD(JL,JK).LT.0.) THEN
  				if (jk.eq.1) then !edg
  	                PUD(JL,JK)=0.5*(PUU(JL,JK)+PUEN(JL,JK))
  	                PVD(JL,JK)=0.5*(PVU(JL,JK)+PVEN(JL,JK))
  				else
  	               PUD(JL,JK)=0.5*(PUU(JL,JK)+PUEN(JL,JK-1))
  	               PVD(JL,JK)=0.5*(PVU(JL,JK)+PVEN(JL,JK-1))
  			   end if
              END IF
    224       CONTINUE
           END IF
  