pro replace_with_nans, x, val
  whr = where(x eq val, cnt)
  if cnt gt 0 then begin
    x[whr] = !VALUES.F_NAN
    message, 'nan count: ' + strtrim(cnt, 2), /conti
  endif 
end
% Compiled module: REPLACE_WITH_NANS.
% REPLACE_WITH_NANS: nan count: 1
      1.10000      2.10000     -3.30000      4.10000          nan      6.00000
