test01 Subroutine

public subroutine test01()

TEST01 demonstrates the plotting of Y(X) data.

Arguments

None

Calls

proc~~test01~~CallsGraph proc~test01 test01 proc~run_gnuplot run_gnuplot proc~test01->proc~run_gnuplot proc~write_xy_data write_xy_data proc~test01->proc~write_xy_data proc~write_xy_plot write_xy_plot proc~test01->proc~write_xy_plot proc~get_unit get_unit proc~write_xy_data->proc~get_unit proc~write_xy_plot->proc~get_unit

Called by

proc~~test01~~CalledByGraph proc~test01 test01 program~test_gnufor test_gnufor program~test_gnufor->proc~test01

Source Code

subroutine test01
!
!*******************************************************************************
!
!! TEST01 demonstrates the plotting of Y(X) data.
!
  implicit none
!
  integer, parameter :: n = 101
!
  !real angle
  !real area
  character ( len = 100 ) :: command_file_name = 'tmp/test01_commands.txt'
  character ( len = 100 ) :: data_file_name = 'tmp/test01_data.txt'
  integer i
  integer ierror
  real x(n)
  real, parameter :: xmin = 0.0+00
  real, parameter :: xmax = 20.0E+00
  real y(n)
!
  write ( *, '(a)' ) ' '
  write ( *, '(a)' ) 'TEST01'
  write ( *, '(a)' ) '  To plot a simple set of (X,Y) data,'
  write ( *, '(a)' ) '  WRITE_XY_DATA writes the data file,'
  write ( *, '(a)' ) '  WRITE_XY_PLOT writes the plot command file.'

  do i = 1, n
    x(i) = ( real ( n - i ) * xmin + real ( i - 1 ) * xmax ) / real ( n - 1 )
    y(i) = sin ( x(i) ) * sin ( 4.0 * x(i) )
  end do

  call write_xy_data ( data_file_name, n, x, y, ierror )

  if ( ierror /= 0 ) then
    write ( *, '(a)' ) ' '
    write ( *, '(a)' ) 'TEST01'
    write ( *, '(a,i6)' ) '  WRITE_XY_DATA returned IERROR = ', ierror
  end if

  call write_xy_plot ( command_file_name, data_file_name, .true., ierror, '*' )

  if ( ierror /= 0 ) then
    write ( *, '(a)' ) ' '
    write ( *, '(a)' ) 'TEST01'
    write ( *, '(a,i6)' ) '  WRITE_XY_PLOT returned IERROR = ', ierror
  end if

  call run_gnuplot ( command_file_name )

  return
endsubroutine test01