anchor.diff:        REAL*8 dy1,dy2,ndy
         COMMON /DVARS/ yr1,mo1,yr2,mo2,dy1,dy2,ndy
         REAL*8 jd1,jd2,hr,mn,sc
  +      REAL*8 dyr,dmo,ddy
         call date2jd(jd1,yr1,mo1,dy1)
  -      if (opt.eq.1) then
  +      if (opt.eq.1.or.opt.eq.3) then
             call date2jd(jd2,yr2,mo2,dy2)
             ndy = jd2 - jd1
  -          write(ans,9997) ndy
  +          if (ndy.lt.30.0d0) then
  +              dyr = yr2-yr1
  +              dmo = mo2-mo1
  +              ddy = dy2-dy1
  +          endif
  +          if (opt.eq.1) then
  +              write(ans,9997) ndy
  +          elseif (opt.eq.3) then
  +              write(ans,9997) ndy*24.0d0*3600.0d0
  +          endif
         else
             jd2 = jd1 + ndy
             call jd2date(yr2,mo2,dy2,jd2)
  
positive.code:               write(ans,9999) yr2,mo2,dy2,hr,mn,sc
            endif
        endif
   9997 format(F20.8)
   9998 format(I6,I4,1F6.1)
   9999 format(I6,I4,4F6.1)
        RETURN
  
negative.code:               read(arg2,*) ndy
            endif
        elseif (ifmt.eq.2) then
            if (long.eq.0.and.opt.eq.1.or.opt.eq.3) then
                read(arg,*) yr1,mo1,dy1,yr2,mo2,dy2
            elseif (long.eq.0.and.opt.eq.2) then
                read(arg,*) yr1,mo1,dy1,ndy
            elseif (long.eq.1.and.opt.eq.1.or.opt.eq.3) then
                read(arg,*,end=2001) yr1,mo1,dy1,hr1,mn1,sc1,
       1                             yr2,mo2,dy2,hr2,mn2,sc2
            elseif (long.eq.1.and.opt.eq.2) then
  