function array_stats(A);

% ARRAY_STATS:  print statistics for given array.
%
% This function computes and prints several statistics for given
% array.
%
% On Input:
%
%    A           Array to diagnose.
%

disp(' ');

if (length(size(A)) == 2),
  Amin=min(min(A));
  Amax=max(max(A));
  disp(['  Min = ', sprintf('%21.14e', Amin), ...
	', Max = ', sprintf('%21.14e', Amax)])
elseif (length(size(A)) == 3),
  Amin=min(min(A));
  Amax=max(max(A));
  for k=1:size(A,3)
    disp(['   k = ', sprintf('%3i', k), ...
         ',  Min = ', sprintf('%21.14e', Amin(k)), ...
	 ',  Max = ', sprintf('%21.14e', Amax(k))])
  end,
elseif (length(size(A)) == 4),
  for rec=1:size(A,4),
    for k=1:size(A,3)
      Amin=min(min(A(:,:,k,rec)));
      Amax=max(max(A(:,:,k,rec)));
      disp(['   rec = ', sprintf('%3i', rec), ...
  	    ',  k = ', sprintf('%3i', k), ...
            ',  Min = ', sprintf('%21.14e', Amin), ...
	    ',  Max = ', sprintf('%21.14e', Amax)])
    end,
    disp(' ');
  end,
end,
disp(' ');
 
return
 
