function d_out = ridfill_nan(d_in)
%ridfill_nan - searches for fill values and replaces with NaN's
%
%Soupy Alexander, 12/15/01; Based on ridfill.m by Ben Guitterez

d_out = d_in;

%CHECK FOR FILL VALUE PROBLEMS
	badu_a = find(d_out > 100000);
	if ~isempty(badu_a),
   
	 	d_out(badu_a) = NaN;
   
	else
 %  	fprintf('No fill values!\n')
   end
   
	badu_b = find(d_out < -100000);
	if ~isempty(badu_b),
   
	 	d_out(badu_b) = NaN;
   
	else
%   	fprintf('No fill values!\n')
	end
	  
