

      subroutine pltdop(l)
c
c Make line plots of doppler fields with ut on x-axis at location l:
c (adopted from linezpht)
c
      include 'tigcmloc.h'
      include 'doppler.h'
      dimension vp(4),plt(ntms)
      character*56 toplab,ylab
      character*80 rec80
      data vp /0.14,0.95,0.20,0.90/
c
c Set up AG:
c
      call agsetf('DASH/PATTERNS/1.',65535.)
      call agsetc ('LABEL/NAME.','T')
      call agsetr("AXIS/TOP/CONTROL.",-1.)
      call agseti ('LINE/NUMBER.', 100)
      call agsetf ('LINE/CHARACTER.', .025)
      call agsetc("LABEL/NAME.","B")
      call agsetr("LABEL/DEF/SUPPRESSION.",1.)
      call agsetr("AXIS/BOT/CONTROL.",-1.)
      call set(vp(1),vp(2),vp(3),vp(4),0.,1.,0.,1.,1)
c
c lset=2 -> AG will use only fractional from set call
      lset = 2 
      call clearstr(toplab)
      if (gloc(1,l).eq.gmflag.or.gloc(2,l).eq.gmflag) then
        write(6,"('pltdop: zonal or global means of doppler fields',
     +    ' not available')")
        return
      endif
      if (locname(1).eq.'xxxxxxxxxxxxxxxx') then
        write(toplab,"('LAT,LON = ',f6.2,', ',f7.2)") 
     +    gloc(1,l),gloc(2,l)
      else
        write(toplab,"('LAT,LON = ',f6.2,', ',f7.2,' (',a,')')") 
     +    gloc(1,l),gloc(2,l),locname(l)(1:lenstr(locname(l)))
      endif
      len = lenstr(toplab)
      call clearstr(rec80)
      write(rec80,"(a)") toplab(1:len)
c
c Field loop (doptn,un,vn,ray):
      do ip=1,4
        do i=1,ntms
          plt(i) = dop(i,l,ip)
        enddo
        call clearstr(ylab)
        lenf = lenstr(dopname(ip))
        if (log10dop(ip).le.0) then
          write(ylab,"(a)") dopname(ip)(1:lenf)
        else
          write(ylab,"('LOG10 ',a)") dopname(ip)(1:lenf)
          call log10f(plt,ntms,1.e-20,cpspval)
        endif
        leny = lenstr(ylab)
        call displa(2,1,1)
        call anotat('UT',ylab(1:leny),0,lset,-1,l)
        call ezxy(utinc,plt,ntms,toplab(1:len))
        call fminmax(plt,ntms,rmin,rmax,cpspval)
        if (rmin.lt.0..and.rmax.gt.0.) 
     +    call line(utinc(1),0.,utinc(ntms),0.)
        isltax = 0
        if (gloc(1,l).ne.gmflag.and.gloc(2,l).ne.gmflag) isltax=1
        call labutxy(mtimes,ntms,0.,0,' ',0.,1,gloc(2,l))
        call wrlab(ylab(1:leny),0.5*(vp(1)+vp(2)),vp(4)+.07,0.)
        call frame
        iframe = iframe+1
        if (iwrascii.gt.0) then
          call wrascii(iwrascii,luascii,plt,ntms,1,utinc,dum,
     +      'UT (HRS)',' ',histvol(ivol),ylab,iframe,rec80,
     +      'tigcmloc',dirascii)
        endif
        write(6,"('pltdop frame ',i4,' field ',a,' ',a)") iframe,
     +    ylab(1:leny),toplab(1:len)
c
c End field loop:
      enddo
      return
      end
