anchor.diff:       &         '  Refratio**2 is not equal to rr2'
            stop
         endif
  +
  +      call build_transform(transform_ptr,a)
  +
  +      m = 0
  +      do jj = 0,1
  +         do ii = 0,1
  +c           # Direction on coarse grid
  +            dc(1) = ii
  +            dc(2) = jj
  +
  +c           # Direction on fine grid (converted using metric). Divide
  +c           # by 2 (refratio) to scale length to unit vector
  +            df(1,m) = (a(1,1)*dc(1) + a(1,2)*dc(2))/2
  +            df(2,m) = (a(2,1)*dc(1) + a(2,2)*dc(2))/2
  +
  +c           # Map (0,1) to (-1/4,1/4) (locations of fine grid points)
  +            shiftx(m) = (ii-0.5d0)/2.d0
  +            shifty(m) = (jj-0.5d0)/2.d0
  +            m = m + 1
  +         enddo
  +      enddo
   
   
         mth = 5
  
positive.code:                   sr = (qcoarse(ic,jc+1,mq) - qc)
                    grady = compute_slopes(sl,sr,mth)
  
  c                 # This works for smooth grid mappings as well.
                    do m = 0,r2-1
                       shiftx =
       &                     (i2(m)-i2(0)- refratio/2.d0 + 0.5)/refratio
                       shifty =
       &                     (j2(m)-j2(0)- refratio/2.d0 + 0.5)/refratio
                       value = qc + shiftx*gradx + shifty*grady
                       qfine(i2(m),j2(m),mq) = value
                    enddo
                 endif
              enddo
  
negative.code:       double precision qcoarse(1-mbc:mx+mbc,1-mbc:my+mbc,meqn)
  
        integer mq,r2, m
        integer i, ic1, ic2, ibc, ifine,i1
        integer j, jc1, jc2, jbc, jfine,j1
        integer ic_add, jc_add, ic, jc, mth
        double precision gradx, grady, qc, sl, sr, value
        double precision compute_slopes
  
  c     # This should be refratio*refratio.
  