anchor.diff:           endif
   
   c        # set maxima or minima if this is a new coarse step
  -         if (tc0.ge.tcfmax) then
  +c        if (tc0.ge.tcfmax) then
  +
  +c        # RJL: rewrote to set min/max every time a grid at level 1
  +c        # is about to be taken.  The previous code failed if there was more than one grid
  +c        # at level 1.   Note that all grids are up to date at start of step on level 1.
  +c        # New feature added at end of this routine to check more frequently if
  +c        # levelcheck > 0.
  +         if (level .eq. 1) then
            if (ioutsurfacemax(ng)+ioutarrivaltimes(ng).gt.0) then
              i0=i0fg2(ng)
            call fgridinterp(fgridoften(i0),xlowfg(ng),ylowfg(ng),
  
positive.code:      &    tc0,mfgridvars2(ng),q,nvar,mx,my,mbc,dx,dy,nvar,xlowmbc,
       &    ylowmbc,maux,aux,ioutarrivaltimes(ng),ioutsurfacemax(ng),1)
           endif
  
  
        endif
  
negative.code: c     # needed there.
  
        tcom = time
        
        level = node(nestlevel,mptr)
  
        if (dump) then
           write(*,*)" dumping grid ",mptr
  