anchor.diff:              dotl = dotr
               dotr = 0.d0
               do 5 m=1,meqn
  -               wnorm2 = wnorm2 + wave(m,mw,i)**2
  -               dotr = dotr + wave(m,mw,i)*wave(m,mw,i+1)
  +               wnorm2 = wnorm2 + wave(i,m,mw)**2
  +               dotr = dotr + wave(i,m,mw)*wave(i+1,m,mw)
       5          continue
  -            if (i.eq.0) go to 190
  -            if (wnorm2.eq.0.d0) go to 190
  +            if (i .eq. 0) go to 190
  +            if (wnorm2 .eq. 0.d0) go to 190
   c
  -            if (s(mw,i) .gt. 0.d0) then
  +            if (s(i,mw) .gt. 0.d0) then
                   r = dotl / wnorm2
                 else
                   r = dotr / wnorm2
  
positive.code: c           # apply limiter to waves:
  c
              do 180 m=1,meqn
                 wave(m,mw,i) = wlimitr * wave(m,mw,i)
    180          continue
  
    190       continue
  
negative.code: c
        implicit double precision (a-h,o-z)
        dimension mthlim(mwaves)
        dimension wave(1-mbc:maxm+mbc,meqn,mwaves)
        dimension    s(1-mbc:maxm+mbc,mwaves)
  c
  c
        do 200 mw=1,mwaves
  