-
Notifications
You must be signed in to change notification settings - Fork 0
/
explodeVariables.m
49 lines (47 loc) · 1.89 KB
/
explodeVariables.m
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
function [dataset, RCP, E, OA, superMode, superAdvantage, superGrowthPenalty, superStart, ...
outputPath, sstPath, matPath, m_mapPath, ...
architecture, useThreads, everyx, specialSubset, ...
keyReefs, skipPostProcessing, doPlots, ...
doCoralCoverMaps, doCoralCoverFigure, doGrowthRateFigure, ...
doGenotypeFigure, doDetailedStressStats, allFigs, ...
saveVarianceStats, newMortYears, optimizerMode, bleachingTarget] = explodeVariables(p)
%EXPLODEVARIABLES Extract parameter structure to program variables.
%
% Note that assigning these programatically is tempting, and there are
% ways. However, MATLAB code is parsed before any such code, possibly
% causing confusion between functions and variables with the same name.
% Just do it the verbose but simple way:
% Science variables
dataset = p.dataset;
RCP = p.RCP;
E = p.E;
OA = p.OA;
superMode = p.superMode;
superAdvantage = p.superAdvantage;
superGrowthPenalty = p.superGrowthPenalty;
superStart = p.superStart;
% Bookkeeping variables
outputPath = p.outputBase; % Note name change.
sstPath = p.sstPath;
matPath = p.matPath;
m_mapPath = p.m_mapPath;
% Computing variables
architecture = p.architecture;
useThreads = p.useThreads; % Note name change
everyx = p.everyx;
specialSubset = p.specialSubset;
% Output variables
keyReefs = p.keyReefs;
skipPostProcessing = p.skipPostProcessing;
doPlots = p.doPlots;
doCoralCoverMaps = p.doCoralCoverMaps;
doCoralCoverFigure = p.doCoralCoverFigure;
doGrowthRateFigure = p.doGrowthRateFigure;
doGenotypeFigure = p.doGenotypeFigure;
doDetailedStressStats = p.doDetailedStressStats;
allFigs = p.allFigs;
saveVarianceStats = p.saveVarianceStats;
newMortYears = p.newMortYears;
optimizerMode = p.optimizerMode;
bleachingTarget = p.bleachingTarget;
end