%N confmtcg %F $MIR/src/subs/cgpgsubs.for
%D Format contour levels
%P nebk
%: plotting
%B
      subroutine confmtcg (xpos, ypos, yinc, nlevs, srtlev, levs, slev,
     *                     write, nlines)

      integer nlevs, nlines, srtlev(nlevs)
      real levs(nlevs), slev, xpos, ypos, yinc
      logical write
  ---------------------------------------------------------------------
  Format contour levels and optionally write to viewport

  Input:
    xpos      c location to start writing contours levels
              in world coordinates
    yinc      Increment in w.c. to step down image for each
              line of contours
    nlevs     NUmber of contour levels
    srtlev    Array sorting levels into ascending order
    levs      Levels
    slev      Scale factor by which user given levels are scaled
              to make numbers in levs
    write     True if actually want to write levels to viewport
  Input/output
    ypos      y location at which to write levels on viewport in
              world coordiantes.  On exit is location for next
              line of text
  Output:
    nlines    Number of lines needed to write all levels
