total_bjerknes_feedback_from_regression_settings.m 4.53 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                           %
%   CALCULATE TOTAL BJERKNES FEEDBACK BASED ON REGRESSION   %
%   FOR ZONAL AND SEASONAL CALCULATIONS                     %
%   SETTINGS                                                %
%                                                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

% ----- %
% BASIC %
% ----- %

    all_references = {'ssh','sst','ustr'};
    all_lags       = {'sst','ustr','ssh'};

    start_year = 1993;
    stop_year = 2012;

    basin_name = 'Pacific';
    dataset_id = 'aviso';

    if strcmp(dataset_id,'oras4')

        all_data = struct('ssh','oras4',...
                          'sst','oras4',...
                          'ustr','era_oras4_forcing');

    elseif strcmp(dataset_id,'aviso')

        all_data = struct('ssh','aviso',...
                          'sst','ersst',...
                          'ustr','era_sfcstress');

    else

        error('Not a valid dataset ID!');

    end

    analysis_type = 'rreg';

    % at which level should normalization take place?
    % everything that lies above this on the CDF
    % is considered an outlier and will be ignored during
    % normalization
    normalizing_level = 0.95;

% ----- %
% FLAGS %
% ----- %

    % should constant normalizing levels be used,
    % or should they be calculated?
    use_constant_normalization  = true;

    plot_total_strengths           = true;
    plot_total_strength_difference = true;
    plot_normalized_feedbacks      = false;

    divert_south = false;
    zonal_analysis_region_definition;

% --------------- %
% PATHS AND FILES %
% --------------- %

    in_path    = '<path where data for zonal analysis is stored>';
    file_dummy = [in_path,...
                  'instantaneous_feedback_strengths_',analysis_type,'_',...
                  num2str(start_year),'-',num2str(stop_year),'_',...
                  basin_name,'_',...
                  '@REF_DATA@-@REF_NAME@_@LAG_DATA@-@LAG_NAME@.mat'];

% -------- %
% PLOTTING %
% -------- %

    % GENERAL
    % +++++++

        atlantic_asymmetric_bjf_plot_settings;

        % axes fine tuning
        x_axes_offset      = 0;
        y_axes_offset      = 0.05;
        width_axes_offset  = -0.06;
        height_axes_offset = -0.065;

        axes_position = axes_position+...
                [x_axes_offset y_axes_offset width_axes_offset height_axes_offset];

    % THE NINO BOXES
    % ++++++++++++++

        % height offset for the offset for the hax_labels
        hax_labels_height_offset = struct('Atlantic',0.035,'Pacific',0.057);    % units: y label values, have to set this

    % COLOURS
    % +++++++

        % colour limits and levels
        c_limits  = [0 0.85];   % here: [0 0.5]
                               % for comparison with total feedbacks based on a single compositing variable: [0 0.85]
        n_colours = 30;        % 34

    % NAMING
    % ++++++

        % naming
        % total_title_dummy = [basin_name,' total @ANOMALYTYPE@ ',...
        %         upper(dataset_id),' Bjerknes feedback, ',...
        %         num2str(start_year),'-',num2str(stop_year)];
        total_title_dummy = [basin_name,', all: @ANOMALYTYPE@'];

        % difference_title_dummy = [basin_name,' total ',...
        %         upper(dataset_id),' Bjerknes feedback difference, ',...
        %         num2str(start_year),'-',num2str(stop_year)];
        difference_title_dummy = [basin_name,', all: difference'];

        feedback_title_dummy = [basin_name,' @ANOMALYTYPE@ ',...
                upper(dataset_id),' @REF_NAME@-@LAG_NAME@, ',...
                num2str(start_year),'-',num2str(stop_year)];

        total_name_dummy = [basin_name,'_total_@ANOMALYTYPE@_',...
                dataset_id,'_feedback_',...
                num2str(start_year),'-',num2str(stop_year),'.png'];

        difference_name_dummy = [basin_name,'_total_',...
                dataset_id,'_feedback_difference_',...
                num2str(start_year),'-',num2str(stop_year),'.png'];

        feedback_name_dummy = [basin_name,'_@ANOMALYTYPE@_',...
                upper(dataset_id),'_@REF_NAME@-@LAG_NAME@_',...
                num2str(start_year),'-',num2str(stop_year),'.png'];

    % MISCELLANEOUS
    % +++++++++++++

        % month shorts
        month_ids = {'J','F','M','A','M','J','J','A','S','O','N','D'};

        % resolution
        print_res = '-r200';

        % cut-off levels
        cut_off_levels = struct('ssh',60,'sst',0.075,'ustr',11);