c#######################################################################
c This is program SUNFLUX.FOR  written by Harold Geller
c
c This subroutine displays the solar flux from 1979 to 1991
c#######################################################################
        PROGRAM SUNFLUX

c       for plotting purposes I use a routine written by
c       Liam Gumley formerly of Curtin University of Technology
c       now with Research Data Systems Corp. of Greenbelt, MD

c       include definition file for logical*1 'init' variables
c       and integer*2 'color' variables

        include    'plot.fd'

c       make subscripted variables to hold various values for plotting

        real*4     xdata(4672), ydata(4672)

c       initialize things for the plot

        init graphics = .true.
        init border   = .true.
        init window   = .true.
        init axes     = .true.
        init fonts    = .true.
        plot method   = .true.
        title only    = .false.
        font height   = 10
        font width    = 5

c       set up colors for just black and white
c        so that printing can be performed more clearly
c         on my printer

        border color = 7
        window color = 0
        axis color   = 7
        label color  = 7
        plot color   = 7
        title color  = 7

c       set counter for number of points for plot.for

        number = 0

c       in this program I simply read in values from S0.DAT

        OPEN (2,File='S0.DAT')

        DO 10 i = 1,4672,1
           xdata(i)=i
           READ(2,999)ydata(i)
999        FORMAT(1F6.2)
        number = number + 1

10      continue

c       set up the plot limits

        xmin = 1.0
        xmax = 4672.0
        ymin = 1365.0
        ymax = 1375.0
        x tic space = 1000.0
        y tic space = 1.0

c       position this plot at the top left of the screen

        x bottom left = 0.0
        y bottom left = 0.0
        x top right   = 1.0
        y top right   = 1.0

c       give it a title

        title = 'Solar Flux from 1979 to 1991'
        x axis title = 'Day (number)'
        y axis title = 'Flux (watts/sq.m.)'

        call            plot( init graphics, init border, init window,
     &                  init axes, init fonts,
     &                  xdata, ydata, number, plot method,
     &                  invert x, invert y, xmin, xmax, ymin, ymax,
     &                  x tic space, y tic space,
     &                  x bottom left, y bottom left,
     &                  x top right, y top right,
     &                  border color, window color, axis color,
     &                  label color, plot color, title color,
     &                  x axis title, y axis title, title, title only,
     &                  font height, font width )

c       wait for user to hit return

        read(*,*)

        call endgraphics()

        STOP

        END

c######################################################################
c       END OF SUNFLUX
c######################################################################