

      subroutine linezpht(utkmx,htutkmx,l)
c
c Make line plots with ut on x-axis at selected zp and/or ht,
c at location l:
c
      include 'tigcmloc.h'
      dimension utkmx(ntms,kmx,nfplt,nloc),htutkmx(ntms,kmx,nloc)
      dimension vp(4),plt(ntms),xax(ntms)
      character*56 toplab
      character*80 rec80
      character*16 ylab
      data vp /0.17,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.)
c
c Set up x axis and do set call:
c
      do i=1,ntms
        xax(i) = utinc(i)
      enddo
      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 
c
c Loop for selected pressure/height:
c
      do 100 k=1,nzphtlin
        call clearstr(toplab)
        if (izphtlin(k).gt.0) then
          if (gloc(1,l).eq.gmflag.and.gloc(2,l).eq.gmflag) then
            write(toplab,"('GLOBAL MEANS  ZP=',f4.1)") zphtline(k)
          elseif (gloc(1,l).ne.gmflag.and.gloc(2,l).eq.gmflag) then
            write(toplab,"('LAT= ',f6.2,' LON=ZONAL MEANS  ZP=',f4.1)") 
     +        gloc(1,l),zphtline(k)
          else
            write(toplab,"('LAT,LON = ',f6.2,f7.2,' ZP=',f4.1)") 
     +        gloc(1,l),gloc(2,l),zphtline(k)
          endif
        else
          if (gloc(1,l).eq.gmflag.and.gloc(2,l).eq.gmflag) then
            write(toplab,"('GLOBAL MEANS  HT=',f5.1)") zphtline(k)
          elseif (gloc(1,l).ne.gmflag.and.gloc(2,l).eq.gmflag) then
            write(toplab,"('LAT= ',f6.2,' LON=ZONAL MEANS  HT=',f5.1)") 
     +        gloc(1,l),zphtline(k)
          else
            write(toplab,"('LAT,LON = ',f6.2,f7.2,' HT=',f5.1)") 
     +        gloc(1,l),gloc(2,l),zphtline(k)
          endif
        endif
        len = lenstr(toplab)
        call clearstr(rec80)
        write(rec80,"(a)") toplab(1:len)
c
c Field loop:
c
        do 200 ip=1,nftot
          if (ifplt(ip).le.0) goto 200
          if (k.gt.1.and.(ip.eq.ixfof2.or.ip.eq.ixhmf2)) goto 200
c
c At selected zp:
          if (izphtlin(k).gt.0) then
            plt(:) = utkmx(:,izphtlin(k),ifplt(ip),l)
c
c At selected ht:
c     dimension utkmx(ntms,kmx,nfplt,nloc),htutkmx(ntms,kmx,nloc)
c
          else
            call intloc(utkmx(1,1,ifplt(ip),l),htutkmx(1,1,l),kmx,
     +        zphtline(k),1,logterp(ip),plt,ntms,ntms,1,ier,cpspval,1)
          endif
          call clearstr(ylab)
          if (logloc.gt.0.and.logterp(ip).gt.0) then
            call log10f(plt,ntms,1.e-20,cpspval)
            write(ylab,"('LOG10 ',a)") labshort(ip)
          else
            write(ylab,"(a)") labshort(ip)
          endif
          call displa(2,1,1)
          call anotat('UT',ylab(1:lenstr(ylab)),0,lset,-1,l)
          call ezxy(xax,plt,ntms,toplab(1:len))
          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(flab(ip)(1:lenstr(flab(ip))),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,"('zphtline frame ',i4,' field ',a,' ',a)") iframe,
     +      ylab(1:lenstr(ylab)),toplab(1:len)
c
c End field loop:
 200    continue
c
c End k loop (selected zp/ht):
 100  continue
      return
      end
