test06 Subroutine

public subroutine test06()

TEST06 plots Z(X,Y) grid data as contours.

Arguments

None

Calls

proc~~test06~~CallsGraph proc~test06 test06 proc~run_gnuplot run_gnuplot proc~test06->proc~run_gnuplot proc~write_xyzgrid_contour write_xyzgrid_contour proc~test06->proc~write_xyzgrid_contour proc~write_xyzgrid_data write_xyzgrid_data proc~test06->proc~write_xyzgrid_data proc~get_unit get_unit proc~write_xyzgrid_contour->proc~get_unit proc~write_xyzgrid_data->proc~get_unit

Called by

proc~~test06~~CalledByGraph proc~test06 test06 program~test_gnufor test_gnufor program~test_gnufor->proc~test06

Source Code

subroutine test06
!
!*******************************************************************************
!
!! TEST06 plots Z(X,Y) grid data as contours.
!
  implicit none
!
  integer, parameter :: nx = 41
  integer, parameter :: ny = 41
!
  character ( len = 100 ) :: command_file_name = 'tmp/test06_commands.txt'
  character ( len = 100 ) :: data_file_name = 'tmp/test06_data.txt'
  integer i
  integer ierror
  integer j
  real x
  real, parameter :: xmax = 1.0E+00
  real, parameter :: xmin = 0.0E+00
  real xyz(3,nx,ny)
  real y
  real, parameter :: ymax = 1.0E+00
  real, parameter :: ymin = 0.0E+00
  real z
!
  write ( *, '(a)' ) ' '
  write ( *, '(a)' ) 'TEST06'
  write ( *, '(a)' ) '  To plot gridded Z(X,Y) data as contours,'
  write ( *, '(a)' ) '  WRITE_XYZGRID_DATA writes the data file,'
  write ( *, '(a)' ) '  WRITE_XYZGRID_CONTOUR writes the plot command file.'

  do i = 1, nx

    x = ( real ( nx - i ) * xmin + real ( i - 1 ) * xmax ) / real ( nx - 1 )

    do j = 1, ny

      y = ( real ( ny - j ) * ymin + real ( j - 1 ) * ymax ) / real ( ny - 1 )

      z = sin ( 64.0E+00 * ( x - 0.5E+00 )**2 * ( y - 0.5E+00 )**2 )

      xyz(1,i,j) = x
      xyz(2,i,j) = y
      xyz(3,i,j) = z

    end do

  end do

  call write_xyzgrid_data ( data_file_name, nx, ny, xyz, ierror )

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

  call write_xyzgrid_contour ( command_file_name, data_file_name, ierror )

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

  call run_gnuplot ( command_file_name )

  return
endsubroutine test06