test03 Subroutine

public subroutine test03()

TEST03 plots parameter (X,Y,Z) data.

Arguments

None

Calls

proc~~test03~~CallsGraph proc~test03 test03 proc~pi pi proc~test03->proc~pi proc~run_gnuplot run_gnuplot proc~test03->proc~run_gnuplot proc~write_xyz_data write_xyz_data proc~test03->proc~write_xyz_data proc~write_xyz_plot write_xyz_plot proc~test03->proc~write_xyz_plot proc~get_unit get_unit proc~write_xyz_data->proc~get_unit proc~write_xyz_plot->proc~get_unit

Called by

proc~~test03~~CalledByGraph proc~test03 test03 program~test_gnufor test_gnufor program~test_gnufor->proc~test03

Source Code

subroutine test03
!
!*******************************************************************************
!
!! TEST03 plots parameter (X,Y,Z) data.
!
  implicit none
!
  integer, parameter :: n = 101
!
  character ( len = 100 ) :: command_file_name = 'tmp/test03_commands.txt'
  character ( len = 100 ) :: data_file_name = 'tmp/test03_data.txt'
  integer i
  integer ierror
  integer, parameter :: nturn = 5
  real, parameter :: r = 5.0E+00
  real theta
  real x(n)
  real y(n)
  real z(n)
  real, parameter :: zmax = 10.0E+00
!
  write ( *, '(a)' ) ' '
  write ( *, '(a)' ) 'TEST03'
  write ( *, '(a)' ) '  To plot a (parametric) set of (X,Y,Z) data,'
  write ( *, '(a)' ) '  WRITE_XYZ_DATA writes the data file,'
  write ( *, '(a)' ) '  WRITE_XYZ_PLOT writes the plot command file.'

  do i = 1, n

    z(i) = zmax * real ( i - 1 ) / real ( n - 1 )

    theta = ( 2.0E+00 * pi() ) * z(i) * real ( nturn ) / zmax

    x(i) = r * cos ( theta )
    y(i) = r * sin ( theta )

  end do

  call write_xyz_data ( data_file_name, n, x, y, z, ierror )

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

  call write_xyz_plot ( command_file_name, data_file_name, ierror )

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

  call run_gnuplot ( command_file_name )

  return
endsubroutine test03