      program trk
*
*  computes and writes out interpolated evolution track
*  call with 2 arguments: trk <M> <Z>
*  <M> = M/Msun, <Z> = Z
*
      implicit real*8 (a-h,l,m,o-z)
      common /trkdat/ qx(200,10), nk
      character cm*5, cz*6, gtype*3
      character fname*21, label(10)*8
cds   data label /'age','log Te','log L','log R', 'mass',
      data label /'age','log.Te','log.L','log.R', 'mass',
     &     ' M_V',' U-B',' B-V',' V-R',' V-I'/
*.....initialize input
      call getarg(1,cm)
      call getarg(2,cz)
cds   added
      write(6, 106) cm,cz
  106 format('#Track  Mass=',A5,' Z=',A6)
      read(cm,'(f5.2)') mass
      read(cz,'(f6.4)') z
      mlog = log10(mass)
      zlog = log10(z/0.02)
*.....read input data (synthetic colours; evolution grid)
      call rdubvi
cds   print*,'read UBVRI'
      call rdgrid(gtype)
cds   print*,'read GRID ',gtype
*.....open output file
      write(cm,'(f5.2)') mass
      if(mass.lt.10.0) cm(1:1) = '0'
      write(cz,'(f6.4)') z
      fname = 'M'//cm//'Z'//cz(3:6)//gtype
cds [Modified CDS: just write out the file name]
cds   open(1,file=fname)
*.....interpolate track
cds   print*,mlog,zlog
      call track(mlog,zlog)
cds   print*,nk,' points, written to file ',fname
cds   modified edition as:
      write(6, 107) nk, fname
  107 format('#',I6,' points for ',A21)
*.....write out results
cds   write(1,100) (label(j),j=1,10)
      write(6,100) (label(j),j=1,10)
      do k = 1, nk
cds      write(1,101) k, (qx(k,j),j=1,10)
         write(6,101) k, (qx(k,j),j=1,10)
      end do
cds   close(1)
 100  format('mod',11x,10a8)
 101  format(i3,1p,e17.9,0p,9f8.4)
      end
