function test_pgma_write ( file_name )

%*****************************************************************************80
%
%% test_pgma_write() tests pgma_write().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 May 2017
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    character FILE_NAME, the name of the output file.
%
  comment = 'Data set by TEST_PGMA_WRITE.'

  width = 300;
  height = 300;
%
%  Set the data.
%
  g = pgma_example ( height, width );
%
%  Easiest to let MAXVAL be the maximum data entry.
%
  maxval = max ( max ( g ) );
%
%  Write the data to the file.
%
  pgma_write ( file_name, comment, width, height, maxval, g );

  return
end

