function [] = climate_IRF(param_name,param_vals,ee,yvar,SSdev)
%CLIMATE_IRF Summary of this function goes here
%   Detailed explanation goes here
    global M_ oo_ options_;

    if nargin < 5
       SSdev = 0;
    end
    if ~options_.irf
        options_.irf = 55;
    end
    
    idp = strmatch(param_name,M_.param_names,'exact');
    M = M_;
    M.params(idp) = param_vals(1);
    [dr,~,M,oo] = resol(0,M,options_,oo_);
    y0            = simult_(M,options_,oo.dr.ys,dr,ee,1)';
    ss0           = oo.dr.ys;
    M.params(idp) = param_vals(2);
    [dr,~,M,oo] = resol(0,M,options_,oo_);
    y1            = simult_(M,options_,oo.dr.ys,dr,ee,1)';
    M.params(idp) = param_vals(3);
    [dr,~,M,oo] = resol(0,M,options_,oo_);
    y2            = simult_(M,options_,oo.dr.ys,dr,ee,1)';
    
    idtot = [];
    idSTART = find(sum(ee,2)~=0);
    idSTART = idSTART(1);
    Tid=1:25;
    T  = Tid' - idSTART;
    figure('NumberTitle', 'off', 'Name', ['Sensitivity of ' param_name]);
    for i1 = 1:size(yvar,1)
        subplot(2,4,i1)
            idx = strmatch(deblank(yvar(i1,:)),M_.endo_names,'exact');
            idtot = [idtot idx];
            
            if SSdev && ss0(idx) ~= 0
   
                y0(:,idx) = (y0(:,idx)/ss0(idx)-1)*100;
                y1(:,idx) = (y1(:,idx)/ss0(idx)-1)*100;
                y2(:,idx) = (y2(:,idx)/ss0(idx)-1)*100;
            end
            plot(T,y0(Tid,idx),'b',T,y1(Tid,idx),'gx',T,y2(Tid,idx),'ro',T,y2(Tid,idx),'r')
            title(yvar(i1,:))
            xlim([min(T) max(T)])
            ylim([min([y0(Tid,idx) ; y1(Tid,idx) ; y2(Tid,idx)]) ...
            max([y0(Tid,idx) ; y1(Tid,idx) ; y2(Tid,idx)])])
    end
    legend([param_name ' = ' num2str(param_vals(1))],[param_name ' = ' num2str(param_vals(2))],[param_name ' = ' num2str(param_vals(3))])
%    matrix_to_txt(  [T y0(Tid,idtot)],...
%                    ['IRF_' param_name num2str(0) '.txt'],char('Time',yvar))
%    matrix_to_txt(  [T y1(Tid,idtot)],...
%                    ['IRF_' param_name num2str(1) '.txt'],char('Time',yvar))
%    matrix_to_txt(  [T y2(Tid,idtot)],...
%                    ['IRF_' param_name num2str(2) '.txt'],char('Time',yvar))
    

end

