README.1dplot (public distribution)
-----------------------------------

This library (1dplot) can either be appended in its entirety to any FORTRAN77
program then compiled as a unit, or compiled separately as an external library
and linked with the desired program in the compile statement.  In either case, it is about as simple a self-contained module for generating publication-
quality postscript graphics as one will find, and is based on my own graphics
library grfx03 (as of 5/19) and the late Kevin Kohlers PSPLOT graphics
library.  Programs using this library should call subroutines grfxopn, hdrftr,
grfx1d, and grfxcls with argument lists as described in the headers of these
routines when 1-D plots are desired.

The only compiler-specific call in this library is in subroutine timedate where
the gfortran-specific internal function date_and_time is called, which fetches
the current date and time.  Other compilers such as Intel's IFORT and Sun's F90
also use date_and_time in the same way; others may not.  In the case of the latter, the user will either have to comment out these calls and forgo this
functionality (entirely aesthetic; writes the date and time in the footer of
the plot), or find the equivalent on their own compiler and make the
appropriate changes.

Following is an example of a FORTRAN77 subroutine using the four 1dplot
routines to generate a four-frame plot:

c=======================================================================
c
       subroutine plotit ( x, y1, y2, y3, y4, npts, phdr, filename )
c
c    written by: David Clarke
c    date      : May, 2019
c    modified 1: 
c
c  PURPOSE:  This routine uses the graphics library 1dplot to plot y1, 
c  y2, y3, and y4 vs. x in four separate frames (arranged 2 x 2) on a 
c  single page, printing the results in file "filename".
c
c  INPUT VARIABLES:
c    x           abscissa against which all variables are plotted
c    y1--y4      four dependent variables to be plotted
c    npts        total number of points in each plot
c    phdr        title for graph (blank => no title)
c    filename    name of file written to disc for plots
c
c  OUTPUT VARIABLES:
c
c  EXTERNALS:
c    GRFXOPN
c    HDRFTR
c    GRFX1D
c    GRFXCLS
c
c-----------------------------------------------------------------------
c
       implicit      none
c
       character*(*) phdr    , filename
       character*64  xlab    , ylab    
       integer       npts    
c
       real          x       (npts), y1      (npts), y2      (npts)
     1             , y3      (npts), y4      (npts)
c
       external      grfxopn , hdrftr  , grfx1d  , grfxcls
c
c-----------------------------------------------------------------------
c
c      Open graphics file.
c
       call grfxopn ( filename )
c
c      Write header, footer, and x-axis label.  phdr, xlab, and ylab are
c  type-set in "NCAR mark-up language".  See subroutine pschars for the
c  syntax.
c
       call hdrftr ( phdr, 1, filename )
       xlab = '|F10|x'
c
c      Plot y1.
c
       ylab = '|F10|y|BF0|1'
       call grfx1d ( x, y1, 0, 1, npts, 1, 1, 0.0, 0.0, 0.0, 0.0, 2, 0.9
     1             , 1, 2, 2, 1, 2, 1, xlab, ylab )
c
c      Plot y2.
c
       ylab = '|F10|y|BF0|2'
       call grfx1d ( x, y2, 0, 1, npts, 1, 1, 0.0, 0.0, 0.0, 0.0, 2, 0.9     
     1             , 1, 2, 2, 2, 2, 1, xlab, ylab )
c
c      Plot y3.
c
       ylab = '|F10|y|BF0|3'
       call grfx1d ( x, y3, 0, 1, npts, 1, 1, 0.0, 0.0, 0.0, 0.0, 2, 0.9
     1             , 1, 2, 2, 1, 2, 2, xlab, ylab )
c
c      Plot y4.
c
       ylab = '|F10|y|BF0|4'
       call grfx1d ( x, y4, 0, 1, npts, 1, 1, 0.0, 0.0, 0.0, 0.0, 2, 0.9
     1             , 1, 2, 2, 2, 2, 2, xlab, ylab )
c
c      Close graphics file.
c
       call grfxcls
       write ( 6, 2010 ) filename
c
c------FORMAT STATEMENTS------------------------------------------------
c
2010   format('PLOTIT  : File ',a,' written to disc.')
c
       return
       end
c
c=======================================================================


DAC, May 2019
