! Testplot_bad - contains error in function call to show purpose of modules
! Jim Crumley - 9/2003
! To compile this program you need to include the the module graph_ps:
!   gfortran graph_ps.o testplot_bad.f90 -o testplot_bad
! This *should* fail.

PROGRAM testplot

  USE graph_ps
                        ! define 8 pointed star
  TYPE (point) :: star(8)
  INTEGER :: i , j
  REAL :: theta
                        ! open file for output
  OPEN(graphics_unit,file = 'plot001.ps')
  WRITE(graphics_unit , *) '%!PS'
  WRITE(graphics_unit , *) 'gsave'

  DO i=1,8              ! define 8 points
     theta = (REAL(i)-0.5) * 3.14159 / 4.
     star(i)%x = 0.5 + 0.5*cos(theta)
     star(i)%y = 0.5 + 0.5*sin(theta)
  ENDDO
  
  ! intentionally calling circle with bad paramter list
  DO i=1,8
     CALL circle(star(i) , .05, 'bad parameter!')  
  ENDDO
  ! draw  lots  of  lines
  DO i=2,8
     DO j=1,i
        CALL  line(star(i) , star(j))
     ENDDO
  ENDDO

  WRITE(graphics_unit , *) 'showpage grestore'

END PROGRAM testplot


