lagged_feedback_strengths_wrapper.m 2.15 KB
Newer Older
Claas Faber's avatar
Claas Faber committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                 %
%    STRENGTH OF LAGGED BJERKNES FEEDBACK ELEMENTS                %
%    VARIABLE ANALYSIS TYPE: ACC, REGRESSION, ROBUST REGRESSION   %
%    WRAPPER                                                      %
%                                                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

addpath('<path where the functions are stored>');

clear all;
close all;
clc;

% -------- %
% SETTINGS %
% -------- %

    % feedback variables
    all_reference_names = {'ssh','sst','ustr'};
    all_lag_names       = {'sst','ustr','ssh'};

    % associated datasets?
    all_data = struct('sst', 'ersst',...
                      'ssh', 'aviso',...
                      'ustr','era_sfcstress');

    % which basin should be analysed?
    all_basins = {'Pacific','Atlantic'};

    % time constraints
    start_year = 1993;
    stop_year  = 2012;

    % which type of analysis should be used to diagnose the feedback strength?
    % choose 'acc' for the anomaly correlation, 'reg' for standard linear
    % regression, and 'rreg' for robust regression. (See method paper for
    % the last option)
    all_analysis = {'rreg'};

% -------------------- %
% SETTING CONSEQUENCES %
% -------------------- %

    % total numbers for the loops
    n_feedbacks = length(all_reference_names);
    n_basins    = length(all_basins);
    n_analysis  = length(all_analysis);

% ------------------ %
% CALL MAIN FUNCTION %
% ------------------ %

    for c_basin = 1:n_basins

        basin_name = char(all_basins{c_basin});

        for c_feedback = 1:n_feedbacks

            reference_name = char(all_reference_names{c_feedback});
            lag_name       = char(all_lag_names{c_feedback});

            for c_analysis = 1:n_analysis

                analysis_type = char(all_analysis{c_analysis});

                % actual call of the script
                lagged_feedback_strengths;

            % for: loop over all analysis types
            end

        % for: loop over all feedbacks
        end

    % for: basins
    end