anchor.diff:        implicit none
   
         integer mx,my,mbc,meqn,refratio,igrid,idir,iface_coarse
  -      integer p4est_refineFactor, maux
  +      integer p4est_refineFactor
         double precision qfine(1-mbc:mx+mbc,1-mbc:my+mbc,meqn)
         double precision qcoarse(1-mbc:mx+mbc,1-mbc:my+mbc,meqn)
         double precision areacoarse(-mbc:mx+mbc+1,-mbc:my+mbc+1)
  -      double precision   areafine(-mbc:mx+mbc+1,-mbc:my+mbc+1)
  -
  -      double precision sumfine, areaf, areac, qf
  -
  -      integer mq,r2
  +      double precision areafine(-mbc:mx+mbc+1,-mbc:my+mbc+1)
  +
  +      double precision sum, kf, kc, qf
  +
  +      integer mq
         integer i, ic_add, ibc, ii, ifine
         integer j, jc_add, jbc, jj, jfine
   
   c     # 'iface' is relative to the coarse grid
  -
  -      r2 = refratio*refratio
   
   c     # Average fine grid onto coarse grid
         do mq = 1,meqn
  
positive.code:       subroutine mb_interpolate_block_corner_ghost(mx,my,mbc,meqn,
       &      refratio, qcoarse, qfine, icorner_coarse, iblock)
        implicit none
        integer mx, my, mbc, meqn, icorner_coarse, iblock, refratio,maux
        double precision qcoarse(1-mbc:mx+mbc,1-mbc:my+mbc,meqn)
        double precision qfine(1-mbc:mx+mbc,1-mbc:my+mbc,meqn)
  
        integer mq, ibc, jbc, ii, jj, r2, ifine, jfine
        integer ic, jc, mth
        double precision gradx, grady, shiftx, shifty
        double precision sl, sr, qc, value, compute_slopes
  
negative.code:             ic_add = igrid*mx/p4est_refineFactor
              do i = 1,mx/p4est_refineFactor
                 do jbc = 1,mbc
                    sum = 0
                    do ii = 1,refratio
                       do jj = 1,refratio
                          ifine = (i-1)*refratio + ii
                          jfine = (jbc-1)*refratio + jj
                          if (iface_coarse .eq. 2) then
                             qf = qfine(ifine,jfine,mq)
                             kf = areafine(ifine,jfine)
                          else
                             qf = qfine(ifine,my+1-jfine,mq)
                             kf = areafine(ifine,my+1-jfine)
                          endif
                          sum = sum + kf*qf
                       enddo
                    enddo
                    if (iface_coarse .eq. 2) then
                       kc = areacoarse(i+ic_add,1-jbc)
                       qcoarse(i+ic_add,1-jbc,mq) = sum/kc
                    else
                       kc = areacoarse(i+ic_add,my+jbc)
                       qcoarse(i+ic_add,my+jbc,mq) = sum/kc
                    endif
                 enddo
              enddo
  