function [f_out]=interp_z_simple(f_in,rc0,rc1,flag_nan_zero)
%---------
%function [f_out]=interp_z_simple(f_in,rc0,rc1,flag_nan_zero)
%
% Input: f_in : size [nx ny nz]
%        rc0  : size [1 nz] 
%        rc1  : size [1 nz1]
%        flag_nan_zero:
%             1(0) = interp excluding(including) points of values 0
%
% Output:
%        f_out: size [nx ny nz1]
%
% atn 09.Mar.2018
%----------

[wei,ind]=get_z_weight(rc1,rc0,1);

sz=size(f_in);
f_out=nan(sz(1),sz(2),length(rc1));

if(flag_nan_zero);
  f_in(find(f_in==0))=nan;
end;

for iz=1:length(rc1);
  f_out(:,:,iz)=wei(iz,1).*f_in(:,:,ind(iz,1))+wei(iz,2).*f_in(:,:,ind(iz,2));
end;

if(flag_nan_zero);
  f_out(isnan(f_out))=0;
end;

return
