anchor.diff:        integer i2(0:rr2-1),j2(0:rr2-1)
         double precision kc
   
  +      integer blockno, get_block
  +
         logical is_valid_average, skip_this_grid
  +      double precision af_sum, qv(0:rr2-1)
  +
  +      blockno = get_block()
   
         is_manifold = manifold .eq. 1
   
  
positive.code:                   if (.not. skip_this_grid) then
                       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 + qf*kf
                          enddo
                          kc = areacoarse(ic,jc)
                          qcoarse(ic,jc,mq) = sum/kc
                       else
                          sum = 0
                          do m = 0,r2-1
  
negative.code:       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
  