anchor.diff:        integer rr2
         parameter(rr2 = 4)
         integer i2(0:rr2-1),j2(0:rr2-1)
  +
  +      double precision af_sum
   
         r2 = refratio*refratio
         if (r2 .ne. rr2) then
  
positive.code:      &               transform_cptr)
                 if (is_manifold) then
                    sum = 0
                    do m = 0,r2-1
                       qf = qfine(i2(m),j2(m),mq)
                       kf = areafine(i2(m),j2(m))
                       sum = sum + kf*qf
                    enddo
                    kc = areacoarse(i1,j1)
                    qcoarse(i1,j1,mq) = sum/kc
                 else
                    sum = 0
                    do m = 0,r2-1
  
negative.code:                   if (.not. skip_this_grid) then
                       if (is_manifold) then
                          sum = 0
                          af_sum = 0
                          do m = 0,r2-1
                             qf = qfine(i2(m),j2(m),mq)
                             kf = areafine(i2(m),j2(m))
                             sum = sum + qf*kf
                             af_sum = af_sum + kf
                          enddo
                          kc = areacoarse(ic,jc)
  c                        qcoarse(ic,jc,mq) = sum/kc
                          qcoarse(ic,jc,mq) = sum/af_sum
                       else
                          sum = 0
                          do m = 0,r2-1
  