anchor.diff:  
   C----------------------------------------------------------------------c
   
  -      SUBROUTINE gcmdln(ifile,ofile,time,nfile,tfile,cfile,getdep)
  +      SUBROUTINE gcmdln(ifile,sfile,tfile,zfile,cfile,nfile,time)
         IMPLICIT none
  -      CHARACTER*40 tag,ifile,ofile,nfile,tfile,cfile
  -      INTEGER narg,i,getdep
  +      CHARACTER*40 tag,ifile,sfile,tfile,zfile,cfile,nfile
  +      INTEGER narg,i
         REAL*8 time
         ifile = 'none'
  -      ofile = 'none'
  +      sfile = 'none'
  +      tfile = 'none'
  +      zfile = 'none'
  +      cfile = 'none'
         nfile = 'none'
  -      tfile = 'none'
  -      cfile = 'none'
         time = -1.0d0
  -      getdep = 0
         narg = iargc()
         if (narg.eq.0) then
             call usage('!! Error: no command line arguments specified')
  
positive.code:           inquire(file=ifile,EXIST=ex)
            if (.not.ex) call usage('!! Error: no input file: '//ifile)
        endif
        if (ofile.eq.'none') then
            write(*,*) '!! Error: No output file specified'
            call usage('!! Use -o SLPFILE to specify slip output file')
        endif
  
  C Read finite fault model, initiate output files
        call readffm(ifile,evlo,evla,evdp,str,dip,rak,dx,dy,slip,trup,
       1             hylo,hyla,nflt)
        open(unit=10,file=ofile,status='unknown')
        if (nfile.ne.'none') open(unit=11,file=nfile,status='unknown')
  
  C----
  C Write files in GMT readable format. If subfault has ruptured, include
  C slip so patch can be colored, otherwise leave out so patch will be
  C transparent.
  C----
        do 14 i = 1,nflt
            if (getdep.eq.1) then
                write(10,*) evlo(i),evla(i),evdp(i)*1.0d-3,str(i),
       1                    dx(i)*1.0d-3,dy(i)*dcos(d2r*dip(i))*1.0d-3
                goto 14
            endif
            if (time.le.0.0d0) then
                write(10,*) evlo(i),evla(i),slip(i),str(i),dx(i)*1.0d-3,
       1                    dy(i)*dcos(d2r*dip(i))*1.0d-3
            else
                if (trup(i).le.time) then
                    write(10,*) evlo(i),evla(i),slip(i),str(i),
       1                        dx(i)*1.0d-3,dy(i)*dcos(d2r*dip(i))*1.0d-3
                elseif (nfile.ne.'none') then
                    write(11,*) evlo(i),evla(i),str(i),dx(i)*1.0d-3,
       1                        dy(i)*dcos(d2r*dip(i))*1.0d-3
                endif
            endif
     14 continue
  
  C Print XYT file
        if (tfile.ne.'none') then
            open(unit=13,file=tfile,status='unknown')
            do 15 i = 1,nflt
                write(13,*) evlo(i),evla(i),trup(i)
     15     continue
        endif
  
  C Print quadrilateral outline of FFM
        if (cfile.ne.'none') then
            open(unit=14,file=cfile,status='unknown')
            do 16 i = 1,nflt
                if (i.eq.1) then
                    iL = i
                    iR = i
                    iB = i
                    iT = i
                    Lmx = evlo(i)
                    Rmx = evlo(i)
                    Bmx = evla(i)
                    Tmx = evla(i)
                else
                    if (evlo(i).lt.Lmx) then
                        Lmx = evlo(i)
                        iL = i
                    endif
                    if (evlo(i).gt.Rmx) then
                        Rmx = evlo(i)
                        iR = i
                    endif
                    if (evla(i).lt.Bmx) then
                        Bmx = evla(i)
                        iB = i
                    endif
                    if (evla(i).gt.Tmx) then
                        Tmx = evla(i)
                        iT = i
                    endif
                endif
     16     continue
            write(14,*) evlo(iL),evla(iL)
            write(14,*) evlo(iT),evla(iT)
            write(14,*) evlo(iR),evla(iR)
            write(14,*) evlo(iB),evla(iB)
            write(14,*) evlo(iL),evla(iL)
        endif
  
        END
  
  C======================================================================c
  
        SUBROUTINE readffm(ffmfile,evlo,evla,evdp,str,dip,rak,dx,dy,slip,
       1                   trup,hylo,hyla,nflt)
  
negative.code:           write(*,*)
        endif
        write(*,*)
       1 'Usage: ff2gmt -f FFMFILE -slip SLIPFILE|-time TIMEFILE',
       2                  '|-dep DEPFILE|-clip CLIPFILE'
        write(*,*)
       1 '              [-trup TIME] [-noslip NOSLIPFILE] [-h]'
        write(*,*)
        write(*,*)
       1 '-f FFMFILE         Finite fault model in standard subfault ',
       2                    'format'
        write(*,*)
       1 '-slip SLIPFILE     Slip value in 3rd column for use with ',
       2                    '"psxy -SJ -C<cptfile>"'
  C     1 '-o SLPFILE     File with slip patches for use with "psxy ',
  C     2                '-SJ -C<cptfile>"'
        write(*,*)
       1 '-time TIMEFILE     Rupture time in 3rd column for use with ',
       2                    '"psxy -SJ -C<cptfile>"'
  C     1 '-tf XYTFILE    Write lon lat trup to file'
        write(*,*)
       1 '-dep DEPFILE       Depth in 3rd column for use with ',
       2                    '"psxy -SJ -C<cptfile>"'
  C     1 '-z             Replace slip with depth (km) in third column'
        write(*,*)
       1 '-clip CLIPFILE     Write outline of FFM to a file'
        write(*,*)
       1 '-trup TIME         Only include subfaults that rupture before ',
       2                    'TIME'
  C     1 '-t TIME        Only include patches that rupture before TIME ',
  C     2                 '(default: include all subfaults)'
        write(*,*)
       1 '-noslip NSLPFILE   Write patches that slip after TIME for use ',
       2                    'with "psxy -SJ"'
  C     1 '-n NOSLPFILE   Write patches that slip after TIME for use ',
  C     2                'with "psxy -SJ"'
        write(*,*)
       1 '-h                 Online help (this screen)'
        STOP
        END
  