TEST05 plots Z(X,Y) grid data as a surface.
subroutine test05 ! !******************************************************************************* ! !! TEST05 plots Z(X,Y) grid data as a surface. ! implicit none ! integer, parameter :: nx = 21 integer, parameter :: ny = 21 !integer, parameter :: nrow = nx * ny ! character ( len = 100 ) :: command_file_name = 'tmp/test05_commands.txt' character ( len = 100 ) :: data_file_name = 'tmp/test05_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)' ) 'TEST05' write ( *, '(a)' ) ' To plot a gridded set of Z(X,Y) data as a surface,' write ( *, '(a)' ) ' WRITE_XYZGRID_DATA writes the data file,' write ( *, '(a)' ) ' WRITE_XYZGRID_SURFACE 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)' ) 'TEST05' write ( *, '(a,i6)' ) ' WRITE_XYZGRID_DATA returned IERROR = ', ierror end if call write_xyzgrid_surface ( command_file_name, data_file_name, ierror ) if ( ierror /= 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST05' write ( *, '(a,i6)' ) ' WRITE_XYZGRID_SURFACE returned IERROR = ', ierror end if call run_gnuplot ( command_file_name ) return endsubroutine test05