diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..258a8c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +output +examples/copse/COPSE_test_output_full +run_copse_tests.txt +*~ +*asv diff --git a/COPSE_setup.m b/COPSE_setup.m new file mode 100644 index 0000000..9604273 --- /dev/null +++ b/COPSE_setup.m @@ -0,0 +1,63 @@ +function COPSE_setup +% Set up COPSE paths + +% Add new directories to this list + +paleodirs={'code','code/core','code/forcings', ... + 'code/copse', ... + 'code/configuration','code/utils', ... + 'libraries/YAMLMatlab_0.4.3', ... + 'examples/copse'}; + +paleopath = pwd; + +% get current path as semicolon-separated list +p = path; + +% check for any PALEO or COPSE entries in current path + +pentries = strsplit(p,pathsep); + +pcopse = {}; +for i = 1:length(pentries) + if ~isempty(strfind(pentries{i},'PALEO')) || ~isempty(strfind(pentries{i},'COPSE')) + pcopse{end+1} = pentries{i}; + end +end + +% prompt user and remove any PALEO entries +% (eg if there are two installations ...) +if ~isempty(pcopse) + fprintf('possible COPSE paths found\n'); + for i=1:length(pcopse) + fprintf(' %s\n',pcopse{i}) + end + + str = input('\nRemove these paths ? Y/N [Y]\n','s'); + if isempty(str) + str = 'Y'; + end + if strcmpi(str,'Y') + for i=1:length(pcopse) + fprintf('removing folder %s\n',pcopse{i}); + rmpath(pcopse{i}); + end + end +end + +% Add PALEO paths + +for i=1:length(paleodirs) + psepdir = strrep(paleodirs{i},'/',filesep); + fulldir = fullfile(paleopath,psepdir); + fprintf('adding folder %s\n',fulldir); + addpath(fulldir); +end + +% Test yaml hence preload - attempt to workaround an issue on linux with crash ? + +yaml_file = 'libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file1.yaml'; +YamlStruct = ReadYaml(yaml_file); + + + diff --git a/KnownIssues.txt b/KnownIssues.txt new file mode 100644 index 0000000..131a8a3 --- /dev/null +++ b/KnownIssues.txt @@ -0,0 +1,76 @@ +COPSE known issues 2017-12-01 +----------------------------- + +Lenton etal (2017) COPSE Reloaded +--------------------------------- +COPSE_reloaded_reloaded.m + +1) Spurious warnings reported to screen when loading some comparison output datasets from older models. + >> Warning: Cannot load an object of class 'copse_model_sfbw': + (seen with some datasets in additional output data in COPSE_V2.0_test_output_full.zip) + No effect on the data loaded. + +Mills etal (2014) G3 +-------------------- +COPSE_mills2014g3_mills2014g3.m + +The below minor fixes are made to this version of the model. These changes make little difference to output and do not alter the conclusions of the original paper. The combined effect of changes relative to the original paper can be demonstrated by editing COPSE_mills2014g3_mills2014g3.m to select +run=copse_millsg3_millsg3_expts('g3mills2014nobugs', 'baseline'); + +1) Land biota T limitation effectively removed (copse_landbiota_mills2014g3.m) + + To reproduce, set + f_bug_g32014_landbiotatemp = 'Yes' + See https://github.com/sjdaines/PALEOexeter/issues/23 + + Effect is: pCO2 is ~0.1 PAL low (200Ma-0), ~< 0.6 PAL low (250Ma-200Ma) + pO2 (not plotted in paper) is ~< 0.06 PAL high (200Ma-0), ~<0.1 PAL high (250Ma-200Ma) + +2) Sr concentration calculation was incorrect (not plotted in paper) + (copse_model_mills2014g3.m) + + f_bug_g32014_Srconc: 'Yes' + +3) Granite area calculation only used CFB area (copse_landsurfaceareas_mills2014g3.m) + + f_granitearea = 'G3original' + +4) Degass forcing extrapolation to times earlier than 230Ma inconsistent + (copse_force_vandermeer.m) + DEGASS returned to background value (=1) at 230Ma, whereas OIB area assumed constant area for T > 230Ma + + copse_force_vandermeer.extrapolate = 3 + +5) Small (~1%) discrepancy between basalt area calculated from LIP table vs offline calculation. + (test_copse_load_phanlip('mills2014g3'), ie copse_load_phanlip.m vs copse_force_revision_ba.m + either + bas_area_mills2014.xlsx or ggge20620-sup-0002-suppinfo2.mat) + + https://github.com/sjdaines/PALEOexeter/issues/18 + +6) Time-evolution of delta_Sr_sed + (copse_model_mills2014g3.m) + + Updated in copse_model_reloaded.m + +7) Silicate weathering used 288 not 288.15 K offset, resulting in ~1% offset in pCO2 + (copse_weathering_rates_mills2014g3.m) + pars.f_act_energies = 'split_bug_g32014_Toffset' + + https://github.com/sjdaines/PALEOexeter/issues/21 + +Bergman etal (2004) +------------------- +COPSE_bergman2004_bergman2004.m + +1) Organic carbon degassing rolloff at low pO2 (copse_model_bergman2004.m) + # COPSE 5_14 C code (and Bergman 2004) use 'O2copsecrashprevent' which rolls + # off organic carbon degassing at low pO2. This has a big effect at low pO2 when + # oxidative weathering is oxygen-independent (ie Ordovician and earlier) + + f_ocdeg : 'O2indep' # options 'O2indep', 'O2copsecrashprevent' + +2) Marine N (unlikely to affect results as N adjusts due to denitrification alone) + (copse_marinebiota_bergman2004.m) + + f_nfix_nreplete: 'Off' # options 'Off','Sign' (COPSE 5_14 C code has 'Sign') + diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..d2a43c0 --- /dev/null +++ b/README.txt @@ -0,0 +1,36 @@ + +The COPSE (Carbon, Oxygen, Phosphorus, Sulphur and Evolution) biogeochemical model predicts the coupled histories and controls on atmospheric O2, CO2 and ocean composition over Phanerozoic time. + +The model is described in the following publications: + +Bergman, N. M., Lenton, T. M., & Watson, A. J. (2004). COPSE: A new model of biogeochemical cycling over Phanerozoic time. American Journal of Science, 304(5), 397–437. http://doi.org/10.2475/ajs.304.5.397 + +Mills, B., Daines, S. J., & Lenton, T. M. (2014). Changing tectonic controls on the long-term carbon cycle from Mesozoic to present. Geochemistry, Geophysics, Geosystems, 15(12), 4866–4884. http://doi.org/10.1002/2014GC005530 + +Lenton, T. M., Dahl, T. W., Daines, S. J., Mills, B. J. W., Ozaki, K., Saltzman, M. R., & Porada, P. (2016). Earliest land plants created modern levels of atmospheric oxygen. Proceedings of the National Academy of Sciences, 113(35), 9704–9709. http://doi.org/10.1073/pnas.1604787113 + +Lenton, T. M., Daines, S.J., Mills, B. J. W. (2017). COPSE reloaded: An improved model of biogeochemical cycling over Phanerozoic time. Earth Science Reviews, in revision. + + +Running the model (requires Matlab version 2012 or higher): +----------------- + +>> COPSE_setup % sets Matlab paths +>> cd examples/copse +>> run_copse_tests % test against archived output (output is included for only the default set of 7 tests) +>> +>> COPSE_reloaded_reloaded % runs model, plots output for Lenton etal (2017) +>> COPSE_bergman2004_bergman2004 % Bergman etal (2004) version +>> COPSE_millsg3_millsg3 % Mills etal (2014) version +>> COPSE_reloaded_bergman2004 % includes results from Lenton etal (2016) - see comments in file + + +Evaluation data: +--------------- + +Datasets are not part of the public release but are available on request from the authors. + +Known issues: +------------ + +Please see KnownIssues.txt \ No newline at end of file diff --git a/code/configuration/copse_modify_struct.m b/code/configuration/copse_modify_struct.m new file mode 100644 index 0000000..5184192 --- /dev/null +++ b/code/configuration/copse_modify_struct.m @@ -0,0 +1,11 @@ +function strct = copse_modify_struct( strct, fld, newval ) +%Modify a struct, error if field doesn't already exist + +if ~isfield(strct,fld) + error ('struct "%s" no field "%s"',inputname(1),fld); +end + +strct.(fld)=newval; + +end + diff --git a/code/configuration/paleo_modelbuilder.m b/code/configuration/paleo_modelbuilder.m new file mode 100644 index 0000000..b8e8e2a --- /dev/null +++ b/code/configuration/paleo_modelbuilder.m @@ -0,0 +1,45 @@ +classdef paleo_modelbuilder + % Create and configure a model from configuration file. + % + % + methods(Static) + function tm = createModel(configfile, configname) + + LN = 'paleo_modelbuilder.createModel'; L = paleo_log.getLogger(); + + % Read configuration from yaml file + cfgset = paleo_parameterset(configfile, configname); + + % Create model: + % locate the relevant section in the cfg structure + modelcfg = paleo_parameterset.findElem(cfgset.configdata, 'model'); + % create the model + L.log(L.DEBUG, LN, sprintf('creating tm ctorstr=''%s''\n', modelcfg.class)); + tm = eval(modelcfg.class); + + %%%%%%%% Set forcing functions for this run + tm.force = {}; + forcecfg = paleo_parameterset.findElem(cfgset.configdata, 'model.force'); + for i = 1:length(forcecfg) + ctorstr = forcecfg{i}; + newforce = eval(ctorstr); + tm.force{end+1} = newforce; + end + + tm.perturb = {}; + perturbcfg = paleo_parameterset.findElem(cfgset.configdata, 'model.perturb'); + for i = 1:length(perturbcfg) + ctorstr = perturbcfg{i}; + newperturb = eval(ctorstr); + tm.perturb{end+1} = newperturb; + end + + %%%%%%%%%% Set top-level parameters + tm.pars = cfgset.configureobject(tm.pars, 'model.pars', 'pars'); + + end + + end +end + + diff --git a/code/configuration/paleo_parameterset.m b/code/configuration/paleo_parameterset.m new file mode 100644 index 0000000..68c1cd0 --- /dev/null +++ b/code/configuration/paleo_parameterset.m @@ -0,0 +1,151 @@ +classdef paleo_parameterset + % A parameter set contains 'configdata' read from 'configname' in yaml 'configfile'. + % + % The yaml configfile should contain configuration data at the top level, eg + % + % copse_reloaded: + % + % + % copse_bergman2004: + % + % + + properties(SetAccess=private) + configfile = ''; % configfile read + configname = ''; % named configuration from that file + + configdata; % struct with data from configfile.(configname) + end + + properties(Constant) + reservedFields = {'class'}; % fields in config file to ignore; + end + + methods + function obj = paleo_parameterset(configfile, configname) + % Read configuration data from yaml parameter file (which may have multiple configs within) + + % Read entire parameter file (which may contain multiple configurations) + obj.configfile = configfile; + filects = ReadYaml(configfile); + + % Get the data for the specified configname + obj.configname = configname; + if isfield(filects, obj.configname) + obj.configdata = filects.(obj.configname); + else + error('no configname %s in configfile %s', obj.configname, obj.configfile); + end + end + + + function target = configureobject(obj, target, configpath, targetname) + % Set properties/fields on a single object 'target' from location 'configpath' in 'configdata' + % + % Input: + % target - object to be configured + % configpath - path within obj.configdata containing configuration for 'target' + % targetname - [optional] name of target object. This makes the target object fields + % available when evaluating a parameter, to allow eg par1 = (2*pars.par2) + % + % Returns: + % target - configured object + + LN = 'paleo_parameterset.configureobject'; L = paleo_log.getLogger(LN); + + + % Find the configuration data at location configpath + % (configdata has been read from file, configpath is specified as an argument) + targetconfig = paleo_parameterset.findElem(obj.configdata, configpath); + + if isempty(targetconfig) + error('no config for configfile %s configname %s configpath %s', obj.configfile, obj.configname, configarg); + else + % configure target ... + + rpars = fields(targetconfig); + + % apply config to target object properties, ignoring reserved fields + for rp = 1:length(rpars) + if ~any(strcmp(rp, obj.reservedFields)) % ignore reserved fields + subval = paleo_parameterset.subValue(targetconfig.(rpars{rp}), targetname, target); + L.log(L.TRACE, LN, sprintf('.%s=%s\n', rpars{rp}, subval)); + target.(rpars{rp}) = subval; + end + end + end + end + end + + + methods(Static) + function subval = subValue(val, ctxtname, ctxtdata) + % parameter substitution. + % + % Input: + % val - parameter value either as a string (which will be evaluated if an expression in round brackets), + % or a string without brackets or non-string (which will just be returned directly) + % ctxtname - [optional] name of a struct or object (eg 'pars') to provide as context for evaluation. + % ctxtdata - [optional] value of this struct or object + % + % Returns: + % subval - parameter value, either as-supplied if non-string, or evaluated from a supplied string + + if nargin < 2 + ctxtname = ''; + end + + if ischar(val) + % evaluate string-valued parameter if of from '(expr)' + + % guard against inadvertent use of 'false' or 'true' which are parsed as strings, not logicals + % use true and false (no quotes) + if any(strcmp(val,{'false','true'})) + error('''false'' and ''true'' strings illegal in parameter value - remove quotes'); + end + % TODO guard against strings that look like they might be supposed to be numeric expressions + % or attempts to set numeric fields to strings? + + % If string is of form '(expr)', evaluate + if ~isempty(val) && strcmp(val(1),'(') && strcmp(val(end),')') + % evaluate contents of brackets so (2+2) = 4 etc + if ~isempty(ctxtname) + % provide optional context for evaluation + eval([ctxtname '= ctxtdata;']); + end + subval = eval(val); + else + % no brackets - just return the raw string + subval = val; + end + else + % return unmodified non-string value + subval = val; + end + end + + + function elem = findElem(data, path) + % find element within structure-tree 'data' at location 'path' + % eg + % data.x.y = elem + % path = 'x.y' + + % split path on . + psplit = strsplit(path,'.'); + + % navigate into data to find elem + elem = data; + if ~isempty(psplit{1}) % NB: strsplit('','.') returns {''} + for i=1:length(psplit) + if isfield(elem, psplit{i}) + elem = elem.(psplit{i}); + else + error('path %s not present', path); + end + end + end + end + end +end + diff --git a/code/copse/copse_Cisotopefrac.m b/code/copse/copse_Cisotopefrac.m new file mode 100644 index 0000000..482dadf --- /dev/null +++ b/code/copse/copse_Cisotopefrac.m @@ -0,0 +1,25 @@ +function [ d_locb, D_P, d_mocb, D_B, d_mccb, d_ocean, d_atmos ] = copse_Cisotopefrac( Tkelvin, pCO2PAL, pO2PAL, phi ) +% COPSE_CISOTOPEFRAC Carbon isotope fractionation from Bergman(2004) COPSE model + +if nargin < 4 + phi = 0.01614; %fraction of C in atmosphere:ocean +end + +%ocean total dissolved CO2 +d_ocean = phi*(9483/Tkelvin-23.89); +%atmosphere CO2 +d_atmos = (phi-1)*(9483/Tkelvin-23.89); + +%marine calcite burial +d_mccb = d_ocean + 15.10 - 4232/Tkelvin; + +%fractionation between marine organic and calcite burial +D_B = 33 -9/sqrt(pCO2PAL) + 5*(pO2PAL-1); +%marine organic carbon burial +d_mocb = d_mccb - D_B; + +%fractionation between terrestrial organic burial and atmospheric CO2 +D_P = 19 + 5*(pO2PAL-1); +d_locb = d_atmos - D_P; +end + diff --git a/code/copse/copse_TempCK1992.m b/code/copse/copse_TempCK1992.m new file mode 100644 index 0000000..b05412d --- /dev/null +++ b/code/copse/copse_TempCK1992.m @@ -0,0 +1,59 @@ +function [ newT, albedo, Tgh, Teff ] = copse_TempCK1992( luminosity, pCO2atm, oldT, fixedalbedo ) +% COPSE_TEMPCK1992 Caldeira and Kasting 1992 temperature function +% +% [ newT, albedo, Tgh, Teff ] = copse_TempCK1992( luminosity, pCO2atm, oldT, fixedalbedo ) +% +% luminosity - solar luminosity, W/m^2 (currently 1368.0) +% CO2atm - atmospheric pCO2, atm (pre-industrial 280e-6) +% oldT - estimated temperature +% fixedalbedo - (optional) fix albedo, default is variable albedo +% +% newT - improved estimate +% albedo - albedo +% Tgh - greenhouse contribution +% Teff - black-body effective temperature +% fixedalbedo - optional - fix albedo +% +% Caldeira, K., & Kasting, J. F. (1992). The life span of the biosphere revisited. Nature, 360(6406), 721–3. doi:10.1038/360721a0 + +CK_sigma = 5.67e-8; % Stefan-Boltzmann +CK_a0 = 1.4891; +CK_a1 = -0.0065979; +CK_a2 = 8.567e-6; +CK_1 = 815.17; +CK_2 = 4.895e+7; +CK_3 = -3.9787e+5; +CK_4 = -6.7084; +CK_5 = 73.221; +CK_6 = -30882; + +if nargin < 4 + % calculate the effective black body temperature + albedo = CK_a0 + CK_a1 * oldT + CK_a2 * oldT^2; +else + albedo = fixedalbedo; +end + +Teff = power((1-albedo) * luminosity / (4 * CK_sigma), 0.25); + +% calculate the greenhouse effect */ +psi = log10(pCO2atm); +Tgh = CK_1 + CK_2 / oldT^2 + CK_3 / oldT + CK_4 / psi^2 ... + + CK_5 / psi + CK_6 / (psi * oldT); + +% Final T is black body T + greenhouse effect + +newT = Teff + Tgh; + +% BM Matlab code - identical to above +% tempcorrect = 0.194; %%%% COPSE temp correction to 15C at present day +% TEMP = ( ( ((1- (1.4891 - 0.0065979*S.temp + (8.567e-6)*(S.temp^2) ) )*SOLAR)/(4*5.67e-8) )^0.25... +% + 815.17 + (4.895e7)*(S.temp^-2) - (3.9787e5)*(S.temp^-1)... +% -6.7084*((log10( CO2atm ))^-2) + 73.221*((log10( CO2atm ))^-1) -30882*(S.temp^-1)*((log10( CO2atm ))^-1) ) + tempcorrect ; + +%%%%%%% CK1992 fixed albedo +% +% TEMP = ( ( ((1- ( ALBEDO ) )*D.SOLAR)/(4*5.67e-8) )^0.25 + 815.17 + (4.895e7)*(S.temp^-2) - (3.9787e5)*(S.temp^-1) -6.7084*((log10( D.pCO2atm ))^-2) + 73.221*((log10( D.pCO2atm ))^-1) -30882*(S.temp^-1)*((log10( D.pCO2atm ))^-1) ) ; + +end + diff --git a/code/copse/copse_budgets_base.m b/code/copse/copse_budgets_base.m new file mode 100644 index 0000000..0efaf7f --- /dev/null +++ b/code/copse/copse_budgets_base.m @@ -0,0 +1,114 @@ +classdef copse_budgets_base < paleo_postprocessor + + properties + + end + + methods + function [ diag, budgets ] = calcall(obj, T, S, diag, budgets ) + %COPSE_BUDGETS_BASE Integrate budgets and check conservation (COPSE 'classic') + % + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Derive budgets + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Calculate Ca budget - split into silicate+C, CAL+sulphates as these are separately conserved (in COPSE base) + % Ca in silicate crust + % Integrate up some useful budgets that enable us to track Ca in silicate crust + diag.int_silw = zeros(length(T),1); + diag.int_sfw = zeros(length(T),1); + diag.int_ccdeg=zeros(length(T),1); + diag.int_gypdeg = zeros(length(T),1); + if isfield(diag,'silw') + for idiag=2:length(T) + diag.int_silw(idiag) = diag.int_silw(idiag-1)+trapz(T(idiag-1:idiag),diag.silw(idiag-1:idiag)); + end + end + if isfield(diag,'sfw') + for idiag=2:length(T) + diag.int_sfw(idiag) = diag.int_sfw(idiag-1)+trapz(T(idiag-1:idiag),diag.sfw(idiag-1:idiag)); + end + end + if isfield(diag,'ccdeg') + for idiag=2:length(T) + diag.int_ccdeg(idiag) = diag.int_ccdeg(idiag-1)+trapz(T(idiag-1:idiag),diag.ccdeg(idiag-1:idiag)); + end + end + if isfield(diag,'gypdeg') + for idiag=2:length(T) + diag.int_gypdeg(idiag) = diag.int_gypdeg(idiag-1)+trapz(T(idiag-1:idiag),diag.gypdeg(idiag-1:idiag)); + end + end + + % Ca in silicate crust relative to initial condition + diag.clc_deltaCaSil = diag.int_ccdeg + diag.int_gypdeg - diag.int_silw - diag.int_sfw; + + % Ca in CAL and S reservoirs (if any) + diag.clc_CALGYPSCa = zeros(length(T),1); + if isfield(S,'CAL') + diag.clc_CALGYPSCa = diag.clc_CALGYPSCa + S.CAL; + end + if isfield(S,'GYP') + diag.clc_CALGYPSCa = diag.clc_CALGYPSCa + S.GYP; + end + + % Net Earth surface Ca + diag.clc_CaNet = diag.clc_CALGYPSCa + S.C + diag.clc_deltaCaSil; + + % Redox + % Carbon reservoirs redox change + diag.clc_RedoxC = S.C + S.A; + % Sulphur reservoirs redox change + diag.clc_RedoxS = zeros(length(T),1); + if isfield(S,'S') + diag.clc_RedoxS = diag.clc_RedoxS + 2*S.S; + end + if isfield(S,'GYP') + diag.clc_RedoxS = diag.clc_RedoxS + 2*S.GYP; + end + + % Overall surface system redox change + diag.clc_RedoxNet = diag.clc_RedoxC + S.O + diag.clc_RedoxS; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Check conservation of budgets + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Carbon + budgets.totalcarbon=(S.A(end)+S.G(end)+S.C(end)) -(S.A(1)+S.G(1)+S.C(1)); + + % Redox + budgets.totalO2equiv = diag.clc_RedoxNet(end) - diag.clc_RedoxNet(1); + + % Ca in CAL and sulphates + budgets.CALGYPSCa = diag.clc_CALGYPSCa(end) - diag.clc_CALGYPSCa(1); + % Ca in crust and carbonates + budgets.CsilCa = (S.C(end) + diag.clc_deltaCaSil(end)) - ... + (S.C(1) + diag.clc_deltaCaSil(1)); + % Ca total + budgets.totalCa = diag.clc_CaNet(end) - diag.clc_CaNet(1); + + % Sulphur + if isfield(S,'S') + budgets.totalsulphur=(S.S(end)+S.PYR(end)+S.GYP(end)) -(S.S(1)+S.PYR(1)+S.GYP(1)); + else + budgets.totalsulphur = NaN; + end + + + + fprintf('\ntotal at end - total at start\n'); + fprintf(' carbon (A + G + C reservoirs) %e mol\n',budgets.totalcarbon); + fprintf(' sulphur (S + PYR + GYP reservoirs) %e mol\n',budgets.totalsulphur); + fprintf(' redox (O + C + A + 2*(S+GYP)) %e mol O_2 equiv\n',budgets.totalO2equiv); + fprintf(' Ca (C + deltaCaSil) %e mol\n',budgets.CsilCa); + fprintf(' Ca (CAL + GYP + S) %e mol\n',budgets.CALGYPSCa); + fprintf(' Ca (CAL + GYP + C + deltaCaSil) %e mol\n',budgets.totalCa); + + + end + end + +end + diff --git a/code/copse/copse_crash.m b/code/copse/copse_crash.m new file mode 100644 index 0000000..916bd2e --- /dev/null +++ b/code/copse/copse_crash.m @@ -0,0 +1,17 @@ +function output = copse_crash(value,label,tmodel) +% COPSE_CRASH COPSE 5_14 Enforce +ve reservoir values by limiting fluxes at small reservoir sizes (??) +% output = 1 ie independent of 'value' for 'value' > 0.1 (implicitly the +% usual range), but limited towards zero for 'value' < 0.1 + +valuelowlimit = 0.1; +if value > valuelowlimit + output = 1 ; +elseif value > 0 + output = value*1.0/valuelowlimit; + fprintf('copse_crash %s value %g tmodel %g\n',label,value,tmodel); +else + output=0; + fprintf('copse_crash %s value %g tmodel %g\n',label,value,tmodel); +end + +end diff --git a/code/copse/copse_f_T.m b/code/copse/copse_f_T.m new file mode 100644 index 0000000..41a3dbf --- /dev/null +++ b/code/copse/copse_f_T.m @@ -0,0 +1,12 @@ +function copse_f_T = copse_f_T(Tk) +% COPSE_F_T Temperature dependence of silicate weathering from COPSE (Bergman 2004) +% +% Tk - Temperature (Kelvin) +% f_T - weathering rate relative to Tzero = 15 C +% +% See also COPSE_equations GEOCARB_equations test_copse_weathering + + CtoK = 273.15; + Tzero = CtoK+15; + copse_f_T = exp(0.09*(Tk-Tzero)) * ( (1 + 0.038*(Tk - Tzero))^0.65 ); +end diff --git a/code/copse/copse_g_T.m b/code/copse/copse_g_T.m new file mode 100644 index 0000000..d9f2e6a --- /dev/null +++ b/code/copse/copse_g_T.m @@ -0,0 +1,18 @@ +function g_T = copse_g_T(Tk) +% COPSE_G_T Temperature dependence of carbonate weathering from COPSE (Bergman 2004) +% +% Tk - Temperature (Kelvin) +% g_T - weathering rate relative to Tzero = 15 C +% NB: will go negative to T <~ 5C !! +% +% See also COPSE_equations GEOCARB_equations test_copse_weathering + + CtoK = 273.15; + Tzero = CtoK+15; + + g_T= 1 + 0.087*(Tk - Tzero); + if g_T < 0 + fprintf('negative g_T %g for Tk %g\n',g_T,Tk); + g_T = 0; + end +end \ No newline at end of file diff --git a/code/copse/copse_landbiota_bergman2004.m b/code/copse/copse_landbiota_bergman2004.m new file mode 100644 index 0000000..234d7c7 --- /dev/null +++ b/code/copse/copse_landbiota_bergman2004.m @@ -0,0 +1,37 @@ +function D = copse_landbiota_bergman2004(pars, tmodel, S, D, TEMP ) +%COPSE_LANDBIOTA COPSE OCT dynamic land vegetation model +% + +%global pars; + +%%%% effect of temp on VEG + +D.V_T = 1 - (( (TEMP - paleo_const.k_CtoK-25)/25 )^2) ; + +% +%%%% effect of CO2 on VEG +P_atm = D.pCO2atm*1e6 ; +P_half = 183.6 ; +P_min = 10 ; +D.V_co2 = (P_atm - P_min) / (P_half + P_atm - P_min) ; + +%%%% effect of O2 on VEG +D.V_o2 = 1.5 - 0.5*D.pO2PAL ; + +%%%% full VEG limitation +D.V_npp = 2*D.EVO*D.V_T*D.V_o2*D.V_co2 ; + +%%% fire feedback +%calculate atmospheric mixing ratio of O2 (for constant atmospheric N etc!) +%(only used for fire ignition probability) +D.mrO2 = D.pO2PAL / ( D.pO2PAL +pars.k16_PANtoO ) ; +D.ignit = max(586.2*(D.mrO2)-122.102 , 0 ) ; +D.firef = pars.k_fire/(pars.k_fire - 1 + D.ignit) ; + + +%%% Mass of terrestrial biosphere +D.VEG = D.V_npp * D.firef ; + + +end + diff --git a/code/copse/copse_landbiota_mills2014g3.m b/code/copse/copse_landbiota_mills2014g3.m new file mode 100644 index 0000000..686fab4 --- /dev/null +++ b/code/copse/copse_landbiota_mills2014g3.m @@ -0,0 +1,41 @@ +function D = copse_landbiota_mills2014g3(pars, tmodel, S, D, TEMP ) +% COPSE_LANDBIOTA COPSE OCT dynamic land vegetation model + +%%%% effect of temp on VEG +switch pars.f_bug_g32014_landbiotatemp + case 'Yes' + % effectively removed T limitation, visible as slightly high VEG + D.V_T = 1 - (( (TEMP - 298)/298 )^2) ; + case 'No' + D.V_T = 1 - (( (TEMP - paleo_const.k_CtoK-25)/25 )^2) ; + otherwise + error('unrecognized pars.f_bug_g32014_landbiotatemp %s',pars.f_bug_g32014_landbiotatemp); +end +% +% +%%%% effect of CO2 on VEG +P_atm = D.pCO2atm*1e6 ; +P_half = 183.6 ; +P_min = 10 ; +D.V_co2 = (P_atm - P_min) / (P_half + P_atm - P_min) ; + +%%%% effect of O2 on VEG +D.V_o2 = 1.5 - 0.5*D.pO2PAL ; + +%%%% full VEG limitation +D.V_npp = 2*D.EVO*D.V_T*D.V_o2*D.V_co2 ; + +%%% fire feedback +%calculate atmospheric mixing ratio of O2 (for constant atmospheric N etc!) +%(only used for fire ignition probability) +D.mrO2 = D.pO2PAL / ( D.pO2PAL +pars.k16_PANtoO ) ; +D.ignit = max(586.2*(D.mrO2)-122.102 , 0 ) ; +D.firef = pars.k_fire/(pars.k_fire - 1 + D.ignit) ; + + +%%% Mass of terrestrial biosphere +D.VEG = D.V_npp * D.firef ; + + +end + diff --git a/code/copse/copse_landbiota_reloaded.m b/code/copse/copse_landbiota_reloaded.m new file mode 100644 index 0000000..080d1c8 --- /dev/null +++ b/code/copse/copse_landbiota_reloaded.m @@ -0,0 +1,62 @@ +function D = copse_landbiota_reloaded(pars, tmodel, S, D, TEMP ) +% COPSE_LANDBIOTA COPSE OCT dynamic land vegetation model + +%%%% effect of temp on VEG +D.V_T = 1 - (( (TEMP - paleo_const.k_CtoK-25)/25 )^2) ; + +%%%% effect of CO2 on VEG +P_atm = D.pCO2atm*1e6 ; +P_half = 183.6 ; +P_min = 10 ; +D.V_co2 = (P_atm - P_min) / (P_half + P_atm - P_min) ; +% Berner choice +D.V_co2_b = 2*D.pCO2PAL / (1.0 + D.pCO2PAL) ; +% New option +D.V_co2_new = D.pCO2PAL^0.5 ; + +%%%% effect of O2 on VEG +D.V_o2 = 1.5 - 0.5*D.pO2PAL ; + +%%%% full VEG limitation +switch pars.f_npp + case 'original' + D.V_npp = 2*D.EVO*D.V_T*D.V_o2*D.V_co2 ; + case 'noT' + D.V_npp = 2*D.EVO*0.84*D.V_o2*D.V_co2 ; + case 'noO2' + D.V_npp = 2*D.EVO*D.V_T*1.0*D.V_co2 ; + case 'noCO2' + D.V_npp = 2*D.EVO*D.V_T*D.V_o2*0.5952381 ; + case 'bernerCO2' + D.V_npp = D.EVO*(D.V_T/0.84)*D.V_o2*D.V_co2_b ; + case 'newCO2' + D.V_npp = D.EVO*(D.V_T/0.84)*D.V_o2*D.V_co2_new ; + case 'constant' + D.V_npp = D.EVO ; + otherwise + error('Unknown f_npp %s',pars.f_npp); +end + +%%% fire feedback +%calculate atmospheric mixing ratio of O2 (for constant atmospheric N etc!) +%(only used for fire ignition probability) +D.mrO2 = D.pO2PAL / ( D.pO2PAL +pars.k16_PANtoO ) ; +switch pars.f_ignit + case 'original' + D.ignit = max(586.2*(D.mrO2)-122.102 , 0 ) ; + case 'bookchapter' + %%% TML new fn. based on data for fuel of 10% moisture content + D.ignit = min(max(48.0*(D.mrO2)-9.08 , 0 ) , 5 ) ; + case 'nofbk' + D.ignit = 1.0 ; + otherwise + error('Unknown f_ignit %s',pars.f_ignit); +end +D.firef = D.fireforcing*pars.k_fire/(D.fireforcing*pars.k_fire - 1 + D.ignit) ; + +%%% Mass of terrestrial biosphere +D.VEG = D.V_npp * D.firef ; + + +end + diff --git a/code/copse/copse_landsurfaceareas_mills2014g3.m b/code/copse/copse_landsurfaceareas_mills2014g3.m new file mode 100644 index 0000000..f523cb0 --- /dev/null +++ b/code/copse/copse_landsurfaceareas_mills2014g3.m @@ -0,0 +1,56 @@ +function D = copse_landsurfaceareas_mills2014g3( pars, tmodel, S, D ) +% Calculate relative basalt, granite, and carbonate areas +% +% Areas are relative to present-day, and +% are "absolute" ie no further normalisation to total land area is used. +% Can be supplied by forcing files (preferred) +% or can be derived as in Mills(2014) G3 paper + +% Basalt area relative to present day +switch(pars.f_basaltarea) + + case {'DefaultForced','g3_2014_datafile'} + % D.BA defined by forcing eg copse_force_revision_ba + % or left at default D.BA=1 + + case 'g3_2014_construct_from_lips' + D.BA = (D.CFB_area + D.oib_area) / pars.k_present_basalt_area; + %case 'Constant' + % leave as constant + + otherwise + error('unknown f_basaltarea %s',pars.f_basaltarea); +end + + +%%%% relative area forcing for granites +switch pars.f_granitearea + case 'Fixed' + % D.GRAN_AREA set to 1 + D.GRAN_AREA = 1 ; + + case 'G3original' + + %%%% old G3 calculation, uses only CFB area in historical calc + land_area = pars.k_present_land_area * D.TOTAL_AREA ; %%% = present * relative forcing + carbonate_area = pars.k_present_carbonate_area * D.CARB_AREA ; %%% = present * relative forcing + total_basalt = pars.k_present_basalt_area * D.BA ; %%% = present * relative forcing + continental_basalt_area = total_basalt - D.oib_area ; %%%% in km^2 remove the OIB/IA part (provided by copse_force_vandermeer.m degassing) + granite_area = land_area - carbonate_area - continental_basalt_area ; %%% SHOULD BE ALL BASALT PROBABLY + + D.GRAN_AREA = granite_area / pars.k_present_granite_area ; + + case 'G3improved' + + %%%% uses same calc as for present day areas + %%%% calc for: granite_area = land_area - carbonate_area - total_basalt ; + granite_area = ( pars.k_present_land_area * D.TOTAL_AREA ) - ( pars.k_present_carbonate_area * D.CARB_AREA ) - ( pars.k_present_basalt_area * D.BA ) ; + D.GRAN_AREA = granite_area / pars.k_present_granite_area ; + + otherwise + error('unrecognized f_granitearea %s',pars.f_granitearea); +end + + +end + diff --git a/code/copse/copse_landsurfaceareas_reloaded.m b/code/copse/copse_landsurfaceareas_reloaded.m new file mode 100644 index 0000000..fdbcbe3 --- /dev/null +++ b/code/copse/copse_landsurfaceareas_reloaded.m @@ -0,0 +1,59 @@ +function D = copse_landsurfaceareas_reloaded( pars, tmodel, S, D ) +% Calculate relative basalt, granite, and carbonate areas +% +% Areas are relative to present-day, and +% are "absolute" ie no further normalisation to total land area is used. +% Can be supplied by forcing files (preferred) +% or can be derived as in Mills(2014) G3 paper + +% Basalt area relative to present day +switch(pars.f_basaltarea) + + case {'DefaultForced','g3_2014_datafile'} + % D.BA defined by forcing eg copse_force_revision_ba + % or left at default D.BA=1 + + case 'g3_2014_construct_from_lips' + D.BA = (D.CFB_area + D.oib_area) / pars.k_present_basalt_area; + %case 'Constant' + % leave as constant + + otherwise + error('unknown f_basaltarea %s',pars.f_basaltarea); +end + + +%%%% relative area forcing for granites +switch pars.f_granitearea + case 'Fixed' + % D.GRAN_AREA set to 1 + D.GRAN_AREA = 1 ; + + case 'Forced' + % Forced by input file from copse_force_granite + D.GRAN_AREA = D.GRAN ; + + case 'ShaleForced' + % Forced by weighted contributions of siliceous and shale+coal + % areas to overall non-basalt silicate weathering flux + D.GRAN_AREA = (1-pars.k_shalefrac)*D.GRAN + pars.k_shalefrac*D.ORG_AREA ; + + case 'OrgEvapForced' + % Forced by weighted contributions of siliceous and shale+coal + % areas to overall non-basalt silicate weathering flux + D.GRAN_AREA = (1-pars.k_orgevapfrac)*D.GRAN + pars.k_orgevapfrac*D.ORGEVAP_AREA ; + + case 'G3improved' + + %%%% uses same calc as for present day areas + %%%% calc for: granite_area = land_area - carbonate_area - total_basalt ; + granite_area = ( pars.k_present_land_area * D.TOTAL_AREA ) - ( pars.k_present_carbonate_area * D.CARB_AREA ) - ( pars.k_present_basalt_area * D.BA ) ; + D.GRAN_AREA = granite_area / pars.k_present_granite_area ; + + otherwise + error('unrecognized f_granitearea %s',pars.f_granitearea); +end + + +end + diff --git a/code/copse/copse_marinebiota_bergman2004.m b/code/copse/copse_marinebiota_bergman2004.m new file mode 100644 index 0000000..666259c --- /dev/null +++ b/code/copse/copse_marinebiota_bergman2004.m @@ -0,0 +1,48 @@ +function D = copse_marinebiota_bergman2004(pars, tmodel, S, D ) +%COPSE_MARINEBIOTA COPSE marine ecosystem model +% + +%global pars; + +%%%% convert marine nutrient reservoir moles to micromoles/kg concentration +D.Pconc = ( S.P/pars.P0 ) * 2.2 ; +D.Nconc = ( S.N / pars.N0 ) * 30.9 ; + +%%%%% Marine new production +D.newp = 117 * min(D.Nconc/16,D.Pconc) ; + +%%%%%% OCEAN ANOXIC FRACTION + +D.ANOX = max( 1 - pars.k1_oxfrac*( D.pO2PAL)*( pars.newp0/D.newp ) , 0 ); + + +%%%% CP ratio +switch pars.f_CPsea + case 'Fixed' + D.CPsea = pars.CPsea0; + case 'VCI' % NB typo in Bergman (2004) has dependency reversed + D.CPsea = pars.f_CPsea_VCI_oxic*pars.f_CPsea_VCI_anoxic / ((1-D.ANOX)*pars.f_CPsea_VCI_anoxic + D.ANOX*pars.f_CPsea_VCI_oxic); + otherwise + error('unrecognized f_CPsea %s',pars.f_CPsea); +end + +%%%%% nitrogen cycle +if (S.N/16) < S.P + D.nfix = pars.k3_nfix *( ( S.P - (S.N/16) ) / ( pars.P0 - (pars.N0/16) ) )^pars.f_nfix_power ; +else + switch pars.f_nfix_nreplete + case 'Off' % Surely more defensible ? + D.nfix = 0; + case 'Sign' % SD - COPSE 5_14 C code has this (?!) + D.nfix = pars.k3_nfix *( -( S.P - (S.N/16) ) / ( pars.P0 - (pars.N0/16) ) )^pars.f_nfix_power; + fprintf('COPSE_equations -ve nfix (check pars.f_nfix_nreplete) tmodel %g yr \n',tmodel); + otherwise + error('unrecognized f_nfix_nreplete %s',pars.f_nfix_nreplete); + end +end + +% Denitrification NB: COPSE 5_14 uses copse_crash to limit at low N +D.denit = pars.k4_denit * ( 1 + ( D.ANOX / (1-pars.k1_oxfrac) ) )*copse_crash(S.N/pars.N0,'denit',tmodel) ; + +end + diff --git a/code/copse/copse_marinebiota_reloaded.m b/code/copse/copse_marinebiota_reloaded.m new file mode 100644 index 0000000..373ae45 --- /dev/null +++ b/code/copse/copse_marinebiota_reloaded.m @@ -0,0 +1,50 @@ +function D = copse_marinebiota_reloaded(pars, tmodel, S, D ) +%COPSE_MARINEBIOTA COPSE marine ecosystem model +% + +%%%% convert marine nutrient reservoir moles to micromoles/kg concentration +D.Pconc = ( S.P/pars.P0 ) * 2.2 ; +D.Nconc = ( S.N / pars.N0 ) * 30.9 ; + +%%%%% Marine new production +D.newp = 117 * min(D.Nconc/16,D.Pconc) ; + +%%%%%% OCEAN ANOXIC FRACTION +switch pars.f_anoxia + case 'original' + D.ANOX = max( 1 - pars.k1_oxfrac*( D.pO2PAL)*( pars.newp0/D.newp ) , 0 ); + case 'newanoxia' + D.ANOX = 1/(1 + exp(-pars.k_logistic*(pars.k_uptake*(D.newp/pars.newp0)-(D.pO2PAL)))); + otherwise + error('unrecognized f_anoxia %s',pars.f_anoxia); +end + +%%%% CP ratio +switch pars.f_CPsea + case 'Fixed' + D.CPsea = pars.CPsea0; + case 'VCI' % NB typo in Bergman (2004) has dependency reversed + D.CPsea = pars.f_CPsea_VCI_oxic*pars.f_CPsea_VCI_anoxic / ((1-D.ANOX)*pars.f_CPsea_VCI_anoxic + D.ANOX*pars.f_CPsea_VCI_oxic); + otherwise + error('unrecognized f_CPsea %s',pars.f_CPsea); +end + +%%%%% nitrogen cycle +if (S.N/16) < S.P + D.nfix = pars.k3_nfix *( ( S.P - (S.N/16) ) / ( pars.P0 - (pars.N0/16) ) )^pars.f_nfix_power ; +else + D.nfix = 0; +end + +% Denitrification +switch pars.f_denit + case 'original' % NB: COPSE 5_14 uses copse_crash to limit at low N + D.denit = pars.k4_denit * ( 1 + ( D.ANOX / (1-pars.k1_oxfrac) ) )*copse_crash(S.N/pars.N0,'denit',tmodel) ; + case 'new' % Introduce dependence on [NO3] throughout + D.denit = pars.k4_denit * ( 1 + ( D.ANOX / (1-pars.k1_oxfrac) ) )*(S.N/pars.N0) ; + otherwise + error('unrecognized f_denit %s',pars.f_denit); +end + +end + diff --git a/code/copse/copse_model_bergman2004.m b/code/copse/copse_model_bergman2004.m new file mode 100644 index 0000000..ebf40a4 --- /dev/null +++ b/code/copse/copse_model_bergman2004.m @@ -0,0 +1,431 @@ +classdef copse_model_bergman2004 < handle + % Time derivative and diagnostic variables (COPSE 'classic' Bergman etal 2004) + % + % Input: + % tmodel - model time (yr) + % S - state vector (struct) + % + % Output: + % dSdt - time derivative of state vector S (struct, fields matching S) + % D - diagnostic variables (create D and add fields as needed, these will be accumulated into struct 'diag') + % + %%%%%%% COPSE for MATLAB + %%%%%%% ported by B Mills, 2013 + %%%%%%% + %%%%%%% updated by S Daines, 2014 + %%%%%%% + %%%%%%% See also PALEO_examples_COPSE + + properties + pars; % global model constants + + % Set forcing mode for this run + forcemode; % Options 'TimeDep', 'SteadyState'; + timeforceSteadyState; % for SteadyState mode, (constant) time seen by forcings + + force; % cell array of copse_force_xxx instances representing historical forcings. + % These are called either with model time, or a fixed time, depending on the setting of runctrl.forcemode + perturb; % cell array of copse_force_xxx instance. These are always called with model time. + + + end + + methods + + + function [dSdt, D ] = timederiv(obj, tmodel, S ) + % Time derivative and diagnostic variables (monolithic 'copse classic' equations file) + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% CHOOSE FORCING FUNCTIONS + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + switch(obj.forcemode) + case 'SteadyState' + % Disconnect tforce from model time for steady-state with fixed forcing + D.tforce = obj.timeforceSteadyState; + case 'TimeDep' + D.tforce = tmodel; + otherwise + error('unknown forcemode %s',obj.forcemode); + end + + % Default (disabled) values for perturbations + D.CONTAREA = 1; + %%% D.RHO additional enhancement to carbonate/silicate weathering + D.RHO = 1; + %%% F_EPSILON enhances nutrient weathering only + D.F_EPSILON = 1; + %%% Perturbation (injection in mol/yr) to A reservoir + D.co2pert = 0; + D.co2pertmoldelta = 0; + + + % Iterate through forcing and perturbation functions as defined in config file + for i = 1:length(obj.force) + D = obj.force{i}.force( D.tforce - paleo_const.time_present_yr, D ) ; + end + for i = 1:length(obj.perturb) + D = obj.perturb{i}.force( tmodel, D ) ; + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END OF FORCING SETUP + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% CO2 and Temperature + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D.pO2PAL = (S.O/obj.pars.O0); + + %%%%%%%% calculations for pCO2 + D.pCO2PAL = (S.A/obj.pars.A0) ; %pre-industrial = 1 + D.pCO2atm = D.pCO2PAL*obj.pars.pCO2atm0; % pre-industrial = 280e-6 + + %%%%%%% Iteratively improved temperature estimate + D.TEMP = copse_temperature(obj.pars, tmodel, D ,S.temp ); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% END CO2 and Temperature + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%% land biota + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D = copse_landbiota_bergman2004(obj.pars, tmodel, S, D, D.TEMP ); + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% calculate weathering + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%% Plant effects on weathering + + D.f_preplant = copse_f_T(D.TEMP) * (D.pCO2PAL^0.5) ; + D.f_plant = copse_f_T(D.TEMP) * ( ( 2*D.pCO2PAL / (1 + D.pCO2PAL) )^0.4 ) ; + + D.g_preplant = copse_g_T(D.TEMP) * (D.pCO2PAL^0.5); + D.g_plant = copse_g_T(D.TEMP) * ( ( 2*D.pCO2PAL / (1 + D.pCO2PAL) )^0.4 ) ; + + D.VWmin = min(D.VEG*D.W,1); + + D.f_co2 = D.f_preplant*(1 - D.VWmin) + D.f_plant*D.VWmin ; + D.g_co2 = D.g_preplant*(1 - D.VWmin) + D.g_plant*D.VWmin ; + + D.w_plantenhance = ( obj.pars.k15_plantenhance + (1-obj.pars.k15_plantenhance)*D.W*D.VEG ); + + %%% silicate and carbonate weathering + D.silw = obj.pars.k_silw*D.CONTAREA*D.UPLIFT*D.RHO* D.w_plantenhance *D.f_co2 ; + D.carbw_fac = D.CONTAREA*D.UPLIFT*D.RHO*D.w_plantenhance*D.g_co2 ; + switch(obj.pars.f_carbwC) + case 'Cindep' % Copse 5_14 + D.carbw = obj.pars.k14_carbw*D.carbw_fac; + case 'Cprop' % A generalization for varying-size C reservoir + D.carbw = obj.pars.k14_carbw*D.carbw_fac*(S.C/obj.pars.C0); + otherwise + error('Unknown f_carbw %s',obj.pars.f_carbw); + end + + %%%% Oxidative weathering + % Functional form of oxidative weathering + switch(obj.pars.f_oxwO) + case 'PowerO2' % Copse 5_14 base with f_oxw_a = 0.5 + D.oxw_fac = (S.O/obj.pars.O0)^obj.pars.f_oxw_a; + case 'SatO2' + D.oxw_fac = (S.O/obj.pars.O0)/((S.O/obj.pars.O0) + obj.pars.f_oxw_halfsat); + otherwise + error('Unknown f_foxwO %s',obj.pars.f_oxwO); + end + + % C oxidative weathering + D.oxidw = obj.pars.k17_oxidw*D.CONTAREA*D.UPLIFT*(S.G/obj.pars.G0)*D.oxw_fac ; + + % Sulphur weathering + switch(obj.pars.Scycle) + case 'Enabled' + % Gypsum weathering tied to carbonate weathering + D.gypw = obj.pars.k22_gypw*(S.GYP/obj.pars.GYP0)*D.carbw_fac ; + % Pyrite oxidative weathering with same functional form as carbon + D.pyrw = obj.pars.k21_pyrw*D.CONTAREA*D.UPLIFT*(S.PYR/obj.pars.PYR0)*D.oxw_fac ; + case 'None' + D.gypw = 0; + D.pyrw = 0; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + + %%%%%%% P weathering and delivery to land and sea + D.phosw_s = D.F_EPSILON*obj.pars.k10_phosw*(2/12)*(D.silw/obj.pars.k_silw) ; + D.phosw_c = D.F_EPSILON*obj.pars.k10_phosw*(5/12)*(D.carbw/obj.pars.k14_carbw); + D.phosw_o = D.F_EPSILON*obj.pars.k10_phosw*(5/12)*(D.oxidw/obj.pars.k17_oxidw) ; + D.phosw = D.phosw_s + D.phosw_c + D.phosw_o; + + D.pland = obj.pars.k11_landfrac*D.VEG*D.phosw ; + pland0 = obj.pars.k11_landfrac*obj.pars.k10_phosw; + + D.psea = D.phosw - D.pland ; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% END calculate weathering + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% calculate degassing + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Inorganic carbon + D.ccdeg = obj.pars.k12_ccdeg*D.DEGASS*(S.C/obj.pars.C0)*D.Bforcing ; + + % Organic carbon + switch obj.pars.f_ocdeg + case 'O2indep' + D.ocdeg = obj.pars.k13_ocdeg*D.DEGASS*(S.G/obj.pars.G0) ; + case 'O2copsecrashprevent' + % COPSE 5_14 does this (always) apparently to prevent pO2 dropping to zero ? + % This has a big effect when pO2 dependence of oxidative weathering switched off + D.ocdeg = obj.pars.k13_ocdeg*D.DEGASS*(S.G/obj.pars.G0)*copse_crash(S.O/obj.pars.O0,'ocdeg',tmodel); + otherwise + error('unrecogized obj.pars.f_ocdeg %s',obj.pars.Scycle); + end + + % Sulphur + switch(obj.pars.Scycle) + case 'Enabled' + D.pyrdeg = obj.pars.k_pyrdeg*(S.PYR/obj.pars.PYR0)*D.DEGASS; + D.gypdeg = obj.pars.k_gypdeg*(S.GYP/obj.pars.GYP0)*D.DEGASS; + case 'None' + D.pyrdeg = 0; + D.gypdeg = 0; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% END calculate degassing + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Marine biota + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D = copse_marinebiota_bergman2004(obj.pars, tmodel, S, D ); + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Burial + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%% Oxidised C species burial + D.mccb = D.carbw + D.silw ; % disguised alkalinity balance + + %%%%% Reduced C species burial + % Marine organic carbon burial + D.mocb = obj.pars.k2_mocb*((D.newp/obj.pars.newp0)^obj.pars.f_mocb_b) ; + % Land organic carbon burial + D.locb = obj.pars.k5_locb*(D.pland/pland0)*D.CPland_relative ; + + % Marine organic P burial + D.mopb = ( D.mocb/D.CPsea ) ; + % Marine carbonate-associated P burial + D.capb = obj.pars.k7_capb*( (D.newp/obj.pars.newp0)^obj.pars.f_mocb_b ); + % Marine Fe-sorbed P burial NB: COPSE 5_14 uses copse_crash to limit at low P + D.fepb = (obj.pars.k6_fepb/obj.pars.k1_oxfrac)*(1-D.ANOX)*copse_crash(S.P/obj.pars.P0,'fepb',tmodel) ; + + % Marine organic nitrogen burial + D.monb = D.mocb/obj.pars.CNsea0 ; + + % Marine sulphur burial + switch(obj.pars.Scycle) + case 'Enabled' + % Marine gypsum sulphur burial + D.mgsb = obj.pars.k_mgsb*(S.S/obj.pars.S0)*(S.CAL/obj.pars.CAL0) ; + % Marine pyrite sulphur burial + switch(obj.pars.f_pyrburial) + case 'copse_noO2' % dependent on sulphate and marine carbon burial + D.mpsb = obj.pars.k_mpsb*(S.S/obj.pars.S0)*(D.mocb/obj.pars.k2_mocb) ; + case 'copse_O2' % dependent on oxygen, sulphate, and marine carbon burial + D.mpsb = obj.pars.k_mpsb*(S.S/obj.pars.S0)/(S.O/obj.pars.O0)*(D.mocb/obj.pars.k2_mocb) ; + otherwise + error('unknown f_pyrburial %s',obj.pars.f_pyrburial); + end + case 'None' + D.mgsb = 0; + D.mpsb = 0; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END Burial + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Update state variables / reservoirs + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%% Iterated temperature + dSdt.temp = D.TEMP - S.temp ; + + %%%% Atmosphere / ocean reservoirs + + %%% Oxygen + if obj.pars.o2fix == 1 + dSdt.O=0; + else + dSdt.O = D.locb + D.mocb - D.oxidw - D.ocdeg + (2)*(D.mpsb - D.pyrw - D.pyrdeg) ; + end + + %%% Carbon + dSdt.A = -D.locb -D.mocb + D.oxidw + D.ocdeg + D.ccdeg + D.carbw - D.mccb + D.co2pert ; + % dSdt.A=0; + + % Marine nutrient reserviors + dSdt.P = D.psea - D.mopb - D.capb - D.fepb ; + dSdt.N = D.nfix - D.denit - D.monb; + + %%% Marine calcium + dSdt.CAL = D.silw + D.carbw + D.gypw - D.mccb -D.mgsb; + + %%%% Crustal C reservoirs + %%%Buried organic C + dSdt.G = D.locb + D.mocb -D.oxidw -D.ocdeg ; + + %%% Buried carb C + dSdt.C = D.mccb - D.carbw - D.ccdeg ; + + %%%%%%% C isotope fractionation + + % Carbon isotope fractionation (relative to total CO2 (A reservoir) + switch(obj.pars.f_cisotopefrac) + case 'fixed' + D.d_mocb = -30; + D.d_locb = -30; + D.d_mccb = 0; + case 'copse_base' + [ D.d_locb, D_P, D.d_mocb, D_B, D.d_mccb, d_ocean, d_atmos ] = copse_Cisotopefrac( D.TEMP, D.pCO2PAL, S.O/obj.pars.O0 ); + case 'copse_noO2' + [ D.d_locb, D_P, D.d_mocb, D_B, D.d_mccb, d_ocean, d_atmos ] = copse_Cisotopefrac( D.TEMP, D.pCO2PAL, 1 ); + otherwise + error('unknown f_cisotopefrac %s',obj.pars.f_cisotopefrac); + end + + + %%%%%%% calculate isotopic fractionation of reservoirs + + D.delta_G = S.moldelta_G/S.G; + D.delta_C = S.moldelta_C/S.C; + D.delta_A = S.moldelta_A/S.A ; + + % isotopic fractionation of mccb + D.delta_mccb = D.delta_A + D.d_mccb; + + % deltaORG_C*ORG_C + dSdt.moldelta_G = D.mocb*( D.delta_A + D.d_mocb ) + D.locb*( D.delta_A + D.d_locb ) ... + - D.oxidw*D.delta_G - D.ocdeg*D.delta_G ; + + % deltaCARB_C*CARB_C + dSdt.moldelta_C = D.mccb*D.delta_mccb - D.carbw*D.delta_C - D.ccdeg*D.delta_C ; + + %%% delta_A * A + dSdt.moldelta_A = -D.locb*( D.delta_A + D.d_locb ) -D.mocb*( D.delta_A + D.d_mocb ) ... + + D.oxidw*D.delta_G + D.ocdeg*D.delta_G + D.ccdeg*D.delta_C ... + + D.carbw*D.delta_C - D.mccb*D.delta_mccb + D.co2pertmoldelta ; + + + % Sulphur + switch(obj.pars.Scycle) + case 'Enabled' + %%% Marine sulphate + dSdt.S = D.gypw + D.pyrw -D.mgsb - D.mpsb +D.gypdeg + D.pyrdeg ; + % dSdt.S=0; + %%% Buried pyrite S + dSdt.PYR = D.mpsb - D.pyrw - D.pyrdeg ; + %%% Buried gypsum S + dSdt.GYP = D.mgsb - D.gypw -D.gypdeg ; + + %Isotopes + + %Pyrite sulphur isotope fractionation relative to sulphate and gypsum + switch(obj.pars.f_sisotopefrac) + case 'fixed' + D.D_mpsb = 35; + case 'copse_O2' + D.D_mpsb = 35*(S.O/obj.pars.O0); + otherwise + error('unknown f_sisotopefrac %s',obj.pars.f_sisotopefrac); + end + + D.delta_GYP = S.moldelta_GYP/S.GYP; + D.delta_PYR = S.moldelta_PYR/S.PYR; + D.delta_S = S.moldelta_S/S.S; + % deltaPYR_S*PYR_S + dSdt.moldelta_PYR = D.mpsb*( D.delta_S - D.D_mpsb ) - D.pyrw*D.delta_PYR - D.pyrdeg*D.delta_PYR ; + % deltaGYP_S*GYP_S + dSdt.moldelta_GYP = D.mgsb*D.delta_S - D.gypw*D.delta_GYP - D.gypdeg*D.delta_GYP ; + %%% delta_S * S + dSdt.moldelta_S = D.gypw*D.delta_GYP + D.pyrw*D.delta_PYR - D.mgsb*D.delta_S -D.mpsb*(D.delta_S - D.D_mpsb ) +D.gypdeg*D.delta_GYP + D.pyrdeg*D.delta_PYR ; + + case 'None' + otherwise + error('unrecognized obj.pars.Scycle %s',obj.pars.Scycle); + end + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END update reservoirs + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END COPSE_equations + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + + + function Sinit = initialise(obj) + %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Initialise reservoir (state variable) sizes etc + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %LN = 'copse_model_bergman2004.initialise'; L = paleo_log.getLogger('copse_model'); + + Sinit = struct; + + Sinit.P = obj.pars.Pinit; + Sinit.O = obj.pars.Oinit; + Sinit.A = obj.pars.Ainit; + Sinit.G = obj.pars.Ginit; + Sinit.C = obj.pars.Cinit; + Sinit.CAL = obj.pars.CALinit; + Sinit.N = obj.pars.Ninit; + + %Initialise C isotope reservoirs + Sinit.moldelta_G = Sinit.G*obj.pars.delta_Ginit; + Sinit.moldelta_C = Sinit.C*obj.pars.delta_Cinit; + Sinit.moldelta_A = Sinit.A*obj.pars.delta_Ainit; + + %Initialise S cycle if required + switch obj.pars.Scycle + case 'Enabled' + Sinit.S = obj.pars.Sinit; + Sinit.PYR = obj.pars.PYRinit; + Sinit.GYP = obj.pars.GYPinit; + Sinit.moldelta_PYR = Sinit.PYR*obj.pars.delta_PYRinit; + Sinit.moldelta_GYP = Sinit.GYP*obj.pars.delta_GYPinit; + Sinit.moldelta_S = Sinit.S*obj.pars.delta_Sinit; + case 'None' + % no S reservoirs + otherwise + error('unrecognized obj.pars.Scycle %s',obj.pars.Scycle); + end + + % Initialise temperature + Sinit.temp = paleo_const.k_CtoK+15; + + end + + + end + +end + diff --git a/code/copse/copse_model_mills2014g3.m b/code/copse/copse_model_mills2014g3.m new file mode 100644 index 0000000..2c806c2 --- /dev/null +++ b/code/copse/copse_model_mills2014g3.m @@ -0,0 +1,580 @@ +classdef copse_model_mills2014g3 < handle + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% COPSE for MATLAB + %%%%%%% ported by B Mills, 2013 + %%%%%%% + %%%%%%% updated by S Daines, 2014 + %%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + properties + pars; % global model constants + + forcemode = 'TimeDep'; % Set forcing mode for this run(options 'TimeDep', 'SteadyState') + timeforceSteadyState; % For forcemode='SteadyState', (constant) time seen by forcings + + force; % Cell array of copse_force_xxx instances representing historical forcings. + % (these are called either with model time, or a fixed time, depending on the setting of runctrl.forcemode) + + perturb; % Cell array of copse_force_xxx instances (these are always called with model time). + + Tstart; %%% added for sr system + + end + + methods + + function [dSdt, D] = timederiv(obj, tmodel, S) + % Time derivative and diagnostic variables (COPSE Mills (2014) G3 equations) + % + % Args: + % tmodel (float): (yr) model time + % S (struct): state vector + % + % Returns: + % dSdt (struct): time derivative of state vector S (struct, fields matching S) + % D (struct): diagnostic variables (create D and add fields as needed, these will be accumulated into struct 'diag') + % + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% CHOOSE FORCING FUNCTIONS + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + switch(obj.forcemode) + case 'SteadyState' + % Disconnect tforce from model time for steady-state with fixed forcing + D.tforce = obj.timeforceSteadyState; + case 'TimeDep' + % Usual forward-model case + D.tforce = tmodel; + otherwise + error('unknown forcemode %s',obj.forcemode); + end + + % Default (disabled) values for forcings / perturbations. + % These are (re)set by forcing functions, if in use. + % NB: many forcings have no default and are not set here. + % + % D.RHO additional enhancement to carbonate/silicate weathering + D.RHO = 1; + % D.RHOSFW additional enhancement to seafloor weathering + D.RHOSFW = 1; + % F_EPSILON enhances nutrient weathering only + D.F_EPSILON = 1; + % PG paleogeog weathering factor + D.PG = 1; + % Basalt area relative to present day + D.BA = 1; + % Land temperature adjustment + D.GEOG = 0; + % Granite area relative to present day + D.GRAN_AREA = 1; + % Carbonate area relative to present day + D.CARB_AREA = 1; + % Total land area relative to present day + D.TOTAL_AREA = 1; + % C/P land multiplier + D.CPland_relative = 1; + % P to land multiplier + D.Ptoland = 1; + % LIP area and co2 + D.CFB_area = 0; % no sensible default - if used, supplied by forcing + D.LIP_CO2 = 0; + D.LIP_CO2moldelta = 0; + % Perturbation (injection in mol/yr) to A reservoir + D.co2pert = 0; + D.co2pertmoldelta = 0; + % Alteration of fire feedback + D.fireforcing = 1; + + % Iterate through forcing and perturbation functions as defined in config file + for i = 1:length(obj.force) + D = obj.force{i}.force( D.tforce - paleo_const.time_present_yr, D ) ; + end + for i = 1:length(obj.perturb) + D = obj.perturb{i}.force( tmodel, D ) ; + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END OF FORCING SETUP + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% CO2 and Temperature + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D.pO2PAL = (S.O/obj.pars.O0); + + %%%%%%%% calculations for pCO2 + switch(obj.pars.f_atfrac) + case 'original' + D.pCO2PAL = (S.A/obj.pars.A0) ; %pre-industrial = 1 + D.phi = 0.01614 ; + case 'quadratic' + D.pCO2PAL = (S.A/obj.pars.A0)^2 ; + D.phi = 0.01614*(S.A/obj.pars.A0) ; + otherwise + error('Unknown f_atfrac %s',obj.pars.f_atfrac); + end + + D.pCO2atm = D.pCO2PAL*obj.pars.pCO2atm0; % pre-industrial = 280e-6 + + %%%%%%% Iteratively improved temperature estimate + D.TEMP = copse_temperature( obj.pars, tmodel, D, S.temp ); + D.GLOBALT = D.TEMP; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% END CO2 and Temperature + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%% land biota + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D = copse_landbiota_mills2014g3( obj.pars, tmodel, S, D, D.TEMP ); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% calculate weathering + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % calculate relative land surface areas + D = copse_landsurfaceareas_mills2014g3( obj.pars, tmodel, S, D ); + + % define normalisation for convenience, to decouple copse_weathering_ functions so they can be reused for modular version + D.normG = S.G/obj.pars.G0; + D.normC = S.C/obj.pars.C0; + switch(obj.pars.Scycle) + case 'Enabled' + D.normPYR = S.PYR/obj.pars.PYR0; + D.normGYP = S.GYP/obj.pars.GYP0; + case 'None' + D.normPYR = 1; + D.normGYP = 1; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + + D = copse_weathering_rates_mills2014g3( obj.pars, tmodel, S, D ); + + D = copse_weathering_fluxes_reloaded( obj.pars, tmodel, S, D ); + + D.pland = obj.pars.k11_landfrac*D.VEG*D.phosw ; + + + D.psea = D.phosw - D.pland ; + + % Seafloor weathering (SD kept this separate so weathering functions just include land surface) + D = copse_weathering_seafloor_reloaded( obj.pars, tmodel, S, D ); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% END calculate weathering + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% calculate degassing + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Inorganic carbon + switch obj.pars.f_ccdeg + case 'original' + D.ccdeg = obj.pars.k12_ccdeg*D.DEGASS*(S.C/obj.pars.C0)*D.Bforcing ; + case 'noB' + D.ccdeg = obj.pars.k12_ccdeg*D.DEGASS*(S.C/obj.pars.C0) ; + otherwise + error('unrecogized obj.pars.f_ccdeg %s',obj.pars.f_ccdeg); + end + + + % Organic carbon + switch obj.pars.f_ocdeg + case 'O2indep' + D.ocdeg = obj.pars.k13_ocdeg*D.DEGASS*(S.G/obj.pars.G0) ; + case 'O2copsecrashprevent' + % COPSE 5_14 does this (always) apparently to prevent pO2 dropping to zero ? + % This has a big effect when pO2 dependence of oxidative weathering switched off + D.ocdeg = obj.pars.k13_ocdeg*D.DEGASS*(S.G/obj.pars.G0)*copse_crash(S.O/obj.pars.O0,'ocdeg',tmodel); + otherwise + error('unrecogized obj.pars.f_ocdeg %s',obj.pars.f_ocdeg); + end + + % Sulphur + switch(obj.pars.Scycle) + case 'Enabled' + D.pyrdeg = obj.pars.k_pyrdeg*(S.PYR/obj.pars.PYR0)*D.DEGASS; + D.gypdeg = obj.pars.k_gypdeg*(S.GYP/obj.pars.GYP0)*D.DEGASS; + case 'None' + D.pyrdeg = 0; + D.gypdeg = 0; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% END calculate degassing + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Marine biota + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D = copse_marinebiota_bergman2004( obj.pars, tmodel, S, D ); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Burial + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%% Reduced C species burial + % Marine organic carbon burial + D.mocb = obj.pars.k2_mocb*((D.newp/obj.pars.newp0)^obj.pars.f_mocb_b) ; + + % Land organic carbon burial - uplift control in pland + D.locb = D.pland*obj.pars.CPland0*D.CPland_relative ; + + % Marine organic P burial + D.mopb = ( D.mocb/D.CPsea ) ; + % Marine carbonate-associated P burial + switch(obj.pars.f_capb) + case 'original' + D.capb = obj.pars.k7_capb*( (D.newp/obj.pars.newp0)^obj.pars.f_mocb_b ); + case 'redox' + D.capb = obj.pars.k7_capb*( (D.newp/obj.pars.newp0)^obj.pars.f_mocb_b )*(0.5+0.5*(1-D.ANOX)/obj.pars.k1_oxfrac); + otherwise + error('unknown f_capb %s',obj.pars.f_capb); + end + % Marine Fe-sorbed P burial NB: COPSE 5_14 uses copse_crash to limit at low P + switch(obj.pars.f_fepb) + case 'original' + D.fepb = (obj.pars.k6_fepb/obj.pars.k1_oxfrac)*(1-D.ANOX)*copse_crash(S.P/obj.pars.P0,'fepb',tmodel) ; + case 'gcubed' %%%% remove copse_crash as in G3 model + D.fepb = (obj.pars.k6_fepb/obj.pars.k1_oxfrac)*(1-D.ANOX) ; + otherwise + error('unknown f_fepb %s',obj.pars.f_fepb); + end + % Marine organic nitrogen burial + D.monb = D.mocb/obj.pars.CNsea0 ; + + % Marine sulphur burial + switch(obj.pars.Scycle) + case 'Enabled' + % Marine gypsum sulphur burial + D.mgsb = obj.pars.k_mgsb*(S.S/obj.pars.S0)*(S.CAL/obj.pars.CAL0) ; + + % Marine pyrite sulphur burial + switch(obj.pars.f_pyrburial) + case 'copse_noO2' % dependent on sulphate and marine carbon burial + D.mpsb = obj.pars.k_mpsb*(S.S/obj.pars.S0)*(D.mocb/obj.pars.k2_mocb) ; + case 'copse_O2' % dependent on oxygen, sulphate, and marine carbon burial + D.mpsb = obj.pars.k_mpsb*(S.S/obj.pars.S0)/(S.O/obj.pars.O0)*(D.mocb/obj.pars.k2_mocb) ; + otherwise + error('unknown f_pyrburial %s',obj.pars.f_pyrburial); + end + case 'None' + D.mgsb = 0; + D.mpsb = 0; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + %%%% marine carbonate carbon burial from alkalinity balance + switch obj.pars.f_SRedoxAlk + case 'on' + %%%%% couple pyrite weathering / burial to marine alkalinity balance TODO is this correct Alk vs S ? + D.mccb = D.carbw + D.silw + (D.mpsb - D.pyrw) ; + case 'degassing' + %%%%% includes pyrite and gypsum degassing as a source of H2SO4: + D.mccb = D.carbw + D.silw + (D.mpsb - D.pyrw - D.pyrdeg - D.gypdeg) ; + case 'off' + %%%%% Oxidised C species burial + D.mccb = D.carbw + D.silw ; + otherwise + error('unrecognized f_SRedoxAlk %s', obj.pars.f_SRedoxAlk); + end + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END Burial + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Update state variables / reservoirs + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%% Iterated temperature + dSdt.temp = D.TEMP - S.temp ; + + %%%% Atmosphere / ocean reservoirs + + %%%% Oxygen + if obj.pars.o2fix == 1 + dSdt.O=0; + else + dSdt.O = D.locb + D.mocb - D.oxidw - D.ocdeg + (2)*(D.mpsb - D.pyrw - D.pyrdeg) ; + end + + %%%% Carbon dioxide + dSdt.A = -D.locb - D.mocb + D.oxidw + D.ocdeg + D.ccdeg - D.mccb + D.carbw - D.sfw + D.LIP_CO2 + D.co2pert ; + + %%%% Marine nutrient reserviors + dSdt.P = D.psea - D.mopb - D.capb - D.fepb ; + dSdt.N = D.nfix - D.denit - D.monb; + + %%%% Marine calcium + dSdt.CAL = D.silw + D.carbw + D.gypw - D.mccb -D.mgsb; + + %%%% Crustal C reservoirs + %%%% Buried organic C + dSdt.G = D.locb + D.mocb -D.oxidw -D.ocdeg ; + + %%%% Buried carb C + dSdt.C = D.mccb + D.sfw - D.carbw - D.ccdeg ; + + %%%% C isotope fractionation + + % Carbon isotope fractionation (relative to total CO2 (A reservoir) + switch(obj.pars.f_cisotopefrac) + case 'fixed' + D.d_mocb = -30; + D.d_locb = -30; + D.d_mccb = 0; + case 'fixed2' % TL 2016 better values + D.d_mocb = -27; + D.d_locb = -27; + D.d_mccb = 0.5; + case 'copse_base' + [ D.d_locb, D.D_P, D.d_mocb, D.D_B, D.d_mccb, D.d_ocean, D.d_atmos ] = copse_Cisotopefrac( D.TEMP, D.pCO2PAL, S.O/obj.pars.O0, D.phi ); + case 'copse_noO2' + [ D.d_locb, D.D_P, D.d_mocb, D.D_B, D.d_mccb, D.d_ocean, D.d_atmos ] = copse_Cisotopefrac( D.TEMP, D.pCO2PAL, 1, D.phi ); + otherwise + error('unknown f_cisotopefrac %s',obj.pars.f_cisotopefrac); + end + + + %%%%%%% calculate isotopic fractionation of reservoirs + + D.delta_G = S.moldelta_G/S.G; + D.delta_C = S.moldelta_C/S.C; + D.delta_A = S.moldelta_A/S.A ; + + % isotopic fractionation of mccb + D.delta_mccb = D.delta_A + D.d_mccb; + + D.d13Cin = (D.oxidw*D.delta_G + D.ocdeg*D.delta_G + D.ccdeg*D.delta_C + D.carbw*D.delta_C)/(D.oxidw + D.ocdeg + D.ccdeg + D.carbw) ; + D.d13Cout = (D.locb*( D.delta_A + D.d_locb ) + D.mocb*( D.delta_A + D.d_mocb ) + (D.sfw + D.mccb)*D.delta_mccb)/(D.locb + D.mocb + D.mccb + D.sfw) ; + D.avgfrac = (D.mocb*(D.delta_A+D.d_mocb)+D.locb*(D.delta_A+D.d_locb))/((D.mocb+D.locb)*D.delta_A) ; + + % deltaORG_C*ORG_C + dSdt.moldelta_G = D.mocb*( D.delta_A + D.d_mocb ) + D.locb*( D.delta_A + D.d_locb ) - D.oxidw*D.delta_G - D.ocdeg*D.delta_G ; + + % deltaCARB_C*CARB_C + dSdt.moldelta_C = (D.mccb + D.sfw)*D.delta_mccb - D.carbw*D.delta_C - D.ccdeg*D.delta_C ; + + %%% delta_A * A + dSdt.moldelta_A = -D.locb*( D.delta_A + D.d_locb ) -D.mocb*( D.delta_A + D.d_mocb ) ... + + D.oxidw*D.delta_G + D.ocdeg*D.delta_G + D.ccdeg*D.delta_C + D.carbw*D.delta_C ... + - (D.mccb + D.sfw)*D.delta_mccb + D.LIP_CO2moldelta+ D.co2pertmoldelta ; + + + % Sulphur + switch(obj.pars.Scycle) + case 'Enabled' + %%% Marine sulphate + dSdt.S = D.gypw + D.pyrw -D.mgsb - D.mpsb +D.gypdeg + D.pyrdeg ; + % dSdt.S=0; + %%% Buried pyrite S + dSdt.PYR = D.mpsb - D.pyrw - D.pyrdeg ; + %%% Buried gypsum S + dSdt.GYP = D.mgsb - D.gypw -D.gypdeg ; + + %Isotopes + + %Pyrite sulphur isotope fractionation relative to sulphate and gypsum + switch(obj.pars.f_sisotopefrac) + case 'fixed' + D.D_mpsb = 35; + case 'copse_O2' + D.D_mpsb = 35*(S.O/obj.pars.O0); + otherwise + error('unknown f_sisotopefrac %s',obj.pars.f_sisotopefrac); + end + + D.delta_GYP = S.moldelta_GYP/S.GYP; + D.delta_PYR = S.moldelta_PYR/S.PYR; + D.delta_S = S.moldelta_S/S.S; + % deltaPYR_S*PYR_S + dSdt.moldelta_PYR = D.mpsb*( D.delta_S - D.D_mpsb ) - D.pyrw*D.delta_PYR - D.pyrdeg*D.delta_PYR ; + % deltaGYP_S*GYP_S + dSdt.moldelta_GYP = D.mgsb*D.delta_S - D.gypw*D.delta_GYP - D.gypdeg*D.delta_GYP ; + %%% delta_S * S + dSdt.moldelta_S = D.gypw*D.delta_GYP + D.pyrw*D.delta_PYR - D.mgsb*D.delta_S -D.mpsb*(D.delta_S - D.D_mpsb ) +D.gypdeg*D.delta_GYP + D.pyrdeg*D.delta_PYR ; + + case 'None' + otherwise + error('unrecognized obj.pars.Scycle %s',obj.pars.Scycle); + end + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Strontium system + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%% + % flux calculations + %%%%%%%%%%%%%%%%%%%%%%%% + + %%%% ocean inputs + D.Sr_old_igw = obj.pars.k_Sr_igg * ( D.granw / obj.pars.k_granw ) ; %%% weathering of old igneous rocks + D.Sr_new_igw = obj.pars.k_Sr_igb * ( D.basw / obj.pars.k_basw) ; %%% weathering of new igneous rocks + D.Sr_mantle = obj.pars.k_Sr_mantle * D.DEGASS ; + + switch(obj.pars.f_Sr_sedw) + case 'original' + D.Sr_sedw = obj.pars.k_Sr_sedw * ( D.carbw / obj.pars.k14_carbw ) ; %%% carbonate weathering + case 'alternative' + D.Sr_sedw = obj.pars.k_Sr_sedw * ( D.carbw / obj.pars.k14_carbw ) * (S.Sr_sed / obj.pars.Sr_sed0) ; + otherwise + error('unrecognized f_Sr_sedw %s', obj.pars.f_Sr_sedw); + end + + %%%% Sr outputs to sediments + switch obj.pars.f_bug_g32014_Srconc + case 'No' + %%%% what it should have been without bugs + Sr_ocean_relative = ( S.Sr_ocean / obj.pars.Sr_ocean0 ) ; %%% assume dependence on Sr conc in ocean + case 'Yes' + %%%% outputs to sediments INCLUDING BUG FROM G3 PAPER: moldelta_Sr_ocean used instead of Sr_ocean, oops! + Sr_ocean_relative = ( S.moldelta_Sr_ocean / obj.pars.Sr_ocean0 ); + otherwise + error('unrecognized f_bug_g32014_Srconc %s', obj.pars.f_bug_g32014_Srconc); + end + D.Sr_sfw = obj.pars.k_Sr_sfw * ( D.sfw_relative ) * Sr_ocean_relative ; %%% assume dependence on Sr conc in ocean + D.Sr_sedb = obj.pars.k_Sr_sedb * ( ( D.silw + D.carbw ) / ( obj.pars.k_silw + obj.pars.k14_carbw ) ) * Sr_ocean_relative ; %%% assume dependence on Sr conc in ocean + + Sr_sed_relative = (S.Sr_sed / obj.pars.Sr_sed0) ; + %%%% loss from sediments + switch(obj.pars.f_Sr_metam) + case 'original' + D.Sr_metam = obj.pars.k_Sr_metam * D.DEGASS ; + case 'alternative' + D.Sr_metam = obj.pars.k_Sr_metam * Sr_sed_relative * D.DEGASS ; + otherwise + error('unrecognized f_Sr_metam %s', obj.pars.f_Sr_metam); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%% ISOTOPE calculations %%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % present day isotope values pars.delta_ defined in .yaml file + + %%%% Sr ratios increasing with time due to 87Rb decay + lambda_Rb = 1.4e-11 ; + d_Sr_0 = 0.69898 ; %%% value at formation of earth + t_present = 4.5e9 ; %%% present time + %%%%% calculate Rb to Sr ratios at present day value (assume unchanging) + d_RbSr_old_ig = (obj.pars.delta_old_ig_present - d_Sr_0)/( 1 - exp(-lambda_Rb*t_present) ) ; + d_RbSr_new_ig = (obj.pars.delta_new_ig_present - d_Sr_0)/( 1 - exp(-lambda_Rb*t_present) ) ; + d_RbSr_mantle = (obj.pars.delta_mantle_present - d_Sr_0)/( 1 - exp(-lambda_Rb*t_present) ) ; + + sediment_rbsr = 0.5 ; %%% present-day inferred from avg crustal value + + %%%% for each timestep calculate d_Sr and d_RbSr + tforwards = 4.5e9 + tmodel ; %%% get old model time from paleo time + D.delta_old_ig = d_Sr_0 + d_RbSr_old_ig*( 1 - exp(-lambda_Rb*tforwards) ) ; + D.delta_new_ig = d_Sr_0 + d_RbSr_new_ig*( 1 - exp(-lambda_Rb*tforwards) ) ; + D.delta_mantle = d_Sr_0 + d_RbSr_mantle*( 1 - exp(-lambda_Rb*tforwards) ) ; + + %%% calculate fractionations in ocean and sediment reservoirs + D.delta_Sr_ocean = S.moldelta_Sr_ocean/S.Sr_ocean; + + whenstart_forwards = obj.Tstart + 4.5e9 ; %%% forwards time for start of this run + D.sediment_sr_evol = sediment_rbsr*( 1 - exp(-lambda_Rb*( tforwards - whenstart_forwards ) ) ) ; %%% term for added 8786sr fractionation + D.delta_Sr_sed = ( S.moldelta_Sr_sed / S.Sr_sed ) + D.sediment_sr_evol ; %%% increasing due to decay + D.dmoldelta_Sr_sed_dt_Rb = 0; + + %%% calculate igneous river composition for plotting + D.delta_igw = (D.Sr_old_igw*D.delta_old_ig + D.Sr_new_igw*D.delta_new_ig)/(D.Sr_old_igw+D.Sr_new_igw) ; + + %%%%%%%%%%%%%%%%%%%%%%%% + % reservoir calculations + %%%%%%%%%%%%%%%%%%%%%%%% + + %%% Ocean Sr + dSdt.Sr_ocean = D.Sr_old_igw + D.Sr_new_igw + D.Sr_sedw + D.Sr_mantle - D.Sr_sedb - D.Sr_sfw ; + + %%% Sediment Sr + dSdt.Sr_sed = D.Sr_sedb - D.Sr_sedw - D.Sr_metam ; + + %%% Ocean Sr * frac + dSdt.moldelta_Sr_ocean = D.Sr_old_igw*D.delta_old_ig + D.Sr_new_igw*D.delta_new_ig + D.Sr_sedw*D.delta_Sr_sed + D.Sr_mantle*D.delta_mantle - D.Sr_sedb*D.delta_Sr_ocean - D.Sr_sfw*D.delta_Sr_ocean ; + + %%% Sediment Sr * frac + dSdt.moldelta_Sr_sed = D.Sr_sedb*D.delta_Sr_ocean - D.Sr_sedw*D.delta_Sr_sed - D.Sr_metam*D.delta_Sr_sed + D.dmoldelta_Sr_sed_dt_Rb; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END strontium system + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END update reservoirs + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END timederiv() + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + + function Sinit = initialise(obj) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Initialise reservoir (state variable) sizes etc + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %LN = 'copse_model_reloaded.initialise'; L = paleo_log.getLogger('copse_model'); + + Sinit = struct; + + Sinit.P = obj.pars.Pinit; + Sinit.O = obj.pars.Oinit; + Sinit.A = obj.pars.Ainit; + Sinit.G = obj.pars.Ginit; + Sinit.C = obj.pars.Cinit; + Sinit.CAL = obj.pars.CALinit; + Sinit.N = obj.pars.Ninit; + + % Initalise Sr + Sinit.Sr_ocean = obj.pars.Sr_ocean_init; + Sinit.Sr_sed = obj.pars.Sr_sed_init; + + + % Initialise C isotope reservoirs + Sinit.moldelta_G = Sinit.G*obj.pars.delta_Ginit; + Sinit.moldelta_C = Sinit.C*obj.pars.delta_Cinit ; + Sinit.moldelta_A = Sinit.A*obj.pars.delta_Ainit; + + % Initialise Sr isotope reservoirs + Sinit.moldelta_Sr_ocean = Sinit.Sr_ocean * obj.pars.delta_Sr_ocean_start; + Sinit.moldelta_Sr_sed = Sinit.Sr_sed * obj.pars.delta_Sr_sed_start; + + + % Initialise S cycle if required + switch obj.pars.Scycle + case 'Enabled' + Sinit.S = obj.pars.Sinit; + Sinit.PYR = obj.pars.PYRinit; + Sinit.GYP = obj.pars.GYPinit; + Sinit.moldelta_PYR = Sinit.PYR*obj.pars.delta_PYRinit; + Sinit.moldelta_GYP = Sinit.GYP*obj.pars.delta_GYPinit; + Sinit.moldelta_S = Sinit.S*obj.pars.delta_Sinit; + case 'None' + % no S reservoirs + otherwise + error('unrecognized obj.pars.Scycle %s',obj.pars.Scycle); + end + + % Initialise temperature + Sinit.temp = paleo_const.k_CtoK+15; + + end + end +end + diff --git a/code/copse/copse_model_reloaded.m b/code/copse/copse_model_reloaded.m new file mode 100644 index 0000000..5509f91 --- /dev/null +++ b/code/copse/copse_model_reloaded.m @@ -0,0 +1,639 @@ +classdef copse_model_reloaded < handle + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% COPSE for MATLAB (Reloaded) + %%%%%%% ported by B Mills, 2013 + %%%%%%% + %%%%%%% updated by S Daines, 2014 + %%%%%%% + %%%%%%% further updated by T Lenton, 2016-7 + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + properties + pars; % global model constants + + forcemode = 'TimeDep'; % Set forcing mode for this run(options 'TimeDep', 'SteadyState') + timeforceSteadyState; % For forcemode='SteadyState', (constant) time seen by forcings + + force; % Cell array of copse_force_xxx instances representing historical forcings. + % (these are called either with model time, or a fixed time, depending on the setting of runctrl.forcemode) + + perturb; % Cell array of copse_force_xxx instances (these are always called with model time). + + end + + methods + + function [dSdt, D] = timederiv(obj, tmodel, S) + % Time derivative and diagnostic variables (COPSE reloaded equations) + % + % Args: + % tmodel (float): (yr) model time + % S (struct): state vector + % + % Returns: + % dSdt (struct): time derivative of state vector S (struct, fields matching S) + % D (struct): diagnostic variables (create D and add fields as needed, these will be accumulated into struct 'diag') + % + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% CHOOSE FORCING FUNCTIONS + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + switch(obj.forcemode) + case 'SteadyState' + % Disconnect tforce from model time for steady-state with fixed forcing + D.tforce = obj.timeforceSteadyState; + case 'TimeDep' + % Usual forward-model case + D.tforce = tmodel; + otherwise + error('unknown forcemode %s',obj.forcemode); + end + + % Default (disabled) values for forcings / perturbations. + % These are (re)set by forcing functions, if in use. + % NB: many forcings have no default and are not set here. + % + % D.RHO additional enhancement to carbonate/silicate weathering + D.RHO = 1; + % D.RHOSFW additional enhancement to seafloor weathering + D.RHOSFW = 1; + % F_EPSILON enhances nutrient weathering only + D.F_EPSILON = 1; + % PG paleogeog weathering factor + D.PG = 1; + % Basalt area relative to present day + D.BA = 1; + % Land temperature adjustment + D.GEOG = 0; + % Granite area relative to present day + D.GRAN_AREA = 1; + % Carbonate area relative to present day + D.CARB_AREA = 1; + % Total land area relative to present day + D.TOTAL_AREA = 1; + % C/P land multiplier + D.CPland_relative = 1; + % P to land multiplier + D.Ptoland = 1; + % Coal depositional area multiplier + D.COAL = 1; + % Evaporite exposed area relative to present day + D.EVAP_AREA = 1; + % Evaporite depositional area multiplier + D.SALT = 1; + % Shale+coal area relative to present day + D.ORG_AREA = 1; + % Shale area relative to present day + D.SHALE_AREA = 1; + % Shale+coal+evaporite area relative to present day + D.ORGEVAP_AREA = 1; + % Prescribed calcium concentration - no default + % D.CAL_NORM = 1; + % LIP area and co2 + D.CFB_area = 0; % no sensible default - if used, supplied by forcing + D.LIP_CO2 = 0; + D.LIP_CO2moldelta = 0; + % Perturbation (injection in mol/yr) to A reservoir + D.co2pert = 0; + D.co2pertmoldelta = 0; + % Alteration of fire feedback + D.fireforcing = 1; + + % Iterate through forcing and perturbation functions as defined in config file + for i = 1:length(obj.force) + D = obj.force{i}.force( D.tforce - paleo_const.time_present_yr, D ) ; + end + for i = 1:length(obj.perturb) + D = obj.perturb{i}.force( tmodel, D ) ; + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END OF FORCING SETUP + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% CO2 and Temperature + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D.pO2PAL = (S.O/obj.pars.O0); + + %%%%%%%% calculations for pCO2 + switch(obj.pars.f_atfrac) + case 'original' + D.pCO2PAL = (S.A/obj.pars.A0) ; %pre-industrial = 1 + D.phi = 0.01614 ; + case 'quadratic' + D.pCO2PAL = (S.A/obj.pars.A0)^2 ; + D.phi = 0.01614*(S.A/obj.pars.A0) ; + otherwise + error('Unknown f_atfrac %s',obj.pars.f_atfrac); + end + + D.pCO2atm = D.pCO2PAL*obj.pars.pCO2atm0; % pre-industrial = 280e-6 + + %%%%%%% Iteratively improved temperature estimate + D.TEMP = copse_temperature( obj.pars, tmodel, D, S.temp ); + D.GLOBALT = D.TEMP; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% END CO2 and Temperature + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%% land biota + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D = copse_landbiota_reloaded( obj.pars, tmodel, S, D, D.TEMP ); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% calculate weathering + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % calculate relative land surface areas + D = copse_landsurfaceareas_reloaded( obj.pars, tmodel, S, D ); + + % define normalisation for convenience, to decouple copse_weathering_ functions so they can be reused for modular version + D.normG = S.G/obj.pars.G0; + D.normC = S.C/obj.pars.C0; + switch(obj.pars.Scycle) + case 'Enabled' + D.normPYR = S.PYR/obj.pars.PYR0; + D.normGYP = S.GYP/obj.pars.GYP0; + case 'None' + D.normPYR = 1; + D.normGYP = 1; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + + D = copse_weathering_rates_reloaded( obj.pars, tmodel, S, D ); + + D = copse_weathering_fluxes_reloaded( obj.pars, tmodel, S, D ); + + switch(obj.pars.f_locb) + case 'original' + D.pland = obj.pars.k11_landfrac*D.VEG*D.phosw ; + case 'Uforced' + %Uplift/erosion control of locb + D.pland = obj.pars.k11_landfrac*D.UPLIFT*D.VEG*D.phosw ; + case 'coal' + %Coal basin forcing of locb + D.pland = obj.pars.k11_landfrac*D.VEG*D.phosw*(obj.pars.k_aq+(1-obj.pars.k_aq)*D.COAL) ; + case 'split' + %Separating aquatic and coal basin components of locb + D.pland = obj.pars.k11_landfrac*D.VEG*D.phosw*(obj.pars.k_aq*D.UPLIFT+(1-obj.pars.k_aq)*D.COAL) ; + otherwise + error('unknown f_locb %s',obj.pars.f_locb); + end + + D.psea = D.phosw - D.pland ; + + % Seafloor weathering (SD kept this separate so weathering functions just include land surface) + D = copse_weathering_seafloor_reloaded( obj.pars, tmodel, S, D ); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% END calculate weathering + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% calculate degassing + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Inorganic carbon + switch obj.pars.f_ccdeg + case 'original' + D.ccdeg = obj.pars.k12_ccdeg*D.DEGASS*(S.C/obj.pars.C0)*D.Bforcing ; + case 'noB' + D.ccdeg = obj.pars.k12_ccdeg*D.DEGASS*(S.C/obj.pars.C0) ; + otherwise + error('unrecogized obj.pars.f_ccdeg %s',obj.pars.f_ccdeg); + end + + + % Organic carbon + switch obj.pars.f_ocdeg + case 'O2indep' + D.ocdeg = obj.pars.k13_ocdeg*D.DEGASS*(S.G/obj.pars.G0) ; + case 'O2copsecrashprevent' + % COPSE 5_14 does this (always) apparently to prevent pO2 dropping to zero ? + % This has a big effect when pO2 dependence of oxidative weathering switched off + D.ocdeg = obj.pars.k13_ocdeg*D.DEGASS*(S.G/obj.pars.G0)*copse_crash(S.O/obj.pars.O0,'ocdeg',tmodel); + otherwise + error('unrecogized obj.pars.f_ocdeg %s',obj.pars.f_ocdeg); + end + + % Sulphur + switch(obj.pars.Scycle) + case 'Enabled' + D.pyrdeg = obj.pars.k_pyrdeg*(S.PYR/obj.pars.PYR0)*D.DEGASS; + D.gypdeg = obj.pars.k_gypdeg*(S.GYP/obj.pars.GYP0)*D.DEGASS; + case 'None' + D.pyrdeg = 0; + D.gypdeg = 0; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%% END calculate degassing + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Marine biota + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + D = copse_marinebiota_reloaded( obj.pars, tmodel, S, D ); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Burial + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%% Reduced C species burial + % Marine organic carbon burial + switch(obj.pars.f_mocb) + case 'original' + D.mocb = obj.pars.k2_mocb*((D.newp/obj.pars.newp0)^obj.pars.f_mocb_b) ; + case 'Uforced' + D.mocb = obj.pars.k2_mocb*D.UPLIFT*((D.newp/obj.pars.newp0)^obj.pars.f_mocb_b) ; + case 'O2dep' + D.mocb = obj.pars.k2_mocb*((D.newp/obj.pars.newp0)^obj.pars.f_mocb_b)*2.1276*exp(-0.755*(S.O/obj.pars.O0)); + case 'both' + D.mocb = obj.pars.k2_mocb*D.UPLIFT*((D.newp/obj.pars.newp0)^obj.pars.f_mocb_b)*2.1276*exp(-0.755*(S.O/obj.pars.O0)); + otherwise + error('unknown f_ocb %s',obj.pars.f_mocb); + end + + % Land organic carbon burial - uplift control in pland + D.locb = D.pland*obj.pars.CPland0*D.CPland_relative ; + + % Marine organic P burial + D.mopb = ( D.mocb/D.CPsea ) ; + % Marine carbonate-associated P burial + switch(obj.pars.f_capb) + case 'original' + D.capb = obj.pars.k7_capb*( (D.newp/obj.pars.newp0)^obj.pars.f_mocb_b ); + case 'redox' + D.capb = obj.pars.k7_capb*( (D.newp/obj.pars.newp0)^obj.pars.f_mocb_b )*(0.5+0.5*(1-D.ANOX)/obj.pars.k1_oxfrac); + otherwise + error('unknown f_capb %s',obj.pars.f_capb); + end + % Marine Fe-sorbed P burial NB: COPSE 5_14 uses copse_crash to limit at low P + switch(obj.pars.f_fepb) + case 'original' + D.fepb = (obj.pars.k6_fepb/obj.pars.k1_oxfrac)*(1-D.ANOX)*copse_crash(S.P/obj.pars.P0,'fepb',tmodel) ; + case 'Dforced' + D.fepb = D.DEGASS*(obj.pars.k6_fepb/obj.pars.k1_oxfrac)*(1-D.ANOX)*copse_crash(S.P/obj.pars.P0,'fepb',tmodel) ; + case 'sfw' + D.fepb = (D.sfw/obj.pars.k_sfw)*(obj.pars.k6_fepb/obj.pars.k1_oxfrac)*(1-D.ANOX)*copse_crash(S.P/obj.pars.P0,'fepb',tmodel) ; + case 'pdep' + D.fepb = (obj.pars.k6_fepb/obj.pars.k1_oxfrac)*(1-D.ANOX)*(S.P/obj.pars.P0) ; + otherwise + error('unknown f_fepb %s',obj.pars.f_fepb); + end + % Marine organic nitrogen burial + D.monb = D.mocb/obj.pars.CNsea0 ; + + % Marine sulphur burial + switch(obj.pars.Scycle) + case 'Enabled' + % Marine gypsum sulphur burial + switch(obj.pars.f_gypburial) + case 'original' % dependent on sulphate and [Ca] + D.mgsb = obj.pars.k_mgsb*(S.S/obj.pars.S0)*(S.CAL/obj.pars.CAL0) ; + case 'Caforced' % dependent on sulphate and prescribed [Ca] + D.mgsb = obj.pars.k_mgsb*(S.S/obj.pars.S0)*D.CAL_NORM ; + otherwise + error('unknown f_gypburial %s',obj.pars.f_gypburial); + end + % Marine pyrite sulphur burial + switch(obj.pars.f_pyrburial) + case 'copse_noO2' % dependent on sulphate and marine carbon burial + D.mpsb = obj.pars.k_mpsb*(S.S/obj.pars.S0)*(D.mocb/obj.pars.k2_mocb) ; + case 'copse_O2' % dependent on oxygen, sulphate, and marine carbon burial + D.mpsb = obj.pars.k_mpsb*(S.S/obj.pars.S0)/(S.O/obj.pars.O0)*(D.mocb/obj.pars.k2_mocb) ; + case 'anoxia' % Experiment: dependent on oxygen, sulphate, marine carbon burial and anoxia + D.mpsb = obj.pars.k_mpsb*(D.mocb/obj.pars.k2_mocb)*(1+4*D.ANOX)*(S.S/obj.pars.S0)/(S.O/obj.pars.O0) ; + otherwise + error('unknown f_pyrburial %s',obj.pars.f_pyrburial); + end + case 'None' + D.mgsb = 0; + D.mpsb = 0; + otherwise + error('unrecogized obj.pars.Scycle %s',obj.pars.Scycle); + end + + %%%% marine carbonate carbon burial from alkalinity balance + switch obj.pars.f_SRedoxAlk + case 'on' + %%%%% couple pyrite weathering / burial to marine alkalinity balance TODO is this correct Alk vs S ? + D.mccb = D.carbw + D.silw + (D.mpsb - D.pyrw) ; + case 'degassing' + %%%%% includes pyrite and gypsum degassing as a source of H2SO4: + D.mccb = D.carbw + D.silw + (D.mpsb - D.pyrw - D.pyrdeg - D.gypdeg) ; + case 'off' + %%%%% Oxidised C species burial + D.mccb = D.carbw + D.silw ; + otherwise + error('unrecognized f_SRedoxAlk %s', obj.pars.f_SRedoxAlk); + end + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END Burial + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Update state variables / reservoirs + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%% Iterated temperature + dSdt.temp = D.TEMP - S.temp ; + + %%%% Atmosphere / ocean reservoirs + + %%%% Oxygen + if obj.pars.o2fix == 1 + dSdt.O=0; + else + dSdt.O = D.locb + D.mocb - D.oxidw - D.ocdeg + (2)*(D.mpsb - D.pyrw - D.pyrdeg) ; + end + + %%%% Carbon dioxide + dSdt.A = -D.locb - D.mocb + D.oxidw + D.ocdeg + D.ccdeg - D.mccb + D.carbw - D.sfw + D.LIP_CO2 + D.co2pert ; + + %%%% Marine nutrient reserviors + dSdt.P = D.psea - D.mopb - D.capb - D.fepb ; + dSdt.N = D.nfix - D.denit - D.monb; + + %%%% Marine calcium + switch(obj.pars.CALcycle) + case 'Enabled' + dSdt.CAL = D.silw + D.carbw + D.gypw - D.mccb -D.mgsb; + case 'None' + % No CAL reservoir + otherwise + error('unrecognized obj.pars.CALcycle %s',obj.pars.CALcycle); + end + + %%%% Crustal C reservoirs + %%%% Buried organic C + dSdt.G = D.locb + D.mocb -D.oxidw -D.ocdeg ; + + %%%% Buried carb C + dSdt.C = D.mccb + D.sfw - D.carbw - D.ccdeg ; + + %%%% C isotope fractionation + + % Carbon isotope fractionation (relative to total CO2 (A reservoir) + switch(obj.pars.f_cisotopefrac) + case 'fixed' + D.d_mocb = -30; + D.d_locb = -30; + D.d_mccb = 0; + case 'fixed2' % TL 2016 better values + D.d_mocb = -27; + D.d_locb = -27; + D.d_mccb = 0.5; + case 'copse_base' + [ D.d_locb, D.D_P, D.d_mocb, D.D_B, D.d_mccb, D.d_ocean, D.d_atmos ] = copse_Cisotopefrac( D.TEMP, D.pCO2PAL, S.O/obj.pars.O0, D.phi ); + case 'copse_noO2' + [ D.d_locb, D.D_P, D.d_mocb, D.D_B, D.d_mccb, D.d_ocean, D.d_atmos ] = copse_Cisotopefrac( D.TEMP, D.pCO2PAL, 1, D.phi ); + otherwise + error('unknown f_cisotopefrac %s',obj.pars.f_cisotopefrac); + end + + + %%%%%%% calculate isotopic fractionation of reservoirs + + D.delta_G = S.moldelta_G/S.G; + D.delta_C = S.moldelta_C/S.C; + D.delta_A = S.moldelta_A/S.A ; + + % isotopic fractionation of mccb + D.delta_mccb = D.delta_A + D.d_mccb; + + D.d13Cin = (D.oxidw*D.delta_G + D.ocdeg*D.delta_G + D.ccdeg*D.delta_C + D.carbw*D.delta_C)/(D.oxidw + D.ocdeg + D.ccdeg + D.carbw) ; + D.d13Cout = (D.locb*( D.delta_A + D.d_locb ) + D.mocb*( D.delta_A + D.d_mocb ) + (D.sfw + D.mccb)*D.delta_mccb)/(D.locb + D.mocb + D.mccb + D.sfw) ; + D.avgfrac = (D.mocb*(D.delta_A+D.d_mocb)+D.locb*(D.delta_A+D.d_locb))/((D.mocb+D.locb)*D.delta_A) ; + + % deltaORG_C*ORG_C + dSdt.moldelta_G = D.mocb*( D.delta_A + D.d_mocb ) + D.locb*( D.delta_A + D.d_locb ) - D.oxidw*D.delta_G - D.ocdeg*D.delta_G ; + + % deltaCARB_C*CARB_C + dSdt.moldelta_C = (D.mccb + D.sfw)*D.delta_mccb - D.carbw*D.delta_C - D.ccdeg*D.delta_C ; + + %%% delta_A * A + dSdt.moldelta_A = -D.locb*( D.delta_A + D.d_locb ) -D.mocb*( D.delta_A + D.d_mocb ) ... + + D.oxidw*D.delta_G + D.ocdeg*D.delta_G + D.ccdeg*D.delta_C + D.carbw*D.delta_C ... + - (D.mccb + D.sfw)*D.delta_mccb + D.LIP_CO2moldelta+ D.co2pertmoldelta ; + + + % Sulphur + switch(obj.pars.Scycle) + case 'Enabled' + %%% Marine sulphate + dSdt.S = D.gypw + D.pyrw -D.mgsb - D.mpsb +D.gypdeg + D.pyrdeg ; + % dSdt.S=0; + %%% Buried pyrite S + dSdt.PYR = D.mpsb - D.pyrw - D.pyrdeg ; + %%% Buried gypsum S + dSdt.GYP = D.mgsb - D.gypw -D.gypdeg ; + + %Isotopes + + %Pyrite sulphur isotope fractionation relative to sulphate and gypsum + switch(obj.pars.f_sisotopefrac) + case 'fixed' + D.D_mpsb = 35; + case 'copse_O2' + D.D_mpsb = 35*(S.O/obj.pars.O0); + otherwise + error('unknown f_sisotopefrac %s',obj.pars.f_sisotopefrac); + end + + D.delta_GYP = S.moldelta_GYP/S.GYP; + D.delta_PYR = S.moldelta_PYR/S.PYR; + D.delta_S = S.moldelta_S/S.S; + % deltaPYR_S*PYR_S + dSdt.moldelta_PYR = D.mpsb*( D.delta_S - D.D_mpsb ) - D.pyrw*D.delta_PYR - D.pyrdeg*D.delta_PYR ; + % deltaGYP_S*GYP_S + dSdt.moldelta_GYP = D.mgsb*D.delta_S - D.gypw*D.delta_GYP - D.gypdeg*D.delta_GYP ; + %%% delta_S * S + dSdt.moldelta_S = D.gypw*D.delta_GYP + D.pyrw*D.delta_PYR - D.mgsb*D.delta_S -D.mpsb*(D.delta_S - D.D_mpsb ) +D.gypdeg*D.delta_GYP + D.pyrdeg*D.delta_PYR ; + + case 'None' + otherwise + error('unrecognized obj.pars.Scycle %s',obj.pars.Scycle); + end + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Strontium system + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%% + % flux calculations + %%%%%%%%%%%%%%%%%%%%%%%% + + %%%% ocean inputs + D.Sr_old_igw = obj.pars.k_Sr_igg * ( D.granw / obj.pars.k_granw ) ; %%% weathering of old igneous rocks + D.Sr_new_igw = obj.pars.k_Sr_igb * ( D.basw / obj.pars.k_basw) ; %%% weathering of new igneous rocks + D.Sr_mantle = obj.pars.k_Sr_mantle * D.DEGASS ; + + switch(obj.pars.f_Sr_sedw) + case 'original' + D.Sr_sedw = obj.pars.k_Sr_sedw * ( D.carbw / obj.pars.k14_carbw ) ; %%% carbonate weathering + case 'alternative' + D.Sr_sedw = obj.pars.k_Sr_sedw * ( D.carbw / obj.pars.k14_carbw ) * (S.Sr_sed / obj.pars.Sr_sed0) ; + otherwise + error('unrecognized f_Sr_sedw %s', obj.pars.f_Sr_sedw); + end + + %%%% Sr outputs to sediments + + Sr_ocean_relative = ( S.Sr_ocean / obj.pars.Sr_ocean0 ) ; %%% assume dependence on Sr conc in ocean + + D.Sr_sfw = obj.pars.k_Sr_sfw * ( D.sfw_relative ) * Sr_ocean_relative ; %%% assume dependence on Sr conc in ocean + D.Sr_sedb = obj.pars.k_Sr_sedb * ( ( D.silw + D.carbw ) / ( obj.pars.k_silw + obj.pars.k14_carbw ) ) * Sr_ocean_relative ; %%% assume dependence on Sr conc in ocean + + Sr_sed_relative = (S.Sr_sed / obj.pars.Sr_sed0) ; + %%%% loss from sediments + switch(obj.pars.f_Sr_metam) + case 'original' + D.Sr_metam = obj.pars.k_Sr_metam * D.DEGASS ; + case 'alternative' + D.Sr_metam = obj.pars.k_Sr_metam * Sr_sed_relative * D.DEGASS ; + otherwise + error('unrecognized f_Sr_metam %s', obj.pars.f_Sr_metam); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%% ISOTOPE calculations %%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % present day isotope values pars.delta_ defined in .yaml file + + %%%% Sr ratios increasing with time due to 87Rb decay + lambda_Rb = 1.4e-11 ; + d_Sr_0 = 0.69898 ; %%% value at formation of earth + t_present = 4.5e9 ; %%% present time + %%%%% calculate Rb to Sr ratios at present day value (assume unchanging) + d_RbSr_old_ig = (obj.pars.delta_old_ig_present - d_Sr_0)/( 1 - exp(-lambda_Rb*t_present) ) ; + d_RbSr_new_ig = (obj.pars.delta_new_ig_present - d_Sr_0)/( 1 - exp(-lambda_Rb*t_present) ) ; + d_RbSr_mantle = (obj.pars.delta_mantle_present - d_Sr_0)/( 1 - exp(-lambda_Rb*t_present) ) ; + + sediment_rbsr = 0.5 ; %%% present-day inferred from avg crustal value + + %%%% for each timestep calculate d_Sr and d_RbSr + tforwards = 4.5e9 + tmodel ; %%% get old model time from paleo time + D.delta_old_ig = d_Sr_0 + d_RbSr_old_ig*( 1 - exp(-lambda_Rb*tforwards) ) ; + D.delta_new_ig = d_Sr_0 + d_RbSr_new_ig*( 1 - exp(-lambda_Rb*tforwards) ) ; + D.delta_mantle = d_Sr_0 + d_RbSr_mantle*( 1 - exp(-lambda_Rb*tforwards) ) ; + + %%% calculate fractionations in ocean and sediment reservoirs + D.delta_Sr_ocean = S.moldelta_Sr_ocean/S.Sr_ocean; + + % Simplified code for time-evolution of delta_Sr_sed due to Rb decay + D.delta_Sr_sed = ( S.moldelta_Sr_sed / S.Sr_sed ); + % rate-of-change of moldelta_Sr_sed due to Rb decay + % (also include a very small secular decrease in Rb abundance for consistency, ~+1.4% at 1 Ga relative to present) + D.dmoldelta_Sr_sed_dt_Rb = S.Sr_sed*lambda_Rb*sediment_rbsr*exp(lambda_Rb*(t_present - tforwards)); + + %%% calculate igneous river composition for plotting + D.delta_igw = (D.Sr_old_igw*D.delta_old_ig + D.Sr_new_igw*D.delta_new_ig)/(D.Sr_old_igw+D.Sr_new_igw) ; + + %%%%%%%%%%%%%%%%%%%%%%%% + % reservoir calculations + %%%%%%%%%%%%%%%%%%%%%%%% + + %%% Ocean Sr + dSdt.Sr_ocean = D.Sr_old_igw + D.Sr_new_igw + D.Sr_sedw + D.Sr_mantle - D.Sr_sedb - D.Sr_sfw ; + + %%% Sediment Sr + dSdt.Sr_sed = D.Sr_sedb - D.Sr_sedw - D.Sr_metam ; + + %%% Ocean Sr * frac + dSdt.moldelta_Sr_ocean = D.Sr_old_igw*D.delta_old_ig + D.Sr_new_igw*D.delta_new_ig + D.Sr_sedw*D.delta_Sr_sed + D.Sr_mantle*D.delta_mantle - D.Sr_sedb*D.delta_Sr_ocean - D.Sr_sfw*D.delta_Sr_ocean ; + + %%% Sediment Sr * frac + dSdt.moldelta_Sr_sed = D.Sr_sedb*D.delta_Sr_ocean - D.Sr_sedw*D.delta_Sr_sed - D.Sr_metam*D.delta_Sr_sed + D.dmoldelta_Sr_sed_dt_Rb; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END strontium system + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END update reservoirs + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% END timederiv() + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + + function Sinit = initialise(obj) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Initialise reservoir (state variable) sizes etc + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %LN = 'copse_model_reloaded.initialise'; L = paleo_log.getLogger('copse_model'); + + Sinit = struct; + + Sinit.P = obj.pars.Pinit; + Sinit.O = obj.pars.Oinit; + Sinit.A = obj.pars.Ainit; + Sinit.G = obj.pars.Ginit; + Sinit.C = obj.pars.Cinit; + + switch(obj.pars.CALcycle) + case 'Enabled' + Sinit.CAL = obj.pars.CALinit; + case 'None' + % No CAL reservoir + otherwise + error('unrecognized obj.pars.CALcycle %s',obj.pars.CALcycle); + end + + Sinit.N = obj.pars.Ninit; + + % Initalise Sr + Sinit.Sr_ocean = obj.pars.Sr_ocean_init; + Sinit.Sr_sed = obj.pars.Sr_sed_init; + + + % Initialise C isotope reservoirs + Sinit.moldelta_G = Sinit.G*obj.pars.delta_Ginit; + Sinit.moldelta_C = Sinit.C*obj.pars.delta_Cinit ; + Sinit.moldelta_A = Sinit.A*obj.pars.delta_Ainit; + + % Initialise Sr isotope reservoirs + Sinit.moldelta_Sr_ocean = Sinit.Sr_ocean * obj.pars.delta_Sr_ocean_start; + Sinit.moldelta_Sr_sed = Sinit.Sr_sed * obj.pars.delta_Sr_sed_start; + + + % Initialise S cycle if required + switch obj.pars.Scycle + case 'Enabled' + Sinit.S = obj.pars.Sinit; + Sinit.PYR = obj.pars.PYRinit; + Sinit.GYP = obj.pars.GYPinit; + Sinit.moldelta_PYR = Sinit.PYR*obj.pars.delta_PYRinit; + Sinit.moldelta_GYP = Sinit.GYP*obj.pars.delta_GYPinit; + Sinit.moldelta_S = Sinit.S*obj.pars.delta_Sinit; + case 'None' + % no S reservoirs + otherwise + error('unrecognized obj.pars.Scycle %s',obj.pars.Scycle); + end + + % Initialise temperature + Sinit.temp = paleo_const.k_CtoK+15; + + end + end +end + diff --git a/code/copse/copse_plot_base.m b/code/copse/copse_plot_base.m new file mode 100644 index 0000000..e0caf7f --- /dev/null +++ b/code/copse/copse_plot_base.m @@ -0,0 +1,873 @@ +function handled=copse_plot_base( wplot, XT, XTlimits,tiplot, plotdata,cdata ) +% Plot a single results figure (COPSE 'classic' model) +% +% handled=copse_plot_base( wplot,XT, XTname, XTlimits, plotdata, compareC514 ) +% +% wplot requested plot (string) +% XT model output: x axis (usually time in yr) (vector) +% XTlimits requested x-axis limits, yr (eg [-500e8 0] ) +% tiplot (not used) time indices to plot +% plotdata model output with fields S, diag, pars +% cdata (optional) COPSE 5_14 output to compare against +% +% handled 1 if we have a handler for requested plot, 0 otherwise +% +% See also COPSE_plotlist COPSE_frontend + +%do we have output to compare against? +if nargin > 5 + outputcompare = 1; +else + outputcompare = 0; +end + +% Unpack supplied data +diag = plotdata.diag; +S = plotdata.S; +pars = plotdata.tm.pars; + +cols = copse_plot_custom_colors ; + +%Assume we can handle this plot unless we discover otherwise +handled = 1; + +switch(char(wplot)) +% case 'MyNewPlot' +% %%%% My new plot that explains everything +% plot(XT,diag.mynewvariable,'r'); +% hold on +% plot(XT,diag.myothervariable,'g'); +% title({'New plot';'line1 (r), line2 (g)'},'Fontweight','bold'); +% xlim(XTlimits); + + case 'PhysForc' + %%%% plot this model output + legends={}; + + plot(XT,diag.SOLAR./1368,'r'); + legends{end+1} = 'SOLAR'; + hold on + plot(XT,diag.CONTAREA,'k') + legends{end+1} = 'CONTAREA'; + plot(XT,diag.UPLIFT,'b') + legends{end+1} = 'UPLIFT'; + + plot(XT,diag.RHO,'c') % additional weatherability enhancement + legends{end+1} = 'RHO'; + if isfield(diag,'RHOSIL') + plot(XT,diag.RHOSIL,'m') % additional silicate terrestrial weatherability enhancement + legends{end+1} = 'RHOSIL'; + end + if isfield(diag,'RHOSFW') + plot(XT,diag.RHOSFW,'m--') % additional sfw weathering enhancement + legends{end+1} = 'RHOSFW'; + end + plot(XT,diag.F_EPSILON,'c--') % additional nutrient weathering enhancement + legends{end+1} = 'F_EPSILON'; + + if isfield(diag,'DEGASSmet') % division into met/arc volc and ridge-island-plume + plot(XT,diag.DEGASSmet,'g') + legends{end+1} = 'DEGASSmet'; + plot(XT,diag.DEGASSrip,'g--') + legends{end+1} = 'DEGASSrip'; + else % COPSE 'classic' + plot(XT,diag.DEGASS,'g') + legends{end+1} = 'DEGASS'; + end + h=legend(legends); + set(h,'FontSize',6,'Location','SouthEast'); + legend boxoff; + title('Phys Forcings','FontWeight','bold') + xlim(XTlimits) + ylim([0 2.1]); + ylabel('Relative strength') + case 'PerturbForc' + %%%% plot this model output + plot(XT,diag.co2pert,'g') + hold on + if isfield(diag,'carbwpert') + plot(XT,diag.carbwpert,'b'); + end + if isfield(diag,'silwpert') + plot(XT,diag.silwpert,'m'); + end + if isfield(diag,'O_Ppert') + plot(XT,diag.O_Ppert*100,'c'); + end + if isfield(diag,'mpsbpert') + plot(XT,diag.mpsbpert,'k'); + end + if isfield(diag,'O_SO2pert') + plot(XT,diag.O_SO2pert,'y'); + end + title({'Perturb Fluxes: REDOX(r), CO_2(g),carbw(b)';'silw(m) phos(c) mpsb(k) SO_2(y)'},'FontWeight','bold') + xlim(XTlimits) + ylabel('mol/yr (phos x100)') + case 'EvolForc' + %%%% plot this model output + plot(XT,diag.EVO,'r') % land plant evolution + hold on + plot(XT,diag.W,'g') %land plant enhancement of weathering + plot(XT,diag.Bforcing,'b') %deep carbonate burial + + h=legend('EVO','W','B'); + set(h,'FontSize',6,'Location','NorthWest'); + legend boxoff; + title('Evol Forcings','FontWeight','bold') + xlim(XTlimits) + ylim([0 2.1]); + ylabel('Relative strength') + + case 'O2' + if outputcompare && isfield(cdata.diag,'pO2PAL') + plot(cdata.T, cdata.diag.pO2PAL, 'color', cols.grey) + hold on + end + if outputcompare && isfield(cdata.diag,'ANOX') + plot(cdata.T, cdata.diag.ANOX, 'color', cols.light_g) + hold on + end + %%%% plot this model output + %%%% SD update to BM Matlab - PAL is proportional to S.O + %%%% This fixes slightly high plotted pO2 + %plot(XT,diag.mrO2./(0.21),'k') + plot(XT,diag.pO2PAL,'k') + hold on + if isfield(diag,'ANOX') + plot(XT,diag.ANOX,'g') + end + title('pO2 PAL(k), anox (g)','FontWeight','bold') + xlim(XTlimits) + %xlabel ('Age (yr)') + %ylim([1.0 1.6]); + ylabel('Normalized value'); + %ylabel('pO2 (PAL)'); + case 'CH4' + plot(XT,diag.pCH4atm,'k') + title('pCH4 atm(k)','FontWeight','bold') + xlim(XTlimits) + ylabel('pCH4 (atm)'); + case 'H2S' + plot(XT,diag.pH2Satm,'k') + title('pH2S atm(k)','FontWeight','bold') + xlim(XTlimits) + ylabel('pH2S (atm)'); + case 'O2Diff' + %Difference between this run and comparison output + %Interpolate onto tcomp grid for comparison + if outputcompare + [ tcomp, pO2diff, rmsfepO2 ] = copse_diff(XTlimits, 'frac', cdata.T, cdata.diag.pO2PAL, XT, diag.pO2PAL); + else + tcomp = []; + pO2diff = []; + rmsfepO2 = NaN; + end + + plot(tcomp, pO2diff,'r') + + fprintf('RMS frac error (pO2 - comparison model) %g\n', rmsfepO2); + title({'pO2 PAL - comp';sprintf('RMS frac error %g',rmsfepO2)},'FontWeight','bold') + xlim(XTlimits) + ylabel('PAL'); + + case 'CO2' + if outputcompare && isfield(cdata.diag,'pCO2PAL') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.pCO2PAL, 'color', cols.grey) + hold on + end + %%%% plot this model output + plot(XT,diag.pCO2PAL,'k') + hold on + title('CO_2','FontWeight','bold') + xlim(XTlimits) + ylabel('pCO_2 PAL') + + case 'CO2Diff' + %Interpolate onto tcomp grid for comparison + if outputcompare + [ tcomp, pCO2diff, rmsfepCO2 ] = copse_diff(XTlimits, 'frac', cdata.T, cdata.diag.pCO2PAL, XT, diag.pCO2PAL); + else + tcomp = []; + pCO2diff = []; + rmsfepCO2 = NaN; + end + + plot(tcomp, pCO2diff,'r') + + fprintf('RMS frac error (pCO2 - comparison model) %g\n', rmsfepCO2); + + title({'pCO2 - comparison model';sprintf('RMS frac error %g',rmsfepCO2)},'FontWeight','bold') + xlim(XTlimits) + ylabel('PAL'); + + + case 'Temp' + if outputcompare && isfield(cdata.diag,'TEMP') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.TEMP-paleo_const.k_CtoK, 'color', cols.grey) + hold on + end + %%%% plot this model output + plot (XT, diag.TEMP-paleo_const.k_CtoK,'k','displayname','temp') + hold on + title('Temperature (C)','FontWeight','bold') + xlim(XTlimits) + ylabel('Temp (C)') + + case 'OceanNP' + if outputcompare && isfield(cdata.S,'P') && isfield(cdata.S,'N') + %%%% plot against COPSE output + plot(cdata.T, cdata.S.P/pars.P0,'color', cols.light_b); + hold on + plot(cdata.T, cdata.S.N/pars.N0, 'color', cols.light_g); + end + %%%% plot this model output + plot(XT,S.P/pars.P0, 'color', 'b'); + hold on + plot(XT,S.N/pars.N0, 'color', 'g'); + title('Ocean P (b) and N (g) conc','FontWeight','bold') + xlim(XTlimits) + ylabel('conc P/(2.2\mum/kg) N/(30.9\mum/kg)'); + %ylim([0.5 1.5]); + + case 'Biota' + if outputcompare && isfield(cdata.diag,'VEG') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.VEG, 'color', cols.grey) + hold on + end + %%%% plot this model output + plot(XT,diag.VEG,'k') % mass of terrestrial biosphere + hold on + plot(XT,diag.newp./pars.newp0,'b') % marine new prod + + title('Biota k:VEG b:marine newp','FontWeight','bold') + xlim(XTlimits) + ylabel('Relative') + + case 'LandBiota' + if outputcompare && isfield(cdata.diag,'VEG') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.VEG, 'color', cols.grey) + hold on + end + %%%% plot this model output + plot(XT,diag.VEG,'k') % mass of terrestrial biosphere + hold on + plot(XT,diag.V_T,'r') + plot(XT,diag.V_co2,'g') + plot(XT,diag.V_o2,'b') + plot(XT,diag.V_npp,'c') + plot(XT,diag.firef,'m') + title({'Land OCT';'r:V_T, g:V_co2, b:V_o2, c:V_npp, m:firef, k:VEG'},'FontWeight','bold','Interpreter','none'); + xlim(XTlimits) + ylabel('Relative') + + case 'FireIgnit' + %%%% plot this model output + plot(XT,diag.ignit,'k') % ignition probability + title('Ignition prob','FontWeight','bold'); + xlim(XTlimits) + ylabel('percent') + + case 'CPWeath' + if outputcompare && isfield(cdata.diag,'silw') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.silw, 'color', cols.light_c) + hold on + end + if outputcompare && isfield(cdata.diag,'carbw') + plot(cdata.T, cdata.diag.carbw, 'color', cols.light_g) + hold on + end + if outputcompare && isfield(cdata.diag,'oxidw') && isfield(cdata.diag,'phosw') + plot(cdata.T, cdata.diag.oxidw, 'color', cols.light_r) + plot(cdata.T, cdata.diag.phosw*100, 'color', cols.light_b) + end + %%%% plot this model output + + plot(XT,diag.silw,'c--') + hold on + plot(XT,diag.carbw,'g') + plot(XT,diag.oxidw,'r') + plot(XT,diag.phosw*100,'b') + if isfield(diag,'sfw') + plot(XT,diag.silw+diag.sfw,'c') + plot(XT,diag.sfw,'m--') + title({'CP Weathering';'r:oxidw, c:silw+sfw, c-:silw m-:sfw, g:carbw, b:phosw x100'},'FontWeight','bold') + else + title({'CP Weathering';'r:oxidw, c-:silw (no sfw), g:carbw, b:phosw x100'},'FontWeight','bold') + end + xlim(XTlimits) + ylabel('Flux mol/yr') + + case 'PWeath' + if outputcompare && isfield(cdata.diag,'phosw') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.phosw, 'color', cols.light_b) + hold on + end + %%%% plot this model output + plot(XT,diag.phosw_s,'c') + hold on + plot(XT,diag.phosw_c,'g') + plot(XT,diag.phosw_o,'r') + plot(XT,diag.phosw,'b') + title({'P Weathering';'r:phosw_o, c:phosw_s, g:phosw_c, b:phosw'},'FontWeight','bold','Interpreter','none') + xlim(XTlimits) + ylabel('Flux mol/yr') + case 'WeathFac' % pre-land surface G3 update + + %%%% plot this model output + plot(XT,diag.f_preplant,'b') + hold on + plot(XT,diag.f_plant,'g') + plot(XT,diag.f_co2,'r') + plot(XT,diag.g_preplant,'b--') + plot(XT,diag.g_plant,'g--') + plot(XT,diag.g_co2,'r--') + plot(XT,diag.w_plantenhance,'c') + + title({'Plant Weath (- f sil -- g carb)';'b:_preplant g:_plant r:_co2 c:w_plantenhance'},'FontWeight','bold','Interpreter','None') + xlim(XTlimits) + ylabel('relative') + + case 'WeathFacNorm' % pre-land surface G3 update + + %%%% plot this model output + plot(XT,diag.f_preplant.*(1-diag.VWmin).*diag.w_plantenhance,'b') + hold on + plot(XT,diag.f_plant.*diag.VWmin.*diag.w_plantenhance,'g') + plot(XT,diag.f_co2.*diag.w_plantenhance,'r') + plot(XT,diag.g_preplant.*(1-diag.VWmin).*diag.w_plantenhance,'b--') + plot(XT,diag.g_plant.*diag.VWmin.*diag.w_plantenhance,'g--') + plot(XT,diag.g_co2.*diag.w_plantenhance,'r--') + plot(XT,diag.w_plantenhance,'c') + plot(XT,diag.VWmin,'k') + + title({'Plant Weath Norm (- f sil -- g carb)';'(b:_preplant g:_plant r:_co2)norm c:w_plantenhance k:VWmin'},'FontWeight','bold','Interpreter','None') + xlim(XTlimits) + ylabel('relative') + case 'WeathFac2' % updated for post-G3 land surface scheme + + %%%% plot this model output + plot(XT,diag.f_gran,'b') + hold on + plot(XT,diag.f_bas,'g') + plot(XT,diag.f_ap,'r') + plot(XT,diag.f_carb,'m') + if isfield(diag, 'w_plantenhance') + plot(XT,diag.w_plantenhance,'c') + end + + title({'Weath fac b:f_gran g:f_bas r:f_ap m:f_carb, c:w_plantenhance'},'FontWeight','bold','Interpreter','None') + xlim(XTlimits) + ylabel('relative') + case 'CDegass' + + %%%%% plot COPSE model output + if outputcompare && isfield(cdata.diag,'ocdeg') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.ocdeg, 'color', cols.light_k) + hold on + end + if outputcompare && isfield(cdata.diag,'ccdeg') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.ccdeg, 'color', cols.light_c) + hold on + end + + %%%% plot this model output + plot(XT,diag.ccdeg,'c') + hold on + plot(XT,diag.ocdeg,'k') + plot(XT,diag.ocdeg+diag.ccdeg,'b') + %plot(XT,diag.mccb+diag.locb+diag.mocb,'m') + title({'C Degassing';'k:ocdeg, c:ccdeg b:totdeg'},'FontWeight','bold') + xlim(XTlimits) + ylabel('Flux mol/yr') + + case 'SDegass' + %%%% No COPSE output + %%%% plot this model output + plot(XT,diag.pyrdeg,'r') + hold on + plot(XT,diag.gypdeg,'g') + title({'S Degassing';'r:pyrdeg, g:gypdeg'},'FontWeight','bold') + xlim(XTlimits) + ylabel('Flux mol/yr') + + case 'GYPPYR' + if outputcompare && isfield(cdata.S,'PYR') && isfield(cdata.S,'GYP') + %%%% plot against COPSE output + plot(cdata.T, cdata.S.PYR, 'color', cols.light_r) + hold on + plot(cdata.T, cdata.S.GYP, 'color', cols.light_g) + end + %%%% plot this model output + title({'S abundances (mol)';'r:PYR, g:GYP'},'FontWeight','bold') + semilogy(XT,S.PYR,'r','displayname','PYR') + hold on + semilogy(XT,S.GYP,'g','displayname','GYP') + xlim(XTlimits) + ylabel('mol') + + case 'CAL' + %%%% plot this model output + if isfield(S,'CAL') + plot(XT,S.CAL./pars.k18_oceanmass*1e3,'k','displayname','CAL') + elseif isfield(diag,'Ocean') && isfield(diag.Ocean,'conc_Ca') + plot(XT,diag.Ocean.tot_Ca./plotdata.tm.modules.ocean.mpars.k18_oceanmass*1e3,'k','displayname','Ca') + elseif isfield(S,'Ca'); + plot(XT,S.Ca./pars.k18_oceanmass*1e3,'k','displayname','Ca') + else + error('no CAL or Ca reservoir'); + end + xlim(XTlimits) + ylabel('mmol/kg') + ylim([0 40]); + title('Marine calcium','FontWeight','bold'); + case 'SCAL' + if outputcompare && isfield(cdata.S,'S') && isfield(cdata.S,'CAL') + %%%% plot against COPSE output + plot(cdata.T, cdata.S.S./pars.k18_oceanmass*1e3, 'color', cols.light_b) + hold on + plot(cdata.T, cdata.S.CAL./pars.k18_oceanmass*1e3, 'color', cols.light_c) + end + %%%% plot this model output + plot(XT,S.S./pars.k18_oceanmass*1e3,'b','displayname','S') + hold on + if isfield(S, 'CAL') + plot(XT,S.CAL./pars.k18_oceanmass*1e3,'c','displayname','CAL') + title({'Marine sulphate calcium';'b:SO4, c:CAL'},'FontWeight','bold') + else + title({'Marine sulphate';'b:SO4'},'FontWeight','bold') + end + xlim(XTlimits) + ylabel('mmol/kg') + ylim([0 40]); + + case 'CRes' + if outputcompare && isfield(cdata.S,'G') && isfield(cdata.S,'C') && isfield(cdata.S,'A') + %%%% plot against COPSE output + semilogy(cdata.T, cdata.S.G/pars.G0, 'color', cols.light_r) + hold on + semilogy(cdata.T, cdata.S.C/pars.C0, 'color', cols.light_g) + semilogy(cdata.T, cdata.S.A/pars.A0, 'color', cols.light_b) + end + %%%% plot this model output + semilogy(XT,S.G./pars.G0,'r','displayname','G') + hold on + semilogy(XT,S.C./pars.C0,'g','displayname','C') + semilogy(XT,S.A./pars.A0,'b','displayname','A') + xlim(XTlimits) + ylabel('Relative abundance') + title({'Relative C abundances (log)';'b:A, r:G, g:C'},'FontWeight','bold') + case 'CGA' + if outputcompare && isfield(cdata.S,'G') && isfield(cdata.S,'C') && isfield(cdata.S,'A') + %%%% plot against COPSE output + plot(cdata.T, cdata.S.G, 'color', cols.light_r) + hold on + plot(cdata.T, cdata.S.C, 'color', cols.light_g) + plot(cdata.T, cdata.S.A/pars.A0, 'color', cols.light_b) + end + %%%% plot this model output + plot(XT,S.G,'r','displayname','G') + hold on + plot(XT,S.C,'g','displayname','C') + plot(XT,S.A,'b','displayname','A') + xlim(XTlimits) + ylabel('mol') + title({'C abundances';'b:A, r:G, g:C'},'FontWeight','bold') + + case 'CResChange' + if outputcompare && isfield(cdata.S,'G') && isfield(cdata.S,'C') && isfield(cdata.S,'A') + %%%% plot against COPSE output + plot(cdata.T, (cdata.S.G - cdata.S.G(1)), 'color', cols.light_r) + hold on + plot(cdata.T, (cdata.S.C - cdata.S.C(1)), 'color', cols.light_g) + plot(cdata.T, (cdata.S.A - cdata.S.A(1)), 'color', cols.light_b) + plot(cdata.T, (cdata.S.G - cdata.S.G(1)) + (cdata.S.C - cdata.S.C(1))+ (cdata.S.A - cdata.S.A(1)), 'color', cols.grey) + end + %%%% plot this model output + plot(XT,S.G - S.G(1),'r','displayname','G') + hold on + plot(XT,S.C - S.C(1),'g','displayname','C') + plot(XT,S.A - S.A(1),'b','displayname','A') + plot(XT,S.G - S.G(1) + S.C - S.C(1) + S.A - S.A(1),'k','displayname','net') + xlim(XTlimits) + ylabel('current - initial (mol)') + title({'Change C abundance (mol)';'b:A, r:G, g:C k:net'},'FontWeight','bold') + + case 'SResChange' + if outputcompare && isfield(cdata.S,'S') && isfield(cdata.S,'PYR') && isfield(cdata.S,'GYP') + %%%% plot against COPSE output + plot(cdata.T, cdata.S.S - cdata.S.S(1), 'color', cols.light_b) + hold on + plot(cdata.T, cdata.S.PYR - cdata.S.PYR(1), 'color', cols.light_r) + plot(cdata.T, cdata.S.GYP - cdata.S.GYP(1), 'color', cols.light_g) + plot(cdata.T, cdata.S.S - cdata.S.S(1) + cdata.S.PYR - cdata.S.PYR(1) + cdata.S.GYP - cdata.S.GYP(1) , 'color', cols.grey) + end + %%%% plot this model output + plot(XT,(S.S - S.S(1)),'b','displayname','S') + hold on + plot(XT,(S.PYR - S.PYR(1)),'r','displayname','PYR') + plot(XT,(S.GYP - S.GYP(1)),'g','displayname','GYP') + plot(XT,(S.S - S.S(1))+(S.PYR - S.PYR(1))+(S.GYP - S.GYP(1)) ,'k','displayname','net') + title({'Change S abundance (mol)';'b:SO4, r:PYR, g:GYP, k:net'},'FontWeight','bold') + xlim(XTlimits) + ylabel('Current - initial (mol)') + + + case 'CaResChange' + if outputcompare && isfield(cdata.S,'C') && isfield(cdata.S,'GYP') && isfield(cdata.S,'CAL') + %%%% plot against COPSE output + %c514output.clc_CaNet = 1.397e19*cdata.S.CAL + cdata.S.GYP + 1e21 * cdata.S.C + (no degas !) - (silicate weath); + + plot(cdata.T, cdata.S.CAL - cdata.S.CAL(1), 'color', cols.light_r) + hold on + plot(cdata.T, cdata.S.GYP - cdata.S.GYP(1), 'color', cols.light_g) + plot(cdata.T, cdata.S.C - cdata.S.C(1) , 'color', cols.light_b) + % plot(cdata.T, c514output.clc_CaNet - c514output.clc_CaNet(1) , 'color', cols.grey) + end + %%%% plot this model output + + if isfield(S,'CAL') + plot(XT,(S.CAL - S.CAL(1)),'r','displayname','CAL') + hold on + elseif isfield(S,'Ca') + plot(XT,(S.Ca - S.Ca(1)),'r','displayname','Ca') + end + if isfield(S,'GYP') + plot(XT,(S.GYP - S.GYP(1)),'g','displayname','GYP') + end + + if isfield(S,'C') + plot(XT,(S.C - S.C(1)),'b','displayname','C') + end + plot(XT,(diag.clc_deltaCaSil - diag.clc_deltaCaSil(1)),'c','displayname','sil') + plot(XT,(diag.clc_CaNet - diag.clc_CaNet(1)) ,'k','displayname','net') + + title({'Change Ca abundance (mol)';'r:CAL/Ca g:GYP b:C c:sil k:net'},'FontWeight','bold') + xlim(XTlimits) + ylabel('Current - initial (mol)') + + case 'RedoxChange' + if outputcompare && isfield(cdata.diag,'clc_RedoxC') && isfield(cdata.diag,'clc_RedoxS') && isfield(cdata.diag,'clc_RedoxNet') + %%%% plot against COPSE output + + plot(cdata.T, cdata.diag.clc_RedoxC - cdata.diag.clc_RedoxC(1), 'color', cols.light_b) + hold on + plot(cdata.T, cdata.S.O - cdata.S.O(1), 'color', cols.light_r) + plot(cdata.T, cdata.diag.clc_RedoxS - cdata.diag.clc_RedoxS(1), 'color', cols.light_g) + plot(cdata.T, cdata.diag.clc_RedoxNet - cdata.diag.clc_RedoxNet(1) , 'color', cols.grey) + end + %%%% plot this model output + + plot(XT,(diag.clc_RedoxC - diag.clc_RedoxC(1)),'b','displayname','C') + hold on + plot(XT,S.O - S.O(1),'r','displayname','O') + plot(XT,(diag.clc_RedoxS - diag.clc_RedoxS(1)),'g','displayname','S') + plot(XT,(diag.clc_RedoxNet - diag.clc_RedoxNet(1)) ,'k','displayname','net') + title({'Change ox-red (mol O_2 equiv)';'b:C+A, r:O, g:2*(GYP+S), k:net'},'FontWeight','bold') + xlim(XTlimits) + ylabel('Current - initial (mol O_2 equiv)') + + case 'CCrustRes' + if outputcompare && isfield(cdata.S,'G') && isfield(cdata.S,'C') + %%%% plot against COPSE output + plot(cdata.T, cdata.S.G/pars.G0, 'color', cols.light_r) + hold on + plot(cdata.T, cdata.S.C/pars.C0, 'color', cols.light_g) + plot(cdata.T, (cdata.S.C + cdata.S.G)/(pars.C0+pars.G0), 'color', cols.light_c) + end + %%%% plot this model output + plot(XT,S.G./pars.G0,'r','displayname','G') + hold on + title({'relative crustal C abundances';'r:G, g:C, c:total'},'FontWeight','bold') + plot(XT,S.C./pars.C0,'g','displayname','C') + plot(XT, ( S.G+S.C )./ (pars.G0 + pars.C0) , 'c') + xlim(XTlimits) + ylabel('Relative abundance') + case 'CPBurialratio' + %%%% plot this model output + plot(XT,diag.CPland_relative,'k',XT,diag.CPsea/pars.CPsea0,'b') + title({'CP burial ratio';'b: marine, k:land'},'FontWeight','bold') + xlim(XTlimits) + ylabel(sprintf('ratio marine/%g land/TBD',pars.CPsea0)); + case 'orgCBurial' + if outputcompare && isfield(cdata.diag,'mocb') && isfield(cdata.diag,'locb') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.mocb, 'color', cols.light_b) + hold on + plot(cdata.T, cdata.diag.locb, 'color', cols.light_k) + plot(cdata.T, cdata.diag.mocb + cdata.diag.locb, 'color', cols.light_r) + end + %%%% plot this model output + tot = zeros(length(XT),1); + if isfield(diag,'mocb') + plot(XT,diag.mocb,'b') + tot=tot+diag.mocb; + end + hold on + if isfield(diag,'locb') + plot(XT,diag.locb,'k') + tot = tot+diag.locb; + end + plot(XT,tot,'r') + title({'org-C burial (mol/yr)';'b:marine, k:land, r:total'},'FontWeight','bold') + xlim(XTlimits) + ylabel('Burial rate') + case 'CSburial' + if outputcompare && isfield(cdata.diag,'mocb') && isfield(cdata.diag,'locb') && isfield(cdata.diag,'mpsb') + %%%% plot against COPSE output + cscomp = (cdata.diag.mocb + cdata.diag.locb)*12./(cdata.diag.mpsb*32); + plot(cdata.T, cscomp, 'color', cols.light_b) + hold on + end + csmodel = (diag.mocb + diag.locb)*12./(diag.mpsb*32); + plot(XT, csmodel, 'b') + hold on; + % Berner (1982) C:S + plot([XT(1) XT(end)],3.22*[1 1],'k--'); + + title({'C:S burial ratio'},'FontWeight','bold') + xlim(XTlimits) + ylabel('C:S (g/g)') + + case 'FRatio' + if outputcompare && isfield(cdata.diag,'mocb') && isfield(cdata.diag,'locb') && isfield(cdata.diag,'mccb') && isfield(cdata.diag,'sfw') + %%%% plot against COPSE output + plot(cdata.T, (cdata.diag.mocb + cdata.diag.locb)./(cdata.diag.mocb + cdata.diag.locb + cdata.diag.mccb + cdata.diag.sfw) , 'color', cols.grey) + hold on + end + %%%% plot this model output + if isfield(diag,'sfw') + plot(XT,( diag.mocb+diag.locb )./ ( diag.mocb + diag.locb + diag.mccb + diag.sfw ),'g') + else + plot(XT,( diag.mocb+diag.locb )./ ( diag.mocb + diag.locb + diag.mccb),'g') + end + hold on + plot(XT,( diag.mocb+diag.locb-diag.oxidw )./(diag.ocdeg + diag.ccdeg),'r'); + % derive isotope-proxy-inversion estimate + if ~isfield(pars,'f_cisotopeCG') + pars.f_cisotopeCG = 'CGdyn'; % COPSE 5_14 behaviour + end + switch pars.f_cisotopeCG + case 'CGdyn' % dynamic C, G sedimentary reserovirs - not observed so assume at present (end-of-run) values + delta_C0=diag.delta_C(end); + delta_G0=diag.delta_G(end); + case 'CGfixed' % fixed isotope composition of degassing and weathering + delta_G0 =diag.delta_G(1); + delta_C0=diag.delta_C(1); + otherwise + error('unknown f_cisotopeCG %s',pars.f_cisotopeCG); + end + if isfield(pars,'k12_ccdegmet') % new split of 'degassing' + d13cvolc0 = ((pars.k12_ccdegmet+pars.k12_ccdegrip)*delta_C0+(pars.k13_ocdegmet+pars.k13_ocdegrip)*delta_G0)... + /(pars.k12_ccdegmet+pars.k12_ccdegrip+pars.k13_ocdegmet + pars.k13_ocdegrip); + else % classic COPSE + d13cvolc0 = (pars.k12_ccdeg*delta_C0+pars.k13_ocdeg*delta_G0)/(pars.k12_ccdeg+pars.k13_ocdeg); + end + eta = 27; % orgc fractionation + fisotope = ((diag.delta_mccb)-d13cvolc0)/eta; + plot(XT,fisotope,'k'); + if isfield(diag,'sfw') + title({'f-ratios';'k:inferred, g:CO2DIC(incl sfw), r:net'},'FontWeight','bold') + else + title({'f-ratios';'k:inferred, g:CO2DIC(no sfw), r:net'},'FontWeight','bold') + end + xlim(XTlimits); + ylim([0 1]); + + case 'SWeath' + if outputcompare && isfield(cdata.diag,'pyrw') && isfield(cdata.diag,'gypw') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.pyrw, 'color', cols.light_r) + hold on + plot(cdata.T, cdata.diag.gypw, 'color', cols.light_g) + end + %%%% plot this model output + plot(XT,diag.pyrw,'r') + hold on + plot(XT,diag.gypw,'g') + + title({'S Weathering';'r:pyrw, g:gypw'},'FontWeight','bold') + xlim(XTlimits) + ylabel('Flux mol/yr') + + case 'SBurial' + if outputcompare && isfield(cdata.diag,'mpsb') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.mpsb, 'color', cols.light_r) + hold on + end + %%%% plot against COPSE output + if outputcompare && isfield(cdata.diag,'mgsb') + plot(cdata.T, cdata.diag.mgsb, 'color', cols.light_g) + hold on + end + %%%% plot this model output + plot(XT,diag.mpsb,'r'); + hold on + plot(XT,diag.mgsb,'g') + xlim(XTlimits) + % ylim([0 3e12]) + title({'S burial (mol/yr)';'r:pyr,g:gyp'},'FontWeight','bold') + ylabel('Burial mol/yr') + + case 'CIsotopes' + if outputcompare && isfield(cdata.diag,'d13C') + %%%% plot against original COPSE output + plot(cdata.T, cdata.diag.d13C, 'color', cols.light_b) + hold on + end + if outputcompare && isfield(cdata.diag,'delta_A') + %%%% plot against a recent comparison model output + plot(cdata.T,cdata.diag.delta_A,'color',cols.light_k); + hold on + plot(cdata.T,cdata.diag.delta_mccb,'color',cols.light_b); + plot(cdata.T,cdata.diag.delta_A+cdata.diag.d_mocb,'color',cols.light_c); + plot(cdata.T,cdata.diag.delta_A+cdata.diag.d_locb,'color',cols.light_m); + end + %%%% plot this model output + %plot(XT,diag.delta_A,'b') + if isfield(diag,'delta_A') + plot(XT,diag.delta_A,'k'); + hold on + plot(XT,diag.delta_mccb,'b'); + plot(XT,diag.delta_A+diag.d_mocb,'c'); + plot(XT,diag.delta_A+diag.d_locb,'m'); + end + plot(XT,diag.delta_C,'g') + hold on; + plot(XT,diag.delta_G,'r') + xlim(XTlimits) + ylim([-1 10]) + title('d13C (single res.) k:A b:mccb,c:mocb,m:locb,r:G,g:C','FontWeight','bold') + ylabel('per mil') + case 'CIsotopesIO' + % additional detail on d13C of inputs/outputs to DIC pool + %%%% plot this model output + %plot(XT,diag.delta_A,'b') + plot(XT,diag.delta_mccb,'k'); + hold on; + plot(XT,diag.delta_A+diag.d_mocb,'c'); + plot(XT,diag.delta_A+diag.d_locb,'m'); + plot(XT, diag.d13Cin, 'b'); + plot(XT, diag.d13Cout, 'b'); + plot(XT, diag.D_B, 'c'); + plot(XT, diag.D_P, 'm'); + %plot(XT,diag.d13Cdegass,'r'); + %plot(XT,diag.d13CDICin,'b'); + %plot(XT,diag.d13CDICout,'c'); + plot(XT,diag.delta_C,'g'); + plot(XT,diag.delta_G,'r') + xlim(XTlimits) + %ylim([-30 -20]); + title('\delta^{13}C: r:G c:mocb m:locb k:mccb g:C b:d13Cin/out','FontWeight','bold') + ylabel('per mil') + case 'CIsotopesDiff' + %Difference between this run and comparison output + %Interpolate onto tcomp grid for comparison + + if outputcompare && isfield(cdata.diag, 'delta_mccb') + [ tcomp, d13Cdiff, d13Crms ] = copse_diff(XTlimits, 'diff', cdata.T, cdata.diag.delta_mccb, XT, diag.delta_mccb); + d13C_comparison = true; + else + tcomp = []; + d13Cdiff = []; + d13Crms = NaN; + d13C_comparison = false; + end + + plot(tcomp, d13Cdiff,'r') + + fprintf('RMS error (mccb d13C - comparison model) %g\n',d13Crms); + if d13C_comparison + title({'mccb d13C - comparison model)';sprintf('RMS Error %g',d13Crms)},'FontWeight','bold') + else + title('No d13C comparison data','FontWeight','bold') + end + + xlim(XTlimits) + ylabel('per mil'); + case 'SIsotopes' + if outputcompare && isfield(cdata.diag,'delta_S') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.delta_S, 'color', cols.light_b) + hold on + end + %%%% plot this model output + if isfield(S,'moldelta_S') + plot(XT,S.moldelta_S./S.S,'b') + hold on + end + plot(XT,S.moldelta_GYP./S.GYP,'g') + hold on + plot(XT,S.moldelta_PYR./S.PYR,'r') + xlim(XTlimits) + title('d34S. b:SO4,r:PYR,g:GYP','FontWeight','bold') + ylabel('per mil') + case 'SIsotopesDiff' + %Difference between this run and C514 output + %Interpolate onto tcomp grid for comparison + if outputcompare && isfield(cdata.diag, 'delta_S') + [ tcomp, d34Sdiff, d34Srms ] = copse_diff(XTlimits, 'diff', cdata.T, cdata.diag.delta_S, XT, diag.delta_S); + d34Scomparison = true; + else + tcomp = []; + d34Sdiff = []; + d34Srms = NaN; + d34Scomparison = false; + end + + plot(tcomp, d34Sdiff,'r') + + fprintf('RMS error (d34S - comparison model) %g\n',d34Srms); + if d34Scomparison + title({'d34S - comparison model';sprintf('RMS Error %g',d34Srms)},'FontWeight','bold') + else + title('No d34S comparison data','FontWeight','bold') + end + xlim(XTlimits) + ylabel('per mil'); + case 'CaIsotopes' + %%%% plot this model output + plot(XT,diag.Ocean.deltaCa44,'b') + xlim(XTlimits) + %ylim([-1 5]) + title('\delta^{44}Ca','FontWeight','bold') + ylabel('per mil') + case 'PBurial' + if outputcompare && isfield(cdata.diag,'capb') + %%%%%%%%%%%%%%%%%%%%% debug figure for P burial fluxes + plot(cdata.T,cdata.diag.capb,'color',cols.light_g) + hold on + plot(cdata.T,cdata.diag.fepb,'color',cols.light_c) + plot(cdata.T,cdata.diag.mopb,'color',cols.light_r) + plot(cdata.T,cdata.diag.psea,'color',cols.light_b) + end + %Plot this model output + plot(XT,diag.capb,'g') + hold on + plot(XT,diag.fepb,'c') + plot(XT,diag.mopb,'r') + if isfield(diag,'psea'); + plot(XT,diag.psea,'b') + end + if isfield(diag,'pland'); + plot(XT,diag.pland,'k') + end + title({'P Burial flux';'psea (b), pland(k), capb(g), fepb (c), mopb (r)'},'Fontweight','bold'); + xlim(XTlimits); + ylabel('mol/yr'); + + + otherwise + handled = 0; +% error('Unknown plot %s',char(wplot)); +end + +end diff --git a/code/copse/copse_plot_custom_colors.m b/code/copse/copse_plot_custom_colors.m new file mode 100644 index 0000000..69ff598 --- /dev/null +++ b/code/copse/copse_plot_custom_colors.m @@ -0,0 +1,12 @@ +function cols = copse_plot_custom_colors + +%%%% define custom colors +cols.grey = [0.7 0.7 0.7] ; +cols.light_k = cols.grey ; +cols.light_r = (1/255)*[255 153 153]; +cols.light_c = (1/255)*[180 255 255]; +cols.light_b = (1/255)*[153 204 255]; +cols.light_g = (1/255)*[204 255 204]; +cols.light_m = (1/255)*[255 186 255]; + +end \ No newline at end of file diff --git a/code/copse/copse_plot_sfbw.m b/code/copse/copse_plot_sfbw.m new file mode 100644 index 0000000..8d5d1b7 --- /dev/null +++ b/code/copse/copse_plot_sfbw.m @@ -0,0 +1,343 @@ +function handled=copse_plot_sfbw( wplot, XT, XTlimits,tiplot, plotdata,cdata ) +% Additional / modified figures for seafloor weathering inclusion +% +% wplot requested plot (string) +% XT model output: x axis (usually time in yr) (vector) +% XTlimits requested x-axis limits, yr (eg [-500e8 0] ) +% tiplot (not used) time indices to plot +% plotdata model output with fields S, diag, pars +% cdata (optional) COPSE 5_14 output to compare against +% +% handled 1 if we have a handler for requested plot, 0 otherwise + +%do we have output to compare against? +if nargin > 5 + outputcompare = 1; +else + outputcompare = 0; +end + +%%%% load the custom colours +cols = copse_plot_custom_colors ; + +% Unpack supplied data +diag=plotdata.diag; +S=plotdata.S; + +%Assume we can handle this plot unless we discover otherwise +handled = 1; + +switch(char(wplot)) + + + case 'Srconc' + %%%%% plot against G3 output if it exists + if outputcompare && isfield(cdata.S,'Sr_ocean') + plot(cdata.T, cdata.S.Sr_ocean*10, 'color', cols.light_b) + hold on + end + if outputcompare && isfield(cdata.S,'Sr_sed') + plot(cdata.T, cdata.S.Sr_sed, 'color', cols.light_k) + hold on + end + %%%% plot this model output + plot (XT, S.Sr_ocean*10,'b','displayname','Sr ocean') + hold on + plot (XT, S.Sr_sed,'k','displayname','Sr sed') + title('[Sr]*10 ocean (b) and sed (k)','FontWeight','bold') + xlim(XTlimits) + ylabel('Mol') + + + + case 'Srfluxes' + %%%%% plot against G3 output if it exists + if outputcompare && isfield(cdata, 'T_Sr') && isfield(cdata.diag,'Sr_old_igw') + plot(cdata.T_Sr, cdata.diag.Sr_old_igw, 'color', cols.light_r) + hold on + end + if outputcompare && isfield(cdata, 'T_Sr') && isfield(cdata.diag,'Sr_new_igw') + plot(cdata.T_Sr, cdata.diag.Sr_new_igw, 'color', cols.light_k) + hold on + end + if outputcompare && isfield(cdata, 'T_Sr') && isfield(cdata.diag,'Sr_sedw') + plot(cdata.T_Sr, cdata.diag.Sr_sedw, 'color', cols.light_c) + hold on + end + if outputcompare && isfield(cdata, 'T_Sr') && isfield(cdata.diag,'Sr_mantle') + plot(cdata.T_Sr, cdata.diag.Sr_mantle, 'color', cols.light_m) + hold on + end + if outputcompare && isfield(cdata, 'T_Sr') && isfield(cdata.diag,'Sr_sedb') + plot(cdata.T_Sr, cdata.diag.Sr_sedb, 'color', cols.light_b) + hold on + end + if outputcompare && isfield(cdata, 'T_Sr') && isfield(cdata.diag,'Sr_sfw') + plot(cdata.T_Sr, cdata.diag.Sr_sfw, 'color', cols.light_g) + hold on + end + if outputcompare && isfield(cdata, 'T_Sr') && isfield(cdata.diag,'Sr_metam') + plot(cdata.T_Sr, cdata.diag.Sr_metam, 'color', cols.light_m, 'linestyle', '--') + hold on + end + + %%%% plot this model output + plot (XT, diag.Sr_old_igw,'r','displayname','Sr_old_igw') + hold on + plot (XT, diag.Sr_new_igw,'k','displayname','Sr_new_igw') + plot (XT, diag.Sr_sedw,'c','displayname','Sr_sedw') + plot (XT, diag.Sr_mantle,'m','displayname','Sr_mantle') + plot (XT, diag.Sr_sedb,'b','displayname','Sr_sedb') + plot (XT, diag.Sr_sfw,'g','displayname','Sr_sfw') + plot (XT, diag.Sr_metam,'m','linestyle','--','displayname','Sr_metam') + + title('Sr fluxes: old ig (r), new ig (k), sedw (c), mantle (m), metam (m-), sedb (b), sfw (g)' ,'FontWeight','bold') + xlim(XTlimits) + ylabel('Mol/yr') + + + + case 'Srfrac' + %%%%% plot against G3 output if it exists + if outputcompare && isfield(cdata.diag,'delta_Sr_ocean') + plot(cdata.T, cdata.diag.delta_Sr_ocean, 'color', cols.light_b) + hold on + end + if outputcompare && isfield(cdata, 'T_Sr_sed') && isfield(cdata.diag,'delta_Sr_sed') + plot(cdata.T_Sr_sed, cdata.diag.delta_Sr_sed, 'color', cols.light_k) + hold on + end + %%%% plot this model output + plot (XT, diag.delta_Sr_ocean,'b','displayname','8786Sr ocean') + hold on + plot (XT, diag.delta_Sr_sed,'k','displayname','8786Sr sed') + plot (XT, diag.delta_igw,'r','displayname','8786Sr river') + plot (XT, diag.delta_old_ig,'r--','displayname','8786Sr old ig') + plot (XT, diag.delta_new_ig,'r:','displayname','8786Sr new ig') + plot (XT, diag.delta_mantle,'m','displayname','8786Sr mantle') + title('8786Sr ocean (b), sed (k), igw (r), old ig (r--), new ig (r:), mantle (m)','FontWeight','bold') + xlim(XTlimits) + ylim([0.702 0.716]) + ylabel('8786Sr') + + case 'SrfracDiff' + %Difference between this run and comparison output + %Interpolate onto tcomp grid for comparison + + if outputcompare && isfield(cdata.diag, 'delta_Sr_ocean') + [ tcomp, dSrdiff, dSrrms ] = copse_diff(XTlimits, 'diff', cdata.T, cdata.diag.delta_Sr_ocean, XT, diag.delta_Sr_ocean); + dSr_comparison = true; + else + tcomp = []; + dSrdiff = []; + dSrrms = NaN; + dSr_comparison = false; + end + + plot(tcomp, dSrdiff,'r') + + fprintf('RMS error (8786Sr ocean - comparison model) %g\n',dSrrms); + if dSr_comparison + title({'8786Sr ocean - comparison model)';sprintf('RMS Error %g',dSrrms)},'FontWeight','bold') + else + title('No 8786Sr ocean comparison data','FontWeight','bold') + end + + xlim(XTlimits) + ylabel('diff 8786Sr'); + + case 'Pcrust' + %%%% plot this model output + semilogy(XT, S.OrgP,'b','displayname','OrgP') + hold on + semilogy(XT, S.CaP,'k','displayname','CaP') + hold on + semilogy(XT, S.FeP,'r','displayname','FeP') + title({'Sedimentary P reservoirs (mol)';'b:OrgP, k:CaP, r:FeP'},'FontWeight','bold') + xlim(XTlimits) + ylabel('mol') + + + case 'oxygen' + if outputcompare && isfield(cdata.diag,'pO2PAL') + plot(cdata.T, cdata.diag.pO2PAL, 'color', cols.grey) + hold on + end + %%%% plot this model output + plot(XT,diag.pO2PAL,'k') + hold on + title('pO2 (PAL)','FontWeight','bold') + xlim(XTlimits) + ylabel('Normalized value'); + + case 'CPWeath' + if outputcompare && isfield(cdata.diag,'silw') + %%%% plot against COPSE output + plot(cdata.T, cdata.diag.silw, 'color', cols.light_c) + hold on + end + if outputcompare && isfield(cdata.diag,'carbw') + plot(cdata.T, cdata.diag.carbw, 'color', cols.light_g) + hold on + end + if outputcompare && isfield(cdata.diag,'oxidw') + plot(cdata.T, cdata.diag.oxidw, 'color', cols.light_r) + end + if outputcompare && isfield(cdata.diag,'phosw') + plot(cdata.T, cdata.diag.phosw*100, 'color', cols.light_b) + end + %%%% plot this model output + + plot(XT,diag.silw,'c--') + hold on + plot(XT,diag.carbw,'g') + plot(XT,diag.oxidw,'r') + plot(XT,diag.phosw*100,'b') + if isfield(diag,'sfw') + plot(XT,diag.silw+diag.sfw,'c') + plot(XT,diag.sfw,'m--') + title({'CP Weathering';'r:oxidw, c:silw+sfw, c-:silw m-:sfw, g:carbw, b:phosw x100'},'FontWeight','bold') + else + title({'CP Weathering';'r:oxidw, c-:silw (no sfw), g:carbw, b:phosw x100'},'FontWeight','bold') + end + xlim(XTlimits) + ylabel('Flux mol/yr') + + + case 'SFW' + + %%%% plot the G3 results average to compare (test code) + if outputcompare + if isfield(cdata.diag, 'sfw') + plot(cdata.T,cdata.diag.sfw,'Color',cols.light_b) + end + hold on + plot(cdata.T,cdata.diag.silw,'Color',cols.light_g) + if isfield(cdata.diag, 'granw') + plot(cdata.T,cdata.diag.granw,'Color',cols.light_r) + end + if isfield(cdata.diag, 'basw') + plot(cdata.T,cdata.diag.basw,'Color',cols.light_k) + end + end + + %%%% plot this model output + plot(XT,diag.sfw,'b','displayname','SFW') + hold on + plot(XT,diag.silw,'g','displayname','silw') + plot(XT,diag.granw,'r','displayname','granw') + plot(XT,diag.basw,'k','displayname','basw') + xlim(XTlimits) + ylabel('weathering (mol/yr)') + title({'Silicate weathering';'SFW(b) silw(g) granw(r) basw(k)'},'FontWeight','bold') + + + + case 'BasaltArea' + + %%%% plot the G3 results average to compare (test code) + if outputcompare && isfield(cdata.diag, 'CFB_area') + plot(cdata.T,cdata.diag.CFB_area,'Color',cols.light_r) + hold on + end + if outputcompare && isfield(cdata.diag, 'oib_area') + plot(cdata.T,cdata.diag.oib_area,'Color',cols.light_b) + hold on + end + + %%%% plot this model output + sumba = 0; + if isfield(diag, 'oib_area') + plot(XT,diag.oib_area,'b','displayname','oib') + hold on + sumba = sumba+diag.oib_area; + end + if isfield(diag, 'CFB_area') + plot(XT,diag.CFB_area,'r','displayname','cfb') + sumba = sumba + diag.CFB_area; + end + plot(XT, sumba,'g','displayname','sum') + + xlim(XTlimits) + ylabel('area (km^2)') + title({'Basalt area OIB(b) CFB(r) sum(g)'},'FontWeight','bold') + + case 'CoalFrac' + plot(XT,diag.COAL,'k') + hold on + title('Coal Forcing','FontWeight','bold') + xlim(XTlimits) + ylabel('Normalized value'); + + case 'SaltFrac' + plot(XT,diag.SALT,'k') + hold on + title('Gypsum Deposition Forcing','FontWeight','bold') + xlim(XTlimits) + ylabel('Normalized value'); + + case 'EvapArea' + plot(XT,diag.EVAP_AREA,'k') + hold on + title('Evaporite Forcing','FontWeight','bold') + xlim(XTlimits) + ylabel('Normalized value'); + + case 'OrgArea' + plot(XT,diag.ORG_AREA,'k') + hold on + title('Shale+Coal Area Forcing','FontWeight','bold') + xlim(XTlimits) + ylabel('Normalized value'); + + case 'ShaleArea' + plot(XT,diag.SHALE_AREA,'k') + hold on + title('Shale Area Forcing','FontWeight','bold') + xlim(XTlimits) + ylabel('Normalized value'); + + case 'SilicateArea' + plot(XT,diag.GRAN_AREA,'k') + hold on + title('Weighted Silicate Forcing','FontWeight','bold') + xlim(XTlimits) + ylabel('Normalized value'); + + case 'LIPCO2' + %%%% plot this model output + plot(XT,diag.LIP_CO2,'b','displayname','LIP_CO2') + xlim(XTlimits) + ylabel('flux (mol C yr^{-1})') + title({'LIP CO2'},'FontWeight','bold') + + case 'PhysForc' % update (override) base version to add BA forcing + %%%% also add carbonate land area + %%%% plot this model output + lgds = {}; + if isfield(diag, 'SOLAR') + plot(XT,diag.SOLAR./1368,'r'); lgds{end+1} = 'SOLAR'; + hold on + end + plot(XT,diag.CARB_AREA,'c'); lgds{end+1} = 'CARB_AREA'; + hold on + plot(XT,diag.TOTAL_AREA,'k--'); lgds{end+1} = 'TOTAL_AREA'; + plot(XT,diag.BA,'k'); lgds{end+1} = 'BA'; + plot(XT,diag.GRAN_AREA,'r--'); lgds{end+1} = 'GRAN AREA'; + plot(XT,diag.UPLIFT,'b'); lgds{end+1} = 'UPLIFT'; + plot(XT,diag.DEGASS,'g'); lgds{end+1} = 'DEGASS'; + plot(XT,diag.PG,'b--'); lgds{end+1} = 'PG'; + + h=legend(lgds); + set(h,'FontSize',6,'Location','SouthWest'); + legend boxoff; + title('Phys Forcings','FontWeight','bold') + xlim(XTlimits) + ylim([0 2.1]); + ylabel('Relative strength') + otherwise + handled = 0; +end + +end + diff --git a/code/copse/copse_temperature.m b/code/copse/copse_temperature.m new file mode 100644 index 0000000..1286d57 --- /dev/null +++ b/code/copse/copse_temperature.m @@ -0,0 +1,28 @@ +function TEMP = copse_temperature( pars, tmodel, D, temp ) +%COPSE_TEMPERATURE Calculate updated temperature +% NB: this is an iteratively improved temperature based on insolation, pCO2, and current temperature + +%global pars; + +%%%%%%% Temperature function: +switch pars.f_temp + case 'CK1992' % Caldeira and Kasting 1992 (variable albedo) + %SD for legibility, moved this code to a function (no change in functionality) + tempcorrect = 0.194; %%%% COPSE temp correction to 15C at present day + TEMP=copse_TempCK1992(D.SOLAR, D.pCO2atm, temp)+tempcorrect; + case 'CK1992fixalbedo' + ALBEDO = 0.3; + tempcorrect = 0.194; %%%% COPSE temp correction to 15C at present day + TEMP=copse_TempCK1992(D.SOLAR, D.pCO2atm, temp, ALBEDO)+tempcorrect; +% case 'mills2011' % mills2011 temp (fixed albedo) +% ALBEDO = 0.3; +% TEMP = (( (D.SOLAR.*(1-ALBEDO))./(4.*(1-(0.773./2)).*5.67e-8) ).^0.25) + 0.1815.*( 0.2507.*((log10(D.pCO2atm)).^4) + 3.9216.*((log10(D.pCO2atm)).^3) + 23.8113.*((log10(D.pCO2atm)).^2) + 83.4113.*((log10(D.pCO2atm))) + 131.6138 ) ; + case 'Berner' + %TL note that this uses its own luminosity (implicitly) + TEMP = paleo_const.k_CtoK + 15 + pars.k_c*log(D.pCO2PAL) + pars.k_l*tmodel/570e6; + otherwise + error('Unknown f_temp %s',pars.f_temp); +end + +end + diff --git a/code/copse/copse_weathering_fluxes_reloaded.m b/code/copse/copse_weathering_fluxes_reloaded.m new file mode 100644 index 0000000..9fdd9d9 --- /dev/null +++ b/code/copse/copse_weathering_fluxes_reloaded.m @@ -0,0 +1,148 @@ +function D = copse_weathering_fluxes_reloaded(pars, tmodel, S, D ) + + + %%% silicate and carbonate weathering + + %%% granite and basalt weathering + + %%% granite weathering + switch pars.f_gran_link_u + case 'original' + D.granw = pars.k_granw*D.UPLIFT*D.PG*D.RHO * D.GRAN_AREA * D.f_gran ; + case 'weak' + D.granw = pars.k_granw*(D.UPLIFT^0.33)*D.PG*D.RHO * D.GRAN_AREA * D.f_gran ; + case 'none' + D.granw = pars.k_granw*D.PG*D.RHO * D.GRAN_AREA * D.f_gran ; + otherwise + error('unrecognized f_gran_link_u %s', pars.f_gran_link_u); + end + %%% apatite associated with granite + %D.granw_ap = pars.k_granw*D.UPLIFT*D.PG*D.RHO * D.GRAN_AREA * D.f_ap ; + + %%%% basw NOT linked to uplift in G3 model + switch pars.f_bas_link_u + case 'no' + D.basw = pars.k_basw*D.BA*D.PG*D.RHO* D.f_bas ; + %%% apatite associated with basalt + %D.basw_ap = pars.k_basw*D.BA*D.PG*D.RHO* D.f_ap ; + case 'yes' + %%%% for bergman run link basw to uplift + D.basw = pars.k_basw*D.BA*D.UPLIFT*D.PG*D.RHO* D.f_bas ; + %%% apatite associated with basalt + %D.basw_ap = pars.k_basw*D.BA*D.UPLIFT*D.PG*D.RHO* D.f_ap ; + case 'weak' + D.basw = pars.k_basw*D.BA*(D.UPLIFT^0.33)*D.PG*D.RHO* D.f_bas ; + otherwise + error('unrecognized f_bas_link_u %s', pars.f_bas_link_u); + end + + D.silw = D.granw + D.basw; + + %%% apatite associated with silicate weathering + % does it follow its own kinetics? (or that of the host rock) + switch pars.f_p_kinetics + case 'no' + D.granw_ap = D.granw; + D.basw_ap = D.basw; + case 'yes' + D.granw_ap = D.granw * (D.f_ap / D.f_gran); + D.basw_ap = D.basw * (D.f_ap / D.f_bas); + otherwise + error('unrecognized f_p_kinetics %s', pars.f_p_kinetics); + end + + % is the P content assumed to vary between granite and basalt? + switch pars.f_p_apportion + case 'no' + D.silw_ap = D.granw_ap + D.basw_ap; + case 'yes' + D.silw_ap = (pars.k_P*D.granw_ap + D.basw_ap)/(pars.k_P*(1-pars.k_basfrac)+pars.k_basfrac); + otherwise + error('unrecognized f_p_apportion %s', pars.f_p_apportion); + end + + D.phosw_s = D.F_EPSILON*pars.k10_phosw*pars.k_Psilw*(D.silw_ap/(pars.k_silw + realmin)) ; % trap 0/0 if k_silw = 0 + + %%% carbonate weathering + switch pars.f_carb_link_u + case 'yes' + D.carbw_fac = D.UPLIFT*D.PG*D.RHO* D.CARB_AREA * D.f_carb ; + case 'no' + D.carbw_fac = D.PG*D.RHO* D.CARB_AREA * D.f_carb ; + otherwise + error('Unknown f_carb_link_u %s', pars.f_carb_link_u); + end + + switch(pars.f_carbwC) + case 'Cindep' % Copse 5_14 + D.carbw = pars.k14_carbw*D.carbw_fac; + case 'Cprop' % A generalization for varying-size C reservoir + D.carbw = pars.k14_carbw*D.carbw_fac*D.normC; + otherwise + error('Unknown f_carbw %s',pars.f_carbwC); + end + + %%%% Oxidative weathering + + % C oxidative weathering + + %%% not affected by PG in G3 paper... + switch(pars.f_oxwG) + case 'O2indep' + D.oxidw = pars.k17_oxidw*D.UPLIFT *D.normG ; + case 'Gindep' + D.oxidw = pars.k17_oxidw*D.UPLIFT *D.oxw_fac ; + case 'Gprop' + D.oxidw = pars.k17_oxidw*D.UPLIFT * D.normG*D.oxw_fac ; + case 'forced' + D.oxidw = pars.k17_oxidw*D.UPLIFT*D.ORG_AREA * D.normG*D.oxw_fac ; + otherwise + error('Unknown f_oxwG %s',pars.f_oxwG); + end + + % Sulphur weathering + switch(pars.Scycle) + case 'Enabled' + switch(pars.f_gypweather) + case 'original' % Gypsum weathering tied to carbonate weathering + D.gypw = pars.k22_gypw*D.normGYP*D.carbw_fac ; + case 'alternative' %independent of carbonate area + D.gypw = pars.k22_gypw*D.normGYP*D.UPLIFT*D.PG*D.RHO*D.f_carb ; + case 'forced' %dependent on evaporite area + D.gypw = pars.k22_gypw*D.normGYP*D.EVAP_AREA*D.UPLIFT*D.PG*D.RHO*D.f_carb ; + otherwise + error('unknown f_gypweather %s',obj.pars.f_gypweather); + end + % Pyrite oxidative weathering + switch(pars.f_pyrweather) + % with same functional form as carbon + case 'copse_O2' %not tied to PG in G3 paper... + D.pyrw = pars.k21_pyrw*D.UPLIFT*D.normPYR*D.oxw_fac ; + case 'copse_noO2' % independent of O2 + D.pyrw = pars.k21_pyrw*D.UPLIFT*D.normPYR ; + case 'forced' %forced by exposed shale area + D.pyrw = pars.k21_pyrw*D.UPLIFT*D.SHALE_AREA*D.normPYR ; + otherwise + error('unknown f_pyrweather %s',obj.pars.f_pyrweather); + end + case 'None' + D.gypw = 0; + D.pyrw = 0; + otherwise + error('unrecogized pars.Scycle %s',pars.Scycle); + end + + + + %%%%%%% P weathering + % D.phosw_s is defined above + + % Introduction of P weathering flux from sandstones etc + D.sedw = D.UPLIFT*D.PG*D.RHO*D.VEG; + D.phosw_x = D.F_EPSILON*pars.k10_phosw*pars.k_Psedw*D.sedw; + + D.phosw_c = D.F_EPSILON*pars.k10_phosw*pars.k_Pcarbw*(D.carbw/(pars.k14_carbw + realmin)); + D.phosw_o = D.F_EPSILON*pars.k10_phosw*pars.k_Poxidw*(D.oxidw/(pars.k17_oxidw + realmin)) ; % trap 0/0 if k17_oxidw = 0 + D.phosw = D.phosw_s + D.phosw_c + D.phosw_o + D.phosw_x; + +end diff --git a/code/copse/copse_weathering_rates_mills2014g3.m b/code/copse/copse_weathering_rates_mills2014g3.m new file mode 100644 index 0000000..562733f --- /dev/null +++ b/code/copse/copse_weathering_rates_mills2014g3.m @@ -0,0 +1,96 @@ +function D = copse_weathering_rates_mills2014g3(pars, tmodel, S, D ) + + +%%% weathering kinetics +switch pars.f_act_energies + case 'single' + %%%% use same activation energy for granite and basalt + D.f_T_gran = exp(0.09*(D.TEMP-288.15)) ; + D.f_T_bas = exp(0.09*(D.TEMP-288.15)) ; + case 'split_bug_g32014_Toffset' + %%%% Mills G3 2014 paper used 288, results in ~1% offset in pCO2 + D.f_T_gran = exp(0.0724*(D.TEMP-288)) ; %%% 50 kJ/mol + D.f_T_bas = exp(0.0608*(D.TEMP-288)) ; %%% 42 kJ/mol + case 'split' + %%%% revert to 288.15 + D.f_T_gran = exp(0.0724*(D.TEMP-288.15)) ; %%% 50 kJ/mol + D.f_T_bas = exp(0.0608*(D.TEMP-288.15)) ; %%% 42 kJ/mol + otherwise + error('unrecognized f_act_energies %s', pars.f_act_energies); +end + + +%%% activation energy for apatite (decide whether to use it in _fluxes) +D.f_T_ap = exp(0.0507*(D.TEMP-288.15)) ; %%% 35 kJ/mol + + +%%% runoff temperature dependence +D.f_T_runoff = ( (1 + 0.038*(D.TEMP - 288.15))^0.65 ) ; +D.g_T_runoff = 1 + 0.087*(D.TEMP - 288.15) ; + + +%%% CO2 dependence +D.f_CO2_abiotic = D.pCO2PAL^0.5 ; +switch(pars.f_co2fert) + case 'original' + D.f_CO2_biotic = ( 2*D.pCO2PAL / (1 + D.pCO2PAL) )^0.4 ; + case 'geocarb3' + D.f_CO2_biotic = ( 2*D.pCO2PAL / (1 + D.pCO2PAL) ) ; + case 'off' + D.f_CO2_biotic = 1.0 ; + otherwise + error('Unknown f_co2fert %s',pars.f_co2fert); +end + + +%%% O2 dependence +switch(pars.f_oxwO) + case 'PowerO2' % Copse 5_14 base with f_oxw_a = 0.5 + D.oxw_fac = D.pO2PAL^pars.f_oxw_a; + case 'SatO2' + D.oxw_fac = D.pO2PAL/(D.pO2PAL + pars.f_oxw_halfsat); + case 'IndepO2' + D.oxw_fac = 1; + otherwise + error('Unknown f_foxwO %s',pars.f_oxwO); +end + + +%%% vegetation dependence +switch(pars.f_vegweath) + case 'original' + D.VWmin = min(D.VEG*D.W,1); + D.f_co2_gran = D.f_T_gran*D.f_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.f_co2_bas = D.f_T_bas*D.f_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.f_co2_ap = D.f_T_ap*D.f_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.g_co2 = D.g_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.w_plantenhance = ( pars.k15_plantenhance + (1-pars.k15_plantenhance)*D.W*D.VEG ); + %combining plant and other effects on rates + D.f_gran = D.w_plantenhance *D.f_co2_gran ; + D.f_bas = D.w_plantenhance *D.f_co2_bas ; + D.f_ap = D.w_plantenhance *D.f_co2_ap ; + D.f_carb = D.w_plantenhance*D.g_co2 ; + case 'new' + D.Vmin = min(D.VEG,1); + D.f_gran = D.f_T_gran*D.f_T_runoff*((1-D.Vmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG) ; + D.f_bas = D.f_T_bas*D.f_T_runoff*((1-D.Vmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG) ; + D.f_ap = D.f_T_ap*D.f_T_runoff*((1-D.Vmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG) ; + D.f_carb = D.g_T_runoff*((1-D.Vmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG) ; + case 'new2' + D.VWmin = min(D.VEG*D.W,1); + D.f_gran = D.f_T_gran*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + D.f_bas = D.f_T_bas*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + D.f_ap = D.f_T_ap*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + D.f_carb = D.g_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + case 'newnpp' + D.VWmin = min(D.V_npp*D.W,1); + D.f_gran = D.f_T_gran*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + D.f_bas = D.f_T_bas*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + D.f_ap = D.f_T_ap*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + D.f_carb = D.g_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + otherwise + error('Unknown f_vegweath %s',pars.f_vegweath); +end + +end + diff --git a/code/copse/copse_weathering_rates_reloaded.m b/code/copse/copse_weathering_rates_reloaded.m new file mode 100644 index 0000000..3982d73 --- /dev/null +++ b/code/copse/copse_weathering_rates_reloaded.m @@ -0,0 +1,86 @@ +function D = copse_weathering_rates_reloaded(pars, tmodel, S, D ) + + +%%% weathering kinetics +switch pars.f_act_energies + case 'single' + %%%% use same activation energy for granite and basalt + D.f_T_gran = exp(0.09*(D.TEMP-288.15)) ; + D.f_T_bas = exp(0.09*(D.TEMP-288.15)) ; + case 'split' + %%%% use different activation energy for granite and basalt + D.f_T_gran = exp(0.0724*(D.TEMP-288.15)) ; %%% 50 kJ/mol + D.f_T_bas = exp(0.0608*(D.TEMP-288.15)) ; %%% 42 kJ/mol + otherwise + error('unrecognized f_act_energies %s', pars.f_act_energies); +end + + +%%% activation energy for apatite (decide whether to use it in _fluxes) +D.f_T_ap = exp(0.0507*(D.TEMP-288.15)) ; %%% 35 kJ/mol + + +%%% runoff temperature dependence +D.f_T_runoff = ( (1 + 0.038*(D.TEMP - 288.15))^0.65 ) ; +D.g_T_runoff = 1 + 0.087*(D.TEMP - 288.15) ; + + +%%% CO2 dependence +D.f_CO2_abiotic = D.pCO2PAL^0.5 ; +switch(pars.f_co2fert) + case 'original' + D.f_CO2_biotic = ( 2*D.pCO2PAL / (1 + D.pCO2PAL) )^0.4 ; + case 'geocarb3' + D.f_CO2_biotic = ( 2*D.pCO2PAL / (1 + D.pCO2PAL) ) ; + case 'off' + D.f_CO2_biotic = 1.0 ; + otherwise + error('Unknown f_co2fert %s',pars.f_co2fert); +end + + +%%% O2 dependence +switch(pars.f_oxwO) + case 'PowerO2' % Copse 5_14 base with f_oxw_a = 0.5 + D.oxw_fac = D.pO2PAL^pars.f_oxw_a; + case 'SatO2' + D.oxw_fac = D.pO2PAL/(D.pO2PAL + pars.f_oxw_halfsat); + case 'IndepO2' + D.oxw_fac = 1; + otherwise + error('Unknown f_foxwO %s',pars.f_oxwO); +end + + +%%% vegetation dependence +switch(pars.f_vegweath) + case 'original' + D.VWmin = min(D.VEG*D.W,1); + D.f_co2_gran = D.f_T_gran*D.f_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.f_co2_bas = D.f_T_bas*D.f_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.f_co2_ap = D.f_T_ap*D.f_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.g_co2 = D.g_T_runoff*(D.f_CO2_abiotic*(1 - D.VWmin) + D.f_CO2_biotic*D.VWmin) ; + D.w_plantenhance = ( pars.k15_plantenhance + (1-pars.k15_plantenhance)*D.W*D.VEG ); + %combining plant and other effects on rates + D.f_gran = D.w_plantenhance *D.f_co2_gran ; + D.f_bas = D.w_plantenhance *D.f_co2_bas ; + D.f_ap = D.w_plantenhance *D.f_co2_ap ; + D.f_carb = D.w_plantenhance*D.g_co2 ; + case 'new2' + D.VWmin = min(D.VEG*D.W,1); + D.f_gran = D.f_T_gran*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + D.f_bas = D.f_T_bas*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + D.f_ap = D.f_T_ap*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + D.f_carb = D.g_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.VEG*D.W) ; + case 'newnpp' + D.VWmin = min(D.V_npp*D.W,1); + D.f_gran = D.f_T_gran*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + D.f_bas = D.f_T_bas*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + D.f_ap = D.f_T_ap*D.f_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + D.f_carb = D.g_T_runoff*((1-D.VWmin)*pars.k15_plantenhance*D.f_CO2_abiotic + D.V_npp*D.W) ; + otherwise + error('Unknown f_vegweath %s',pars.f_vegweath); +end + +end + diff --git a/code/copse/copse_weathering_seafloor_reloaded.m b/code/copse/copse_weathering_seafloor_reloaded.m new file mode 100644 index 0000000..a63cb6e --- /dev/null +++ b/code/copse/copse_weathering_seafloor_reloaded.m @@ -0,0 +1,54 @@ +function D = copse_weathering_seafloor_reloaded(pars, tmodel, S, D ) +% Seafloor weathering flux + +% Tectonic forcing +% D.RHOSFW is a hook to apply perturbations for sensitivity studies (usually = 1) +switch pars.f_sfw_force + case 'None' + force_sfw = D.RHOSFW * 1; + case 'DEGASS' + force_sfw = D.RHOSFW *D.DEGASS; + case 'MetRip' + force_sfw = D.RHOSFW *D.DEGASSrip; + otherwise + error('unknown f_sfw_force %s', pars.f_sfwforce); +end + + +% Temperature / CO2 dependence +% NB: two temperature-based functions are _very_ similar +switch pars.f_sfw_opt + case 'mills2014pCO2' % Mills (2014) PNAS 10.1073/pnas.1321679111 + f_sfw = (D.pCO2PAL^pars.f_sfw_alpha) ; + + case 'sfw_Tbotw' % Stuart sfw function for ox weath model + % normalised to bottom-water temperature (global TEMP(in C) - 12.5) + D.TbotwC = max(D.GLOBALT - paleo_const.k_CtoK - 12.5, 0); % from S&G high-lat T = 2.5C for Temp = 15C, don't go below freezing + + f_sfw = exp(0.066*(D.TbotwC - 2.5)); % activation energy 41 kJ mol^{-1} + % NB: oxweath had normalisation error, gave f_sfw = exp(0.165) = 1.18 for present day TEMP = 15C + + case 'sfw_temp' % Josh Improved sfw function considering temperature + f_sfw = exp(0.0608*(D.GLOBALT-288)) ; %%% 42KJ/mol activation energy assumed as with terrestrial basalt + + case 'sfw_strong' % Coogan&Dosso 92 kJ/mol apparent activation energy + f_sfw = exp(0.1332*(D.GLOBALT-288.15)) ; + + case 'sfw_noT' % No temperature dependence + f_sfw = 1.0 ; + + otherwise + error('unrecognized pars.f_sfw_opt %s',pars.f_sfw_opt); +end + + +%%%% calculate relative rate of seafloor weathering (give zero if k_sfw is zero) +if pars.k_sfw == 0 + D.sfw_relative = 0 ; +else + D.sfw_relative = force_sfw * f_sfw; +end +D.sfw = pars.k_sfw * D.sfw_relative ; + +end + diff --git a/code/core/paleo_const.m b/code/core/paleo_const.m new file mode 100644 index 0000000..def7cd5 --- /dev/null +++ b/code/core/paleo_const.m @@ -0,0 +1,29 @@ +classdef paleo_const + % Global constant values + + properties(Constant) + % Define model time offset (user preference - all code should obey this) + time_present_yr = 0; % model time at present epoch + + %%%% Physical constants + k_CtoK = 273.15; % convert degrees C to Kelvin + k_Rgas = 8.3144621 % J/K/mol gas constant + k_molVolIdealGas = 22.4136; % l/mol molar volume of ideal gas at STP (0C, 1 atm) + + % Earth system present-day parameters + k_solar_presentday = 1368; % present-day solar insolation W/m^2 + k_secpyr = 3.15569e7;%present-day seconds per year + k_daypyr = paleo_const.k_secpyr/(24*3600); % days in a year + + k_moles1atm = 1.77e20; % Moles in 1 atm + + k_preindCO2atm = 280e-6; % + + % Atmospheric composition from Sarmiento & Gruber (2006) Table 3.1.1 (which cites Weast & Astle 1982) + k_atmmixrN2 = 0.78084; % N2 atmospheric mixing ratio (moles / moles dry air) + k_atmmixrO2 = 0.20946; % O2 atmospheric mixing ratio (moles / moles dry air) + end + + +end + diff --git a/code/core/paleo_integrate_ode.m b/code/core/paleo_integrate_ode.m new file mode 100644 index 0000000..8d69996 --- /dev/null +++ b/code/core/paleo_integrate_ode.m @@ -0,0 +1,208 @@ +classdef paleo_integrate_ode < handle + % Integrate using Matlab ode15s 'gear' stiff ODE solver + % ODE only (no DAE support) + + properties + timetoadd; % yr to integrate for + + % For adaptive step size, identify any discontinuities (in forcings) and force restart with small step size + timerestarts = []; + + %%%%%%% Max function calls for integration (set to eg 1000 to force failure of runs + %%%%%%% that make no progress) + maxcalls = Inf; + + + % Report statistics after integration + odeoptions = odeset('Stats','on'); + + %runctrl.odeoptions = odeset(runctrl.odeoptions,'NonNegative','on','AbsTol',1e5) ; + %runctrl.odeoptions = odeset(runctrl.odeoptions,'RelTol',1e-5) ; % almost identical run times vs default 1e-3 ? + %runctrl.odeoptions = odeset(runctrl.odeoptions,'BDF','on') ; + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Options used by COPSE_integrate + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + timeint; % concatenation of timeend, timestart and timerestarts + + + telltime = 100; % print status every telltime timesteps + callsctr = 0; % counter for number of function calls used + + ncalls; % total number of calls actually used for integration + cpusec; % seconds of cputime used + + % Mapping from PALEO struct (S, diag) <-> Matlab Y vector + StoYmapper; + + tm; % reference to tm (to pass to ode integrator) + end + + + methods + function obj = paleo_integrate_ode(timetoadd) + obj.timetoadd = timetoadd; + end + + function [ T, S, diag ] = integrate( obj, tm, Tstart, Sinit, Timeoutput ) + %%%%%%% Sinit initial conditions (struct with field for each state variable) + %%%%%%% Sscale scaling for each state variable + %%%%%%% + %%%%%%% Output: + %%%%%%% T solution timesteps (vector) + %%%%%%% S solution state vector (struct, fields as Sinit, mapped from Marlab ODE solver Y vector) + %%%%%%% diag solution diagnostic variables (struct) + %%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + % store reference to tm (in order to pass through to ode integrator) + obj.tm = tm; + + %Initialise struct <-> y vec mapper + %obj.StoYmapper = paleo_Stovec(Sinit,'field'); + obj.StoYmapper = paleo_structtovec(Sinit,1,'field'); + + % time cpu used + cpustart = cputime; + + % Matlab ODE solver with adaptive timestep + + + % Initial values + Yinit = obj.StoYmapper.struct2vector(Sinit); + + %Create vector of time intervals + Tend = Tstart + obj.timetoadd; + + validrestarts=[]; + for i=1:length(obj.timerestarts); + if obj.timerestarts(i) > Tstart && obj.timerestarts(i) < Tend + validrestarts(end+1) = obj.timerestarts(i); + end + end + obj.timeint = [Tstart validrestarts Tend]; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% %Integrate forward in time restarting at specified intervals and + % concatenating output + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + for ti=1:(length(obj.timeint)-1) + fprintf('\nintegrating from time\t%g\tto %g yr\n',obj.timeint(ti),obj.timeint(ti+1)); + % generate set of output times within this interval + if ~isempty(Timeoutput) + outputidx = find(Timeoutput>obj.timeint(ti) & Timeoutput < obj.timeint(ti+1)); + tspan = [obj.timeint(ti) Timeoutput(outputidx) obj.timeint(ti+1)]; + fprintf('adaptive timestep: saving output at %g times :\n',length(tspan)); + fprintf(' %g',tspan); + fprintf('\n'); + else + fprintf('adaptive timestep: saving output for every timestep\n'); + tspan = [obj.timeint(ti) obj.timeint(ti+1)]; + end + + + [Tint,Yint] = ode15s(@obj.ode_adaptor,tspan,Yinit,obj.odeoptions); + %restart from where we just got to + Yinit = Yint(end,:); + %concatenate output + if ti == 1 + T = Tint; + Y = Yint; + else + % start at second point to avoid repeating same T value which + % confuses interpolation etc + T = [T ; Tint(2:end) ]; + Y = [Y ; Yint(2:end,:)]; + end + end + + clear Tint Yint Yinit; %clear intermediate results + + + obj.ncalls = obj.callsctr; + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%% Second pass - calculate diagnostics (two passes as Matlab ODE solver + %%%%%%% timesteps are not the same as function evaluations) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + fprintf('calculating diagnostics...\n'); + + diag = []; % remove old data + + obj.callsctr = 0; + for idiag=1:length(T) + + SattimeT = obj.StoYmapper.vector2struct(Y(idiag,:)); + + [dummy, D] = tm.timederiv(T(idiag),SattimeT); + + %Store diagnostic variables in global struct diag for future analysis + diag = paleo_structtovec.addRecord(diag, idiag, D); + + end + + % Convert T and S + T = T'; % ' to convert to row vector for consistency with 'diag' and normal matlab use + S=obj.StoYmapper.matrix2struct(Y); + + + + %%%%%%% Report cpu etc + obj.cpusec = cputime - cpustart; + + fprintf('\nfunction evaluations (first pass) %g cputime (total) %g sec\n',obj.ncalls,obj.cpusec); + + + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Adaptor to map function required by Matlab ODE solver (using vectors) + % to our version (using structs). + % Also keeps track of number of function calls + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + function dydt = ode_adaptor(obj, tmodel,y) + % Called by Matlab ODE solver, adapts paleo_model.timederiv (based on struct S & dSdt) to Matlab vector Y & dYdt + % + % tmodel - time, yr + % y - state vector, as passed in by Matlab ODE solver + % dydt - time derivate of state vector, as required by Matlab ODE solver + % + + % Convert Matlab vector y -> our struct S + S = obj.StoYmapper.vector2struct(y'); + + % Call our paleo equations + dSdt = obj.tm.timederiv(tmodel,S); + + % Convert our struct dSdt -> Matlab vector dydy + dydt = obj.StoYmapper.struct2vector(dSdt); + + % Some housekeeping - report and check number of function calls + + % output timestep if specified + if obj.telltime + if mod(obj.callsctr,obj.telltime)==0 + fprintf('nsteps % 10i tmodel % 16.4f\n',obj.callsctr,tmodel); + end + end + obj.callsctr=obj.callsctr+1; + + % Force runs that make no progress (ie reduce step size and crawl to a halt) to exit, + % enabling eg a grid of runs over a parameter space with some unfeasible regions + if obj.callsctr > obj.maxcalls; + ME = MException('PALEO:maxcalls','number of function calls obj.maxcalls %g exceeded',obj.maxcalls); + throw(ME); + end + + end + + + end + + +end + diff --git a/code/core/paleo_plotlist.m b/code/core/paleo_plotlist.m new file mode 100644 index 0000000..33f5b5e --- /dev/null +++ b/code/core/paleo_plotlist.m @@ -0,0 +1,220 @@ +classdef paleo_plotlist + % Plot top level: multiple plots from 'listplots' using functions in 'plotters' + + properties + plotters = {}; % cell array of function handle with copse_plot_xxx + listplots = {}; % cell array of strings with list of plots. + + figfrac = 0; + %figfrac = 0.8; % figure size (fraction of screen), or 0 for Matlab default + % NB: on Matlab Windows (some versions), each window takes + % ~width x height x 4 bytes of 'Java heap memory' + % = ~ 6MB for 'figfac = 0.8' (assuming 1920 x 1280 screen) + % = ~ 1MB for Matlab default figure size + + checkmem = true; % true to check memory before creating a figure + memcutoff = 50e6; % refuse to plot another figure if Matlab memory drops below this value + memfail = 10e6; % error immediately if below this + + % see http://uk.mathworks.com/help/matlab/creating_plots/resolving-low-level-graphics-issues.html + %forcepainters = true; % force matlab to use 'painters' renderer: possible workaround for TL PC issues.. + forcepainters = false; + + % add time, data, id to bottom-right of plot + % NB: Matlab >= R2015b generates a spurious warning 'too many input arguments' + % if text width exceeds plot width + addidstr = false; + + % Specify list of times for output display (eg ocean models) + Ttoplot = []; + end + + methods + + function plotlist( obj, XT, XTlimits, XTname, plotdata, varargin ) + % Plot multiple plots across several figure windows + % + % paleo_plotlist( listplots, tlimits, pars, runctrl, T, S, diag, compareC514 ) + % + % Args: + % listplots - requested list of plots (cell array of strings) + % XT - vector with x-axis (usually time) + % XTlimits - x(time)-axis limits ([xtmin xtmax], or '' for default) + % XTname - x axis label (usually empty) + % plotdata - struct with files pars, runctrl, S, diag + % varargin - optional comparison dataset, passed through to plotters + % + % + + + + %Default x (time) axes limits + if isempty(XTlimits) + XTlimits = [XT(1) XT(end)]; + end + + + + + % Find time step indices ~ corresponding to requested output times + if isempty(obj.Ttoplot) + tiplot = [1 length(XT)]; % t steps to plot + else + tiplot = []; + for i = 1:length(obj.Ttoplot) + titoplot = find(XT>=obj.Ttoplot(i),1,'first'); + if ~isempty(titoplot) + tiplot(end+1)=titoplot; + end + end + end + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% SETUP + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Set plots per page + nplotx=3; + nploty=3; + + % Make figure windows as large as possible and slightly non-overlapping + % ScreenSize is a four-elementvector: [left, bottom, width, height]: + scrsz = get(0,'ScreenSize'); + + %colour for plot axes (?) + plotcol=[0.95 0.95 0.95]; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%% END SETUP + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%% Iterate through list of requested plots + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % subplot counter (zero offset, so subplot = iplot+1) + iplot=nplotx*nploty; % trigger new figure + % figure counter + ifig = 1; + + + for p = 1:length(obj.listplots) + wplot=obj.listplots{p}; + + if obj.checkmem + obj.CheckJavaHeapMem(); + end + + % generate new figure window + if iplot >= nplotx*nploty + iplot = 0; + if obj.figfrac > 0 % large figure + figsz = [scrsz(3)*(1-obj.figfrac)-ifig*50 scrsz(4)*(1-obj.figfrac)-ifig*100 scrsz(3)*obj.figfrac scrsz(4)*obj.figfrac]; + if obj.forcepainters + figure('Color',plotcol,'Position',figsz,'Renderer','painters'); + else + figure('Color',plotcol,'Position',figsz); + end + else % default size figure + if obj.forcepainters + figure('Color',plotcol,'Renderer','painters') + else + figure('Color',plotcol); + end + end + + ifig = ifig+1; + + if obj.addidstr && ~isempty(plotdata) + paleo_timestampplot(plotdata); + end + end + + + + switch wplot + case 'startline' + % move iplot to beginning of line + if mod(iplot,nplotx) ~= 0 + iplot = iplot + nplotx - mod(iplot,nplotx) ; + end + case 'skip' + %%%% leave a gap in the plot page + iplot=iplot+1; + case 'newpage' + %%%% force new page and do nothing + iplot = inf; + otherwise + %new plot panel + subplot(nploty,nplotx,iplot+1) + %generate the requested plot - carry on past error eg due to missing data + try + % iterate through the list of plotters until we find one that knows about this plot + iplnext = 1; + plotted = 0; + while ~plotted && iplnext <= length(obj.plotters) + plotted = obj.plotters{iplnext}( wplot, XT, XTlimits, tiplot, plotdata, varargin{:}); + iplnext = iplnext + 1; + end + % plot not found ? + if ~plotted + error('Unknown plot %s',wplot); + else + if ~isempty(XTname) + xlabel(XTname); + end + end + catch err + ploterr=sprintf('%s failed',wplot); + title(ploterr); + fprintf('plot %s:\n', ploterr); + disp(getReport(err,'extended')); + end + iplot=iplot+1; + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%% END Iterate through list of requested plots + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if obj.checkmem + mem = paleo_plotlist.GetJavaHeapMem(); + fprintf('paleo_plotlist: Memory max %g total %g free %g avail %g\n',... + mem.max,mem.total,mem.free,mem.avail); + end + + end + + function CheckJavaHeapMem(obj) + % check Matlab memory + % see http://stackoverflow.com/questions/6201272/how-to-avoid-matlab-crash-when-opening-too-many-figures + + mem = paleo_plotlist.GetJavaHeapMem(); + if mem.avail < obj.memcutoff && mem.avail > obj.memfail + fprintf('paleo_plotlist: Memory is low max %g total %g free %g avail %g -> running garbage collector...\n please close some figure windows\n',... + mem.max,mem.total, mem.free, mem.avail); + java.lang.Runtime.getRuntime.gc; + end + + mem = paleo_plotlist.GetJavaHeapMem(); + if mem.avail < obj.memcutoff + fprintf('paleo_plotlist: Memory is low max %g total %g free %g avail %g\n',... + mem.max,mem.total, mem.free, mem.avail); + error('Java memory low -> refusing to create a new figure! - please close some figure windows'); + end + + end + end + + methods(Static) + function mem = GetJavaHeapMem() + mem.max =java.lang.Runtime.getRuntime.maxMemory; + mem.total=java.lang.Runtime.getRuntime.totalMemory; + mem.free =java.lang.Runtime.getRuntime.freeMemory; + mem.avail= mem.max - mem.total + mem.free; + end + end + +end + diff --git a/code/core/paleo_postprocessor.m b/code/core/paleo_postprocessor.m new file mode 100644 index 0000000..ca26802 --- /dev/null +++ b/code/core/paleo_postprocessor.m @@ -0,0 +1,11 @@ +classdef (Abstract) paleo_postprocessor < handle + % Interface for a post-processing function + + methods (Abstract) + + [ diag, budgets ] = calcall(obj, T, S, diag, budgets ) + + end + +end + diff --git a/code/core/paleo_run.m b/code/core/paleo_run.m new file mode 100644 index 0000000..cc0d2ea --- /dev/null +++ b/code/core/paleo_run.m @@ -0,0 +1,270 @@ +classdef paleo_run < handle + % Container for COPSE model, integrator, output data, postprocessing, and plotting + % + % Usually created and used by scripts in examples/copse + % These scripts automate: + % 1) Create paleo_run and populate with 'tm' (model), 'integrator', 'postprocessors', 'analyzers' + % 2) paleo_run.initisalise() + % 3) paleo_run.integrate() + % 4) paleo_run.postprocess() + % 5) paleo_run.saveoutput() + % 6) paleo_run.plot() + % + % Saved runs can be reloaded with + % > my_run = paleo_run.loadoutput(, ) + + + properties + tm; % 'The model' + outputdir = paleo_paths.getOutputDir(); % Directory for model output + + Tstart = 0; % (yr) initial time + + % set to list of times to save output (in S, diag). Empty means 'all' for adaptive timestepper + timeoutput = []; + + integrator; % paleo_integrate_xxx time integrator + + % Model output + Sinit = struct; % Sinit.statevar1(1 .. nT,1) or Sinit.Ocean.statevar(1 .. nbox) + T = []; % T(1 .. nT) + S = struct; % S.statevar1(1 .. nT,1) or S.Ocean.statevar1(1 .. nT, 1 .. nbox) + diag = struct; % diag.diagvar1(1 .. nT,1) or diag.Ocean.diagvar1(1 .. nT, 1 .. nbox) + + postprocessors; % function handle containing function to add additional checks/statistics etc following model run. + + budgets = struct; % struct with summary output from postprocessing + + %%% Name of results file (change this in config file to archive a run); + outputfile = 'COPSEtesting'; + + analyzers; % run analysis + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Fields available to define / describe experiment + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Free-form text fields to identify run, label plots etc + date = datestr(clock); + codefile = mfilename('fullpath'); % + + config; % Matlab .m file that sets up model + baseconfig; % Parameter passed to 'config' to set baseline expt + expt; % Parameter passed to 'config' to select specific experiment etc + expars; % struct with any additional parameters + + end + + methods + + function initialise(obj) + % Initialise reservoirs (state variables) + + LN = 'paleo_run.initialise'; L = paleo_log.getLogger('paleo_run'); + + L.log(L.INFO,LN, sprintf('initialise from parameters\n')); + obj.Sinit = obj.tm.initialise(); + + end + + + function integrate(obj) + % Integrate ODE + + LN = 'paleo_run.integrate'; L = paleo_log.getLogger('paleo_run'); + + L.log(L.INFO,LN, sprintf('start model integration\n')); + L.log(L.INFO,LN, sprintf('(default) output dir %s\n', obj.outputdir)); + L.log(L.INFO,LN, sprintf('(default) outputfile %s\n', obj.outputfile)); + + + % standard ODE integration + + [ obj.T, obj.S, obj.diag ] = obj.integrator.integrate( obj.tm, obj.Tstart, obj.Sinit, obj.timeoutput ); + + end + + function postprocess(obj) + % Integrate up budgets and do some conservation checks + % (fills struct obj.budgets) + + LN = 'paleo_run.postprocess'; L = paleo_log.getLogger('paleo_run'); + pplist = obj.postprocessors; + if ~isempty(pplist) + % handle a single postprocessor - put into a cell array + if ~iscell(pplist) + pplist = {pplist}; + end + + % iterate through list + for b=1:length(pplist) + switch class(pplist{b}) + case 'function_handle' + % deprecated + [ obj.diag, obj.budgets ] = pplist{b}( obj.T, obj.S, obj.diag,obj.budgets ); + otherwise + % assume a paleo_postprocessor instance + [ obj.diag, obj.budgets ] = pplist{b}.calcall( obj.T, obj.S, obj.diag,obj.budgets ); + end + end + else + L.log(L.INFO,LN, sprintf('no postprocessors defined\n')); + end + end + + function plot(obj, XTlimits, XTname, varargin) + % Plot output + % + % Args: + % obj (paleo_run): class instance (generated automatically if called as paleo_run.plot) + % XTlimits ([xtmin xtmax], optional): x(time)-axis limits ('' for default) + % XTname (str, optional): x axis label (usually empty) + % varargin (paleo_run, optional): comparison dataset, passed through to plotters + + LN = 'paleo_run.plot'; L = paleo_log.getLogger('paleo_run'); + if nargin < 2 + XTlimits = ''; + end + if nargin < 3 + XTname = ''; + end + + if isempty(obj.analyzers) + L.log(L.ERROR,LN, sprintf('no output plotter defined\n')); + else + obj.analyzers.plotlist(obj.T,XTlimits,XTname,obj,varargin{:}); + end + end + + + function t = astable(obj) + % Return run output (T, S, diag) as a Matlab table + % + % Returns: + % t (table): T, S, diag as Matlab table + % This can be viewed in the Matlab Workspace browser + % It can be written to a spreadsheet with + % > writetable(t,'test.xls') + + t = table(obj.T', 'VariableNames', {'T'}); + + Sfields = fields(obj.S); + for s = 1:length(Sfields) + sf = Sfields{s}; + t.(sf) = obj.S.(sf); + end + + Dfields = fields(obj.diag); + for d = 1:length(Dfields) + df = Dfields{d}; + t.(df) = obj.diag.(df); + end + + end + + + function saveoutput(obj, outfile, outputdir) + % Save output + % + % Args: + % outfile (str, optional): ouput file, defaults to obj.outfile + % outputdir (str, optional): output folder, defaults to obj.outputdir + + LN = 'paleo_run.saveoutput'; L = paleo_log.getLogger('paleo_run'); + + % override outputfile if requested + if nargin >= 2 + obj.outputfile = paleo_paths.fixFileSep(outfile); + end + + % override outputfile if requested + if nargin >= 3 + obj.outputdir = paleo_paths.fixFileSep(outputdir); + end + + + % Transfer fields from the object to a struct and save that + % This provides some backwards compatiblity, including at minimum ability to load the data fields + % NB: if asked to save a class instance, Matlab will save, but then may fail to load (with warning) if + % a class of that name is not present, or (worse) may appear to load but actually 'load' different code. + % So to avoid this, we don't save class instances. + rs.output_version = 'COPSE_2.0'; + p=properties(obj); + for i=1:length(p); + switch(p{i}) + case {'outputdir', 'Tstart', 'timeoutput', 'Sinit', 'T', 'S', 'diag', 'outputfile', ... + 'date', 'codefile', 'config', 'baseconfig', 'expt', 'expars'} + rs.(p{i}) = obj.(p{i}); + case 'tm' + % transfer parameters, if present + % don't save the model instance, as that might change in future versions + if isprop(obj.tm, 'pars') + rs.tm = struct(); + rs.tm.pars = obj.tm.pars; + end + otherwise + % don't save class instances, for future compatibility (see note above). + end + end + + pfile = fullfile(paleo_paths.fixFileSep(obj.outputdir),paleo_paths.fixFileSep(obj.outputfile)); + L.log(L.INFO,LN, sprintf('saving output to file %s\n',pfile)); + save(pfile,'rs'); + end + end + + methods(Static) + function obj = loadoutput(filename, outputdir) + % Load output file + % + % Args: + % filename (str): filename of output (optionally can be a full path) + % outputdir (str, optional): folder for output, defaults to paleo_paths.getOutputDir() + % Returns: + % obj (paleo_run): run loaded from disk + + LN = 'paleo_run.loadoutput'; L = paleo_log.getLogger('paleo_run'); + + filename = paleo_paths.fixFileSep(filename); + + if strncmp(filename,filesep,1) + L.log(L.INFO,LN, sprintf('using full path from filename %s\n',filename)); + elseif nargin < 2 + outputdir = paleo_paths.getOutputDir(); + L.log(L.INFO,LN, sprintf('using default outputdir %s\n',outputdir)); + else + L.log(L.INFO,LN, sprintf('using supplied outputdir %s\n',outputdir)); + end + + pfile = fullfile(paleo_paths.fixFileSep(outputdir),filename); + L.log(L.INFO,LN, sprintf('loading output from file %s\n',pfile)); + + % load data into struct 'rs' + load(pfile); + + obj = paleo_run(); + rsfields=fields(rs); + p=properties(obj); + + % transfer fields from struct to paleo_run, with some checking for mismatches + for i=1:length(rsfields) + pf = find(strcmp(p,rsfields{i})); + if pf + obj.(rsfields{i}) = rs.(rsfields{i}); + % remove from list of properties once set + p=p([1:pf-1 pf+1:end]); + elseif strcmp(rsfields{i}, 'version') + % version of output data format - not stored + else + L.log(L.INFO,LN, sprintf('no property for field %s\n',rsfields{i})); + end + end + + for i=1:length(p) + L.log(L.INFO,LN, sprintf('no data field for property %s\n',p{i})); + end + + % update outputdir + obj.outputdir = outputdir; + end + end +end \ No newline at end of file diff --git a/code/core/paleo_structtovec.m b/code/core/paleo_structtovec.m new file mode 100644 index 0000000..55fa9db --- /dev/null +++ b/code/core/paleo_structtovec.m @@ -0,0 +1,333 @@ +classdef paleo_structtovec < handle + % Map state variables and diagnostics from y linear vector (used by ODE integrators) to/from named fields in struct + + properties(SetAccess = private) + name = ''; % convenience - label this instance + + packorder; % 'field' (y packing f1 cell1-f2 .. celln-f2 .. fn), 'cell' (y packing cell1-f1, cell1-f2, ..., cell2-f1 etc) + + IM = struct; % Datastructure mapping S.(field) <==> Y(IM.(field)) + + istart = 1; % first Y index for our mapping + ilength = 0; % total number of elements in our mapping + + end + + properties(Access=private) + % cache top-level field names and type as the test for structure is a slowish op + strnm = {}; % strnm = fields(IM) + strfld = []; % logical strfld(i) = isstruct(IM.(strnm{i})) + + end + + + methods + function obj = paleo_structtovec(S, istart, packorder) + % Initialise 'IM' mapping + % S should be a struct with the correct variable dimensions (scalars, vectors) + + if ~strcmp(packorder,'field') + error('packorder %s not supported',packorder) + end + + obj.istart = istart; + + obj.packorder = packorder; + + % recursively iterate through S and define mapping + + [obj.IM, iend] = obj.addFields(obj.IM, S,istart,1); + obj.ilength = iend - istart; + end + + + + function S=vector2struct(obj, Y) + % Convert row vector Y to struct S + + if length(Y) ~= obj.ilength + error('paleo_structtovec.vector2struct length(Y) %g ~= ilength %g', length(Y), obj.ilength); + end + + S = struct; + + imt = obj.IM; + + sf = obj.strnm; + for i=1:length(sf) + if obj.strfld(i) + ims = imt.(sf{i}); + Ssub = struct; + ssf = fields(ims); + for j=1:length(ssf) + Ssub.(ssf{j}) = Y(ims.(ssf{j})); + end + S.(sf{i}) = Ssub; + else + S.(sf{i})=Y(imt.(sf{i})); + end + end + + end + + function S=matrix2struct(obj, Y) + % Convert matrix Y to struct S + + if size(Y,2) ~= obj.ilength + error('paleo_structtovec.matrix2struct size(Y,2) %g ~= ilength %g', size(Y,2), obj.ilength); + end + + S = struct; + + sf = obj.strnm; + + for i=1:length(sf) + if obj.strfld(i) + ims = obj.IM.(sf{i}); + Ssub = struct; + ssf = fields(ims); + for j=1:length(ssf) + Ssub.(ssf{j}) = Y(:,ims.(ssf{j})); + end + S.(sf{i}) = Ssub; + else + S.(sf{i})=Y(:,obj.IM.(sf{i})); + end + end + + end + + function Y=struct2vector(obj, S, sidx) + % CConvert struct S to column vector y + % check S against fieldnames in Sfieldnames for any extra fields inadvertently added as a result of typos... + % Optional argument sidx select record sidx from S (cf default case for single record in S) + if nargin < 3 + sidx = 1; + end + + % preallocate column vector y for speed + Y=zeros(obj.ilength,1); + imt = obj.IM; + + sf = obj.strnm; + + if length(sf) ~= length(fieldnames(S)) + imt + S + error('paleo_structtovec.struct2vector Sfieldnames %g != S %g',length(sf),length(fieldnames(S))); + end + + for i=1:length(sf) + if obj.strfld(i) + ims = imt.(sf{i}); + Ssub = S.(sf{i}); + ssf = fieldnames(ims); + if length(ssf) ~= length(fieldnames(Ssub)) + ims + Ssub + error('paleo_structtovec.struct2vector %s.Sfieldnames %g != S %g',sf{i},length(ssf),length(fieldnames(Ssub))); + end + for j=1:length(ssf) + Y(ims.(ssf{j})) = Ssub.(ssf{j})(sidx,:); + end + else + Y(imt.(sf{i}))= S.(sf{i})(sidx,:); + end + end + end + + function yidx = ridx(obj, Sname, obidx) + % index into y vector of top-level field name Sname + if nargin > 2 + yidx = obj.idx('',Sname,obidx); + else + yidx = obj.idx('',Sname); + end + end + + function yidx = idx(obj, groupname, Sname, obidx) + % index into y vector of (optional subset obidx) of (vector) tracer field name Sname + % Convenience function equivalent to: + % IM.(Sname)(obidx) + % IM.(groupname).(Sname)(obidx) if field present + % [] (empty array) if field absent + % + % groupname - '' for top level, otherwise obj.IM.(groupname) + % sidx -- index of field S in list of fields + % obidx -- list of indices of subset of ocean boxes + + yidx = []; + + if isempty(groupname) + if isfield(obj.IM,Sname) + yidx = obj.IM.(Sname); + end + else + if isfield(obj.IM.(groupname),Sname) + yidx = obj.IM.(groupname).(Sname); + end + end + + if nargin > 3 && ~isempty(yidx) + yidx = yidx(obidx); + end + end + + function [imap, icurrent] = addFields(obj, imap, S, icurrent, lvl) + % add fields recursively to imap from S + + if lvl > 2 + error('only single level of substructure supported'); + end + + sftmp = fields(S); + % put scalar (top-level) fields at beginning of list to help Jacobian inverse memory consumption + sfscalar = {}; + sfvector = {}; + for i = 1:length(sftmp) + isstr = isstruct(S.(sftmp{i})); + if lvl == 1 + % optimisation - cache top-level field names and type for future speed + obj.strnm{i} = sftmp{i}; + obj.strfld(i) = isstr; + end + if isstr + sfvector{end+1} = sftmp{i}; + else + sfscalar{end+1} = sftmp{i}; + end + end + + % add scalars + for i = 1:length(sfscalar) + imap.(sfscalar{i}) = icurrent -1 + (1:length(S.(sfscalar{i}))); + icurrent = icurrent + length(S.(sfscalar{i})); + + end + % recurse into vectors + for i = 1:length(sfvector) + % recurse into substruct + [imap.(sfvector{i}), icurrent] = obj.addFields(struct, S.(sfvector{i}),icurrent,lvl+1); + end + end + + + + end + + methods(Static) + function diag = addRecord(diag, idiag, D) + % Accumulate records in struct (with one level of nesting) to end of struct-of-vectors + %Store diagnostic variables in global struct diag for future analysis: + % add record D as entry idiag in accumulated struct diag + + Dfields=fieldnames(D); + for i=1:length(Dfields) + if isstruct(D.(Dfields{i})) + DDfields = fieldnames(D.(Dfields{i})); + for j = 1:length(DDfields) + diag.(Dfields{i}).(DDfields{j})(idiag,:) = D.(Dfields{i}).(DDfields{j}); + end + else + diag.(Dfields{i})(idiag,:)=D.(Dfields{i}); + end + end + end + + function diag = addNumRecord(diag, idiag, fromdiag, ifromdiag) + % As addRecord, with choice of specified record idx from input fromdiag + % add record fromdiag(ifromdiag) as entry idiag in accumulated struct diag + + Dfields=fieldnames(fromdiag); + for i=1:length(Dfields) + if isstruct(fromdiag.(Dfields{i})) + DDfields = fieldnames(fromdiag.(Dfields{i})); + for j = 1:length(DDfields) + diag.(Dfields{i}).(DDfields{j})(idiag,:) = fromdiag.(Dfields{i}).(DDfields{j})(ifromdiag,:); + end + else + diag.(Dfields{i})(idiag,:)=fromdiag.(Dfields{i})(ifromdiag,:); + end + end + end + + function [S, foundnan] = adddeltat(S, deltat, dSdt, checknan) + % S = S + deltat * dSdt + % where S, dSdt are structs with up to one level of nesting + + foundnan = false; + Sfields=fieldnames(S); + for i=1:length(Sfields) + if isstruct(S.(Sfields{i})) + SSfields = fieldnames(S.(Sfields{i})); + for j = 1:length(SSfields) + S.(Sfields{i}).(SSfields{j}) = S.(Sfields{i}).(SSfields{j}) + deltat*dSdt.(Sfields{i}).(SSfields{j}); + if checknan && any(isnan(S.(Sfields{i}).(SSfields{j}))) + warning('nan in S.%s.%s',Sfields{i},SSfields{j}); + foundnan = true; + end + end + else + S.(Sfields{i}) = S.(Sfields{i}) + deltat*dSdt.(Sfields{i}); + if checknan && any(isnan(S.(Sfields{i}))) + warning('nan in S.%s',Sfields{i}); + foundnan = true; + end + end + end + end + + function Sinterp = interpt(Sinterp, Soffline, tidx, interpfac) + % linearly interpolate S or D vector + if length(tidx) > 2 + error('interpolation max 2 records'); + end + + Sfields=fieldnames(Soffline); + for i=1:length(Sfields) + if isstruct(Soffline.(Sfields{i})) + SSfields = fieldnames(Soffline.(Sfields{i})); + for j = 1:length(SSfields) + Sinterp.(Sfields{i}).(SSfields{j}) = interpfac(1)*Soffline.(Sfields{i}).(SSfields{j})(tidx(1),:); + if length(interpfac) > 1 + Sinterp.(Sfields{i}).(SSfields{j}) = Sinterp.(Sfields{i}).(SSfields{j}) + interpfac(2)*Soffline.(Sfields{i}).(SSfields{j})(tidx(2),:); + end + end + else + Sinterp.(Sfields{i}) = interpfac(1)*Soffline.(Sfields{i})(tidx(1),:); + if length(interpfac) > 1 + Sinterp.(Sfields{i}) = Sinterp.(Sfields{i}) + interpfac(2)*Soffline.(Sfields{i})(tidx(2),:); + end + end + end + + end + + function Swsum = weightsum(Swsum, Soffline, tidx, whtfac) + % construct weighted sum for records tidx, weight factors whtfac + + % convert input from (possibly) row vectors to column vectors + tidx = reshape(tidx,[],1); + whtfac = reshape(whtfac,[],1); + + + Sfields=fieldnames(Soffline); + for i=1:length(Sfields) + if isstruct(Soffline.(Sfields{i})) + SSfields = fieldnames(Soffline.(Sfields{i})); + for j = 1:length(SSfields) + lgthrec = size(Soffline.(Sfields{i}).(SSfields{j}),2); + whtrep = repmat(whtfac, 1, lgthrec); + Swsum.(Sfields{i}).(SSfields{j}) = sum(whtrep.*Soffline.(Sfields{i}).(SSfields{j})(tidx,:),1); + end + else + lgthrec = size(Soffline.(Sfields{i}),2); + whtrep = repmat(whtfac,1, lgthrec); + Swsum.(Sfields{i}) = sum(whtrep.*Soffline.(Sfields{i})(tidx,:),1); + end + end + + end + end +end + diff --git a/code/forcings/CR_force_D_temp.xlsx b/code/forcings/CR_force_D_temp.xlsx new file mode 100644 index 0000000..b601542 Binary files /dev/null and b/code/forcings/CR_force_D_temp.xlsx differ diff --git a/code/forcings/CR_force_LIP_table.xlsx b/code/forcings/CR_force_LIP_table.xlsx new file mode 100644 index 0000000..44f507a Binary files /dev/null and b/code/forcings/CR_force_LIP_table.xlsx differ diff --git a/code/forcings/D_haq_inversion_2017.xlsx b/code/forcings/D_haq_inversion_2017.xlsx new file mode 100644 index 0000000..fd73ada Binary files /dev/null and b/code/forcings/D_haq_inversion_2017.xlsx differ diff --git a/code/forcings/D_vandermeer.xlsx b/code/forcings/D_vandermeer.xlsx new file mode 100644 index 0000000..c83b87c Binary files /dev/null and b/code/forcings/D_vandermeer.xlsx differ diff --git a/code/forcings/Horita_Ca.xlsx b/code/forcings/Horita_Ca.xlsx new file mode 100644 index 0000000..623ecec Binary files /dev/null and b/code/forcings/Horita_Ca.xlsx differ diff --git a/code/forcings/PG_godderis.xlsx b/code/forcings/PG_godderis.xlsx new file mode 100644 index 0000000..bbb3371 Binary files /dev/null and b/code/forcings/PG_godderis.xlsx differ diff --git a/code/forcings/bas_area_mills2014.xlsx b/code/forcings/bas_area_mills2014.xlsx new file mode 100644 index 0000000..faae392 Binary files /dev/null and b/code/forcings/bas_area_mills2014.xlsx differ diff --git a/code/forcings/berner_carbonate_land_area.xlsx b/code/forcings/berner_carbonate_land_area.xlsx new file mode 100644 index 0000000..d616d4a Binary files /dev/null and b/code/forcings/berner_carbonate_land_area.xlsx differ diff --git a/code/forcings/berner_fr.xlsx b/code/forcings/berner_fr.xlsx new file mode 100644 index 0000000..f459b83 Binary files /dev/null and b/code/forcings/berner_fr.xlsx differ diff --git a/code/forcings/berner_land_area.xlsx b/code/forcings/berner_land_area.xlsx new file mode 100644 index 0000000..e8b9f33 Binary files /dev/null and b/code/forcings/berner_land_area.xlsx differ diff --git a/code/forcings/coal_basin_frac_new.xlsx b/code/forcings/coal_basin_frac_new.xlsx new file mode 100644 index 0000000..3fee017 Binary files /dev/null and b/code/forcings/coal_basin_frac_new.xlsx differ diff --git a/code/forcings/copse_find_force.m b/code/forcings/copse_find_force.m new file mode 100644 index 0000000..0be0163 --- /dev/null +++ b/code/forcings/copse_find_force.m @@ -0,0 +1,23 @@ +function [ force, idxforce ] = copse_find_force( model, forceclassname, allowempty ) +% Find a forcing in list +% looks for forcing of class 'forceclassname' in cell array model.force + +if nargin < 3 + allowempty = false; +end + +idxforce = find(strcmp(cellfun(@class, model.force,'UniformOutput',false), forceclassname)); + +if isempty(idxforce) + if ~allowempty + error('no %s forcing found in list', forceclassname); + end + force = []; +elseif length(idxforce) == 1 + force = model.force{idxforce}; +else + error('multiple forcings matching %s found in list', forceclassname); +end + +end + diff --git a/code/forcings/copse_force.m b/code/forcings/copse_force.m new file mode 100644 index 0000000..c1e955a --- /dev/null +++ b/code/forcings/copse_force.m @@ -0,0 +1,15 @@ +classdef (Abstract) copse_force < handle + % Interface implemented by copse forcing or perturbation + % + % Implementations should define properties to hold their configuration + % (eg duration, magnitude etc) + % + methods (Abstract) + % A forcing is called with tforce (which may or may not be the same as tmodel), + % and is in years relative to present_day = 0; + % A perturbation is called with tmodel + D = force(tmodel_or_tforce, D); + end + +end + diff --git a/code/forcings/copse_force_B.m b/code/forcings/copse_force_B.m new file mode 100644 index 0000000..0ebf642 --- /dev/null +++ b/code/forcings/copse_force_B.m @@ -0,0 +1,17 @@ +classdef copse_force_B < copse_force + % Forcing, calcerous plankton evolution + methods + + function D = force(obj, tyr_after_present, D) + % tyr_after_present - (negative) years after present day + + % ' to convert to column vector to allow use of fast interpolation routine + D.Bforcing = copse_interp1([-1e10 -500e6 -300e6 -150e6 -140e6 -110e6 -90e6 -50e6 -10e6 0 1E10]',... + [0.75 0.75 0.75 0.75 0.83776596 0.90990691 0.96110372 0.98902926 1 1 1]',... + tyr_after_present); + end + end + +end + + diff --git a/code/forcings/copse_force_CK_solar.m b/code/forcings/copse_force_CK_solar.m new file mode 100644 index 0000000..f4131e1 --- /dev/null +++ b/code/forcings/copse_force_CK_solar.m @@ -0,0 +1,18 @@ +classdef copse_force_CK_solar < copse_force + %Time-dependent solar insolation (Caldeira & Kasting, 1992) + properties + solarpresentday = 1368; % W m^-2 present-day insolation + end + + methods + function D = force(obj, tforceafterpresent, D) + % + % cf Gough (1981) Solar Physics has 1/(1+2/5(1-t/tsun)) = 1/(1+0.4*(tsun-t)/tsun) + % tyr_after_present - (negative) years after present day + + D.SOLAR=1./(1+ (-tforceafterpresent./4.55e9)*0.38 )*obj.solarpresentday; + + end + end +end + diff --git a/code/forcings/copse_force_CPlandrel.m b/code/forcings/copse_force_CPlandrel.m new file mode 100644 index 0000000..8dcb72f --- /dev/null +++ b/code/forcings/copse_force_CPlandrel.m @@ -0,0 +1,24 @@ +classdef copse_force_CPlandrel < copse_force + %CP land burial ratio doubles in permo-carboniferous (COPSE) + + properties + %COPSE5_14 + k_begin_Carb_yr = -355000000; % increase period begins + k_end_Carb_yr = -290000000; % decrease period begins + + %The code then applies a ramp of +- 1 over 10My _starting_ from these times + + k_Carb_ramp_yr = 10e6; + end + + methods + + function D = force(obj, tyr_after_present, D) + % ' to convert to column vector to allow use of fast interpolation routine + D.CPland_relative = copse_interp1([-1e10 obj.k_begin_Carb_yr obj.k_begin_Carb_yr+obj.k_Carb_ramp_yr obj.k_end_Carb_yr obj.k_end_Carb_yr+obj.k_Carb_ramp_yr 1E10 ]',... + [1 1 2 2 1 1]',... + tyr_after_present) ; + end + end + +end diff --git a/code/forcings/copse_force_LIP.m b/code/forcings/copse_force_LIP.m new file mode 100644 index 0000000..2226d39 --- /dev/null +++ b/code/forcings/copse_force_LIP.m @@ -0,0 +1,78 @@ +classdef copse_force_LIP < copse_force + % Forcing (CO2, basalt area) due to one LIP + % + % + properties + Name % vector of spreadsheet rows accumulated into this event + Type + liptime % emplacement time, yr relative to present-day + peakCFBarea % km2 peak area exposed to subaerial weathering + presentCFBarea % km2 present-day area, or NaN if not available + co2_potential % co2 released (mol C) + co2_d13c = -5 % co2 release isotopic composition TODO value ? + + decayoffset; % yr wait before erosion begins. + lamb; % 1/yr lambda for exponential area decay + co2releasetime; % yr timeframe for CO2 release (yrs) (full width of gaussian) + smoothempl; % true for sigmoidal emplacement + end + + methods + + function f = copse_force_LIP(liptime, Name, Type, peakCFBarea, smoothempl, co2_potential, decayoffset, lamb, co2releasetime) + % Constructor. See properties for information on parameters + % + f.liptime = liptime; + f.Name = Name; + f.Type = Type; + f.peakCFBarea = peakCFBarea; + f.smoothempl = smoothempl; + f.co2_potential = co2_potential; + f.decayoffset = decayoffset; + f.lamb = lamb; + f.co2releasetime = co2releasetime; + end + + function area = calc_LIP_CFBarea(obj,timeyr) + % create a sigmoidal or step rise and exponential decline in area. + + smoothing = 3e-6 ; %%% smooth curve to build up area + offset = 1.5e6; %%% shift curve + + if obj.smoothempl + %%% emplacement function is made from sigmoid + empl = sigmoid(smoothing,timeyr - obj.liptime + offset); + else + % step at obj.liptime + empl = 0.5 + 0.5.*sign(timeyr - obj.liptime); + end + % exponential decay + erode = ( 0.5 + 0.5.*sign(timeyr - obj.liptime - obj.decayoffset) ) ... + .* ( 1 - exp(-obj.lamb*(timeyr - obj.liptime - obj.decayoffset) ) ); + + area = obj.peakCFBarea.*(empl - erode); + end + + function co2release = calc_LIP_co2(obj,timeyr) + % release function uses gaussian + co2release = obj.co2_potential.*gaussnorm(0.5*obj.co2releasetime,timeyr - obj.liptime) ; + end + + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Calculate basalt area and CO2 releate + D.CFB_area = D.CFB_area + obj.calc_LIP_CFBarea(tforce_presentdayiszeroyr) ; + co2 = obj.calc_LIP_co2(tforce_presentdayiszeroyr) ; + D.LIP_CO2 = D.LIP_CO2 + co2; + D.LIP_CO2moldelta = D.LIP_CO2moldelta + co2*obj.co2_d13c; + end + end +end + +function s=sigmoid(smooth, t) + s = 1./(1+exp(-t*smooth)); +end + +function g=gaussnorm(width,offset) + g = 1./(width*(2*pi)^0.5)*exp(-offset.^2/(2*width^2)); +end diff --git a/code/forcings/copse_force_PG_godderis.m b/code/forcings/copse_force_PG_godderis.m new file mode 100644 index 0000000..79b5806 --- /dev/null +++ b/code/forcings/copse_force_PG_godderis.m @@ -0,0 +1,45 @@ +classdef copse_force_PG_godderis < copse_force + % Paleogeographic effect on weathering/erosion Godderis + % + % + properties + extrapolate = 1; % extrapolate out-of-range time values to extrapval + extrapval = 1; + end + properties(SetAccess=private) % can be read, but not modified + + datafile = 'forcings/PG_godderis.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) Paleogeog + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_PG_godderis(extrapolate) + f.extrapolate = extrapolate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading Paleogeog data from "%s"\n',obj.datafile); + eru = xlsread(obj.datafile); + obj.data.timeMa = eru(:,1); + obj.data.Paleogeog = eru(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tMya = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate && (tMya > obj.data.timeMa(1)) + D.PG = obj.extrapval; + elseif obj.extrapolate && (tMya < obj.data.timeMa(end)) + D.PG = obj.extrapval; + else + D.PG = interp1(obj.data.timeMa,obj.data.Paleogeog,tMya) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_UDWEbergman2004.m b/code/forcings/copse_force_UDWEbergman2004.m new file mode 100644 index 0000000..b8afce8 --- /dev/null +++ b/code/forcings/copse_force_UDWEbergman2004.m @@ -0,0 +1,98 @@ +classdef copse_force_UDWEbergman2004 < copse_force + % Interpolate and optionally apply naive extrapolation of forcings into (constant) Precambrian and future + % + % U tectonic uplift + % GEOCARB II (Berner 1994) based on Sr isotopes + % D metamorphic and volcanic degassing. + % Bergman etal (2004), same as GEOCARB II (Berner 1994): + % Engerbretson etal (1992) seafloor subduction (spreading) rate 0 - 150Ma, + % Gaffin (1987) Paleo-sealevel based 570 - 150Ma + % E land plant evolution and colonisation + % Bergman etal (2004) + % W biological enhancement of weathering + % Bergman etal (2004) + % + properties + doU = 1; + doD = 1; + doE = 1; + doW = 1; + end + properties(SetAccess=private) + extrapolate; + C_514_forcings; + forcingfile='forcings/copse_forcings'; + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_UDWEbergman2004(extrapolate) + f.extrapolate = extrapolate; + f.load(); + end + + % Load data from Noam's COPSE run, datafile modified to remove NaNs + function load(obj) + + fprintf('loading U,D,W,E forcings from COPSE datafile "%s"\n',obj.forcingfile); + + load(obj.forcingfile); + + % Label with present epoch at year time_present_yr (zero in this case) + obj.C_514_forcings.time_present_yr = 0; + + %%%% convert time to forwards in years + obj.C_514_forcings.Tyr = - copse_forcings(:,1) ; + + obj.C_514_forcings.U=copse_forcings(:,2); + obj.C_514_forcings.D=copse_forcings(:,3); + obj.C_514_forcings.W=copse_forcings(:,4); + obj.C_514_forcings.E=copse_forcings(:,5); + + end + + function D = force(obj, tforce_presentdayiszeroyr, D) + % Convert requested time to offset used by the forcing file + tforce = tforce_presentdayiszeroyr + obj.C_514_forcings.time_present_yr; + + if obj.doU + if obj.extrapolate && (tforce < obj.C_514_forcings.Tyr(1)) + D.UPLIFT = 1; + elseif obj.extrapolate && (tforce > obj.C_514_forcings.Tyr(end)) + D.UPLIFT = 1; + else + D.UPLIFT = interp1(obj.C_514_forcings.Tyr,obj.C_514_forcings.U,tforce) ; + end + end + if obj.doD + if obj.extrapolate && (tforce < obj.C_514_forcings.Tyr(1)) + D.DEGASS = 1; + + elseif obj.extrapolate && (tforce > obj.C_514_forcings.Tyr(end)) + D.DEGASS = 1; + else + D.DEGASS = interp1(obj.C_514_forcings.Tyr,obj.C_514_forcings.D,tforce) ; + end + end + if obj.doW + if obj.extrapolate && (tforce < obj.C_514_forcings.Tyr(1)) + D.W = 0; + elseif obj.extrapolate && (tforce > obj.C_514_forcings.Tyr(end)) + D.W = 1; + else + D.W = interp1(obj.C_514_forcings.Tyr,obj.C_514_forcings.W,tforce) ; + end + end + if obj.doE + if obj.extrapolate && (tforce < obj.C_514_forcings.Tyr(1)) + D.EVO = 0; + elseif obj.extrapolate && (tforce > obj.C_514_forcings.Tyr(end)) + D.EVO = 1; + else + D.EVO = interp1(obj.C_514_forcings.Tyr,obj.C_514_forcings.E,tforce) ; + end + end + end + end +end + diff --git a/code/forcings/copse_force_berner_carbonate_land_area.m b/code/forcings/copse_force_berner_carbonate_land_area.m new file mode 100644 index 0000000..b2112f0 --- /dev/null +++ b/code/forcings/copse_force_berner_carbonate_land_area.m @@ -0,0 +1,44 @@ +classdef copse_force_berner_carbonate_land_area < copse_force + % Carbonate land area from GEOCARB + % + + properties + extrapolate = 1; % extrapolate out-of-range time values to extrapval + end + properties(SetAccess=private) % can be read, but not modified + extrapval = 1; + datafile = 'forcings/berner_carbonate_land_area.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) CARB AREA + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_berner_carbonate_land_area(extrapolate) + f.extrapolate = extrapolate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading carbonate land area from "%s"\n',obj.datafile); + eru = xlsread(obj.datafile); + obj.data.tforwardsage = eru(:,1); + obj.data.carbonate_land_area = eru(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tforwardsage = tforce_presentdayiszeroyr + 4.5e9; % Mya + if obj.extrapolate && (tforwardsage < obj.data.tforwardsage(1)) + D.CARB_AREA = obj.extrapval; + elseif obj.extrapolate && (tforwardsage > obj.data.tforwardsage(end)) + D.CARB_AREA = obj.extrapval; + else + D.CARB_AREA = interp1(obj.data.tforwardsage,obj.data.carbonate_land_area,tforwardsage) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_berner_fr.m b/code/forcings/copse_force_berner_fr.m new file mode 100644 index 0000000..d33d665 --- /dev/null +++ b/code/forcings/copse_force_berner_fr.m @@ -0,0 +1,45 @@ +classdef copse_force_berner_fr < copse_force + % Uplift forcing GEOCARB III Berner(2001) Fig 2. + % + % From fit to Ronov (1993) sediment abundance data + % + properties + extrapolate = 1; % extrapolate out-of-range time values to extrapval + end + properties(SetAccess=private) % can be read, but not modified + extrapval = 1; + datafile = 'forcings/berner_fr.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) Erosion/uplift + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_berner_fr(extrapolate) + f.extrapolate = extrapolate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading Uplift/erosion data from "%s"\n',obj.datafile); + eru = xlsread(obj.datafile); + obj.data.timeMa = eru(:,1); + obj.data.ErosionUplift = eru(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tMya = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate && (tMya > obj.data.timeMa(1)) + D.UPLIFT = obj.extrapval; + elseif obj.extrapolate && (tMya < obj.data.timeMa(end)) + D.UPLIFT = obj.extrapval; + else + D.UPLIFT = interp1(obj.data.timeMa,obj.data.ErosionUplift,tMya) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_berner_total_land_area.m b/code/forcings/copse_force_berner_total_land_area.m new file mode 100644 index 0000000..b9a0afc --- /dev/null +++ b/code/forcings/copse_force_berner_total_land_area.m @@ -0,0 +1,44 @@ +classdef copse_force_berner_total_land_area < copse_force + % Carbonate land area from GEOCARB + % + + properties + extrapolate = 1; % extrapolate out-of-range time values to extrapval + end + properties(SetAccess=private) % can be read, but not modified + extrapval = 1; + datafile = 'forcings/berner_land_area.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) CARB AREA + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_berner_total_land_area(extrapolate) + f.extrapolate = extrapolate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading total land area from "%s"\n',obj.datafile); + eru = xlsread(obj.datafile); + obj.data.tforwardsage = eru(:,1); + obj.data.total_land_area = eru(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tforwardsage = tforce_presentdayiszeroyr + 4.5e9; % Mya + if obj.extrapolate && (tforwardsage < obj.data.tforwardsage(1)) + D.TOTAL_AREA = obj.extrapval; + elseif obj.extrapolate && (tforwardsage > obj.data.tforwardsage(end)) + D.TOTAL_AREA = obj.extrapval; + else + D.TOTAL_AREA = interp1(obj.data.tforwardsage,obj.data.total_land_area,tforwardsage) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_calcium.m b/code/forcings/copse_force_calcium.m new file mode 100644 index 0000000..a799486 --- /dev/null +++ b/code/forcings/copse_force_calcium.m @@ -0,0 +1,47 @@ +classdef copse_force_calcium < copse_force + % Forcing from file + properties + estimate % estimate to use ('','','') + extrapolate = 1; % 0 none, 1 extrapolate out-of-range time values to extrapval, 2 extrapolate to first/last data points + end + properties(SetAccess=private) % can be read, but not modified + extrapval = 1; + datafile = 'forcings/Horita_Ca.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_calcium(estimate) + f.estimate = estimate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading [Ca++] normalised forcing data from "%s"\n',obj.datafile); + cal = xlsread(obj.datafile); + obj.data.timeMa = cal(:,1); + obj.data.calnorm = cal(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tdatafile = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate == 1 + D.CAL_NORM = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.(obj.estimate); obj.extrapval; obj.extrapval],... + tdatafile) ; + elseif obj.extrapolate == 2 + D.CAL_NORM = interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.(obj.estimate)(1); obj.data.(obj.estimate); obj.data.(obj.estimate)(end); ],... + tdatafile) ; + else + D.CAL_NORM = interp1(obj.data.timeMa,obj.data.(obj.estimate),tdatafile) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_co2pulse.m b/code/forcings/copse_force_co2pulse.m new file mode 100644 index 0000000..e09f449 --- /dev/null +++ b/code/forcings/copse_force_co2pulse.m @@ -0,0 +1,35 @@ +classdef copse_force_co2pulse < copse_force + % pulse C injection forcing + % + % cf Payne etal (2010) PNAS scenario + % 2.4e18 molC, 10ky, -10 d13C + % gives ~ 3 per mil delta 13C (as they have), ~1.2 mmol/kg Ca++ max, -0.15 per mil d44C (~ half their value). + + properties + size; + duration; + tstart; + d13C; + end + + methods + % Constructor. This enforces input of parameters when object is created + function f = copse_force_co2pulse(size, duration, tstart,d13C) + f.size = size; + f.duration = duration; + f.tstart = tstart; + f.d13C = d13C; + end + function D = force(obj, tmodel, D) + prate = obj.size/obj.duration ... + *copse_force_tophat(tmodel, obj.tstart , obj.tstart + obj.duration); + D.co2pert = D.co2pert + prate; + if obj.d13C ~= 0 + D.co2pertmoldelta = D.co2pertmoldelta + prate*obj.d13C; + end + end + end + +end + + diff --git a/code/forcings/copse_force_coal.m b/code/forcings/copse_force_coal.m new file mode 100644 index 0000000..5cbef23 --- /dev/null +++ b/code/forcings/copse_force_coal.m @@ -0,0 +1,50 @@ +classdef copse_force_coal < copse_force + % Forcing from file coal_basin_frac.xlsx + properties + estimate % estimate to use ('Davg','Dmin','Dmax') + extrapolate = 1; % 0 none, 1 extrapolate out-of-range time values to extrapval, 2 extrapolate to first/last data points + end + properties(SetAccess=private) % can be read, but not modified + extrapval = 1; + %datafile = 'forcings/coal_basin_frac.xlsx' + datafile = 'forcings/coal_basin_frac_new.xlsx' + %datafile = 'forcings/coal_basin_frac_CP_merge.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) COAL + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_coal(estimate) + f.estimate = estimate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading coal fraction data from "%s"\n',obj.datafile); + coal = xlsread(obj.datafile); + obj.data.timeMa = coal(:,1); + obj.data.coalfrac = coal(:,2); + obj.data.coalnorm = coal(:,3); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tdatafile = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate == 1 + D.COAL = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.(obj.estimate); obj.extrapval; obj.extrapval],... + tdatafile) ; + elseif obj.extrapolate == 2 + D.COAL = interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.(obj.estimate)(1); obj.data.(obj.estimate); obj.data.(obj.estimate)(end); ],... + tdatafile) ; + else + D.COAL = interp1(obj.data.timeMa,obj.data.(obj.estimate),tdatafile) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_composite.m b/code/forcings/copse_force_composite.m new file mode 100644 index 0000000..71227cb --- /dev/null +++ b/code/forcings/copse_force_composite.m @@ -0,0 +1,83 @@ +classdef copse_force_composite < copse_force + % Container for multiple forcings. + % Option to pre-calculate interpolation to a supplied time grid. + % + % + properties + fastinterp=0 % if using tgrid, set to 1 to enable fast interpolation (no error checking !) + end + properties(SetAccess=private) % can be read, but not written to + forcings; % cell array of forcings + tgrid=[]; % optional grid to precalculate forcings on for speed + dfields; % is using tgrid, supply list of fields used {'field1', 'field2', ...} + dfieldstoset % if using tgrid, supply flags to define set=1 or add=0 [1 0 1 ...] + Dgrid; % gridded forcings; + end + + methods + + function f = copse_force_composite(forcings, tgrid, dfields, dfieldstoset) + % Constructor. + % + % Args: + % forcings (cell array): list of copse_force_XXX instances + % tgrid (vector, optional): time grid to pre-calculate interpolation + % dfields (cell array, optional): list of fields to expect for pre-calulated interpolation + % dfieldstoset (vector, optional): per-field flag, true to set this field, false to add to this field + + f.forcings = forcings; + if nargin > 1 + f.tgrid = tgrid; + f.dfields = dfields; + f.dfieldstoset = dfieldstoset; + f.calcgrid(); + end + + end + + function D = force(obj, tforce_or_tmodel, D) + % dispatch to appropriate handler + if isempty(obj.tgrid) + % apply list of forcings + D = force_individual(obj, tforce_or_tmodel, D); + else + % use pre-calculated interpolation + D = force_grid(obj, tforce_or_tmodel, D); + end + end + + function D = force_individual(obj, tforce_or_tmodel, D) + % iterate through the list of forcings, accumulating into D + for i = 1:length(obj.forcings) + D = obj.forcings{i}.force(tforce_or_tmodel, D); + end + end + + function calcgrid(obj) + % calculate gridded forcings + D = struct; + for i=1:length(obj.dfields) + D.(obj.dfields{i}) = 0; + end + + obj.Dgrid = obj.force_individual(obj.tgrid,D); + end + + function D = force_grid(obj, tforce_or_tmodel, D) + % calculate forcing by interpolating from grid + for i=1:length(obj.dfields) + if obj.fastinterp % fast interp1, requires column vectors + interpval = interp1qr(obj.tgrid',obj.Dgrid.(obj.dfields{i})',tforce_or_tmodel')'; + else + interpval = interp1(obj.tgrid,obj.Dgrid.(obj.dfields{i}),tforce_or_tmodel); + end + if obj.dfieldstoset(i) + D.(obj.dfields{i}) = interpval; + else + D.(obj.dfields{i}) = D.(obj.dfields{i}) + interpval; + end + end + end + end +end + diff --git a/code/forcings/copse_force_examples.m b/code/forcings/copse_force_examples.m new file mode 100644 index 0000000..99a1166 --- /dev/null +++ b/code/forcings/copse_force_examples.m @@ -0,0 +1,28 @@ +classdef copse_force_examples < copse_force + % Example perturbations + % + % + + methods + + function D = force(obj, tmodel, D) + % Override background forcings with perturbations + D.UPLIFT = 1+copse_force_tophat(tmodel ,300e6, 310e6); + %D.UPLIFT = 1+copse_force_tophat(tmodel ,300e6, 500e6); + D.DEGASS = 1+copse_force_tophat(tmodel ,350e6, 360e6); + %D.DEGASS = 1+copse_force_tophat(tmodel ,300e6, 500e6); + + %%% D.RHO additional enhancement to carbonate/silicate weathering + D.RHO = 1+copse_force_tophat(tmodel , 400e6, 410e6); + %D.RHO = 1+copse_force_tophat(tmodel , 300e6, 500e6); + %%% F_EPSILON enhances nutrient weathering only + D.F_EPSILON = 1+copse_force_tophat(tmodel , 450e6, 500e6); + %D.F_EPSILON = 1+copse_force_tophat(tmodel , 300e6, 500e6); + + end + end + +end + + + diff --git a/code/forcings/copse_force_granite.m b/code/forcings/copse_force_granite.m new file mode 100644 index 0000000..8e774b6 --- /dev/null +++ b/code/forcings/copse_force_granite.m @@ -0,0 +1,49 @@ +classdef copse_force_granite < copse_force + % Forcing from file sandstone_shield_siliceous_area.xlsx + properties + estimate % estimate to use ('','','') + extrapolate = 1; % 0 none, 1 extrapolate out-of-range time values to extrapval, 2 extrapolate to first/last data points + end + properties(SetAccess=private) % can be read, but not modified + extrapval = 1; + %datafile = 'forcings/sandstone_shield_siliceous_area.xlsx' + datafile = 'forcings/shield_area.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_granite(estimate) + f.estimate = estimate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading sandstone+shield+chert area forcing data from "%s"\n',obj.datafile); + gran = xlsread(obj.datafile); + obj.data.timeMa = gran(:,1); + obj.data.silarea = gran(:,2); + obj.data.silnorm = gran(:,3); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tdatafile = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate == 1 + D.GRAN = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.(obj.estimate); obj.extrapval; obj.extrapval],... + tdatafile) ; + elseif obj.extrapolate == 2 + D.GRAN = interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.(obj.estimate)(1); obj.data.(obj.estimate); obj.data.(obj.estimate)(end); ],... + tdatafile) ; + else + D.GRAN = interp1(obj.data.timeMa,obj.data.(obj.estimate),tdatafile) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_haq_D.m b/code/forcings/copse_force_haq_D.m new file mode 100644 index 0000000..a270af8 --- /dev/null +++ b/code/forcings/copse_force_haq_D.m @@ -0,0 +1,60 @@ +classdef copse_force_haq_D < copse_force + % New sea level inversion CO2 degassing forcing, with estimate for OIB area + properties + oib_area_scaling = 2e6; % km2 for deg_relative = 1 + extrapolate = 1; % 0 none, 1 extrapolate out-of-range time values to extrapval, 2 extrapolate to first/last data points + extrapval = 1; % used when extrapolate = 1 + end + properties(SetAccess=private) % read-only + %datafile = 'forcings/vandermeer_degassing.xlsx' + %datafile = 'forcings/D_vandermeer.xlsx' + %datafile = 'forcings/CR_force_D_temp.xlsx' + %datafile = 'forcings/royer_D.xlsx' + %datafile = 'forcings/D_haq_inversion.xlsx' + datafile = 'forcings/D_haq_inversion_2017.xlsx' + %datafile = 'forcings/D_max.xlsx' + % struct with raw data from spreadsheet columns Time(Ma) D(avg) D(min) D(max) + data; + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_haq_D() + f.load(); + end + + function load(obj) + %%%% load degassing + fprintf('loading degassing data from "%s"\n',obj.datafile); + degassing = xlsread(obj.datafile); + obj.data.timeMa = degassing(:,1); + obj.data.D = degassing(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + + % Convert requested time to offset used by the forcing file + tMa = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate == 1 + D.DEGASS = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.D; obj.extrapval; obj.extrapval],... + tMa) ; + elseif obj.extrapolate == 2 + D.DEGASS = interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.D(1); obj.data.D; obj.data.D(end); ],... + tMa) ; + else + D.DEGASS = interp1(obj.data.timeMa,obj.data.D, tMa) ; + end + D.oib_area = obj.oib_area_scaling*D.DEGASS ; + end + + function oib_area = present_day_OIB_area(obj) + % return present-day oib_area for use in model initialisation + D = obj.force(paleo_const.time_present_yr, struct()); + oib_area = D.oib_area; + end + end +end + + diff --git a/code/forcings/copse_force_org_evap_area.m b/code/forcings/copse_force_org_evap_area.m new file mode 100644 index 0000000..edb27ce --- /dev/null +++ b/code/forcings/copse_force_org_evap_area.m @@ -0,0 +1,47 @@ +classdef copse_force_org_evap_area < copse_force + % Forcing from file shale_and_coal_area.xlsx + properties + estimate % estimate to use ('','','') + extrapolate = 1; % 0 none, 1 extrapolate out-of-range time values to extrapval, 2 extrapolate to first/last data points + end + properties(SetAccess=private) % can be read, but not modified + extrapval = 1; + datafile = 'forcings/organics_and_evaporites_area.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) ORG+EVAP + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_org_evap_area(estimate) + f.estimate = estimate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading organics+evaporites area forcing data from "%s"\n',obj.datafile); + orgevap = xlsread(obj.datafile); + obj.data.timeMa = orgevap(:,1); + obj.data.orgevapnorm = orgevap(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tdatafile = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate == 1 + D.ORGEVAP_AREA = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.(obj.estimate); obj.extrapval; obj.extrapval],... + tdatafile) ; + elseif obj.extrapolate == 2 + D.ORGEVAP_AREA = interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.(obj.estimate)(1); obj.data.(obj.estimate); obj.data.(obj.estimate)(end); ],... + tdatafile) ; + else + D.ORGEVAP_AREA = interp1(obj.data.timeMa,obj.data.(obj.estimate),tdatafile) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_pulse.m b/code/forcings/copse_force_pulse.m new file mode 100644 index 0000000..db708a0 --- /dev/null +++ b/code/forcings/copse_force_pulse.m @@ -0,0 +1,27 @@ +classdef copse_force_pulse < copse_force + %Generic pulse injection forcing, for specified field + % + % Examples: 'O_SO2pert', 'carbwpert', 'O_Ppert', 'mpsbpert', 'F_EPSILON' + + properties + dfield; + size; + duration; + tstart; + end + + methods + % Constructor. This enforces input of parameters when object is created + function f = copse_force_pulse(dfield, size, duration, tstart) + f.dfield = dfield; + f.size = size; + f.duration = duration; + f.tstart = tstart; + end + function D = force(obj, tmodel, D ) + D.(obj.dfield) = D.(obj.dfield) + obj.size/obj.duration ... + *copse_force_tophat(tmodel, obj.tstart , obj.tstart + obj.duration); + end + end + +end \ No newline at end of file diff --git a/code/forcings/copse_force_ramp.m b/code/forcings/copse_force_ramp.m new file mode 100644 index 0000000..849a223 --- /dev/null +++ b/code/forcings/copse_force_ramp.m @@ -0,0 +1,38 @@ +classdef copse_force_ramp < copse_force + %Generic ramp forcing, for specified field + % + % Examples: 'SHELFAREA' + + properties + dfield; + valfromto; + tinterval; + oper; + end + + methods + % Constructor. This enforces input of parameters when object is created + function f = copse_force_ramp(dfield, fromto, tinterval, oper) + f.dfield = dfield; + f.valfromto = fromto; + f.tinterval = tinterval; + f.oper = oper; + end + function D = force(obj, tforce, D ) + val = interp1([-1e11 obj.tinterval(1) obj.tinterval(2) 1e11],... + [obj.valfromto(1) obj.valfromto(1) obj.valfromto(2) obj.valfromto(2)],... + tforce); + switch obj.oper + case '+' + D.(obj.dfield) = D.(obj.dfield) + val; + case '*' + D.(obj.dfield) = D.(obj.dfield) * val; + case '=' + D.(obj.dfield) = val; + otherwise + error('unknown oper %s',obj.oper); + end + end + end + +end \ No newline at end of file diff --git a/code/forcings/copse_force_revision_ba.m b/code/forcings/copse_force_revision_ba.m new file mode 100644 index 0000000..1cfc1bd --- /dev/null +++ b/code/forcings/copse_force_revision_ba.m @@ -0,0 +1,71 @@ +classdef copse_force_revision_ba < copse_force + %%% BA forcing from finished G3 paper + properties + estimate % estimate to use ('BAavg','BAmin','BAmax') + extrapolate = 2; % 0 none, 1 extrapolate out-of-range time values to extrapval, 2 extrapolate to first/last data points + extrapval = 1; % used when extrapolate = 1 + end + properties(SetAccess=private) % read-only + datafile; % data file used + % struct with raw data from spreadsheet columns Time(Ma) BA(avg) BA(min) BA(max) + data; + end + + methods + % Constructor. This loads data when object is created + function obj = copse_force_revision_ba(estimate, datasource) + obj.estimate = estimate; + obj.load(datasource); + end + + function load(obj, datasource) + %%%% load revision basalt area + switch datasource + case 'xls' + % xls file from COPSE tree + obj.datafile = 'forcings/bas_area_mills2014.xlsx'; + fprintf('loading g3 revision data table from "%s" estimate "%s" \n', obj.datafile,obj.estimate); + barevised = xlsread(obj.datafile); + obj.data.timeMa = barevised(:,1); + obj.data.BAavg = barevised(:,2); + % obj.data.BAmin = barevised(:,3); + % obj.data.BAmax = barevised(:,4); + % SD columns were swapped + obj.data.BAmin = barevised(:,4); + obj.data.BAmax = barevised(:,3); + case 'g3supp' + % .mat file provided as supp info + obj.datafile = 'forcings/ggge20620-sup-0002-suppinfo2.mat'; + fprintf('loading g3 revision data table from "%s" estimate "%s" \n', obj.datafile,obj.estimate); + barevised = load(obj.datafile); + obj.data.timeMa = -barevised.BA_force2(:, 1); + obj.data.BAavg = barevised.BA_force2(:,2)./barevised.BA_force2(end,2); + obj.data.BAmin = barevised.BA_force2(:,4)./barevised.BA_force2(end,4); + obj.data.BAmax = barevised.BA_force2(:,3)./barevised.BA_force2(end,3); + otherwise + error('unrecognized datasource %s', datasource); + end + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + + % Convert requested time to offset used by the forcing file + tMa = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate == 1 + D.BA = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.(obj.estimate); obj.extrapval; obj.extrapval],... + tMa) ; + elseif obj.extrapolate == 2 + D.BA = interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.(obj.estimate)(1); obj.data.(obj.estimate); obj.data.(obj.estimate)(end); ],... + tMa) ; + else + D.BA = interp1(obj.data.timeMa,obj.data.(obj.estimate),tMa) ; + end + + end + + end +end + + diff --git a/code/forcings/copse_force_royer_fD.m b/code/forcings/copse_force_royer_fD.m new file mode 100644 index 0000000..00abcb4 --- /dev/null +++ b/code/forcings/copse_force_royer_fD.m @@ -0,0 +1,47 @@ +classdef copse_force_royer_fD < copse_force + % Paleogeographic effect on weathering/erosion Godderis + % + % + properties + extrapolate = 1; % extrapolate out-of-range time values to extrapval + extrapval = 1; + end + properties(SetAccess=private) % can be read, but not modified + + datafile = 'forcings/royer_fDfAw.xlsx' + %datafile = 'forcings/royer_fDfA.xlsx' + %datafile = 'forcings/royer_fD.xlsx' + data; % struct with raw data from spreadsheet columns Time(Ma) Paleogeog + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_royer_fD(extrapolate) + f.extrapolate = extrapolate; + f.load(); + end + + function load(obj) + %%%% load data + fprintf('loading Paleogeog data from "%s"\n',obj.datafile); + eru = xlsread(obj.datafile); + obj.data.timeMa = eru(:,1); + obj.data.Paleogeog = eru(:,2); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + % Convert requested time to offset used by the forcing file + tMya = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate && (tMya > obj.data.timeMa(1)) + D.PG = obj.extrapval; + elseif obj.extrapolate && (tMya < obj.data.timeMa(end)) + D.PG = obj.extrapval; + else + D.PG = interp1(obj.data.timeMa,obj.data.Paleogeog,tMya) ; + end + end + + end +end + + diff --git a/code/forcings/copse_force_tophat.m b/code/forcings/copse_force_tophat.m new file mode 100644 index 0000000..c80a302 --- /dev/null +++ b/code/forcings/copse_force_tophat.m @@ -0,0 +1,14 @@ +function tophat = copse_force_tophat(t, tstart, tend) +% handy top hat function for constructing perturbations to forcings etc +% tophat = copse_force_tophat(t, tstart, tend) +% +% tophat = 1 for tstart < t < tend, 0 elsewhere + +if (t > tstart) && (t < tend) + tophat = 1; + else + tophat = 0; +end + +end + diff --git a/code/forcings/copse_force_vandermeer.m b/code/forcings/copse_force_vandermeer.m new file mode 100644 index 0000000..f73ad8d --- /dev/null +++ b/code/forcings/copse_force_vandermeer.m @@ -0,0 +1,80 @@ +classdef copse_force_vandermeer < copse_force + % Vandermeer CO2 degassing forcing, with estimate for OIB area + properties + oib_area_scaling = 2e6; % km2 for deg_relative = 1 + estimate % estimate to use ('Davg','Dmin','Dmax') + extrapolate = 1; % 0 none, 1 extrapolate out-of-range time values to extrapval, 2 extrapolate to first/last data points + % 3 G3 bug compatibility, DEGASS as extrapolate=1, oib_area as extrapolate=2 + extrapval = 1; % used when extrapolate = 1 + end + properties(SetAccess=private) % read-only + %datafile = 'forcings/vandermeer_degassing.xlsx' + datafile = 'forcings/D_vandermeer.xlsx' + % + % NB: D_vandermeer_Ben.xlsx includes an additional value at 250Ma + % (extrapolation from 230Ma) [and also swaps the column order D(min) <-> D(max)] + % The check output 'g3_outputs_avg.mat' agrees with D_vandermeer.xlsx + % (hence generates a step in DEGASS from 1 -> 1.566034 at 230Ma) + % + % datafile = 'forcings/D_vandermeer_Ben.xlsx' + % struct with raw data from spreadsheet columns Time(Ma) D(avg) D(min) D(max) + % or D_vandermeer_Ben Time(Ma) D(avg) D(max) D(min) + data; + end + + methods + % Constructor. This loads data when object is created + function f = copse_force_vandermeer(estimate, extrapolate) + f.estimate = estimate; + f.extrapolate = extrapolate; + f.load(); + end + + function load(obj) + %%%% load vandermeer degassing + fprintf('loading Vandermeer degassing data from "%s"\n',obj.datafile); + degassing_vandermeer = xlsread(obj.datafile); + obj.data.timeMa = degassing_vandermeer(:,1); + obj.data.Davg = degassing_vandermeer(:,2); + obj.data.Dmin = degassing_vandermeer(:,3); + obj.data.Dmax = degassing_vandermeer(:,4); + % NB: column order for D_vandermeer_Ben.xlsx + % obj.data.Dmin = degassing_vandermeer(:,4); + % obj.data.Dmax = degassing_vandermeer(:,3); + end + + function D = force(obj, tforce_presentdayiszeroyr, D ) + + % Convert requested time to offset used by the forcing file + tMa = -tforce_presentdayiszeroyr/1e6; % Mya + if obj.extrapolate == 1 + D.DEGASS = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.(obj.estimate); obj.extrapval; obj.extrapval],... + tMa) ; + D.oib_area = obj.oib_area_scaling*D.DEGASS ; + elseif obj.extrapolate == 2 + D.DEGASS = interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.(obj.estimate)(1); obj.data.(obj.estimate); obj.data.(obj.estimate)(end); ],... + tMa) ; + D.oib_area = obj.oib_area_scaling*D.DEGASS ; + elseif obj.extrapolate == 3 + % G3 bug compatibility + % DEGASS extrapolate to extrapval + D.DEGASS = interp1([ 1e10; obj.data.timeMa(1)+1e-3; obj.data.timeMa; obj.data.timeMa(end)-1e-3; -1e10], ... + [obj.extrapval; obj.extrapval; obj.data.(obj.estimate); obj.extrapval; obj.extrapval],... + tMa) ; + % oib_area extrapolate to first/last data points + D.oib_area = obj.oib_area_scaling* ... + interp1([ 1e10; obj.data.timeMa; -1e10], ... + [ obj.data.(obj.estimate)(1); obj.data.(obj.estimate); obj.data.(obj.estimate)(end); ],... + tMa) ; + else + D.DEGASS = interp1(obj.data.timeMa,obj.data.(obj.estimate),tMa) ; + D.oib_area = obj.oib_area_scaling*D.DEGASS ; + end + end + + end +end + + diff --git a/code/forcings/copse_forcings.mat b/code/forcings/copse_forcings.mat new file mode 100644 index 0000000..8f3450a Binary files /dev/null and b/code/forcings/copse_forcings.mat differ diff --git a/code/forcings/copse_forcings.xlsx b/code/forcings/copse_forcings.xlsx new file mode 100644 index 0000000..8ce6a44 Binary files /dev/null and b/code/forcings/copse_forcings.xlsx differ diff --git a/code/forcings/copse_load_phanlip.m b/code/forcings/copse_load_phanlip.m new file mode 100644 index 0000000..a3510aa --- /dev/null +++ b/code/forcings/copse_load_phanlip.m @@ -0,0 +1,245 @@ +classdef copse_load_phanlip < handle + % Load LIPs excel file and constructs copse_force_LIP forcings for use in model + + properties(SetAccess=private) %can be read but not modified + rev; % data version + datafile; % spreadsheet with LIP data + PhanLIPs; % structure for input data + end + + methods + % Constructor. This loads data when object is created + function obj = copse_load_phanlip(rev) + obj.rev = rev; + switch obj.rev + case 'mills2014g3' + obj.datafile = 'forcings/ggge20620-sup-0001-suppinfo1.xlsx'; + case 'copseRL' + obj.datafile = 'forcings/CR_force_LIP_table.xlsx'; + case {'copseRL_jw', 'copseRL_jw_revisedAreas'}; + obj.datafile = 'forcings/CR_force_LIP_table_jw.xlsx'; + otherwise + error('undefined rev %s',rev) + end + + obj.loadall(); + end + + function LIPs = create_LIPs(obj, co2releasefield, default_lambda, LIPtrange, smoothempl, areafac, decayoffset, default_co2releasetime) + % Create a cell array of copse_force_LIP forcings, parameterised based on the spreadsheet data (and arguments). + % + % Args: + % co2releasefield (str): spreadsheet field for CO2 release (see struct fields in load() ) + % default_lambda (float): (1/yr) default lambda for exponential area decay, for lips with unspecified present-day area + % LIPtrange (optional): range of emplacement times to include, [tmin tmax] in yr, relative to present-day = 0 + % smoothempl (bool, optional): true to apply sigmoidal function to emplacement + % areafac (float, optional): multiplier for lip area + % decayoffset (float, optional): (yr) wait before erosion begins. + % default_co2releasetime (float, optional): (yr) timescale for CO2 release, for lips where this is not specified + % + % Returns: + % LIPs (cell array of copse_force_LIP) : LIP forcings (one per row in input spreadsheet) + + if nargin < 4 + LIPtrange = [-Inf, Inf]; % include all lips + end + if nargin < 5 + smoothempl = false; + end + if nargin < 6 + areafac = 1; + end + if nargin < 7 + decayoffset = 0; + end + if nargin < 8 + default_co2releasetime = 2e5; + end + + % Initialise empty list of LIPs + LIPs={}; + + % Iterate through rows in the spreadsheet + + for i=1:length(obj.PhanLIPs.Allages) + liptime = - obj.PhanLIPs.Allages(i)*1e6; % emplacement time (or NaN) in yr, relative to present-day = 0 + if ~isnan(liptime) && (liptime >= LIPtrange(1)) && (liptime <= LIPtrange(2)) + switch co2releasefield + case 'NoCO2' + lipCO2 = 0; + otherwise + lipCO2 = NaNtodefault(obj.PhanLIPs.(co2releasefield)(i), 0.0); + end + co2releasetime = NaNtodefault(1e6*obj.PhanLIPs.DegassDuration(i), default_co2releasetime); + + peak_area = areafac*NaNtodefault(obj.PhanLIPs.CFBareas(i), 0.0); + + % calculate decay rate from present-day area, if available + present_area = obj.PhanLIPs.PresentDayArea(i); + if isnan(present_area) + % no present_area - use default lambda + lambda = default_lambda; + else + % calculate decay rate to give present day area + % present_area = peak_area*exp((liptime + decayoffset)*lambda) + lambda = log(present_area/peak_area)/(liptime + decayoffset); + end + + LIPs{end+1} = copse_force_LIP( ... + liptime, ... + obj.PhanLIPs.Names{i}, ... + obj.PhanLIPs.Types{i}, ... + peak_area, ... + smoothempl, ... + lipCO2, ... + decayoffset, ... + lambda, ... + co2releasetime); + + + end + end + + end + + function [flips, default_lambda, lipsAll] = create_LIP_forcing(obj, Tstart, Tend, co2releasefield, present_CFB_area, varargin) + % Create a LIP forcing function from data table, adjusting decay rates to match present_CFB_area + % + % Args: + % Tstart (float): start of time range where forcing required + % Tend (float): end of time range where forcing required + % co2releasefield: 'NoCO2', 'CO2min', 'CO2max' + % present_CFB_area (float): (km2) target area, decay constant lambda (for those lips with unknown present day area) is adjusted to meet this + % varargin: passed through to createLIPs: LIPtrange, smoothempl, areafac, decayoffset, co2releasetime + % + % Returns: + % flips: composite forcing (basalt area and CO2), pre-calculated interpolation to grid for range Tstart:Tend + % default_lambda: decay rate (for lips where present day area not available), to create present_CFB_area + % lipsAll (cell array): individual LIP forcings + + % solve for decay constant that provides present_CFB_area + default_lambda = obj.match_present_CFB_area(present_CFB_area, co2releasefield, varargin{:}); + + % create forcing + % cell array of individual LIP forcings + lipsAll = obj.create_LIPs(co2releasefield, default_lambda, varargin{:}); + % Create composite forcing, pre-calculated interpolation to tgrid. + % NB: forcing will only be interpolated and available for range Tstart - Tend + tgrid = Tstart:1e4:Tend; + flips= copse_force_composite(lipsAll,tgrid,{'CFB_area','LIP_CO2','LIP_CO2moldelta'},[0 0 0]); + flips.fastinterp=1; + + % check: evaluate present-day CFB area + D.CFB_area = 0; + D.LIP_CO2 = 0; + D.LIP_CO2moldelta = 0; + D = flips.force(paleo_const.time_present_yr, D); + + frac_area_err = abs(D.CFB_area - present_CFB_area)/present_CFB_area; + if frac_area_err > 1e-8 + error('LIP present_day_area failed, frac_area_err %g', frac_area_err); + end + end + + function default_lambda = match_present_CFB_area(obj, present_CFB_area, co2releasefield, varargin) + % solve for decay rate that produces specified present_CFB_area (km2) + % varargin is passed through to createLIPs: smoothempl, areafac, decayoffset, co2releasetime + + % anonymous function for root finder + areaDiff = @(lamb) obj.get_present_CFB_area(co2releasefield, lamb, varargin{:}) - present_CFB_area; + + options = optimset('Display','iter'); + + default_lambda = fzero(areaDiff, [0.25e-8 4e-8],options); + + end + + function present_day_CFB_area = get_present_CFB_area(obj, co2releasefield, default_lambda, varargin) + % find present-day CFB area + % varargin is passed through to createLIPs: smoothempl, areafac, decayoffset, co2releasetime + + lipsAll = obj.create_LIPs(co2releasefield, default_lambda, varargin{:}); + + flips= copse_force_composite(lipsAll); + + D.CFB_area = 0; + D.LIP_CO2 = 0; + D.LIP_CO2moldelta = 0; + D = flips.force(paleo_const.time_present_yr, D); + + present_day_CFB_area = D.CFB_area; + end + + function loadall(obj) + % Load data from spreadsheet + + fprintf('loading all LIPs data from "%s"\n',obj.datafile); + + % xlsread is very slow when columns are specified, so read the whole file then select columns + [xlsnum, xlstxt, xlsraw] = xlsread(obj.datafile); + + % store the columns we want in a struct + obj.PhanLIPs.Allages = xlsnum(:,icolfromChar('A')); % Mya + num_lip_rows = length(obj.PhanLIPs.Allages); + num_header_rows = 2; + % check - Matlab prunes non-numeric rows from xlsnum, leaves all rows in xlsraw + if xlsraw{num_header_rows + 1, icolfromChar('A')} ~= obj.PhanLIPs.Allages(1) + error('unexpected spreadsheet format'); + end + obj.PhanLIPs.Names = strtrim(xlsraw(num_header_rows+1:num_header_rows+num_lip_rows, icolfromChar('B'))); + obj.PhanLIPs.Types = strtrim(xlsraw(num_header_rows+1:num_header_rows+num_lip_rows, icolfromChar('C'))); + + switch (obj.datafile) + case {'forcings/ggge20620-sup-0001-suppinfo1.xlsx', 'forcings/CR_force_LIP_table.xlsx'} + obj.PhanLIPs.CFBareas = xlsnum(:,icolfromChar('D')); % km2 + obj.PhanLIPs.Allvolume = xlsnum(:,icolfromChar('E')); % km3 + obj.PhanLIPs.CO2min = xlsnum(:,icolfromChar('F')); % mol + obj.PhanLIPs.CO2max = xlsnum(:,icolfromChar('G')); % mol + obj.PhanLIPs.DegassDuration = xlsnum(:,icolfromChar('H')); % Myr + obj.PhanLIPs.PresentDayArea = xlsnum(:,icolfromChar('I')); % km2 + case 'forcings/CR_force_LIP_table_jw.xlsx' + switch(obj.rev) + case 'copseRL_jw' + obj.PhanLIPs.CFBareas = xlsnum(:,icolfromChar('D')); % km2 + case 'copseRL_jw_revisedAreas' + obj.PhanLIPs.CFBareas = xlsnum(:,icolfromChar('E')); % km2 + otherwise + error('unrecognized rev %s', obj.rev); + end + obj.PhanLIPs.Allvolume = xlsnum(:,icolfromChar('F')); % km3 + obj.PhanLIPs.CO2min = xlsnum(:,icolfromChar('G')); % mol + obj.PhanLIPs.CO2max = xlsnum(:,icolfromChar('H')); % mol + obj.PhanLIPs.DegassDuration = xlsnum(:,icolfromChar('I')); % Myr + obj.PhanLIPs.PresentDayArea = xlsnum(:,icolfromChar('J')); % km2 + otherwise + error('unrecognized datafile %s', obj.datafile); + end + + end + end +end + +function colidx = icolfromChar(colLet) +% Convert an upper-case column letter to numeric column index + + if length(colLet) ~=1 + error('column not single character %s',colLet) + end + colidx = unicode2native(colLet) - unicode2native('A') + 1; + if (colidx < 1) || (colidx > 26) + error('column out of range character %s',colLet); + end +end + +function y=NaNtodefault(x, default_value) +% Replace NaN with default_value + if isnan(x) + y=default_value; + else + y=x; + end +end + + + + diff --git a/code/forcings/ggge20620-sup-0001-suppinfo1.xlsx b/code/forcings/ggge20620-sup-0001-suppinfo1.xlsx new file mode 100644 index 0000000..a262a4c Binary files /dev/null and b/code/forcings/ggge20620-sup-0001-suppinfo1.xlsx differ diff --git a/code/forcings/ggge20620-sup-0002-suppinfo2.mat b/code/forcings/ggge20620-sup-0002-suppinfo2.mat new file mode 100644 index 0000000..0b055ba Binary files /dev/null and b/code/forcings/ggge20620-sup-0002-suppinfo2.mat differ diff --git a/code/forcings/input_namechange.dat b/code/forcings/input_namechange.dat new file mode 100644 index 0000000..241c2f9 --- /dev/null +++ b/code/forcings/input_namechange.dat @@ -0,0 +1,564 @@ +runtime 600000000 +File: input.dat +Author: Noam Bergman, N.Bergman@uea.ac.uk +This is the default input file for version 5. +It consists of data for the forcings U, D, W and E for the past 550my, +at 1my intervals, and starts at 600MyBP for a 50my spin up. +Note the file consists of the magic number 'runtime' followed by +the time in the past when the model is to start running (600MyBP). +All the text (including this) following the first line is ignored by +the program when it reads datafiles, until it reaches a line starting +with a number, i.e., the line after next. +time_yBP_ U D W E +600000000 1.048 1.2 0 0 +550000000 1.048 1.2 0 0 +549000000 1.047 1.22 +548000000 1.047 1.24 +547000000 1.049 1.25 +546000000 1.052 1.27 +545000000 1.056 1.29 +544000000 1.06 1.31 +543000000 1.064 1.33 +542000000 1.069 1.34 +541000000 1.074 1.36 +540000000 1.078 1.38 +539000000 1.083 1.4 +538000000 1.089 1.42 +537000000 1.094 1.45 +536000000 1.1 1.47 +535000000 1.105 1.49 +534000000 1.111 1.51 +533000000 1.117 1.53 +532000000 1.123 1.56 +531000000 1.128 1.58 +530000000 1.134 1.6 +529000000 1.139 1.61 +528000000 1.143 1.62 +527000000 1.146 1.63 +526000000 1.149 1.64 +525000000 1.152 1.65 +524000000 1.155 1.66 +523000000 1.157 1.67 +522000000 1.16 1.68 +521000000 1.163 1.69 +520000000 1.165 1.7 +519000000 1.166 1.69 +518000000 1.166 1.68 +517000000 1.164 1.67 +516000000 1.163 1.66 +515000000 1.137 1.66 +514000000 1.135 1.65 +513000000 1.133 1.64 +512000000 1.131 1.63 +511000000 1.128 1.62 +510000000 1.126 1.61 +509000000 1.117 1.6 +508000000 1.121 1.6 +507000000 1.126 1.59 +506000000 1.129 1.58 +505000000 1.132 1.58 +504000000 1.134 1.57 +503000000 1.136 1.56 +502000000 1.137 1.55 +501000000 1.137 1.55 +500000000 1.137 1.54 +499000000 1.137 1.54 +498000000 1.136 1.54 +497000000 1.135 1.53 +496000000 1.133 1.53 +495000000 1.131 1.53 +494000000 1.128 1.53 +493000000 1.124 1.53 +492000000 1.12 1.52 +491000000 1.115 1.52 +490000000 1.11 1.52 +489000000 1.106 1.52 +488000000 1.101 1.52 +487000000 1.096 1.51 +486000000 1.092 1.51 +485000000 1.089 1.51 +484000000 1.086 1.51 +483000000 1.085 1.51 +482000000 1.083 1.5 +481000000 1.082 1.5 +480000000 1.08 1.5 +479000000 1.078 1.5 +478000000 1.077 1.5 +477000000 1.075 1.51 +476000000 1.074 1.51 +475000000 1.073 1.51 +474000000 1.073 1.51 +473000000 1.073 1.51 +472000000 1.075 1.52 +471000000 1.076 1.52 +470000000 1.076 1.52 +469000000 1.076 1.52 +468000000 1.074 1.52 +467000000 1.07 1.53 +466000000 1.065 1.53 0 0 +465000000 1.059 1.53 0.002 0.002 +464000000 1.051 1.53 0.003 0.003 +463000000 1.039 1.53 0.003 0.003 +462000000 1.024 1.54 0.004 0.004 +461000000 1.011 1.54 0.005 0.005 +460000000 0.997 1.54 0.006 0.006 +459000000 0.979 1.54 0.006 0.006 +458000000 0.96 1.54 0.007 0.007 +457000000 0.943 1.54 0.008 0.008 +456000000 0.928 1.54 0.008 0.008 +455000000 0.912 1.55 0.009 0.009 +454000000 0.899 1.55 0.010 0.010 +453000000 0.887 1.55 0.011 0.011 +452000000 0.876 1.55 0.011 0.011 +451000000 0.867 1.55 0.012 0.012 +450000000 0.859 1.55 0.013 0.013 +449000000 0.853 1.55 0.014 0.014 +448000000 0.849 1.55 0.014 0.014 +447000000 0.846 1.56 0.015 0.015 +446000000 0.843 1.56 0.016 0.016 +445000000 0.841 1.56 0.016 0.016 +444000000 0.839 1.56 0.017 0.017 +443000000 0.837 1.56 0.018 0.018 +442000000 0.836 1.57 0.019 0.019 +441000000 0.836 1.57 0.019 0.019 +440000000 0.837 1.57 0.02 0.02 +439000000 0.839 1.57 0.02 0.02 +438000000 0.842 1.57 0.02 0.02 +437000000 0.846 1.57 0.02 0.02 +436000000 0.852 1.57 0.02 0.02 +435000000 0.859 1.57 0.02 0.02 +434000000 0.866 1.57 0.02 0.02 +433000000 0.875 1.57 0.02 0.02 +432000000 0.884 1.57 0.02 0.02 +431000000 0.894 1.57 0.02 0.02 +430000000 0.904 1.57 0.02 0.02 +429000000 0.914 1.57 0.02 0.02 +428000000 0.925 1.57 0.02 0.02 +427000000 0.934 1.56 0.02 0.02 +426000000 0.942 1.56 0.02 0.02 +425000000 0.949 1.56 0.02 0.02 +424000000 0.956 1.56 0.02 0.02 +423000000 0.965 1.56 0.02 0.02 +422000000 0.974 1.55 0.02 0.02 +421000000 0.983 1.55 0.02 0.02 +420000000 0.992 1.55 0.02 0.02 +419000000 1.002 1.54 0.024 0.027 +418000000 1.01 1.54 0.028 0.033 +417000000 1.017 1.53 0.032 0.040 +416000000 1.023 1.52 0.036 0.046 +415000000 1.028 1.52 0.040 0.053 +414000000 1.032 1.51 0.044 0.059 +413000000 1.035 1.5 0.048 0.066 +412000000 1.036 1.49 0.052 0.072 +411000000 1.037 1.49 0.056 0.079 +410000000 1.036 1.48 0.060 0.085 +409000000 1.034 1.47 0.064 0.092 +408000000 1.032 1.46 0.068 0.098 +407000000 1.028 1.45 0.072 0.105 +406000000 1.023 1.44 0.076 0.111 +405000000 1.018 1.43 0.080 0.118 +404000000 1.011 1.42 0.084 0.124 +403000000 1.003 1.41 0.088 0.131 +402000000 0.995 1.4 0.092 0.137 +401000000 0.985 1.39 0.096 0.144 +400000000 0.975 1.38 0.1 0.15 +399000000 0.964 1.38 0.103 0.155 +398000000 0.953 1.38 0.105 0.160 +397000000 0.941 1.38 0.108 0.165 +396000000 0.929 1.37 0.110 0.170 +395000000 0.915 1.37 0.113 0.175 +394000000 0.901 1.37 0.115 0.180 +393000000 0.886 1.37 0.118 0.185 +392000000 0.87 1.36 0.120 0.190 +391000000 0.853 1.36 0.123 0.195 +390000000 0.836 1.36 0.125 0.200 +389000000 0.818 1.36 0.128 0.205 +388000000 0.801 1.36 0.130 0.210 +387000000 0.799 1.37 0.133 0.215 +386000000 0.798 1.37 0.135 0.220 +385000000 0.797 1.37 0.138 0.225 +384000000 0.797 1.37 0.140 0.230 +383000000 0.796 1.38 0.143 0.235 +382000000 0.796 1.38 0.145 0.240 +381000000 0.795 1.38 0.148 0.245 +380000000 0.795 1.38 0.15 0.25 +379000000 0.794 1.39 0.16 0.26 +378000000 0.794 1.39 0.17 0.27 +377000000 0.793 1.39 0.18 0.28 +376000000 0.792 1.39 0.19 0.29 +375000000 0.792 1.4 0.20 0.30 +374000000 0.793 1.4 0.21 0.31 +373000000 0.794 1.4 0.22 0.32 +372000000 0.8 1.4 0.23 0.33 +371000000 0.808 1.4 0.24 0.34 +370000000 0.818 1.41 0.25 0.35 +369000000 0.828 1.41 0.26 0.36 +368000000 0.838 1.41 0.27 0.37 +367000000 0.847 1.41 0.28 0.38 +366000000 0.856 1.42 0.29 0.39 +365000000 0.864 1.42 0.30 0.40 +364000000 0.873 1.42 0.31 0.41 +363000000 0.881 1.42 0.32 0.42 +362000000 0.889 1.43 0.33 0.43 +361000000 0.895 1.43 0.34 0.44 +360000000 0.901 1.43 0.35 0.45 +359000000 0.905 1.43 0.36 0.46 +358000000 0.907 1.43 0.37 0.47 +357000000 0.907 1.43 0.38 0.48 +356000000 0.905 1.43 0.39 0.49 +355000000 0.9 1.43 0.4 0.5 +354000000 0.895 1.43 0.408 0.51 +353000000 0.888 1.43 0.416 0.52 +352000000 0.88 1.43 0.424 0.53 +351000000 0.872 1.43 0.432 0.54 +350000000 0.864 1.43 0.440 0.55 +349000000 0.854 1.42 0.448 0.56 +348000000 0.843 1.4 0.456 0.57 +347000000 0.83 1.39 0.464 0.58 +346000000 0.817 1.37 0.472 0.59 +345000000 0.803 1.36 0.480 0.60 +344000000 0.789 1.34 0.488 0.61 +343000000 0.775 1.33 0.496 0.62 +342000000 0.763 1.31 0.504 0.63 +341000000 0.753 1.3 0.512 0.64 +340000000 0.744 1.28 0.520 0.65 +339000000 0.737 1.26 0.528 0.66 +338000000 0.731 1.24 0.536 0.67 +337000000 0.725 1.22 0.544 0.68 +336000000 0.72 1.2 0.552 0.69 +335000000 0.716 1.19 0.560 0.70 +334000000 0.712 1.17 0.568 0.71 +333000000 0.71 1.15 0.576 0.72 +332000000 0.708 1.13 0.584 0.73 +331000000 0.709 1.11 0.592 0.74 +330000000 0.711 1.09 0.6 0.75 +329000000 0.715 1.09 0.605 0.758 +328000000 0.721 1.09 0.61 0.767 +327000000 0.729 1.09 0.615 0.775 +326000000 0.736 1.09 0.62 0.783 +325000000 0.744 1.09 0.625 0.792 +324000000 0.751 1.09 0.63 0.800 +323000000 0.757 1.09 0.635 0.808 +322000000 0.764 1.09 0.64 0.817 +321000000 0.771 1.09 0.645 0.825 +320000000 0.777 1.09 0.65 0.833 +319000000 0.784 1.09 0.655 0.842 +318000000 0.79 1.1 0.66 0.850 +317000000 0.797 1.1 0.665 0.858 +316000000 0.804 1.11 0.67 0.867 +315000000 0.81 1.11 0.675 0.875 +314000000 0.817 1.11 0.68 0.883 +313000000 0.823 1.12 0.685 0.892 +312000000 0.83 1.12 0.69 0.900 +311000000 0.836 1.13 0.695 0.908 +310000000 0.843 1.13 0.7 0.917 +309000000 0.85 1.14 0.705 0.925 +308000000 0.857 1.15 0.71 0.933 +307000000 0.863 1.15 0.715 0.942 +306000000 0.865 1.16 0.72 0.950 +305000000 0.863 1.17 0.725 0.958 +304000000 0.859 1.18 0.73 0.967 +303000000 0.853 1.19 0.735 0.975 +302000000 0.845 1.19 0.74 0.983 +301000000 0.834 1.2 0.745 0.992 +300000000 0.822 1.21 0.75 1 +299000000 0.81 1.21 +298000000 0.801 1.21 +297000000 0.797 1.21 +296000000 0.796 1.21 +295000000 0.798 1.21 +294000000 0.8 1.21 +293000000 0.802 1.21 +292000000 0.808 1.21 +291000000 0.809 1.21 +290000000 0.811 1.21 +289000000 0.81 1.2 +288000000 0.807 1.18 +287000000 0.801 1.17 +286000000 0.793 1.15 +285000000 0.783 1.14 +284000000 0.771 1.13 +283000000 0.755 1.11 +282000000 0.737 1.1 +281000000 0.719 1.08 +280000000 0.702 1.07 +279000000 0.689 1.07 +278000000 0.678 1.08 +277000000 0.67 1.08 +276000000 0.662 1.08 +275000000 0.655 1.09 +274000000 0.649 1.09 +273000000 0.642 1.09 +272000000 0.634 1.1 +271000000 0.625 1.1 +270000000 0.614 1.11 +269000000 0.605 1.11 +268000000 0.597 1.11 +267000000 0.589 1.12 +266000000 0.582 1.12 +265000000 0.576 1.12 +264000000 0.57 1.13 +263000000 0.562 1.13 +262000000 0.555 1.13 +261000000 0.549 1.14 +260000000 0.543 1.14 +259000000 0.541 1.14 +258000000 0.539 1.14 +257000000 0.542 1.13 +256000000 0.549 1.13 +255000000 0.56 1.13 +254000000 0.578 1.13 +253000000 0.601 1.12 +252000000 0.629 1.12 +251000000 0.658 1.12 +250000000 0.678 1.12 +249000000 0.712 1.11 +248000000 0.757 1.11 +247000000 0.789 1.11 +246000000 0.802 1.11 +245000000 0.8 1.1 +244000000 0.788 1.1 +243000000 0.77 1.1 +242000000 0.751 1.1 +241000000 0.735 1.09 +240000000 0.727 1.09 +239000000 0.733 1.09 +238000000 0.755 1.09 +237000000 0.785 1.09 +236000000 0.805 1.09 +235000000 0.818 1.1 +234000000 0.821 1.1 +233000000 0.814 1.1 +232000000 0.796 1.1 +231000000 0.768 1.1 +230000000 0.736 1.1 +229000000 0.732 1.1 +228000000 0.728 1.1 +227000000 0.725 1.11 +226000000 0.722 1.11 +225000000 0.72 1.11 +224000000 0.718 1.11 +223000000 0.716 1.11 +222000000 0.715 1.12 +221000000 0.714 1.12 +220000000 0.713 1.12 +219000000 0.713 1.12 +218000000 0.713 1.12 +217000000 0.713 1.13 +216000000 0.714 1.13 +215000000 0.716 1.13 +214000000 0.717 1.13 +213000000 0.719 1.13 +212000000 0.72 1.14 +211000000 0.722 1.14 +210000000 0.723 1.14 +209000000 0.723 1.14 +208000000 0.721 1.13 +207000000 0.719 1.13 +206000000 0.716 1.12 +205000000 0.711 1.12 +204000000 0.705 1.12 +203000000 0.698 1.11 +202000000 0.691 1.11 +201000000 0.682 1.1 +200000000 0.673 1.1 +199000000 0.664 1.1 +198000000 0.655 1.1 +197000000 0.646 1.1 +196000000 0.636 1.1 +195000000 0.622 1.1 +194000000 0.609 1.09 +193000000 0.597 1.09 +192000000 0.586 1.09 +191000000 0.575 1.09 +190000000 0.554 1.09 +189000000 0.551 1.1 +188000000 0.555 1.1 +187000000 0.56 1.11 +186000000 0.566 1.11 +185000000 0.573 1.12 +184000000 0.584 1.12 +183000000 0.592 1.13 +182000000 0.6 1.13 +181000000 0.605 1.14 +180000000 0.608 1.14 +179000000 0.609 1.15 +178000000 0.611 1.15 +177000000 0.613 1.16 +176000000 0.612 1.17 +175000000 0.609 1.18 +174000000 0.6 1.18 +173000000 0.588 1.19 +172000000 0.58 1.2 +171000000 0.576 1.2 +170000000 0.574 1.21 +169000000 0.574 1.22 +168000000 0.573 1.22 +167000000 0.568 1.23 +166000000 0.56 1.23 +165000000 0.553 1.24 +164000000 0.548 1.25 +163000000 0.544 1.25 +162000000 0.54 1.26 +161000000 0.538 1.26 +160000000 0.536 1.27 +159000000 0.534 1.25 +158000000 0.531 1.22 +157000000 0.529 1.2 +156000000 0.527 1.17 +155000000 0.526 1.15 +154000000 0.526 1.12 +153000000 0.528 1.1 +152000000 0.531 1.07 +151000000 0.535 1.05 +150000000 0.537 1.02 +149000000 0.541 1.02 +148000000 0.544 1.01 +147000000 0.548 1.01 +146000000 0.552 1 +145000000 0.555 1 +144000000 0.558 1 +143000000 0.561 0.99 +142000000 0.563 0.99 +141000000 0.565 0.98 +140000000 0.567 0.98 +139000000 0.573 1.03 +138000000 0.581 1.09 +137000000 0.594 1.14 +136000000 0.61 1.2 +135000000 0.626 1.25 +134000000 0.642 1.3 +133000000 0.657 1.36 +132000000 0.671 1.41 +131000000 0.686 1.47 +130000000 0.702 1.52 +129000000 0.714 1.53 +128000000 0.724 1.54 +127000000 0.732 1.55 +126000000 0.737 1.56 +125000000 0.741 1.58 +124000000 0.742 1.59 +123000000 0.742 1.6 +122000000 0.742 1.61 +121000000 0.74 1.62 +120000000 0.738 1.63 +119000000 0.735 1.64 +118000000 0.731 1.65 +117000000 0.726 1.66 +116000000 0.721 1.67 +115000000 0.716 1.68 0.75 1 +114000000 0.705 1.69 0.767 1 +113000000 0.719 1.7 0.783 1 +112000000 0.731 1.71 0.800 1 +111000000 0.739 1.72 0.817 1 +110000000 0.747 1.73 0.833 1 +109000000 0.752 1.72 0.850 1 +108000000 0.756 1.71 0.867 1 +107000000 0.758 1.71 0.883 1 +106000000 0.758 1.7 0.900 1 +105000000 0.758 1.69 0.917 1 +104000000 0.758 1.68 0.933 1 +103000000 0.758 1.67 0.950 1 +102000000 0.757 1.67 0.967 1 +101000000 0.755 1.66 0.983 1 +100000000 0.754 1.65 1 1 +99000000 0.75 1.62 +98000000 0.745 1.59 +97000000 0.739 1.57 +96000000 0.732 1.54 +95000000 0.724 1.51 +94000000 0.716 1.48 +93000000 0.705 1.45 +92000000 0.693 1.43 +91000000 0.681 1.4 +90000000 0.671 1.37 +89000000 0.669 1.37 +88000000 0.677 1.36 +87000000 0.683 1.36 +86000000 0.688 1.35 +85000000 0.693 1.35 +84000000 0.697 1.35 +83000000 0.701 1.34 +82000000 0.704 1.34 +81000000 0.707 1.33 +80000000 0.709 1.33 +79000000 0.712 1.33 +78000000 0.716 1.33 +77000000 0.72 1.34 +76000000 0.725 1.34 +75000000 0.731 1.34 +74000000 0.737 1.34 +73000000 0.744 1.34 +72000000 0.751 1.35 +71000000 0.758 1.35 +70000000 0.764 1.35 +69000000 0.768 1.35 +68000000 0.771 1.35 +67000000 0.774 1.35 +66000000 0.78 1.35 +65000000 0.781 1.35 +64000000 0.78 1.35 +63000000 0.778 1.35 +62000000 0.777 1.35 +61000000 0.776 1.35 +60000000 0.774 1.35 +59000000 0.773 1.36 +58000000 0.771 1.37 +57000000 0.77 1.38 +56000000 0.767 1.39 +55000000 0.765 1.41 +54000000 0.765 1.42 +53000000 0.767 1.43 +52000000 0.771 1.44 +51000000 0.776 1.45 +50000000 0.782 1.46 +49000000 0.784 1.44 +48000000 0.784 1.41 +47000000 0.783 1.39 +46000000 0.779 1.36 +45000000 0.774 1.34 +44000000 0.768 1.32 +43000000 0.761 1.29 +42000000 0.754 1.27 +41000000 0.746 1.24 +40000000 0.739 1.22 +39000000 0.734 1.2 +38000000 0.731 1.18 +37000000 0.729 1.17 +36000000 0.728 1.15 +35000000 0.727 1.13 +34000000 0.729 1.11 +33000000 0.735 1.09 +32000000 0.743 1.08 +31000000 0.748 1.06 +30000000 0.753 1.04 +29000000 0.758 1.03 +28000000 0.764 1.03 +27000000 0.77 1.02 +26000000 0.777 1.02 +25000000 0.787 1.01 +24000000 0.8 1 +23000000 0.81 1 +22000000 0.817 0.99 +21000000 0.826 0.99 +20000000 0.839 0.98 +19000000 0.851 0.98 +18000000 0.868 0.98 +17000000 0.887 0.98 +16000000 0.9 0.98 +15000000 0.908 0.98 +14000000 0.912 0.98 +13000000 0.916 0.98 +12000000 0.92 0.98 +11000000 0.925 0.98 +10000000 0.932 0.98 +9000000 0.937 0.98 +8000000 0.941 0.98 +7000000 0.946 0.99 +6000000 0.955 0.99 +5000000 0.966 0.99 +4000000 0.971 0.99 +3000000 0.974 0.99 +2000000 0.979 1 +1000000 0.992 1 +0000000 1 1 1 1 diff --git a/code/forcings/organics_and_evaporites_area.xlsx b/code/forcings/organics_and_evaporites_area.xlsx new file mode 100644 index 0000000..ac0abc8 Binary files /dev/null and b/code/forcings/organics_and_evaporites_area.xlsx differ diff --git a/code/forcings/royer_fDfAw.xlsx b/code/forcings/royer_fDfAw.xlsx new file mode 100644 index 0000000..50c0bdb Binary files /dev/null and b/code/forcings/royer_fDfAw.xlsx differ diff --git a/code/forcings/shield_area.xlsx b/code/forcings/shield_area.xlsx new file mode 100644 index 0000000..fce63ab Binary files /dev/null and b/code/forcings/shield_area.xlsx differ diff --git a/code/paleo_local_paths_example.m b/code/paleo_local_paths_example.m new file mode 100644 index 0000000..1c17ef8 --- /dev/null +++ b/code/paleo_local_paths_example.m @@ -0,0 +1,19 @@ +classdef paleo_local_paths_example + % Global path defaults + % + % Copy and modify to define local output directory + % + % paleo_local_paths.m -- defines paths for all computers + % ['paleo_local_paths_' paleo_paths.getHostname() '.m'] -- defines paths for this computer only + + properties(Constant) + %outputdir = '..\..\..\..\PALEOoutput'; + %outputdir = 'E:\Dropbox\PALEOoutput'; + %outputdir = 'E:\PALEOoutput'; + outputdir = '/data/sd336/PALEOoutput'; + %outputdir = 'I:\sd336\PALEOoutput'; + end + + +end + diff --git a/code/paleo_paths.m b/code/paleo_paths.m new file mode 100644 index 0000000..ab8d0d6 --- /dev/null +++ b/code/paleo_paths.m @@ -0,0 +1,86 @@ +classdef paleo_paths + % Global path defaults + % To override, create a 'paleo_local_paths' class with outputdir property + + properties(Constant) + outputdir_rel = 'output'; % relative to ../PALEO/ + + end + + methods(Static) + function paleo_root = paleo_root() + % Full path to top-level PALEO directory + thisfile = mfilename('fullpath'); + + filesp = strfind(thisfile,filesep); % array of indices of / (or \) + + % .. PALEO\code\paleo_paths.m + % end-1 end + paleo_root = thisfile(1:filesp(end-1)); + end + + function outputdir = getOutputDir() + % override outputdir definition with local value ? + + % machine specific file + localmachinefile = ['paleo_local_paths_' paleo_paths.getHostname()]; + + if exist(localmachinefile,'class') && any(strcmp('outputdir',properties(localmachinefile))) + % try a machine specific version first + outputdir = paleo_paths.fixFileSep(eval(sprintf('%s.outputdir',localmachinefile))); + elseif exist('paleo_local_paths','class') && any(strcmp('outputdir',properties('paleo_local_paths'))) + % or a generic local version + outputdir = paleo_paths.fixFileSep(paleo_local_paths.outputdir); + else + % or the supplied standard version + outputdir = fullfile(paleo_paths.paleo_root(), paleo_paths.fixFileSep(paleo_paths.outputdir_rel)); + end + + if ~exist(outputdir, 'dir') + warning(['output dir\n%s\nis either not present or not a directory.\n' ... + '\nIf this path is correct, then please create the directory.\n' ... + '\nTo customize output path for all computer:\n' ... + 'create and edit ''paleo_local_paths.m''\n' ... + 'in directory ''%s'' ,\n' ... + '\nTo customize output path for this computer:\n' ... + 'create and edit ''%s''\n' ... + '\n(use paleo_local_paths_example.m as an example)'], ... + outputdir, .... + fullfile(paleo_paths.paleo_root(),'code'),... + [localmachinefile '.m'] ); + end + + + end + + function outputpath = getOutputPath(outputfile) + outputpath = fullfile(paleo_paths.getOutputDir(),outputfile); + end + + + + function hostname = getHostname() + % short version of computer name. + % Appears to work on Windows and linux + % + % eg to suffix machine-specific paths etc + + [ret, hostname] = system('hostname'); + + % trim trailing cr/lf (? or some invisible character..) + hostname = strtrim(hostname); + + % substitute illegal Matlab filename characters + % Matlab only allows letter, numbers, and underscores + hostname = strrep(hostname,'-','_'); + + end + + function path = fixFileSep(path) + % Replace \ / with appropriate platform defaults + path = strrep(path,'/',filesep); + path = strrep(path ,'\',filesep); + end + end +end + diff --git a/code/tests/test_Cisotopefrac.m b/code/tests/test_Cisotopefrac.m new file mode 100644 index 0000000..7567c2c --- /dev/null +++ b/code/tests/test_Cisotopefrac.m @@ -0,0 +1,27 @@ +% test_Cisotopefrac Plot copse_Cisotopefrac for testing +% +% See also: copse_Cisotopefrac + +pCO2PAL=[1 10 1 10]; +pO2PAL=[1 1 0.1 0.1]; + +TC=linspace(-10,30,100); + +for j=1:4 +for i=1:length(TC) + [d_locb(i), D_P(i), d_mocb(i), D_B(i), d_mccb(i), d_ocean(i), d_atmos(i)]=copse_Cisotopefrac(TC(i)+273,pCO2PAL(j),pO2PAL(j)); +end + +subplot(2,2,j); + +plot(TC,d_mccb,TC,d_mocb, TC,d_locb,TC,d_ocean,TC,d_atmos,TC,D_B,'--',TC,D_P,'--'); +xlabel('T C'); +ylabel('\delta^{13}C per mille'); +title(sprintf('pCO2PAL %g pO2PAL %g',pCO2PAL(j),pO2PAL(j))); + +h=legend('d_mccb','d_mocb','d_locb','d_ocean','d_atmos','D_B','D_P'); +legend boxoff; +set(h,'Interpreter','none'); + +ylim([-40 40]); +end \ No newline at end of file diff --git a/code/tests/test_G3_basalt_area.m b/code/tests/test_G3_basalt_area.m new file mode 100644 index 0000000..430615d --- /dev/null +++ b/code/tests/test_G3_basalt_area.m @@ -0,0 +1,10 @@ +% compare Mills etal (2014) G3 basalt area forcing from supp info vs xls in COPSE tree + +rba_xls = copse_force_revision_ba('BAavg', 'xls'); +rba_g3 = copse_force_revision_ba('BAavg', 'g3supp'); + +rba_diff = rba_xls.data.BAavg - rba_g3.data.BAavg; +figure; plot(rba_xls.data.timeMa, rba_diff); +xlabel('T (Ma)'); +title('Basalt area forcing G3 supp - COPSE xls'); +ylabel('diff .mat - .xls'); \ No newline at end of file diff --git a/code/tests/test_Stovec.m b/code/tests/test_Stovec.m new file mode 100644 index 0000000..22dacef --- /dev/null +++ b/code/tests/test_Stovec.m @@ -0,0 +1,57 @@ +classdef test_Stovec + % Test paleo_Stovec mapper + + + methods(Static) + function [stov, Sinit] = create() + % test mapping S -> vec + + Sinit.A = 1; + Sinit.B = 2; + Sinit.C = 10:13; + Sinit.D.dA = 100; + Sinit.D.dB = 200; + Sinit.D.dC = 1000:1003; + Sinit.E.dA = 10000; + Sinit.E.dB = 20000; + Sinit.E.dC = 100000:100003; + Sinit.E.dE = 100010:100013; + + Sinit + Sinit.D + Sinit.E + + %stov = paleo_Stovec(Sinit, 'field'); + stov = paleo_structtovec(Sinit, 1, 'field'); + end + + function [stov, Sinit] = StovtoS() + [stov, Sinit] = test_Stovec.create(); + + y = stov.struct2vector(Sinit); + + for i=1:length(y) + fprintf('y(%g) = %g ',i,y(i)); + end + fprintf('\n'); + + Smap = stov.vector2struct(y'); + + Smap + + ymap = stov.struct2vector(Smap); + + ndiff = 0; + for i=1:length(y) + fprintf('y(%g) = %g, ymap(%g) = %g, diff %g ',i,y(i),i,ymap(i)); + if ymap(i) ~= y(i) + ndiff = ndiff + 1; + end + end + fprintf('\n'); + fprintf('ndiff %g\n',ndiff); + end + end + +end + diff --git a/code/tests/test_TempCK1992.m b/code/tests/test_TempCK1992.m new file mode 100644 index 0000000..8d6cdb7 --- /dev/null +++ b/code/tests/test_TempCK1992.m @@ -0,0 +1,41 @@ +% Check numerical consistency of copse_TempCK1992 temperature function +% No implication the values used here are within the domain of validity of +% the approximation used +% See also copse_TempCK1992 + +presentluminosity = 1368; %present day +tempcorrect = 0.194; +CtoK = 273.15; + +%display pre-ind mean T +myfun = @(oldT) copse_TempCK1992(presentluminosity, 280e-6, oldT) + tempcorrect - oldT; +TempPreInd = fzero(myfun, [200 400]); +fprintf('TempPreInd %g C for pCO2 %g ppm\n',TempPreInd-CtoK, 280); + +%check doesn't crash for wide range of parameter values +pCO2atmgrid=logspace(log10(20e-6),log10(20000e-6),100); +fraclumgrid=[1.1 1.0 0.8]; + +for j=1:length(fraclumgrid) + luminosity = fraclumgrid(j)*presentluminosity; + for i=1:length(pCO2atmgrid); + % Example code to find solution iteratively: + myfun = @(oldT) copse_TempCK1992(luminosity, pCO2atmgrid(i), oldT) + tempcorrect - oldT; + Temp(i) = fzero(myfun, [200 400]); + [ dummyuncorrectedT, albedo(i), Tgh(i), Teff(i) ] = copse_TempCK1992(luminosity, pCO2atmgrid(i), Temp(i)); + end + + subplot(2,3,j) + semilogx(pCO2atmgrid,Temp-CtoK,pCO2atmgrid,Tgh,pCO2atmgrid,Teff-CtoK); + h=legend('Temp','Tgh','Teff'); + legend boxoff; + xlabel('pCO2 (atm)'); + ylabel('T C'); + title(sprintf('Solar lum %g %g W m^{-2}',fraclumgrid(j),luminosity)); + + subplot(2,3,j+length(fraclumgrid)) + semilogx(pCO2atmgrid,albedo); + xlabel('pCO2 (atm)'); + ylabel('albedo'); + title(sprintf('Solar lum %g %g W m^{-2}',fraclumgrid(j),luminosity)); +end \ No newline at end of file diff --git a/code/tests/test_copse_load_phanlip.m b/code/tests/test_copse_load_phanlip.m new file mode 100644 index 0000000..7ec46db --- /dev/null +++ b/code/tests/test_copse_load_phanlip.m @@ -0,0 +1,377 @@ +function test_copse_load_phanlip(lipvers) + +% Test LIP and Vandermeer degassing forcings +% Updated for revised G3 paper + +%version = 'G3sub'; +%version = 'G3rev'; + + + + +% present day CFB area +present_day_CFB_area = 4.8e6; % km2 + +switch lipvers + case 'mills2014g3' + + smoothempl = false; + LIPtrange = [-Inf Inf]; % include all lips + + % time grid for plotting CO2 release etc + Tstart = -500e6; + Tend = 0; + tgrid = Tstart:1e4:Tend; + + % OIB area from degassing forcing + % set extrapolation for oib_area to first/last datapoint + forcedegass = copse_force_vandermeer('Davg', 3); + % calculate forcings on tgrid + D=struct; + Ddegasav = forcedegass.force(tgrid , D); + forcedegass.estimate = 'Dmin'; + Ddegasmin = forcedegass.force(tgrid , D); + forcedegass.estimate = 'Dmax'; + Ddegasmax = forcedegass.force(tgrid , D); + + + % Compare OIB and LIP basalt area to precalculated composite datafile + % time range to calculate RMS for basalt area + t_area_comp_range = [-300e6 Inf]; + % select indices to include in RMS error calculation + it = (tgrid > t_area_comp_range(1)) & (tgrid < t_area_comp_range(2)); + % error tolerance + maxRMS = 1e-2; + % Read precalculated composite basalt area + forceba = copse_force_revision_ba('BAavg', 'g3supp'); + Dfield = 'BA'; + D = struct; + Dbaavg = forceba.force(tgrid , D); + forceba.estimate = 'BAmin'; + Dbamin = forceba.force(tgrid , D); + forceba.estimate = 'BAmax'; + Dbamax = forceba.force(tgrid , D); + + case 'copseRL' + + smoothempl = false; + LIPtrange = [-Inf Inf]; % include all lips + + % time grid for plotting CO2 release etc + Tstart = -800e6; + Tend = 0; + tgrid = Tstart:1e4:Tend; + + % OIB area from degassing forcing + forcedegass = copse_force_haq_D(); + % calculate forcings on tgrid + D=struct; + Ddegasav = forcedegass.force(tgrid , D); + Ddegasmin = Ddegasav; + Ddegasmax = Ddegasav; + + % Compare OIB and LIP basalt area to precalculated composite datafile + % No precalculated total basalt area, so use G3 + fprintf('No precalculated total basalt area, comparing to G3 (2014)\n'); + % time range to calculate RMS for basalt area + t_area_comp_range = [-300e6 Inf]; + % select indices to include in RMS error calculation + it = (tgrid > t_area_comp_range(1)) & (tgrid < t_area_comp_range(2)); + % set error tolerance high to disable check + maxRMS = 1; + % Read precalculated composite basalt area + forceba = copse_force_revision_ba('BAavg', 'g3supp'); + Dfield = 'BA'; + D = struct; + Dbaavg = forceba.force(tgrid , D); + forceba.estimate = 'BAmin'; + Dbamin = forceba.force(tgrid , D); + forceba.estimate = 'BAmax'; + Dbamax = forceba.force(tgrid , D); + + case {'copseRL_jw', 'copseRL_jw_revisedAreas'} + % work in progress extending LIP table + smoothempl = false; + LIPtrange = [-Inf Inf]; % include all lips + + % time grid for plotting CO2 release etc + Tstart = -900e6; + Tend = 0; + tgrid = Tstart:1e4:Tend; + + % OIB area from degassing forcing + forcedegass = copse_force_haq_D(); + % calculate forcings on tgrid + D=struct; + Ddegasav = forcedegass.force(tgrid , D); + Ddegasmin = Ddegasav; + Ddegasmax = Ddegasav; + + % Compare OIB and LIP basalt area to precalculated composite datafile + fprintf('comparing to copse_force_BA_jw\n'); + % time range to calculate RMS for basalt area + t_area_comp_range = [-900e6 Inf]; + % select indices to include in RMS error calculation + it = (tgrid > t_area_comp_range(1)) & (tgrid < t_area_comp_range(2)); + % set error tolerance high to disable check + maxRMS = 1; + % Read precalculated composite basalt area + forceba = copse_force_BA_jw('BAavg'); + Dfield = 'BA'; + D = struct; + Dbaavg = forceba.force(tgrid , D); + forceba.estimate = 'BAmin'; + Dbamin = forceba.force(tgrid , D); + forceba.estimate = 'BAmax'; + Dbamax = forceba.force(tgrid , D); + + otherwise + error('unrecognized lipvers %s', lipvers); +end + + +% Load the LIP database +phanlip = copse_load_phanlip(lipvers); + +% Create list of LIPs, no CO2 +[forcegridlipsNoCO2, default_lambda, lipsNoCO2] = phanlip.create_LIP_forcing(Tstart, Tend, 'NoCO2', present_day_CFB_area, LIPtrange, smoothempl); +fprintf('default_lambda = %g yr-1 to match present day CFB area %g km2\n', default_lambda, present_day_CFB_area); +% composite forcing, no interpolation to grid +forcelipsNoCO2 = copse_force_composite(lipsNoCO2); + +% Create list of all LIPs, with min and max CO2 release +% This should be two near-identical lists, differing only in 'co2_potential' +lipsCO2min = phanlip.create_LIPs('CO2min', default_lambda, LIPtrange, smoothempl); +lipsCO2max = phanlip.create_LIPs('CO2max', default_lambda, LIPtrange, smoothempl); +% composite forcing, no interpolation to grid +forcelipsCO2max = copse_force_composite(lipsCO2max); + +% test 'high' value for basalt area, combination of x1.5 on area and delayed exponential weathering, +bahigh_areafac = 1.5; % multiplier for LIP area +bahigh_decayoffset = 1e7; %%% wait before erosion begins. +[forcegridlipsNoCO2highBA, bahigh_lamb, lipsNoCO2highBA] = phanlip.create_LIP_forcing(Tstart, Tend, 'NoCO2', present_day_CFB_area, LIPtrange, smoothempl, ... + bahigh_areafac, bahigh_decayoffset); +fprintf('bahigh_lamb = %g yr-1 to match present day CFB area %g km2\n', bahigh_lamb, present_day_CFB_area); + +% Build lists of LIP properties +[CFBNoCO2time, CFBNoCO2Area, ~] = merge_LIPs(lipsNoCO2); +[CFBtime, ~, CFB_CO2min] = merge_LIPs(lipsCO2min); +[CFBtime, ~, CFB_CO2max] = merge_LIPs(lipsCO2max); + +%%%% plot bar chart of Phanerozoic CFB area +figure; + +subplot(2,3,1); +bar(CFBNoCO2time,CFBNoCO2Area) +ylabel('Area (km^{2})') +xlabel('Time (Ma)') +title('Phanerozoic CFB area'); + +%%%% plot bar chart of CFB CO2 release + +subplot(2,3,2) +bar(CFBtime,CFB_CO2min,'b') +ylabel('CO2 potential (min) (mol)') +xlabel('Time (Ma)') +title('CO2 potential (min)'); + +%%%% plot bar chart of total CO2 release +subplot(2,3,3) +bar(CFBtime,CFB_CO2max,'r') +ylabel('CO2 potential (max) (mol)') +xlabel('Time (Ma)') +title('CO2 potential (max)'); + +%%% cumulative CO2 release +subplot(2,3,4); +D.CFB_area= zeros(1,length(tgrid)); +D.LIP_CO2 = zeros(1,length(tgrid)); +D.LIP_CO2moldelta = zeros(1,length(tgrid)); +DAllCO2max = forcelipsCO2max.force(tgrid, D); +plot(tgrid,DAllCO2max.LIP_CO2); +title('CO2 release rate (max)') +ylabel('CO2 release (mol yr^{-1})'); +xlabel('Time (Ma)') + + +%%% plot each individual CO2 release curve +subplot(2,3,5); +lgds = {}; +for n = 1:length(lipsCO2max) + D.CFB_area= zeros(1,length(tgrid)); + D.LIP_CO2 = zeros(1,length(tgrid)); + D.LIP_CO2moldelta = zeros(1,length(tgrid)); + D = lipsCO2max{n}.force(tgrid, D); + + plot(tgrid,D.LIP_CO2); + lgds{end+1} = lipsCO2max{n}.Name; + hold on +end +title('CO2 release rate (max, individual LIPS)') +ylabel('CO2 release (mol yr^{-1})'); +xlabel('Time (Ma)') +legend(lgds); + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Test CFB area forcing +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +figure; + +% Plot CFB area for individual LIPs +subplot(2,3,1) +for n = 1:length(lipsNoCO2) + D.CFB_area= zeros(1,length(tgrid)); + D.LIP_CO2 = zeros(1,length(tgrid)); + D.LIP_CO2moldelta = zeros(1,length(tgrid)); + D = lipsNoCO2{n}.force(tgrid, D); + plot(tgrid,D.CFB_area); + hold on +end + +title('Area (continental LIPs) (km^2)') +ylabel('area km^2'); +xlabel('Time (Ma)') + +% Plot cumulative CFB area and OIB area +subplot(2,3,4) +% standard CFB area forcing +D.CFB_area= zeros(1,length(tgrid)); +D.LIP_CO2 = zeros(1,length(tgrid)); +D.LIP_CO2moldelta = zeros(1,length(tgrid)); +DstandardCFB = forcelipsNoCO2.force(tgrid, D); +plot(tgrid,DstandardCFB.CFB_area,'g'); +hold on +% overlay gridded version (should be identical) +D.CFB_area= zeros(1,length(tgrid)); +D.LIP_CO2 = zeros(1,length(tgrid)); +D.LIP_CO2moldelta = zeros(1,length(tgrid)); +DgridCFB = forcegridlipsNoCO2.force(tgrid, D); +plot(tgrid,DgridCFB.CFB_area,'b'); +hold on +% 'high' CFB area forcing +D.CFB_area= zeros(1,length(tgrid)); +D.LIP_CO2 = zeros(1,length(tgrid)); +D.LIP_CO2moldelta = zeros(1,length(tgrid)); +DhighCFB = forcegridlipsNoCO2highBA.force(tgrid, D); +plot(tgrid,DhighCFB.CFB_area,'c'); +hold on + +%overlay OIB estimated from degassing forcing +plot(tgrid,Ddegasav.oib_area,'r') +plot(tgrid,Ddegasmin.oib_area,'r--') +plot(tgrid,Ddegasmax.oib_area,'r--') +title('Area: Cont LIPS (g,b, c high), OIB (r) (km^2)') +ylabel('area km^2'); +xlabel('Time (Ma)') + +presentdaybasaltarea = DstandardCFB.CFB_area(end) + Ddegasav.oib_area(end); +presentdaybasaltareahigh = DhighCFB.CFB_area(end) + Ddegasav.oib_area(end); +fprintf('present day (t=%g yr) basalt areas km2: CFB %g CFBhigh %g OIB (av) %g total %g total_high %g\n',... + tgrid(end), DstandardCFB.CFB_area(end),DhighCFB.CFB_area(end), Ddegasav.oib_area(end), presentdaybasaltarea,presentdaybasaltareahigh); + + + +% 'standard' LIP area +subplot(2, 3, 2); +plot(tgrid,(Ddegasav.oib_area + DstandardCFB.CFB_area)/presentdaybasaltarea ,'r') +hold on +plot(tgrid,(Ddegasmin.oib_area + DstandardCFB.CFB_area)/presentdaybasaltarea ,'r--') +plot(tgrid,(Ddegasmax.oib_area + DstandardCFB.CFB_area)/presentdaybasaltarea ,'r--') +if ~isempty(forceba) + plot(tgrid,Dbaavg.(Dfield) ,'g') + plot(tgrid,Dbamin.(Dfield) ,'g--') + plot(tgrid,Dbamax.(Dfield) ,'g--') +end +title('OIB(av,min,max)+CFB(r), BA avg(g),min/max(g--)') +ylabel('Relative area') +xlabel('Time (Ma)') + +subplot(2, 3, 5); +if ~isempty(forceba) + barel_diff = (Ddegasav.oib_area + DstandardCFB.CFB_area)/presentdaybasaltarea-Dbaavg.(Dfield); + % calculate mean sq error between precalculated basalt area and LIP-based calculation + meansqerr_standard = (sum(barel_diff(it).^2)/length(tgrid(it)))^0.5; + fprintf('mean sq error in total basalt area (%g < t < %g): "standard" %g\n', ... + t_area_comp_range(1), t_area_comp_range(2), meansqerr_standard); + if meansqerr_standard > 1e-2 + warning('area comparison fails - error %g > %g', meansqerr_standard, maxRMS); + end + plot(tgrid, barel_diff); + title('(OIB(av)+CFB(r))/(present day area) - BA (avg)') + ylabel('diff normalized area') + xlabel('Time (Ma)') +else + title('No comparison total basalt area forcing'); +end + +% 'high' LIP area +subplot(2, 3, 3); +plot(tgrid,(Ddegasav.oib_area + DhighCFB.CFB_area)/presentdaybasaltareahigh ,'b') +hold on; +plot(tgrid,(Ddegasmin.oib_area + DhighCFB.CFB_area)/presentdaybasaltareahigh ,'b--') +plot(tgrid,(Ddegasmax.oib_area + DhighCFB.CFB_area)/presentdaybasaltareahigh ,'b--') +if ~isempty(forceba) + plot(tgrid,Dbaavg.(Dfield) ,'g') + plot(tgrid,Dbamin.(Dfield) ,'g--') + plot(tgrid,Dbamax.(Dfield) ,'g--') +end +title('OIB(av,min,max)+CFB high(b), BA avg(g),min/max(g--)') +ylabel('Relative area') +xlabel('Time (Ma)') + +subplot(2, 3, 6); +if ~isempty(forceba) + % calculate mean sq error between precalculated basalt area and LIP-based calculation + barelhigh_diff = (Ddegasav.oib_area + DhighCFB.CFB_area)/presentdaybasaltareahigh-Dbamax.(Dfield); + meansqerr_high = (sum((barelhigh_diff(it)).^2)/length(tgrid(it)))^0.5; + fprintf('mean sq error in total basalt area (%g < t < %g): "high" %g\n', ... + t_area_comp_range(1), t_area_comp_range(2), meansqerr_high); + if meansqerr_high > 1e-2 + warning('area comparison fails - error %g > %g', meansqerr_high, maxRMS); + end + plot(tgrid, barelhigh_diff); + title('(OIB(av)+CFB high(r))/(present day area) - BA (max)') + ylabel('diff normalized area') + xlabel('Time (Ma)') +else + title('No comparison total basalt area forcing'); +end + +end + +function [time, CFBArea, CO2] = merge_LIPs(lips) + % merge lips occuring at same time + % Args: + % lips (cell array of copse_force_LIP): lip forcings, possibly several events at same time + % Returns: + % time (vector): emplacement time + % CFBArea (vector): initial emplaced area + % CO2 (vector): CO2 + + time = []; CFBArea = []; CO2= []; + + % merge duplicate ages into one list + curr_time = lips{1}.liptime; + curr_area = lips{1}.peakCFBarea; + curr_CO2 = lips{1}.co2_potential; + + for i=2:length(lips) + if lips{i}.liptime ~= curr_time + time(end+1) = curr_time; + CFBArea(end+1) = curr_area; + CO2(end+1) = curr_CO2; + curr_time = lips{i}.liptime; + curr_area = lips{i}.peakCFBarea; + curr_CO2 = lips{i}.co2_potential; + else + curr_area = curr_area + lips{i}.peakCFBarea; + curr_CO2 = curr_CO2 + lips{i}.co2_potential; + end + end + time(end+1) = curr_time; + CFBArea(end+1) = curr_area; + CO2(end+1) = curr_CO2; +end + \ No newline at end of file diff --git a/code/tests/test_copse_weathering.m b/code/tests/test_copse_weathering.m new file mode 100644 index 0000000..072c60e --- /dev/null +++ b/code/tests/test_copse_weathering.m @@ -0,0 +1,38 @@ +% Test copse weathering functions + +CtoK = 273.15; + +TgridC=linspace(5,30,100); + +powT = 1; + +for i=1:length(TgridC) + f_T(i)=copse_f_T(TgridC(i)+CtoK); + g_T(i)=copse_g_T(TgridC(i)+CtoK); + pow_T(i)=power(TgridC(i)/15,powT); +end + +figure; + +subplot(1,2,1); +plot(TgridC,f_T,TgridC,g_T,TgridC,pow_T); +xlabel('T C'); +ylabel('Relative weath rate'); +legend('f_T (sil)','g_T (carb)',sprintf('pow T %g',powT)); +title('T dependence'); + +CO2gridPAL=logspace(-1,2,100); + +for i=1:length(CO2gridPAL) + preplant(i) = CO2gridPAL(i)^0.5 ; + plant(i) = ( 2*CO2gridPAL(i) / (1 + CO2gridPAL(i)) )^0.4 ; +end + +plantenhance =0.15; + +subplot(1,2,2); +semilogx(CO2gridPAL,plantenhance*preplant,CO2gridPAL,(1-plantenhance)*plant); +xlabel('pCO2 (PAL)'); +ylabel('Relative weath rate'); +legend(sprintf('preplant*%g',plantenhance),sprintf('plantenhance*%g',(1-plantenhance))); +title('pCO_2 dependence'); diff --git a/code/tests/test_plot.m b/code/tests/test_plot.m new file mode 100644 index 0000000..db0b6bb --- /dev/null +++ b/code/tests/test_plot.m @@ -0,0 +1,7 @@ +%%%%% run this file to test the proxydata plot +plotter = paleo_plotlist ; +plotter.listplots = {'dataO2'; 'dataCO2'; 'dataSO4'; 'datad13C'; 'datad34S'; 'data8786Sr'; 'datad7Li'; 'datad44Ca'; 'data187188Os' } ; +% plotter.listplots = {'O2'; 'CO2'; 'SO4'; 'd34S'; 'd7Li'; 'd44Ca'; '187188Os'} ; +plotter.plotters = {@copse_plot_proxydata} ; +% plotter.plotlist('',[3.9e9 4.5e9],'','') ; +plotter.plotlist('',[run.T(1) run.T(end)],'',run) ; \ No newline at end of file diff --git a/code/tests/test_uplift.m b/code/tests/test_uplift.m new file mode 100644 index 0000000..070e9cf --- /dev/null +++ b/code/tests/test_uplift.m @@ -0,0 +1,40 @@ +% plot erosion / uplift forcings + +tgrid = -600e6:1e6:0; +D.UPLIFT=zeros(1,length(tgrid)); + +% Bergman (2004) COPSE forcings +udwe_bergman2004 = copse_force_UDWEbergman2004(0); +udwe_bergman2004.doD = 0; +udwe_bergman2004.doW = 0; +udwe_bergman2004.doE = 0; + +Dberg2004 = udwe_bergman2004.force(tgrid,D); + +% Berner / Ronov GEOCARB III (2001) uplift +u_br = copse_force_U_berner_ronov(0); +Dbr = u_br.force(tgrid,D); + +figure; +plot(tgrid,Dberg2004.UPLIFT); +hold all +plot(tgrid,Dbr.UPLIFT); +legend('Berg2004','GEOCARBIII'); +xlabel('time yr'); +ylabel('Uplift/erosion (rel)'); + +% Godderis (2014) Paleogeog weathering enhancement + +pg = copse_force_PG_godderis(0); +D.PG = zeros(1,length(tgrid)); +Dpg = pg.force(tgrid,D); + +figure; +plot(tgrid,Dpg.PG); +xlabel('time yr'); +ylabel('Paleogeog (rel)'); + + + + + diff --git a/code/utils/copse_diff.m b/code/utils/copse_diff.m new file mode 100644 index 0000000..555584b --- /dev/null +++ b/code/utils/copse_diff.m @@ -0,0 +1,32 @@ +function [ tcomp, diff, diffRMS ] = copse_diff( tlimits, diffRMSmethod, timeA, fieldA, timeB, fieldB, tcstart ) + +% Calculate RMS difference of two time-series input fields +% Both fields are interpolated to a common grid at 1e6 yr intervals + +if nargin < 7 + tcstart = 2; %first point to include (ie omit first 1e6 yr to avoid startup transients) +end + +%set region for error comparison with C514 output +tcomp = tlimits(1):1e6:tlimits(2); %uniform grid + + +%Interpolate onto tcomp grid for comparison +A_interp = interp1(timeA, fieldA,tcomp); + +%Interpolate onto tcomp grid for comparison +B_interp = interp1(timeB, fieldB,tcomp); + +diff = B_interp - A_interp; + +switch diffRMSmethod + case 'frac' + diffRMS = sqrt(sum((diff(tcstart:end)./A_interp(tcstart:end)).^2)/length(diff(tcstart:end))); + case 'diff' + diffRMS = sqrt(sum(diff(tcstart:end).^2)/length(diff(tcstart:end))); + otherwise + error('unrecognized diffRMSmethod %s', diffRMSmethod); +end + +end + diff --git a/code/utils/copse_fig.m b/code/utils/copse_fig.m new file mode 100644 index 0000000..54cf3d8 --- /dev/null +++ b/code/utils/copse_fig.m @@ -0,0 +1,186 @@ +classdef copse_fig + + methods(Static) + function xlim(limits, figs, direction) + % COPSE_FIG.XLIM reset x axes of all subpanels within specified figures + % + % limits - [xmin xmax] + % figs - 1, 1:4 etc + % direction - 'normal' or 'reverse' + + if nargin < 2 + figs = gcf; + end + + if nargin < 3 + direction = 'normal'; + end + + %iterate through the supplied list of figures + for fig = figs + % find axes in figure, avoiding legends + hlist=findobj(fig,'Type','axes','-not','Tag','legend'); + for hi=1:length(hlist) + xlim(hlist(hi),limits); + set(hlist,'XDir',direction); % see 'Axes Properties' help page + end + end + end + + function ylim(limits, figs, direction) + % COPSE_FIG.YLIM reset Y axes of all subpanels within specified figures + % + % limits - [ymin ymax] + % figs - 1, 1:4 etc + % direction - 'normal' or 'reverse' + + if nargin < 2 + figs = gcf; + end + + if nargin < 3 + direction = 'normal'; + end + + %iterate through the supplied list of figures + for fig = figs + % find axes in figure, avoiding legends + hlist=findobj(fig,'Type','axes','-not','Tag','legend'); + for hi=1:length(hlist) + ylim(hlist(hi),limits); + set(hlist,'YDir',direction); % see 'Axes Properties' help page + end + end + end + + function expand(figs, figfrac) + % Expand figures - NB on some Windows Matlab versions, each figure takes ~ 6MB of Java Heap memory + % which has a relatively small available ~128MB by default + % + % figs - 1, 1:4 etc + % figfrac - fraction of screen + if nargin < 1 + figs = gcf; + end + + if nargin < 2 + figfrac = 0.8; + end + + % Make figure windows as large as possible and slightly non-overlapping + % ScreenSize is a four-elementvector: [left, bottom, width, height]: + scrsz = get(0,'ScreenSize'); + + + %iterate through the supplied list of figures + ifig = 1; + for fig = figs + figsz = [scrsz(3)*(1-figfrac)-ifig*50 scrsz(4)*(1-figfrac)-ifig*100 scrsz(3)*figfrac scrsz(4)*figfrac]; + set(fig,'Position',figsz); + figure(fig); + ifig = ifig + 1; + end + end + + + function printpdf(fh, pdfname,sz,scx,scy, addfname) + % print specified figure full-size on A4 paper + % + % Input: + % fh - figure handle (number) + % pdfname - filename for output + % sz - (optional, default 's') 'f' or 'l' (full A4 size) or 's' (square) + % scx,scy - (optional, default 1.0, 1.0) fractional size for output x,y + % addfname - (optional, default 1). 1 to add a text label with output + % filename, 0 to not add label. + % + % SD 2010-11-29 add comments for 'help' + % + % see MATLAB->Graphics->Printing and Exporting->Changing a Figure's settings + + if nargin < 3 + sz = 's'; + end + + if nargin < 4 + scx = 1.0; + end + + if nargin < 5 + scy=scx; + end + + if nargin < 6 + addfname = 1; + end + + figure(fh); + if addfname + %location in 'normalized' plot coordinates (bottom left (0,0) top right (1,1) + xloc=0.0; + yloc=0.0; + box=annotation('textbox',[xloc yloc 1.0 0.05]); + btxt=[' ' (fullfile(pwd, pdfname))]; + set(box,'String',btxt,'Interpreter','none','Fontsize',6,'FitBoxToText','on'); + set(box,'LineStyle','none'); + set(box,'VerticalAlignment','bottom'); + end + + % see Matlab 'help print' + set(fh,'PaperType','A4'); + + + if strcmp(sz,'f') + orient('portrait'); + psize=get(gcf,'PaperSize'); + %20.9840 29.6774 + hzps=psize(1); + vtps=psize(2); + hzbord=0.6; + vtbord=2; + hzsz=hzps-hzbord*2; + vtsz=vtps-vtbord*2; + elseif strcmp(sz,'l') + orient('landscape'); + psize=get(gcf,'PaperSize'); + %20.9840 29.6774 + hzps=psize(1); + vtps=psize(2); + hzbord=2; + vtbord=0.6; + hzsz=hzps-hzbord*2; + vtsz=vtps-vtbord*2; + elseif strcmp(sz,'s'); + orient('portrait'); + psize=get(gcf,'PaperSize'); + %20.9840 29.6774 + hzps=psize(1); + vtps=psize(2); + hzbord=0.6; + hzsz=hzps-hzbord*2; + vtsz=hzsz; + vtbord=0.5*(vtps-vtsz); + else + error('unknown paper size',sz); + end + + set(fh,'PaperPosition',[hzbord vtbord hzsz*scx vtsz*scy]); + %defaults get(gcf,'PaperPosition') + %rect = [left, bottom, width, height] + %0.6345 6.3452 20.3046 15.2284 + % which look wrong!? (width goes to extreme rh edge with border 0.6 at lh?) + + %SD 2010-07-29 '-painters' sets rendering algorithm + %Matlab appears to be buggy here (or at least have cryptic behaviour) + %sometimes it uses this by default, sometimes it uses something else and + %produces blocky output + print(['-f' num2str(fh)],'-dpdf',pdfname, '-painters'); + %print(['-f' num2str(fh)],'-dpdf',pdfname, '-zbuffer'); + + if addfname + set(box,'String',''); + end + end + + end +end \ No newline at end of file diff --git a/code/utils/copse_interp1.m b/code/utils/copse_interp1.m new file mode 100644 index 0000000..0d18db0 --- /dev/null +++ b/code/utils/copse_interp1.m @@ -0,0 +1,14 @@ +function [ yi ] = copse_interp1( x, Y, xi ) +% COPSE_INTERP1 Wrapper for alternative 1-d interpolation functions +% +% Matlab interp1 is remarkably slow but safe. Fast routines do no error checking. +% This wrapper allows easy switching so if speed becomes an issue, +% we can temporarily switch to fast interpolation. +% Default setting should be interp1 so we catch errors. + +%yi = interp1(x,Y,xi); +yi = interp1qr(x,Y,xi); % this imposes an additional requirement for x , xi to be _column_ vectors + + +end + diff --git a/code/utils/interp1qr.m b/code/utils/interp1qr.m new file mode 100644 index 0000000..ad7dd3a --- /dev/null +++ b/code/utils/interp1qr.m @@ -0,0 +1,80 @@ +function yi = interp1qr(x,y,xi) +%% Quicker 1D linear interpolation +% Performs 1D linear interpolation of 'xi' points using 'x' and 'y', +% resulting in 'yi', following the formula yi = y1 + (y2-y1)/(x2-x1)*(xi-x1). +% Returns NaN for values of 'xi' out of range of 'x', and when 'xi' is NaN. +% +% 'x' is column vector [m x 1], monotonically increasing. +% 'y' is matrix [m x n], corresponding to 'x'. +% 'xi' is column vector [p x 1], in any order. +% 'yi' is matrix [p x n], corresponding to 'xi'. +% +% Copyright (c) 2013 Jose M. Mier +% + +%% Full function description +% Quicker 1D linear interpolation: 'interp1qr' +% Performs 1D linear interpolation of 'xi' points using 'x' and 'y', +% resulting in 'yi', following the formula yi = y1 + (y2-y1)/(x2-x1)*(xi-x1). +% +% It has same functionality as built-in MATLAB function 'interp1q' (see +% MATLAB help for details). +% +% It runs at least 3x faster than 'interp1q' and 8x faster than 'interp1', +% and more than 10x faster as m=length(x) increases (see attached performance +% graph). +% +% As with 'interp1q', this function does no input checking. To work properly +% user has to be aware of the following: +% - 'x' must be a monotonically increasing column vector. +% - 'y' must be a column vector or matrix with m=length(x) rows. +% - 'xi' must be a column vector. +% +% As with 'interp1q', if 'y' is a matrix, then the interpolation is performed +% for each column of 'y', in which case 'yi' is p=length(xi) by n=size(y,2). +% +% As with 'interp1q', this function returns NaN for any values of 'xi' that +% lie outside the coordinates in 'x', and when 'xi' is NaN. +% +% This function uses the approach given by Loren Shure (The MathWorks) in +% http://blogs.mathworks.com/loren/2008/08/25/piecewise-linear-interpolation/ +% - Uses the function 'histc' to get the 'xi_pos' vector. +% - Also uses a small trick to rearrange the linear operation, such that +% yi = y1 + s*(xi-x1), where s = (y2-y1)/(x2-x1), now becomes +% yi = y1 + t*(y2-y1), where t = (xi-x1)/(x2-x1), which reduces the need +% for replicating a couple of matrices and the right hand division +% operation for 't' is simpler than it was for 's' because it takes place +% only in one dimension (both 'x' and 'xi' are column vectors). +% +% Acknowledgements: Nils Oberg, Blake Landry, Marcelo H. Garcia, +% the University of Illinois (USA), and the University of Cantabria (Spain). +% +% Author: Jose M. Mier +% Contact: jmierlo2@illinois.edu +% Date: August 2013 +% Version: 4 +% + +%% Function begins + +% Size of 'x' and 'y' +m = size(x,1); +n = size(y,2); + +% For each 'xi', get the position of the 'x' element bounding it on the left [p x 1] +[~,xi_pos] = histc(xi,x); +xi_pos = max(xi_pos,1); % To avoid index=0 when xi < x(1) +xi_pos = min(xi_pos,m-1); % To avoid index=m+1 when xi > x(end). + +% 't' matrix [p x 1] +dxi = xi-x(xi_pos); +dx = x(xi_pos+1)-x(xi_pos); +t = dxi./dx; + +% Get 'yi' +yi = y(xi_pos,:) + t(:,ones(1,n)).*(y(xi_pos+1,:)-y(xi_pos,:)); + +% Give NaN to the values of 'yi' corresponding to 'xi' out of the range of 'x' +yi(xix(end),:) = NaN; + +end \ No newline at end of file diff --git a/code/utils/paleo_log.m b/code/utils/paleo_log.m new file mode 100644 index 0000000..ff52931 --- /dev/null +++ b/code/utils/paleo_log.m @@ -0,0 +1,149 @@ +classdef paleo_log < handle + % PALEO log class + % + % Simple logger based on ideas from log4j + % Modified version of 'log4m' which is available at + % http://uk.mathworks.com/matlabcentral/fileexchange/37701-log4m-a-powerful-and-simple-logger-for-matlab/content/log4m.m + + properties (Constant) + ALL = 0; + TRACE = 1; + DEBUG = 2; + INFO = 3; + WARN = 4; + ERROR = 5; + FATAL = 6; + OFF = 7; + end + + properties(SetAccess = protected) + logger; % our name + commandWindowLevel = paleo_log.INFO; + fullpath; + fileLevel = paleo_log.ALL; + fileID; + end + + methods (Static) + function initialise() + % Reset and remove any existing loggers + + % Unfortunate workaround to signal to getLogger (which is managing logger instances) + paleo_log.getLogger('','',''); + + + end + + function obj = getLogger( logger, create, init) + % Return a logger object + % With no arguments, returns default top-level logger + % Optional 2nd argument returns a specific logger (if configured) + % Optional 3rd argument signal initialise (value is ignored) + + persistent loggerObject; % top level default + persistent loggerMap; % optional specific loggers + + if nargin > 2 + % initialise - clear any installed loggers + loggerObject = ''; + loggerMap = ''; + else + % normal case + + if isempty(loggerObject) + loggerObject = paleo_log('default'); % create default object + end + + if nargin < 1 + % return default top-level logger + obj = loggerObject; + else + % create a new logger if not + if nargin >= 2 && create + loggerMap.(logger) = paleo_log(logger); + end + + % return custom logger if available, otherwise system logger + if isempty(loggerMap) || ~isfield(loggerMap,logger) + obj = loggerObject; + else + obj = loggerMap.(logger); + + end + end + end + end + + function outputpath = getOutputPathTimeStamped(outputroot, timestamp) + % timestamped full path in output folder + + if nargin < 2 + timestamp = paleo_log.getTimestamp(); + end + + outputpath = fullfile(paleo_paths.getOutputDir(),[ outputroot timestamp '.log']); + end + + function timestamp = getTimestamp() + % character string timestamp for current time + % apparently datetime is only in recent (> 2013 ?) Matlab versions + %timestamp = char(datetime('now','Format','yyyyMMdd-HHmm')); + [Y, M, D, H, MN, S] = datevec(now); + timestamp = sprintf('%4i%02i%02i-%02i%02i',Y, M, D, H, MN); + end + end + + methods + function setCommandWindowLevel(obj,loggerIdentifier) + obj.commandWindowLevel = loggerIdentifier; + end + + function setFileLevel(obj,loggerIdentifier) + obj.fileLevel = loggerIdentifier; + end + + function setLogFile(obj, filename) + if ~isempty(obj.fileID) + obj.log(obj.WARN,'paleo_log',sprintf('closing existing log file %s\n',obj.fullpath)); + fclose(obj.fileID); + obj.fileID = ''; + obj.fullpath = ''; + end + + obj.fullpath = filename; + obj.fileID = fopen(obj.fullpath, 'w'); + obj.log(obj.INFO,'paleo_log',sprintf('opening log file %s\n',obj.fullpath)); + end + + function log(obj, level, funcName, message) + if obj.commandWindowLevel <= level + switch level + case obj.WARN + warning('%s: %s', funcName, message); + case obj.ERROR + error('%s: %s', funcName, message); + otherwise + fprintf('%s: %s', funcName, message); + end + end + + if ~isempty(obj.fileID) && obj.fileLevel <= level + fprintf(obj.fileID, '%s: %s', funcName, message); + end + end + + end + methods(Access = private) + function obj = paleo_log(logger) + obj.logger = logger; + end + + + function delete(obj) + if ~isempty(obj.fileID) + fclose(obj.fileID); + end + end + end +end + diff --git a/code/utils/paleo_timestampplot.m b/code/utils/paleo_timestampplot.m new file mode 100644 index 0000000..ea4d26a --- /dev/null +++ b/code/utils/paleo_timestampplot.m @@ -0,0 +1,63 @@ +function paleo_timestampplot(optlabel) +% Label current figure with run info and current time. +% Three options: +% - no argument: just timestamp at bottom right +% optlabel = string argument: just text at bottom left +% optlabel = paleo_run instance as argument: COPSE-specific run info + +%location in 'normalized' plot coordinates (bottom left (0,0) top right (1,1) +xloc=0.0; +yloc=0.0; +box=annotation('textbox',[xloc yloc 1.0 0.06]); +set(box,'LineStyle','none'); + +if nargin < 1 % just timestamp + + c=fix(clock); + btxt=sprintf('%s %02i:%02i ', date, c(4),c(5)); + set(box,'String',btxt); + set(box,'HorizontalAlignment','Right'); + +else + if isobject(optlabel) % full info from runctrl struct + run = optlabel; + % config; % Matlab .m file that sets up model + % baseconfig; % Parameter passed to 'config' to set baseline expt + % expt; % Parameter passed to 'config' to select specific experiment etc + % apply defaults if necessary (local changes as Matlab copies arguments) + config = run.config; + if isempty(config) + config = ''; + end + baseconfig = run.baseconfig; + if isempty(baseconfig) + baseconfig = ''; + end + expt = run.expt; + if isempty(expt) + expt = ''; + end + + rundesc = sprintf('Run: config ''%s'' baseconfig ''%s'' expt ''%s'' outputfile ''%s'' Date: %s Plot: %s',... + config, baseconfig, expt, run.outputfile, run.date, datestr(clock)); + + btxt={sprintf('Code: %s', run.codefile);rundesc}; + %btxt=rundesc(1:148); + + set(box,'HorizontalAlignment','Right','FitBoxToText','Off'); + set(box,'LineStyle','none'); + set(box,'Interpreter','none','Fontsize',6); + %Matlab R2015b generates a spurious warning 'too many input arguments' if text width exceeds plot width + set(box,'String',btxt) + + + elseif ischar(optlabel) % text string, bottom left + btxt=sprintf(' %s', txt); + set(box,'String',btxt); + set(box,'HorizontalAlignment','Left'); + else + error('copse_timestampplot - unrecognized argument'); + end +end + +end \ No newline at end of file diff --git a/code/utils/strsplit.m b/code/utils/strsplit.m new file mode 100644 index 0000000..ad49d79 --- /dev/null +++ b/code/utils/strsplit.m @@ -0,0 +1,110 @@ +function terms = strsplit(s, delimiter) +%STRSPLIT Splits a string into multiple terms +% +% terms = strsplit(s) +% splits the string s into multiple terms that are separated by +% white spaces (white spaces also include tab and newline). +% +% The extracted terms are returned in form of a cell array of +% strings. +% +% terms = strsplit(s, delimiter) +% splits the string s into multiple terms that are separated by +% the specified delimiter. +% +% Remarks +% ------- +% - Note that the spaces surrounding the delimiter are considered +% part of the delimiter, and thus removed from the extracted +% terms. +% +% - If there are two consecutive non-whitespace delimiters, it is +% regarded that there is an empty-string term between them. +% +% Examples +% -------- +% % extract the words delimited by white spaces +% ts = strsplit('I am using MATLAB'); +% ts <- {'I', 'am', 'using', 'MATLAB'} +% +% % split operands delimited by '+' +% ts = strsplit('1+2+3+4', '+'); +% ts <- {'1', '2', '3', '4'} +% +% % It still works if there are spaces surrounding the delimiter +% ts = strsplit('1 + 2 + 3 + 4', '+'); +% ts <- {'1', '2', '3', '4'} +% +% % Consecutive delimiters results in empty terms +% ts = strsplit('C,Java, C++ ,, Python, MATLAB', ','); +% ts <- {'C', 'Java', 'C++', '', 'Python', 'MATLAB'} +% +% % When no delimiter is presented, the entire string is considered +% % as a single term +% ts = strsplit('YouAndMe'); +% ts <- {'YouAndMe'} +% + +% History +% ------- +% - Created by Dahua Lin, on Oct 9, 2008 +% + +%% parse and verify input arguments + +assert(ischar(s) && ndims(s) == 2 && size(s,1) <= 1, ... + 'strsplit:invalidarg', ... + 'The first input argument should be a char string.'); + +if nargin < 2 + by_space = true; +else + d = delimiter; + assert(ischar(d) && ndims(d) == 2 && size(d,1) == 1 && ~isempty(d), ... + 'strsplit:invalidarg', ... + 'The delimiter should be a non-empty char string.'); + + d = strtrim(d); + by_space = isempty(d); +end + +%% main + +s = strtrim(s); + +if by_space + w = isspace(s); + if any(w) + % decide the positions of terms + dw = diff(w); + sp = [1, find(dw == -1) + 1]; % start positions of terms + ep = [find(dw == 1), length(s)]; % end positions of terms + + % extract the terms + nt = numel(sp); + terms = cell(1, nt); + for i = 1 : nt + terms{i} = s(sp(i):ep(i)); + end + else + terms = {s}; + end + +else + p = strfind(s, d); + if ~isempty(p) + % extract the terms + nt = numel(p) + 1; + terms = cell(1, nt); + sp = 1; + dl = length(delimiter); + for i = 1 : nt-1 + terms{i} = strtrim(s(sp:p(i)-1)); + sp = p(i) + dl; + end + terms{nt} = strtrim(s(sp:end)); + else + terms = {s}; + end +end + diff --git a/examples/copse/COPSE_bergman2004_bergman2004.m b/examples/copse/COPSE_bergman2004_bergman2004.m new file mode 100644 index 0000000..9048289 --- /dev/null +++ b/examples/copse/COPSE_bergman2004_bergman2004.m @@ -0,0 +1,26 @@ +% COPSE CLASSIC Single ocean-atmosphere box example + +%%%% Start logger +timestamp = paleo_log.getTimestamp(); +LN = 'COPSE_bergman2004_bergman2004'; paleo_log.initialise(); L = paleo_log.getLogger(); +% Optionally set logging to file +%L.setLogFile(paleo_log.getOutputPathTimeStamped('COPSE_bergman2004_bergman2004', timestamp)); +% and disable logging to terminal +% L.setCommandWindowLevel(L.OFF); + +run=copse_bergman2004_bergman2004_expts('', 'baseline'); +%run=copse_bergman2004_bergman2004_expts('run9'); % no S cycle +%run=copse_bergman2004_bergman2004_expts('run3VCI'); + + +run.initialise; % modify pars.Ainit etc to change initial values +run.integrate; +run.postprocess; +run.saveoutput; + +% load comparison model output +copse5_14_modeloutput=copse_output_load('bergman2004'); +run.plot('','',copse5_14_modeloutput); + + + diff --git a/examples/copse/COPSE_bergman2004_bergman2004_cfg.yaml b/examples/copse/COPSE_bergman2004_bergman2004_cfg.yaml new file mode 100644 index 0000000..612a356 --- /dev/null +++ b/examples/copse/COPSE_bergman2004_bergman2004_cfg.yaml @@ -0,0 +1,150 @@ +# COPSE Bergman(2004) base model configuration (original C code version 5_14) + +copse5_14_base: + model: + class: copse_model_bergman2004() + + force: + # historical forcings from COPSE + - copse_force_CK_solar + - copse_force_UDWEbergman2004(1) + - copse_force_B + - copse_force_CPlandrel + + perturb: [] # list of perturbation functions + + pars: + #### Physical constants + k_CtoK : (paleo_const.k_CtoK) # convert degrees C to Kelvin + + ##### model constants (Table 4 Bergman etal 2004, consts.hh in COPSE 5_14 C code) + k1_oxfrac : 0.86 # initial oxic fraction + k2_mocb : 4.5e12 # ocean organic carbon burial (mol/yr) + k3_nfix : 8.72e12 # nitrogen fixation (mol/yr) + k4_denit : 4.3e12 # denitrification (mol/yr) + k5_locb : 4.5e12 # land organic carbon burial (mol/yr) + k6_fepb : 6e9 # Fe-P burial (mol/yr) + k7_capb : 1.5e10 # Ca-P burial (mol/yr) + k11_landfrac : 0.10345 # fract of weath P buried on land + k12_ccdeg : 6.65e12 # carbonate C degassing + k13_ocdeg : 1.25e12 # org C degassing + k14_carbw : 13.35e12 # carbonate weathering + k15_plantenhance: 0.15 # weathering enhancement factor prior to vascular plant colonisation + k_fire : 100 # fire feedback + k16_PANtoO : 3.762 # For calculating mixing ratio O2 from normalised O2 + + k18_oceanmass : 1.397e21 # kg + + #### COPSE S system + Scycle : 'Enabled' # 'None' to remove completely + + k21_pyrw : 0.53e12 + k22_gypw : 1e12 + k_pyrdeg : 0 # pyrite degassing (mol/yr) + k_gypdeg : 0 # gypsum degassing (mol/yr) + k_mpsb : 0.53e12 # = k21_pyrw + k_mgsb : 1e12 # =k22_gypw + + ####### option to hold oxygen constant, 1 : fix O2, 0 : do not fix O2. + o2fix : 0 + + + ## ######################################################################## + ####### Options controlling functional forms + ########################################################################## + + # Organic carbon degassing + # COPSE 5_14 C code (and Bergman 2004) use 'O2copsecrashprevent' which rolls + # off organic carbon degassing at low pO2. This has a big effect at low pO2 when + # oxidative weathering is oxygen-independent (ie Ordovician and earlier) + f_ocdeg : 'O2indep' # options 'O2indep', 'O2copsecrashprevent' + + # Temperature function + f_temp : 'CK1992' # options 'CK1992','CK1992fixalbedo','mills2011' + + # C (carbonate reservoir) dependence of carbonate weathering + f_carbwC : 'Cindep' # options 'Cindep','Cprop' + + + ####### Oxidative weathering + f_oxwO : 'PowerO2' # options 'PowerO2,'SatO2' + f_oxw_a : 0.5 #oxidative weathering dependency on O2 concentration + #f_oxw_halfsat : 1e-6 #set small value to represent O2-indep with limit to satisfy ODE integrator + + # Marine N cycle + f_nfix_power : 2 # + f_nfix_nreplete: 'Off' # options 'Off','Sign' (COPSE 5_14 C code has 'Sign') + + # Marine ecosystem + newp0 : 225.956 + + # Marine CPN ratio + # Functional form of CPsea ratio + f_CPsea : 'Fixed' # Options 'Fixed','VCI' (Bergman 2004 run 2) + CPsea0 : 250 # for f_CPsea:'Fixed' + # Van Cappellen & Ingall (f_CPsea:'VCI') marine C/P burial ratio consts + f_CPsea_VCI_oxic : 217.0 # These are Redfield Revisited 1 steady-state values + f_CPsea_VCI_anoxic : 4340.0 + #f_CPsea_VCI_oxic : 200.0 # Original VC&I values + #f_CPsea_VCI_anoxic : 4000.0 + + CNsea0 : 37.5 # Always fixed + + #marine organic carbon burial power-law dependency on new production + f_mocb_b : 2 + + #Marine pyrite sulphur burial dependency on oxygen + f_pyrburial : 'copse_O2' # options 'copse_O2','copse_noO2' + + # C isotope fractionation calculation + f_cisotopefrac : 'copse_base' # options 'copse_base','fixed', 'copse_noO2' + + # S isotope fractionation calculation + f_sisotopefrac : 'fixed' # options 'fixed','copse_O2' + + ########################################################################## + ####### END Options controlling functional forms + ########################################################################## + + + ########################################################################## + #reservoir present day sizes (mol) - used for normalisation + ########################################################################## + P0 : 3.1e15 + N0 : 4.35e16 + O0 : 3.7e19 + C0 : 5e21 + G0 : 1.25e21 + A0 : 3.193e18 + #Q0 : 1.3e20 + PYR0 : 1.8e20 + GYP0 : 2e20 + S0 : 4e19 + #M0 : 1e14 + CAL0 : 1.397e19 + + pCO2atm0 : 280e-6 # pCO2 corresponding to A0 (atm) + + ######################################################################### + #reservoir initial sizes (mol) + ########################################################################## + + Pinit : (pars.P0) + Ninit : (pars.N0) + Oinit : (pars.O0) + Cinit : (pars.C0) + Ginit : (pars.G0) + Ainit : (pars.A0) + PYRinit : (pars.PYR0) + GYPinit : (pars.GYP0) + Sinit : (pars.S0) + CALinit : (pars.CAL0) + + # initial isotope fractionation values (from COPSE 5_14 code) + delta_Ginit : -26 + delta_Cinit : 1 + delta_Ainit : 0 + delta_PYRinit : -15 + delta_GYPinit : 20 + delta_Sinit : 20 + diff --git a/examples/copse/COPSE_millsg3_millsg3.m b/examples/copse/COPSE_millsg3_millsg3.m new file mode 100644 index 0000000..f9f713e --- /dev/null +++ b/examples/copse/COPSE_millsg3_millsg3.m @@ -0,0 +1,29 @@ +% COPSE 0-D examples + +%%%% Start logger +timestamp = paleo_log.getTimestamp(); +LN = 'COPSE_reloaded_millsg3'; paleo_log.initialise(); L = paleo_log.getLogger(); +% Optionally set logging to file +%L.setLogFile(paleo_log.getOutputPathTimeStamped('COPSE_reloaded_millsg3', timestamp)); +% and disable/enable logging to terminal +% L.setCommandWindowLevel(L.DEBUG); + +comparisondata = false; + +%%%% "g3mills2014withbugs" implements the exact G3 model, with bugs, for last 250Myr +% run=copse_millsg3_millsg3_expts('g3mills2014withbugs', 'baseline',comparisondata); +%run=copse_millsg3_millsg3_expts('g3mills2014nobugs', 'baseline'); +%run=copse_millsg3_millsg3_expts('g3mills2014nobugs', 'weather'); +% use spreadsheet-based LIP forcing +run=copse_millsg3_millsg3_expts('g3mills2014withbugs', 'LipNoCO2', comparisondata); +%run=copse_reloaded_millsg3_expts('g3mills2014withbugs', 'LipAllCO2max'); + +% load comparison model output +comparisonmodel =copse_output_load('millsg3'); + +run.initialise; +run.integrate; +run.postprocess; +run.saveoutput; +run.plot('','',comparisonmodel); + diff --git a/examples/copse/COPSE_millsg3_millsg3_cfg.yaml b/examples/copse/COPSE_millsg3_millsg3_cfg.yaml new file mode 100644 index 0000000..8eac268 --- /dev/null +++ b/examples/copse/COPSE_millsg3_millsg3_cfg.yaml @@ -0,0 +1,269 @@ +# Mills (2014) G3 base model configuration + bug fixes +# settings for copse_model_sfbw + +copse_millsg3_2014: + model: + class: copse_model_mills2014g3() + + force: + - copse_force_CK_solar + - copse_force_UDWEbergman2004(1) + - copse_force_B + - copse_force_CPlandrel # historical forcings from COPSE + - copse_force_PG_godderis(1) # G3 'PG' add paleogeog factor + - copse_force_vandermeer('Davg', 3) # G3 DEGASS 'vdm' NB: relies on overriding DEGASS set earlier + # extrapolate=3 for G3 bug compatibility: oib_area extrapolate as constant, DEGASS set to extrapval=1.0 + - copse_force_berner_fr(1) # G3 UPLIFT 'polyu' Polynomial degassing from geocarb 3 NB: override UPLIFT set earlier + # G3 Land surface granite/basalt/carbonate split + - copse_force_berner_total_land_area(1) # G3 TOTAL_AREA + - copse_force_berner_carbonate_land_area(1) # G3 Change to carb area from g3 paper. + - copse_force_revision_ba('BAavg', 'g3supp') # G3 BA basalt area from the G3 final paper, uses datafile supplied with paper, no LIP co2 degassing here + # this is normalized to present + + + perturb: [] # list of perturbation functions + + pars: + #### Physical constants + k_CtoK : (paleo_const.k_CtoK) # convert degrees C to Kelvin + + ##### model constants (Table 4 Bergman etal 2004, consts.hh in COPSE 5_14 C code) + k1_oxfrac : 0.86 # initial oxic fraction + k2_mocb : 4.5e12 # ocean organic carbon burial (mol/yr) + k3_nfix : 8.72e12 # nitrogen fixation (mol/yr) + k4_denit : 4.3e12 # denitrification (mol/yr) + k5_locb : 4.5e12 # land organic carbon burial (mol/yr) + CPland0 : 1000 #TL new constant present day C/P land burial + k6_fepb : 6e9 # Fe-P burial (mol/yr) + k7_capb : 1.5e10 # Ca-P burial (mol/yr) + #k11_landfrac : 0.10345 # fract of weath P buried on land + k_Psilw : (2/12) + k_Pcarbw : (5/12) + k_Poxidw : (5/12) + k_Psedw : 0 + k12_ccdeg : 6.65e12 # carbonate C degassing + k13_ocdeg : 1.25e12 # org C degassing + k14_carbw : 13.35e12 # carbonate weathering + k15_plantenhance: 0.25 # G3 Plant enhancement of weathering take 1/4 instead of 1/7 + k_fire : 100 # fire feedback + k16_PANtoO : 3.762 # For calculating mixing ratio O2 from normalised O2 + + k18_oceanmass : 1.397e21 # kg + + k_basfrac : 0.35 # fraction of silw that is basaltic at present + k_shalefrac : 0.75 # fraction of granw (=silw-basw) that is from shales at present + k_orgevapfrac : 0.6 # fraction of granw (=silw-basw) that is from organics+evaporites at present + k_P : 1.0 # enrichment of P:(Ca+Mg) in granite versus basalt + + k_aq : 0.9 # fraction of locb assumed to occur in aquatic settings (not coals) + + #### COPSE S system + Scycle : 'Enabled' # 'None' to remove completely + + k21_pyrw : 0.53e12 + k22_gypw : 1e12 + k_pyrdeg : 0 # pyrite degassing (mol/yr) + k_gypdeg : 0 # gypsum degassing (mol/yr) + k_mpsb : (pars.k21_pyrw) # = k21_pyrw + k_mgsb : (pars.k22_gypw) # =k22_gypw + + #### Sr system (Mills et al. 2014b) Sr fluxes + k_Sr_total_igw: 13e9 ### igneous weathering mol/yr + k_Sr_igg: (pars.k_Sr_total_igw * (1 - pars.k_basfrac)) ### granite weathering + k_Sr_igb: (pars.k_Sr_total_igw * pars.k_basfrac) ### basalt weathering + k_Sr_sedw: 17e9 ### sediment weathering + k_Sr_metam: 13e9 ### metamorphic flux + k_Sr_mantle: 7.3e9 ### direct mantle flux + + #### present land areas for relative calculations, Mills et al 2014 G3 + + k_present_land_area: 1.5e8 ### km2 + k_present_basalt_area: 6.8e6 ### includes island basalts, dessert 2003 + k_present_silicate_area: 8.1e7 ### km2 dessert 2003 + k_present_granite_area: (pars.k_present_silicate_area - pars.k_present_basalt_area) ### assuming silicates = granite+basalt + k_present_carbonate_area: (pars.k_present_land_area - pars.k_present_silicate_area) ### assuming only silicates and carbonates exist + + + ####### option to hold oxygen constant, 1 : fix O2, 0 : do not fix O2. + o2fix : 0 + + + ## ######################################################################## + ####### Options controlling functional forms + ########################################################################## + + # Inorganic carbon degassing + f_ccdeg : 'original' # options 'noB' + + # Organic carbon degassing + # COPSE 5_14 C code (and Berman 2004) use 'O2copsecrashprevent' which rolls + # off organic carbon degassing at low pO2. This has a big effect at low pO2 when + # oxidative weathering is oxygen-independent (ie Ordovician and earlier) + f_ocdeg : 'O2indep' # options 'O2indep', 'O2copsecrashprevent' + + # CO2 partitioning + f_atfrac : 'original' # option 'quadratic' + + # Temperature function + f_temp : 'CK1992' # options 'CK1992','CK1992fixalbedo','Berner' + k_c : 4 + k_l : 7.4 + + # Basalt area forcing + f_basaltarea: 'g3_2014_datafile' # G3 Enable basalt area forcing (present-day value for normalisation calculated below) + f_granitearea: 'G3improved' # G3 enable granite area here + #f_oib_scaling: 'Degass' # G3 OIB forcing scales with degassing + + # C (carbonate reservoir) dependence of carbonate weathering + f_carbwC : 'Cindep' # options 'Cindep','Cprop' + + # Basalt weathering response to uplift changes + f_bas_link_u: 'no' # G3 basalt weathering does not respont to uplift changes (G3) + + # Granite weathering response to uplift changes + f_gran_link_u: 'original' # linear depedence + + # Carbonate weathering response to uplift changes + f_carb_link_u: 'yes' # linear depedence + + # G3 different activation energies for bas and gran weathering + f_act_energies: 'split' + + # Baseline configuration - apatite kinetics assumed to follow host rock + f_p_kinetics: 'no' + + # Baseline configuration - granite and basalt have same P content + f_p_apportion : 'no' + + # Baseline CO2 fertilisation effect in weathering function + f_co2fert: 'original' + + # Baseline configuration for vegetation dependence of weathering + f_vegweath: 'original' + + ####### Oxidative weathering + f_oxwO : 'PowerO2' # options 'PowerO2,'SatO2' + f_oxw_a : 0.5 #oxidative weathering dependency on O2 concentration + #f_oxw_halfsat : 1e-6 #set small value to represent O2-indep with limit to satisfy ODE integrator + f_oxwG : 'Gprop' # oxw prop to size of org C reservoir + + f_pyrweather : 'copse_O2' # options 'copse_O2','copse_noO2','forced' + f_gypweather : 'original' # options 'original','alternative','forced' + + ######## seafloor weathering + k_sfw: 1.75e12 # G3 Seafloor weathering 'sfwalpha' + f_sfw_force: 'DEGASS' # tectonic forcing + f_sfw_opt: 'mills2014pCO2' + f_sfw_alpha: 0.23 # wildly uncertain + + # G3 Link sulphur redox to alkalinity + f_SRedoxAlk: 'on' + + # Replicate land biota temp bug from Mills 2014 G3 + f_bug_g32014_landbiotatemp: 'No' # Options 'No', 'Yes' + + # Replicate Sr system concentration bug from Mills 2014 G3 (not plotted in paper) + f_bug_g32014_Srconc: 'No' # Options 'No', 'Yes' + + # Marine N cycle + f_nfix_power : 2 # COPSE 5_14 C code default + + # Marine ecosystem + newp0 : 225.956 + + # Marine CPN ratio + # Functional form of CPsea ratio + f_CPsea : 'Fixed' # Options 'Fixed','VCI' (Bergman 2004 run 2) + CPsea0 : 250 # for f_CPsea:'Fixed' + # Van Cappellen & Ingall (f_CPsea:'VCI') marine C/P burial ratio consts + f_CPsea_VCI_oxic : 217.0 # These are Redfield Revisited 1 steady-state values + f_CPsea_VCI_anoxic : 4340.0 + #f_CPsea_VCI_oxic : 200.0 # Original VC&I values + #f_CPsea_VCI_anoxic : 4000.0 + + CNsea0 : 37.5 # Always fixed + + #marine organic carbon burial power-law dependency on new production + f_mocb_b : 2 + + #Ca-P burial + f_capb : 'original' # options 'redox' + + #Fe-P burial + f_fepb : 'original' # options 'gcubed' + + #Marine pyrite sulphur burial dependency on oxygen + f_pyrburial : 'copse_O2' # options 'copse_O2','copse_noO2' + + # C isotope fractionation calculation + f_cisotopefrac : 'copse_base' # options 'copse_base','fixed','fixed2','copse_noO2' + + # S isotope fractionation calculation + f_sisotopefrac : 'fixed' # options 'fixed','copse_O2' + + # Sr metamorphic loss flux + f_Sr_metam : 'original' # options 'original','alternative' + + # Sr weathering flux + f_Sr_sedw : 'original' # options 'original','alternative' + + ########################################################################## + ####### END Options controlling functional forms + ########################################################################## + + + ########################################################################## + #reservoir present day sizes (mol) - used for normalisation + ########################################################################## + P0 : 3.1e15 + N0 : 4.35e16 + O0 : 3.7e19 + C0 : 5e21 + G0 : 1.25e21 + A0 : 3.193e18 + #Q0 : 1.3e20 + PYR0 : 1.8e20 + GYP0 : 2e20 + S0 : 4e19 + #M0 : 1e14 + CAL0 : 1.397e19 + + pCO2atm0 : 280e-6 # pCO2 corresponding to A0 (atm) + + #### normalization for Sr reservoirs + Sr_ocean0 : 1.2e17 ### francois and walker 1992 + Sr_sed0 : 5e18 ### francois and walker 1992 + + ######################################################################### + #reservoir initial sizes (mol) + ########################################################################## + # G3 paper was tuned to arrive at present day values + Pinit : (pars.P0) + Ninit : (pars.N0) + Oinit : (pars.O0) + Cinit : (pars.C0*0.9899) + Ginit : (pars.G0*0.9251) + Ainit : (pars.A0) + PYRinit : (pars.PYR0*1.1452) + GYPinit : (pars.GYP0*0.8743) + Sinit : (pars.S0) + CALinit : (pars.CAL0) + + # initial isotope fractionation values (from COPSE 5_14 code) + delta_Ginit : -26 + delta_Cinit : 1 + delta_Ainit : 0 + delta_PYRinit : -15 + delta_GYPinit : 20 + delta_Sinit : 20 + + #### starting Sr reservoirs + Sr_ocean_init : (pars.Sr_ocean0) + Sr_sed_init : (pars.Sr_sed0) + + #### starting Sr fractionations + delta_new_ig_present: 0.705 ### francois and walker + delta_old_ig_present: 0.715 ### 0.715 G-cubed, 0.718 francois and walker + delta_mantle_present: 0.703 ### francois and walker + delta_Sr_ocean_start: 0.708 #### starting at 250Ma (allow for spin up) + delta_Sr_sed_start: 0.714 #### guess to recover present day values diff --git a/examples/copse/COPSE_reloaded_bergman2004.m b/examples/copse/COPSE_reloaded_bergman2004.m new file mode 100644 index 0000000..f276b71 --- /dev/null +++ b/examples/copse/COPSE_reloaded_bergman2004.m @@ -0,0 +1,51 @@ +% COPSE 0-D examples + +%%%% Start logger +timestamp = paleo_log.getTimestamp(); +LN = 'COPSE_reloaded_bergman2004'; paleo_log.initialise(); L = paleo_log.getLogger(); +% Optionally set logging to file +%L.setLogFile(paleo_log.getOutputPathTimeStamped('COPSE_reloaded_bergman2004', timestamp)); +% and disable/enable logging to terminal +% L.setCommandWindowLevel(L.DEBUG); + +comparisondata = false; + +%%%% run bergman 2004 exact model +run=copse_reloaded_bergman2004_expts('bergman2004','baseline',comparisondata); +%%%% experiments in the original paper +%run=copse_reloaded_bergman2004_expts('bergman2004','run2',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','run3',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','run6',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','run7',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','run8',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','run9',comparisondata); %%% S plots fail +%run=copse_reloaded_bergman2004_expts('bergman2004','run11',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','run12',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','run3VCI',comparisondata); + +%%%% run lenton et al 2012 Ordovician model but for full Phanerozoic +%run=copse_reloaded_bergman2004_expts('bergman2004','ordovician',comparisondata); + +%%%% run lenton 2013 book chapter model +%run=copse_reloaded_bergman2004_expts('bergman2004','bookchapter',comparisondata); + +%%%% run lenton et al 2016 PNAS paleozoic model runs +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_base',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_blue',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_cyan',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_magenta',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_green',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_yellow',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_red',comparisondata); +%run=copse_reloaded_bergman2004_expts('bergman2004','paleozoic_black',comparisondata); + + +% load comparison model output COPSE 514 +comparisonmodel =copse_output_load('bergman2004'); + +run.initialise; +run.integrate; +run.postprocess; +run.saveoutput; +run.plot('','',comparisonmodel); + diff --git a/examples/copse/COPSE_reloaded_bergman2004_cfg.yaml b/examples/copse/COPSE_reloaded_bergman2004_cfg.yaml new file mode 100644 index 0000000..18b182e --- /dev/null +++ b/examples/copse/COPSE_reloaded_bergman2004_cfg.yaml @@ -0,0 +1,259 @@ +# COPSE Bergman(2004) base model configuration (original C code version 5_14) +# settings for copse_model_sfbw + +copse5_14_base: + model: + class: copse_model_reloaded() + + force: + # historical forcings from COPSE + - copse_force_CK_solar + - copse_force_UDWEbergman2004(1) + - copse_force_B + - copse_force_CPlandrel + + perturb: [] # list of perturbation functions + + pars: + #### Physical constants + k_CtoK : (paleo_const.k_CtoK) # convert degrees C to Kelvin + + ##### model constants (Table 4 Bergman etal 2004, consts.hh in COPSE 5_14 C code) + k_c : 4.328 # new determines climate sensitivity to CO2 + k_l : 7.4 # new determines temperature sensitivity to luminosity + k_logistic : 12.0 # new determines slope of logistic anoxia function + k_uptake : 0.5 # new determines efficiency of nutrient uptake in anoxia function + k1_oxfrac : 0.86 # initial oxic fraction + k2_mocb : 4.5e12 # ocean organic carbon burial (mol/yr) + k3_nfix : 8.72e12 # nitrogen fixation (mol/yr) + k4_denit : 4.3e12 # denitrification (mol/yr) + k5_locb : 4.5e12 # land organic carbon burial (mol/yr) + CPland0 : 1000 #TL new constant present day C/P land burial + k6_fepb : 6e9 # Fe-P burial (mol/yr) + k7_capb : 1.5e10 # Ca-P burial (mol/yr) + k11_landfrac : 0.10345 # fract of weath P buried on land + k_Psilw : (2/12) + k_Pcarbw : (5/12) + k_Poxidw : (5/12) + k_Psedw : 0 + k12_ccdeg : 6.65e12 # carbonate C degassing + k13_ocdeg : 1.25e12 # org C degassing + k14_carbw : 13.35e12 # carbonate weathering + k_sfw : 0e12 # new seafloor weathering (mol/yr) + #k_silw : 12e12 # new terrestrial silicate weathering (mol/yr) + k_basfrac : 0.35 # new fraction of silw that is volcanic ('basalt') at present + #k_basw : 3e12 # new volcanic ('basalt') silicate weathering (mol/yr) + #k_granw : 9e12 # new non-volcanic ('granite') silicate weathering (mol/yr) + k_orgevapfrac : 0.6 # new fraction of granw (=silw-basw) that is from organics+evaporites at present + k15_plantenhance: 0.15 # weathering enhancement factor prior to vascular plant colonisation + k_fire : 100 # fire feedback + k16_PANtoO : 3.762 # For calculating mixing ratio O2 from normalised O2 + k18_oceanmass : 1.397e21 # kg + newp0 : 225.956 # (umol/kg) + CNsea0 : 37.5 # marine organic C/N burial ratio + CPsea0 : 250 # marine organic C/P burial ratio when f_CPsea:'Fixed' + + + #### COPSE Ca system + CALcycle : 'Enabled' # + + #### COPSE S system + Scycle : 'Enabled' # 'None' to remove completely + + k21_pyrw : 0.53e12 + k22_gypw : 1e12 + k_pyrdeg : 0 # pyrite degassing (mol/yr) + k_gypdeg : 0 # gypsum degassing (mol/yr) + k_mpsb : (pars.k21_pyrw) # =k21_pyrw + k_mgsb : (pars.k22_gypw) # =k22_gypw + + #### Sr system (Mills et al. 2014b) Sr fluxes + k_Sr_total_igw: 13e9 ### igneous weathering mol/yr + #k_Sr_igg: (pars.k_Sr_total_igw * (1 - pars.k_basfrac)) ### granite weathering + #k_Sr_igb: (pars.k_Sr_total_igw * pars.k_basfrac) ### basalt weathering + k_Sr_sedw: 17e9 ### sediment weathering + k_Sr_metam: 13e9 ### metamorphic flux + k_Sr_mantle: 7.3e9 ### direct mantle flux + + #### present land areas for relative calculations, Mills et al 2014 G3 + + k_present_land_area: 1.5e8 ### km2 + k_present_basalt_area: 6.8e6 ### includes island basalts, dessert 2003 + k_present_silicate_area: 8.1e7 ### km2 dessert 2003 + k_present_granite_area: (pars.k_present_silicate_area - pars.k_present_basalt_area) ### assuming silicates = granite+basalt + k_present_carbonate_area: (pars.k_present_land_area - pars.k_present_silicate_area) ### assuming only silicates and carbonates exist + + + ####### option to hold oxygen constant, 1 : fix O2, 0 : do not fix O2. + o2fix : 0 + + + ## ######################################################################## + ####### Options controlling functional forms + ########################################################################## + + # CO2 partitioning + f_atfrac : 'original' # option 'quadratic' + + # Temperature function + f_temp : 'CK1992' # options 'CK1992','CK1992fixalbedo','mills2011' + + # Terrestrial ecosystem + f_npp : 'original' # options 'noT','noO2','noCO2','newCO2','bernerCO2','constant' + f_ignit : 'original' # options 'original','nofbk' + + # Inorganic carbon degassing + f_ccdeg : 'original' # options 'noB' + + # Organic carbon degassing + # COPSE 5_14 C code (and Berman 2004) use 'O2copsecrashprevent' which rolls + # off organic carbon degassing at low pO2. This has a big effect at low pO2 when + # oxidative weathering is oxygen-independent (ie Ordovician and earlier) + # For the reloaded paper we dispense with this and let the model crash if it wants + f_ocdeg : 'O2indep' # options 'O2indep', 'O2copsecrashprevent' + + # Seafloor weathering + f_sfw_force : 'DEGASS' # dependent on degassing (i.e. seafloor spreading), options 'None' + f_sfw_opt : 'sfw_temp' # dependent on temperature, options 'sfw_strong','sfw_noT','mills2014pCO2' + f_sfw_alpha : 0.23 # sensitivity if CO2 dependent (Mills et al. 2014) + + # Vegetation dependence of weathering + f_vegweath : 'original' # options 'original','new','newnpp' + f_co2fert : 'original' # CO2 fertilisation effect in original weathering function + + # Activation energies for basalt and granite weathering + f_act_energies : 'single' # options 'single' + + # Granite weathering + f_gran_link_u : 'original' # linear depedence on uplift + f_granitearea : 'Fixed' # area forcing, options 'Fixed','G3improved' + #f_granitearea: 'DefaultForced' # leave at default = 1 + + # Basalt weathering + f_bas_link_u : 'yes' # dependence on uplift, options 'yes' + f_basaltarea: 'DefaultForced' # leave at default = 1 (options 'DefaultForced', 'G3original', ''G3improved) + #f_oib_scaling : 'Degass' # G3 OIB forcing scales with degassing + + # Carbonate weathering + f_carbwC : 'Cindep' # dependence on carbonate C reservoir, options 'Cindep' (original) + f_carb_link_u : 'yes' # linear depedence on uplift + + # Gypsum weathering + f_gypweather : 'original' # options 'original','forced' + + # Oxidative C weathering + f_oxwO : 'PowerO2' # options 'PowerO2,'SatO2' + f_oxw_a : 0.5 # power dependence on O2 concentration + f_oxwG : 'Gprop' # dependence on organic C reservoir + + # Pyrite weathering + f_pyrweather : 'copse_O2' # options 'copse_O2' (original),'forced' + + # Phosphorus weathering + f_p_kinetics : 'no' # assumed to follow host rock kinetics, options 'yes' (=apatite Ea) + f_p_apportion : 'no' # no=granite and basalt assumed to have same P content, options 'yes' + + # Land organic carbon burial + f_locb : 'original' # options 'Uforced','split','original' + + # Marine anoxia + f_anoxia : 'original' # options 'original' + + # Marine N cycle + f_nfix_power : 2 # SD update to BM Matlab code which has f_nfix_power : 1. This fixes discrepancy between P (phosphorus) and COPSE 5_14 (most visible in Cambrian) + f_denit : 'original' # options 'new' + + # Marine organic carbon burial + f_mocb : 'original' # options 'Uforced','O2dep','both' + f_mocb_b : 2 # power-law dependency on new production + + # Marine organic phosphorus burial + f_CPsea : 'Fixed' # Options 'Fixed','VCI' (Bergman 2004 run 2) + f_CPsea_VCI_oxic : 217.0 # These are Redfield Revisited 1 steady-state values + f_CPsea_VCI_anoxic : 4340.0 + + # Marine Fe-P burial + f_fepb : 'original' # options 'Dforced','sfw','original' + + # Marine Ca-P burial + f_capb : 'original' # options 'redox' + + # Marine pyrite sulphur burial + f_pyrburial : 'copse_O2' # dependency on oxygen, options 'copse_noO2','anoxia' + + # Marine gypsum sulphur burial + f_gypburial : 'original' # dependency on prescribed [Ca++], options 'original' + + # Carbonate burial + f_SRedoxAlk : 'off' # link sulphur redox to alkalinity, options 'on' + + # C isotope fractionation calculation + f_cisotopefrac : 'copse_base' # options 'copse_base','fixed', 'copse_noO2' + + # S isotope fractionation calculation + f_sisotopefrac : 'fixed' # options 'fixed','copse_O2' + + # Sr metamorphic loss flux + f_Sr_metam : 'alternative' # dependency on parent reservoir size, options 'original' + + # Sr weathering flux + f_Sr_sedw : 'alternative' # dependency on parent reservoir size, options 'original' + + ########################################################################## + ####### END Options controlling functional forms + ########################################################################## + + + ########################################################################## + #reservoir present day sizes (mol) - used for normalisation + ########################################################################## + P0 : 3.1e15 + N0 : 4.35e16 + O0 : 3.7e19 + C0 : 5e21 + G0 : 1.25e21 + A0 : 3.193e18 + PYR0 : 1.8e20 + GYP0 : 2e20 + S0 : 4e19 + CAL0 : 1.397e19 + + pCO2atm0 : 280e-6 # pCO2 corresponding to A0 (atm) + + #### normalization for Sr reservoirs + Sr_ocean0 : 1.2e17 ### francois and walker 1992 + Sr_sed0 : 5e18 ### francois and walker 1992 + + ######################################################################### + #reservoir initial sizes (mol) + ########################################################################## + + Pinit : (pars.P0) + Ninit : (pars.N0) + Oinit : (pars.O0) + Cinit : (pars.C0) + Ginit : (pars.G0) + Ainit : (pars.A0) + PYRinit : (pars.PYR0) + GYPinit : (pars.GYP0) + Sinit : (pars.S0) + CALinit : (pars.CAL0) + + # initial isotope fractionation values (from COPSE 5_14 code) + delta_Ginit : -26 + delta_Cinit : 1 + delta_Ainit : 0 + delta_PYRinit : -15 + delta_GYPinit : 20 + delta_Sinit : 20 + + #### starting Sr reservoirs + Sr_ocean_init : (pars.Sr_ocean0) + Sr_sed_init : (pars.Sr_sed0) + + #### starting Sr fractionations + delta_new_ig_present: 0.705 ### francois and walker + delta_old_ig_present: 0.715 ### updated; 0.715 G-cubed, 0.718 francois and walker + delta_mantle_present: 0.703 ### francois and walker + delta_Sr_ocean_start: 0.708 ### reasonable average value for Phanerozoic + delta_Sr_sed_start : 0.708 ### updated reasonable average value for Phanerozoic diff --git a/examples/copse/COPSE_reloaded_reloaded.m b/examples/copse/COPSE_reloaded_reloaded.m new file mode 100644 index 0000000..571b801 --- /dev/null +++ b/examples/copse/COPSE_reloaded_reloaded.m @@ -0,0 +1,82 @@ +% COPSE 0-D examples + +%%%% Start logger +timestamp = paleo_log.getTimestamp(); +LN = 'COPSE_reloaded_reloaded'; paleo_log.initialise(); L = paleo_log.getLogger(); +% Optionally set logging to file +%L.setLogFile(paleo_log.getOutputPathTimeStamped('COPSE_reloaded_reloaded', timestamp)); +% and disable/enable logging to terminal +% L.setCommandWindowLevel(L.DEBUG); + +comparisondata = false; + +%%%% "reloaded" runs the new COPSE reloaded for whole Phanerozoic +run=copse_reloaded_reloaded_expts('reloaded', 'baseline', comparisondata); + +%%%% "original" reconstructs the original COPSE for whole Phanerozoic +%run=copse_reloaded_reloaded_expts('original', 'baseline', comparisondata); +%%%% Variants in Fig. 5 +%run=copse_reloaded_reloaded_expts('original', 'DB', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'U', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'EWCP', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'DUEWBCP', comparisondata); +%%%% Variants in Fig. 6 +%run=copse_reloaded_reloaded_expts('original', 'sfw', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'basnoU', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'Easplit', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'vegweath', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'bernerT', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'newweath', comparisondata); +%%%% Variants in Fig. 7 +%run=copse_reloaded_reloaded_expts('original', 'CAL', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'ignit', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'pyrweath', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'newweathredox', comparisondata); +%run=copse_reloaded_reloaded_expts('original', 'newbase', comparisondata); + +%%%% "newbase" runs the new COPSE structure with old fluxes and without additional forcings for whole Phanerozoic +%run=copse_reloaded_reloaded_expts('newbase', 'baseline', comparisondata); +%%%% Variants in Fig. 8 +%run=copse_reloaded_reloaded_expts('newbase', 'highS', comparisondata); +%run=copse_reloaded_reloaded_expts('newbase', 'highCin', comparisondata); +%run=copse_reloaded_reloaded_expts('newbase', 'lowCorg', comparisondata); +%run=copse_reloaded_reloaded_expts('newbase', 'Pweath', comparisondata); +%run=copse_reloaded_reloaded_expts('newbase', 'newfluxes', comparisondata); +%%%% Variants in Fig. 9 +%run=copse_reloaded_reloaded_expts('newbase', 'basalt', comparisondata); +%run=copse_reloaded_reloaded_expts('newbase', 'granite', comparisondata); +%run=copse_reloaded_reloaded_expts('newbase', 'PG', comparisondata); +%run=copse_reloaded_reloaded_expts('newbase', 'bcoal', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'baseline', comparisondata); + +%%%% "reloaded" runs the new COPSE reloaded for whole Phanerozoic +%run=copse_reloaded_reloaded_expts('reloaded', 'baseline', comparisondata); +%%%% Variants in Fig. 10 +%run=copse_reloaded_reloaded_expts('reloaded', 'k15025', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'k1501', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'newnpp', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'sfwstrong', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'sfwnoT', comparisondata); +%%%% Variants in Fig. 11 +%run=copse_reloaded_reloaded_expts('reloaded', 'climsens15', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'climsens225', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'climsens45', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'climsens6', comparisondata); +%%%% Variants in Fig. 12 +%run=copse_reloaded_reloaded_expts('reloaded', 'locbU', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'mocbU', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'locbUmocbU', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'mocbO2', comparisondata); +%run=copse_reloaded_reloaded_expts('reloaded', 'VCI', comparisondata); + + +% load comparison model output new baseline in COPSE reloaded paper +comparisonmodel =copse_output_load('reloaded', 'reloaded_baseline'); +% comparisonmodel =copse_output_load('reloaded', 'reloaded_VCI'); + +run.initialise; +run.integrate; +run.postprocess; +run.saveoutput; +run.plot('','',comparisonmodel); + diff --git a/examples/copse/COPSE_reloaded_reloaded_cfg.yaml b/examples/copse/COPSE_reloaded_reloaded_cfg.yaml new file mode 100644 index 0000000..d89be86 --- /dev/null +++ b/examples/copse/COPSE_reloaded_reloaded_cfg.yaml @@ -0,0 +1,273 @@ +# Lenton, Daines, Mills (2017) new COPSE baseline model configuration +# settings for copse_model_sfbw + +copse_reloaded: + model: + class: copse_model_reloaded() + + force: + - copse_force_royer_fD(1) # 'PG' additional paleogeography forcing factor + - copse_force_haq_D() # DEGASS updated degassing based on sealevel inversion + - copse_force_berner_fr(1) # UPLIFT updated uplift/erosion polynomial from geocarb 3 + - copse_force_calcium('calnorm') # CAL_NORM additional [Ca++] forcing factor + - copse_force_org_evap_area('orgevapnorm') # new shale+coal+evaporite exposed area forcing which contributes to granite forcing + - copse_force_granite('silnorm') # new silicate exposed area forcing which contributes to granite forcing + - copse_force_coal('coalnorm') # COAL new coal depositional area forcing + # New timing of E: + - copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') + - copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') + # New timing of W: + - copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') + - copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') + # New forcing of C/P land to combine with bcoal forcing + - copse_force_ramp('CPland_relative', [0 1], [-465e6 -445e6], '+') + - copse_force_ramp('CPland_relative', [0 -1], [-345e6 -300e6], '+') + # Ramp up P weathering to get +2 per mil d13C plateau + - copse_force_ramp('F_EPSILON', [0 0.5], [-465e6 -445e6], '+') + - copse_force_ramp('F_EPSILON', [0 -0.5], [-410e6 -400e6], '+') + # Change B forcing to linear + - copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') + + perturb: [] # list of perturbation functions + + pars: + #### Physical constants + k_CtoK : (paleo_const.k_CtoK) # convert degrees C to Kelvin + + #### Model constants + k_c : 4.328 # new determines climate sensitivity to CO2 + k_l : 7.4 # new determines temperature sensitivity to luminosity + k_logistic : 12.0 # new determines slope of logistic anoxia function + k_uptake : 0.5 # new determines efficiency of nutrient uptake in anoxia function + k1_oxfrac : 0.9975 # updated initial oxic fraction + k2_mocb : 2.5e12 # updated marine organic carbon burial (mol/yr) + k3_nfix : 8.667e12 # updated nitrogen fixation (mol/yr) + k4_denit : 4.3e12 # denitrification (mol/yr) + k5_locb : 2.5e12 # updated land organic carbon burial (mol/yr) + k_aq : 0.8 # new fraction of locb assumed to occur in aquatic settings (not coals) + CPland0 : 1000 # new constant present day C/P land burial + k6_fepb : 1e10 # updated Fe-P burial (mol/yr) + k7_capb : 2e10 # updated Ca-P burial (mol/yr) + k10_phosw : 4.25e10 # updated P weathering (mol/yr) + k11_landfrac : 0.05882 # updated fraction of weathered P buried on land + k_Psilw : 0.8 # updated silicate fraction of P weathering + k_Pcarbw : 0.14 # updated carbonate fraction of P weathering + k_Poxidw : 0.06 # updated oxidative fraction of P weathering + k_Psedw : 0 + #k_P : 1.0 # enrichment of P:(Ca+Mg) in granite versus basalt + k12_ccdeg : 15e12 # updated carbonate C degassing (mol/yr) + k13_ocdeg : 1.25e12 # organic C degassing (mol/yr) + k14_carbw : 8e12 # updated carbonate weathering (mol/yr) + k_sfw : 3e12 # new seafloor weathering (mol/yr) + k_silw : 12e12 # new terrestrial silicate weathering (mol/yr) + k_basfrac : 0.25 # new fraction of silw that is volcanic ('basalt') at present + k_basw : 3e12 # new volcanic ('basalt') silicate weathering (mol/yr) + k_granw : 9e12 # new non-volcanic ('granite') silicate weathering (mol/yr) + #k_shalefrac : 0.75 # new fraction of granw (=silw-basw) that is from shales at present + k_orgevapfrac : 0.6 # new fraction of granw (=silw-basw) that is from organics+evaporites at present + k15_plantenhance: 0.15 # plant enhancement of weathering + k_fire : 3 # updated fire feedback + k16_PANtoO : 3.762 # For calculating mixing ratio O2 from normalised O2 + k17_oxidw : 3.75e12 # updated C oxidative weathering (mol/yr) + k18_oceanmass : 1.397e21 # (kg) + newp0 : 225.956 # (umol/kg) + CNsea0 : 37.5 # marine organic C/N burial ratio + CPsea0 : 250 # marine organic C/P burial ratio when f_CPsea:'Fixed' + + + #### COPSE Ca system + CALcycle : 'None' # Ca concentration forced via CAL_NORM + + #### COPSE S system + Scycle : 'Enabled' # 'None' to remove completely + + k21_pyrw : 0.45e12 # updated pyrite weathering (mol/yr) + k22_gypw : 2.0e12 # updated gypsum weathering (mol/yr) + k_pyrdeg : 0.25e12 # new pyrite degassing (mol/yr) + k_gypdeg : 0.5e12 # new gypsum degassing (mol/yr) + k_mpsb : 0.7e12 # updated pyrite burial (mol/yr) + k_mgsb : 2.5e12 # updated gypsum burial (mol/yr) + + #### Sr system (fluxes following Mills et al. 2014) + k_Sr_total_igw : 13e9 # igneous weathering mol/yr + #k_Sr_igg : (pars.k_Sr_total_igw * (1 - pars.k_basfrac)) # granite weathering + #k_Sr_igb : (pars.k_Sr_total_igw * pars.k_basfrac) # basalt weathering + k_Sr_sedw : 17e9 # sediment weathering + k_Sr_metam : 13e9 # metamorphic flux + k_Sr_mantle : 7.3e9 # direct mantle flux + + #### present land areas for relative calculations, Mills et al 2014 G3 + k_present_land_area: 1.5e8 ### km2 + k_present_basalt_area: 6.8e6 ### includes island basalts, dessert 2003 + k_present_silicate_area: 8.1e7 ### km2 dessert 2003 + k_present_granite_area: (pars.k_present_silicate_area - pars.k_present_basalt_area) ### assuming silicates = granite+basalt + k_present_carbonate_area: (pars.k_present_land_area - pars.k_present_silicate_area) ### assuming only silicates and carbonates exist + + #### option to hold oxygen constant, 1 : fix O2, 0 : do not fix O2. + o2fix : 0 + + + ## ######################################################################## + ####### Options controlling functional forms + ########################################################################## + + # CO2 partitioning + f_atfrac : 'quadratic' # option 'original' + + # Temperature function + f_temp : 'Berner' # options 'CK1992' (original),'CK1992fixalbedo' + + # Terrestrial ecosystem + f_npp : 'original' # options 'noT','noO2','noCO2','newCO2','bernerCO2','constant' + f_ignit : 'bookchapter' # options 'original','nofbk' + + # Inorganic carbon degassing + f_ccdeg : 'original' # options 'noB' + + # Organic carbon degassing + f_ocdeg : 'O2indep' # options 'O2copsecrashprevent' (original, Bergman 2004) + + # Seafloor weathering + f_sfw_force : 'DEGASS' # dependent on degassing (i.e. seafloor spreading), options 'None' + f_sfw_opt : 'sfw_temp' # dependent on temperature, options 'sfw_strong','sfw_noT','mills2014pCO2' + f_sfw_alpha : 0.23 # sensitivity if CO2 dependent (Mills et al. 2014) + + # Vegetation dependence of weathering + f_vegweath : 'new2' # options 'original','new','newnpp' + f_co2fert : 'original' # CO2 fertilisation effect in original weathering function + + # Activation energies for basalt and granite weathering + f_act_energies : 'split' # options 'single' + + # Granite weathering + f_gran_link_u : 'original' # linear depedence on uplift + f_granitearea : 'OrgEvapForced' # area forcing, options 'Fixed','G3improved' + + # Basalt weathering + f_bas_link_u : 'no' # dependence on uplift, options 'yes' + f_basaltarea : 'g3_2014_construct_from_lips' # area forcing, options 'g3_2014_datafile' + #f_oib_scaling : 'Degass' # G3 OIB forcing scales with degassing + + # Carbonate weathering + f_carbwC : 'Cprop' # dependence on carbonate C reservoir, options 'Cindep' (original) + f_carb_link_u : 'yes' # linear depedence on uplift + + # Gypsum weathering + f_gypweather : 'alternative' # options 'original','forced' + + # Oxidative C weathering + f_oxwO : 'PowerO2' # options 'PowerO2,'SatO2' + f_oxw_a : 0.5 # power dependence on O2 concentration + f_oxwG : 'Gprop' # dependence on organic C reservoir + + # Pyrite weathering + f_pyrweather : 'copse_noO2' # options 'copse_O2' (original),'forced' + + # Phosphorus weathering + f_p_kinetics : 'no' # assumed to follow host rock kinetics, options 'yes' (=apatite Ea) + f_p_apportion : 'no' # no=granite and basalt assumed to have same P content, options 'yes' + + # Land organic carbon burial + f_locb : 'coal' # options 'Uforced','split','original' + + # Marine anoxia + f_anoxia : 'newanoxia' # options 'original' + + # Marine N cycle + f_nfix_power : 2 # + f_denit : 'new' # dependence on [NO3], options 'original' + + # Marine organic carbon burial + f_mocb : 'original' # options 'Uforced','O2dep','both' + f_mocb_b : 2 # power-law dependency on new production + + # Marine organic phosphorus burial + f_CPsea : 'Fixed' # Options 'Fixed','VCI' (Bergman 2004 run 2) + f_CPsea_VCI_oxic : 250.0 # marine C/P burial ratio oxic (f_CPsea:'VCI') + f_CPsea_VCI_anoxic : 4000.0 # marine C/P burial ratio anoxic (f_CPsea:'VCI') + + # Marine Fe-P burial + f_fepb : 'pdep' # options 'Dforced','sfw','original' + + # Marine Ca-P burial + f_capb : 'original' # options 'redox' + + # Marine pyrite sulphur burial + f_pyrburial : 'copse_O2' # dependency on oxygen, options 'copse_noO2','anoxia' + + # Marine gypsum sulphur burial + f_gypburial : 'Caforced' # dependency on prescribed [Ca++], options 'original' + + # Carbonate burial + f_SRedoxAlk : 'off' # link sulphur redox to alkalinity, options 'on' + + # C isotope fractionation calculation + f_cisotopefrac : 'copse_base' # options 'copse_base','fixed','fixed2','copse_noO2' + + # S isotope fractionation calculation + f_sisotopefrac : 'fixed' # options 'fixed','copse_O2' + + # Sr metamorphic loss flux + f_Sr_metam : 'alternative' # dependency on parent reservoir size, options 'original' + + # Sr weathering flux + f_Sr_sedw : 'alternative' # dependency on parent reservoir size, options 'original' + + ########################################################################## + ####### END Options controlling functional forms + ########################################################################## + + + ########################################################################## + #reservoir present day sizes (mol) - used for normalisation + ########################################################################## + P0 : 3.1e15 + N0 : 4.35e16 + O0 : 3.7e19 + C0 : 5e21 + G0 : 1.25e21 + A0 : 3.193e18 + PYR0 : 1.8e20 + GYP0 : 2e20 + S0 : 4e19 + CAL0 : 1.397e19 + + pCO2atm0 : 280e-6 # pCO2 corresponding to A0 (atm) + + #### normalization for Sr reservoirs + Sr_ocean0 : 1.2e17 ### francois and walker 1992 + Sr_sed0 : 5e18 ### francois and walker 1992 + + ######################################################################### + #reservoir initial sizes (mol) + ########################################################################## + + Pinit : (pars.P0) + Ninit : (pars.N0) + Oinit : (pars.O0) + Cinit : (pars.C0) + Ginit : (pars.G0) + Ainit : (pars.A0) + PYRinit : (pars.PYR0) + GYPinit : (pars.GYP0) + Sinit : (pars.S0) + CALinit : (pars.CAL0) + + # initial isotope fractionation values (from COPSE 5_14 code) + delta_Ginit : -26 + delta_Cinit : 1 + delta_Ainit : 0 + delta_PYRinit : -15 + delta_GYPinit : 20 + delta_Sinit : 20 + + #### starting Sr reservoirs + Sr_ocean_init : (pars.Sr_ocean0) + Sr_sed_init : (pars.Sr_sed0) + + #### starting Sr fractionations + delta_new_ig_present: 0.705 ### francois and walker + delta_old_ig_present: 0.715 ### updated; 0.715 G-cubed, 0.718 francois and walker + delta_mantle_present: 0.703 ### francois and walker + delta_Sr_ocean_start: 0.708 ### reasonable average value for Phanerozoic + delta_Sr_sed_start : 0.708 ### updated reasonable average value for Phanerozoic diff --git a/examples/copse/COPSE_test_output/Lenton2016blackdashed.mat b/examples/copse/COPSE_test_output/Lenton2016blackdashed.mat new file mode 100644 index 0000000..8c6de9a Binary files /dev/null and b/examples/copse/COPSE_test_output/Lenton2016blackdashed.mat differ diff --git a/examples/copse/COPSE_test_output/base_514_namechange.txt b/examples/copse/COPSE_test_output/base_514_namechange.txt new file mode 100644 index 0000000..5c7340d --- /dev/null +++ b/examples/copse/COPSE_test_output/base_514_namechange.txt @@ -0,0 +1,602 @@ +time_My_ O2 CO2 P N S T V Alk d13C d34S anox silw oxdw carbw phsw mocb locb mccb gypw pyrw gypb pyrb A C G PYR GYP CAL +600.00 1.000 1.000 0.999 1.000 1.000 4.76 0.000 1.00 0.037 20.00 0.140 0.30 8.12 0.23 1.96 4.50 0.00 0.53 0.02 0.56 1.00 0.53 1.00 5.00 1.25 1.80 2.00 1.00 +599.00 0.795 4.813 0.689 0.686 0.986 11.30 0.000 1.00 -8.734 19.78 0.003 1.49 7.20 3.12 2.27 2.12 0.00 4.61 0.23 0.49 0.93 0.31 4.81 4.99 1.24 1.80 2.01 0.94 +598.00 0.633 7.870 0.835 0.778 0.973 14.07 0.000 1.00 -7.643 19.72 0.301 2.63 6.39 5.41 2.52 2.72 0.00 8.05 0.41 0.44 0.87 0.49 7.87 4.99 1.24 1.80 2.01 0.90 +597.00 0.518 10.193 0.915 0.838 0.959 15.72 0.000 1.00 -6.216 19.88 0.469 3.62 5.76 7.12 2.71 3.16 0.00 10.74 0.54 0.40 0.84 0.69 10.19 4.99 1.23 1.80 2.02 0.87 +596.00 0.441 11.945 0.965 0.879 0.943 16.80 0.000 1.00 -4.974 20.25 0.569 4.44 5.30 8.39 2.86 3.48 0.00 12.83 0.63 0.37 0.81 0.88 11.95 4.99 1.23 1.80 2.02 0.86 +595.00 0.392 13.259 0.999 0.908 0.925 17.56 0.000 1.00 -3.965 20.80 0.629 5.09 4.98 9.34 2.99 3.71 0.00 14.43 0.71 0.35 0.78 1.03 13.26 4.99 1.23 1.81 2.02 0.85 +594.00 0.363 14.247 1.023 0.930 0.906 18.10 0.000 1.00 -3.170 21.48 0.664 5.60 4.79 10.05 3.10 3.89 0.00 15.66 0.76 0.34 0.76 1.14 14.25 4.98 1.22 1.82 2.02 0.84 +593.00 0.349 14.992 1.040 0.948 0.885 18.49 0.000 1.00 -2.556 22.25 0.683 6.01 4.69 10.59 3.19 4.04 0.00 16.60 0.80 0.33 0.75 1.21 14.99 4.98 1.22 1.82 2.02 0.85 +592.00 0.343 15.559 1.054 0.962 0.865 18.79 0.000 1.00 -2.089 23.06 0.694 6.33 4.64 11.01 3.27 4.16 0.00 17.34 0.83 0.33 0.74 1.24 15.56 4.98 1.22 1.83 2.02 0.85 +591.00 0.341 15.992 1.064 0.973 0.845 19.02 0.000 1.00 -1.739 23.87 0.698 6.58 4.62 11.32 3.34 4.26 0.00 17.91 0.86 0.33 0.73 1.24 15.99 4.98 1.22 1.84 2.02 0.86 +590.00 0.342 16.324 1.072 0.982 0.826 19.19 0.000 1.00 -1.478 24.67 0.700 6.78 4.62 11.57 3.39 4.34 0.00 18.35 0.87 0.33 0.72 1.23 16.32 4.99 1.22 1.85 2.02 0.87 +589.00 0.344 16.580 1.078 0.989 0.808 19.33 0.000 1.00 -1.283 25.44 0.701 6.94 4.62 11.76 3.44 4.40 0.00 18.70 0.89 0.34 0.71 1.22 16.58 4.99 1.21 1.86 2.02 0.88 +588.00 0.346 16.775 1.083 0.994 0.791 19.44 0.000 1.00 -1.139 26.17 0.701 7.07 4.63 11.92 3.47 4.45 0.00 18.98 0.90 0.34 0.71 1.20 16.78 4.99 1.21 1.87 2.01 0.90 +587.00 0.348 16.924 1.087 0.998 0.774 19.53 0.000 1.00 -1.032 26.87 0.700 7.17 4.64 12.03 3.50 4.49 0.00 19.20 0.91 0.34 0.70 1.18 16.92 4.99 1.21 1.88 2.01 0.91 +586.00 0.349 17.035 1.090 1.002 0.759 19.60 0.000 1.00 -0.952 27.52 0.700 7.25 4.64 12.13 3.52 4.52 0.00 19.37 0.91 0.34 0.70 1.16 17.04 4.99 1.21 1.89 2.01 0.92 +585.00 0.350 17.117 1.092 1.004 0.744 19.65 0.000 1.00 -0.892 28.13 0.700 7.31 4.64 12.20 3.54 4.54 0.00 19.50 0.92 0.35 0.70 1.14 17.12 4.99 1.21 1.89 2.01 0.94 +584.00 0.351 17.174 1.094 1.006 0.730 19.70 0.000 1.00 -0.846 28.70 0.700 7.36 4.64 12.25 3.55 4.56 0.00 19.61 0.92 0.35 0.70 1.12 17.17 4.99 1.21 1.90 2.01 0.96 +583.00 0.351 17.213 1.095 1.007 0.717 19.73 0.000 1.00 -0.810 29.24 0.701 7.39 4.63 12.29 3.56 4.57 0.00 19.69 0.92 0.35 0.70 1.10 17.21 4.99 1.20 1.91 2.00 0.97 +582.00 0.350 17.235 1.096 1.008 0.704 19.76 0.000 1.00 -0.783 29.74 0.701 7.42 4.62 12.32 3.56 4.58 0.00 19.74 0.92 0.35 0.70 1.08 17.24 5.00 1.20 1.92 2.00 0.99 +581.00 0.349 17.245 1.096 1.009 0.692 19.78 0.000 1.00 -0.761 30.21 0.702 7.44 4.61 12.34 3.57 4.58 0.00 19.79 0.92 0.35 0.69 1.07 17.25 5.00 1.20 1.92 2.00 1.00 +580.00 0.348 17.244 1.097 1.009 0.680 19.80 0.000 1.00 -0.743 30.65 0.703 7.46 4.60 12.36 3.57 4.58 0.00 19.81 0.92 0.35 0.69 1.05 17.24 5.00 1.20 1.93 2.00 1.02 +579.00 0.346 17.235 1.097 1.009 0.668 19.82 0.000 1.00 -0.728 31.06 0.705 7.47 4.58 12.36 3.56 4.58 0.00 19.83 0.92 0.35 0.69 1.04 17.24 5.00 1.20 1.94 1.99 1.04 +578.00 0.345 17.219 1.097 1.008 0.657 19.83 0.000 1.00 -0.715 31.44 0.706 7.47 4.56 12.37 3.56 4.58 0.00 19.84 0.92 0.35 0.69 1.03 17.22 5.00 1.20 1.94 1.99 1.05 +577.00 0.342 17.196 1.096 1.008 0.646 19.84 0.000 1.00 -0.705 31.79 0.708 7.48 4.55 12.36 3.56 4.57 0.00 19.84 0.92 0.35 0.69 1.02 17.20 5.00 1.20 1.95 1.99 1.07 +576.00 0.340 17.169 1.096 1.007 0.635 19.84 0.000 1.00 -0.695 32.12 0.710 7.47 4.53 12.36 3.55 4.57 0.00 19.83 0.92 0.35 0.69 1.00 17.17 5.00 1.19 1.96 1.99 1.09 +575.00 0.338 17.139 1.096 1.007 0.625 19.85 0.000 1.00 -0.686 32.43 0.711 7.47 4.50 12.35 3.54 4.56 0.00 19.82 0.92 0.35 0.69 0.99 17.14 5.01 1.19 1.96 1.99 1.10 +574.00 0.335 17.104 1.095 1.006 0.615 19.85 0.000 1.00 -0.679 32.72 0.713 7.47 4.48 12.34 3.54 4.55 0.00 19.81 0.92 0.35 0.69 0.98 17.10 5.01 1.19 1.97 1.98 1.12 +573.00 0.333 17.068 1.095 1.005 0.605 19.85 0.000 1.00 -0.671 32.98 0.715 7.46 4.46 12.33 3.53 4.54 0.00 19.79 0.91 0.35 0.69 0.97 17.07 5.01 1.19 1.98 1.98 1.14 +572.00 0.330 17.029 1.094 1.004 0.595 19.85 0.000 1.00 -0.664 33.23 0.717 7.45 4.43 12.32 3.52 4.53 0.00 19.77 0.91 0.35 0.69 0.96 17.03 5.01 1.19 1.98 1.98 1.15 +571.00 0.327 16.988 1.093 1.003 0.585 19.85 0.000 1.00 -0.658 33.46 0.720 7.44 4.41 12.30 3.51 4.52 0.00 19.74 0.91 0.35 0.68 0.95 16.99 5.01 1.19 1.99 1.98 1.17 +570.00 0.324 16.946 1.093 1.002 0.576 19.85 0.000 1.00 -0.651 33.67 0.722 7.43 4.39 12.28 3.50 4.51 0.00 19.72 0.91 0.35 0.68 0.95 16.95 5.01 1.19 2.00 1.97 1.18 +569.00 0.321 16.903 1.092 1.000 0.567 19.85 0.000 1.00 -0.645 33.86 0.724 7.42 4.36 12.27 3.49 4.50 0.00 19.69 0.91 0.35 0.68 0.94 16.90 5.01 1.18 2.00 1.97 1.20 +568.00 0.318 16.859 1.091 0.999 0.558 19.85 0.000 1.00 -0.639 34.04 0.726 7.41 4.34 12.25 3.49 4.49 0.00 19.66 0.90 0.35 0.68 0.93 16.86 5.02 1.18 2.01 1.97 1.22 +567.00 0.315 16.815 1.090 0.998 0.549 19.84 0.000 1.00 -0.633 34.21 0.728 7.40 4.31 12.23 3.48 4.48 0.00 19.63 0.90 0.35 0.68 0.92 16.81 5.02 1.18 2.01 1.97 1.23 +566.00 0.312 16.769 1.089 0.997 0.541 19.84 0.000 1.00 -0.627 34.36 0.730 7.39 4.29 12.21 3.47 4.47 0.00 19.60 0.90 0.35 0.68 0.91 16.77 5.02 1.18 2.02 1.97 1.25 +565.00 0.310 16.724 1.089 0.996 0.532 19.84 0.000 1.00 -0.622 34.50 0.733 7.37 4.26 12.20 3.46 4.46 0.00 19.57 0.90 0.35 0.67 0.90 16.72 5.02 1.18 2.02 1.96 1.26 +564.00 0.307 16.678 1.088 0.994 0.524 19.84 0.000 1.00 -0.616 34.62 0.735 7.36 4.24 12.18 3.45 4.45 0.00 19.54 0.89 0.35 0.67 0.90 16.68 5.02 1.18 2.03 1.96 1.28 +563.00 0.304 16.632 1.087 0.993 0.516 19.83 0.000 1.00 -0.610 34.73 0.737 7.35 4.22 12.16 3.44 4.44 0.00 19.51 0.89 0.35 0.67 0.89 16.63 5.02 1.18 2.04 1.96 1.30 +562.00 0.301 16.586 1.086 0.992 0.508 19.83 0.000 1.00 -0.605 34.84 0.739 7.34 4.19 12.14 3.43 4.43 0.00 19.48 0.89 0.35 0.67 0.88 16.59 5.02 1.18 2.04 1.96 1.31 +561.00 0.298 16.540 1.085 0.991 0.500 19.83 0.000 1.00 -0.599 34.93 0.741 7.32 4.17 12.12 3.42 4.42 0.00 19.44 0.89 0.34 0.66 0.87 16.54 5.03 1.17 2.05 1.95 1.33 +560.00 0.295 16.494 1.084 0.989 0.493 19.82 0.000 1.00 -0.594 35.01 0.743 7.31 4.14 12.10 3.41 4.40 0.00 19.41 0.88 0.34 0.66 0.87 16.49 5.03 1.17 2.05 1.95 1.34 +559.00 0.292 16.448 1.084 0.988 0.485 19.82 0.000 1.00 -0.589 35.08 0.745 7.30 4.12 12.08 3.40 4.39 0.00 19.38 0.88 0.34 0.66 0.86 16.45 5.03 1.17 2.06 1.95 1.36 +558.00 0.290 16.402 1.083 0.987 0.478 19.82 0.000 1.00 -0.583 35.14 0.748 7.29 4.10 12.06 3.39 4.38 0.00 19.35 0.88 0.34 0.66 0.85 16.40 5.03 1.17 2.06 1.95 1.38 +557.00 0.287 16.356 1.082 0.986 0.471 19.81 0.000 1.00 -0.578 35.19 0.750 7.27 4.07 12.04 3.38 4.37 0.00 19.32 0.88 0.34 0.66 0.85 16.36 5.03 1.17 2.07 1.95 1.39 +556.00 0.284 16.311 1.081 0.984 0.464 19.81 0.000 1.00 -0.572 35.24 0.752 7.26 4.05 12.02 3.37 4.36 0.00 19.28 0.87 0.34 0.65 0.84 16.31 5.03 1.17 2.07 1.94 1.41 +555.00 0.282 16.265 1.080 0.983 0.457 19.81 0.000 1.00 -0.567 35.27 0.754 7.25 4.03 12.00 3.36 4.35 0.00 19.25 0.87 0.34 0.65 0.83 16.27 5.03 1.17 2.08 1.94 1.42 +554.00 0.279 16.220 1.080 0.982 0.451 19.81 0.000 1.00 -0.562 35.30 0.756 7.24 4.01 11.99 3.35 4.34 0.00 19.22 0.87 0.34 0.65 0.83 16.22 5.03 1.17 2.08 1.94 1.44 +553.00 0.277 16.176 1.079 0.981 0.444 19.80 0.000 1.00 -0.557 35.32 0.758 7.22 3.98 11.97 3.34 4.33 0.00 19.19 0.87 0.34 0.65 0.82 16.18 5.04 1.17 2.09 1.94 1.46 +552.00 0.274 16.131 1.078 0.980 0.438 19.80 0.000 1.00 -0.552 35.34 0.759 7.21 3.96 11.95 3.34 4.32 0.00 19.16 0.87 0.34 0.64 0.81 16.13 5.04 1.16 2.09 1.93 1.47 +551.00 0.272 16.087 1.077 0.979 0.431 19.80 0.000 1.00 -0.547 35.35 0.761 7.20 3.94 11.93 3.33 4.31 0.00 19.13 0.86 0.34 0.64 0.81 16.09 5.04 1.16 2.10 1.93 1.49 +550.00 0.269 16.043 1.076 0.977 0.425 19.80 0.000 1.00 -0.542 35.35 0.763 7.19 3.92 11.91 3.32 4.30 0.00 19.10 0.86 0.34 0.64 0.80 16.04 5.04 1.16 2.10 1.93 1.50 +549.00 0.267 16.000 1.076 0.976 0.419 19.79 0.000 1.00 -0.537 35.35 0.765 7.17 3.90 11.88 3.31 4.29 0.00 19.05 0.86 0.34 0.64 0.79 16.00 5.04 1.16 2.10 1.93 1.52 +548.00 0.264 15.992 1.075 0.976 0.413 19.81 0.000 1.00 -0.535 35.35 0.767 7.18 3.87 11.89 3.30 4.28 0.00 19.07 0.86 0.33 0.63 0.79 15.99 5.04 1.16 2.11 1.93 1.53 +547.00 0.261 16.010 1.076 0.976 0.408 19.84 0.000 1.00 -0.532 35.35 0.770 7.22 3.86 11.94 3.31 4.29 0.00 19.16 0.86 0.33 0.63 0.79 16.01 5.04 1.16 2.11 1.92 1.55 +546.00 0.259 16.027 1.077 0.977 0.402 19.86 0.000 1.00 -0.523 35.35 0.772 7.26 3.85 12.00 3.32 4.30 0.00 19.27 0.86 0.33 0.63 0.79 16.03 5.04 1.16 2.12 1.92 1.57 +545.00 0.257 16.057 1.080 0.980 0.397 19.90 0.000 1.00 -0.513 35.34 0.775 7.33 3.84 12.08 3.34 4.32 0.00 19.41 0.87 0.33 0.63 0.79 16.06 5.04 1.16 2.12 1.92 1.58 +544.00 0.255 16.097 1.083 0.983 0.391 19.93 0.000 1.00 -0.502 35.34 0.777 7.39 3.84 12.17 3.36 4.35 0.00 19.57 0.87 0.34 0.63 0.79 16.10 5.04 1.16 2.13 1.92 1.60 +543.00 0.253 16.143 1.086 0.986 0.386 19.97 0.000 1.00 -0.488 35.33 0.780 7.47 3.83 12.27 3.38 4.38 0.00 19.73 0.88 0.34 0.63 0.79 16.14 5.05 1.16 2.13 1.91 1.62 +542.00 0.251 16.195 1.089 0.990 0.381 20.02 0.000 1.00 -0.473 35.32 0.782 7.55 3.84 12.38 3.40 4.41 0.00 19.93 0.89 0.34 0.62 0.79 16.19 5.05 1.15 2.14 1.91 1.64 +541.00 0.250 16.232 1.093 0.993 0.376 20.05 0.000 1.00 -0.456 35.31 0.783 7.63 3.84 12.47 3.42 4.44 0.00 20.10 0.89 0.34 0.62 0.79 16.23 5.05 1.15 2.14 1.91 1.66 +540.00 0.249 16.275 1.096 0.997 0.372 20.09 0.000 1.00 -0.441 35.29 0.785 7.70 3.85 12.57 3.45 4.48 0.00 20.27 0.90 0.34 0.62 0.79 16.27 5.05 1.15 2.15 1.91 1.68 +539.00 0.248 16.325 1.100 1.001 0.368 20.14 0.000 1.00 -0.426 35.26 0.787 7.78 3.85 12.68 3.47 4.51 0.00 20.46 0.90 0.34 0.62 0.79 16.32 5.05 1.15 2.15 1.90 1.70 +538.00 0.247 16.377 1.104 1.005 0.363 20.18 0.000 1.00 -0.412 35.23 0.788 7.88 3.87 12.80 3.50 4.55 0.00 20.68 0.91 0.34 0.62 0.79 16.38 5.05 1.15 2.15 1.90 1.72 +537.00 0.247 16.430 1.108 1.010 0.360 20.22 0.000 1.00 -0.397 35.19 0.790 7.96 3.88 12.92 3.53 4.59 0.00 20.88 0.92 0.35 0.62 0.79 16.43 5.05 1.15 2.16 1.90 1.74 +536.00 0.246 16.501 1.112 1.014 0.356 20.28 0.000 1.00 -0.385 35.15 0.791 8.07 3.89 13.06 3.56 4.63 0.00 21.13 0.93 0.35 0.63 0.79 16.50 5.05 1.15 2.16 1.89 1.76 +535.00 0.246 16.566 1.117 1.020 0.352 20.33 0.000 1.00 -0.370 35.11 0.793 8.17 3.90 13.18 3.59 4.68 0.00 21.35 0.93 0.35 0.63 0.79 16.57 5.05 1.15 2.17 1.89 1.78 +534.00 0.245 16.631 1.121 1.024 0.349 20.38 0.000 1.00 -0.355 35.06 0.794 8.27 3.91 13.32 3.63 4.72 0.00 21.59 0.94 0.35 0.63 0.79 16.63 5.05 1.15 2.17 1.89 1.80 +533.00 0.245 16.691 1.126 1.029 0.346 20.42 0.000 1.00 -0.340 35.01 0.795 8.38 3.93 13.45 3.66 4.77 0.00 21.83 0.95 0.35 0.63 0.79 16.69 5.05 1.15 2.18 1.88 1.82 +532.00 0.245 16.749 1.130 1.034 0.343 20.47 0.000 1.00 -0.326 34.95 0.796 8.48 3.95 13.58 3.69 4.81 0.00 22.06 0.96 0.36 0.63 0.79 16.75 5.05 1.15 2.18 1.88 1.85 +531.00 0.245 16.822 1.135 1.040 0.340 20.52 0.000 1.00 -0.314 34.89 0.797 8.59 3.96 13.72 3.73 4.86 0.00 22.30 0.97 0.36 0.64 0.79 16.82 5.05 1.14 2.19 1.88 1.87 +530.00 0.245 16.890 1.139 1.044 0.337 20.57 0.000 1.00 -0.302 34.83 0.798 8.70 3.98 13.86 3.76 4.91 0.00 22.56 0.97 0.36 0.64 0.80 16.89 5.06 1.14 2.19 1.88 1.89 +529.00 0.245 16.953 1.144 1.050 0.335 20.62 0.000 1.00 -0.289 34.76 0.799 8.80 4.00 13.98 3.79 4.96 0.00 22.78 0.98 0.36 0.64 0.80 16.95 5.06 1.14 2.19 1.87 1.92 +528.00 0.246 16.998 1.148 1.054 0.332 20.66 0.000 1.00 -0.275 34.69 0.800 8.88 4.01 14.09 3.82 5.00 0.00 22.97 0.99 0.37 0.64 0.80 17.00 5.06 1.14 2.20 1.87 1.94 +527.00 0.246 17.031 1.151 1.057 0.330 20.70 0.000 1.00 -0.263 34.61 0.800 8.95 4.02 14.16 3.84 5.03 0.00 23.11 0.99 0.37 0.65 0.79 17.03 5.06 1.14 2.20 1.87 1.97 +526.00 0.247 17.059 1.154 1.060 0.328 20.73 0.000 1.00 -0.253 34.53 0.800 9.01 4.04 14.24 3.86 5.06 0.00 23.25 0.99 0.37 0.65 0.79 17.06 5.06 1.14 2.21 1.86 1.99 +525.00 0.247 17.082 1.156 1.063 0.326 20.76 0.000 1.00 -0.245 34.45 0.800 9.07 4.05 14.31 3.88 5.08 0.00 23.38 1.00 0.37 0.66 0.79 17.08 5.06 1.14 2.21 1.86 2.01 +524.00 0.247 17.101 1.158 1.065 0.324 20.79 0.000 1.00 -0.238 34.36 0.800 9.13 4.06 14.38 3.90 5.11 0.00 23.51 1.00 0.37 0.66 0.79 17.10 5.06 1.14 2.22 1.85 2.04 +523.00 0.248 17.118 1.160 1.068 0.322 20.81 0.000 1.00 -0.232 34.27 0.801 9.17 4.06 14.43 3.91 5.13 0.00 23.61 1.00 0.38 0.66 0.79 17.12 5.06 1.14 2.22 1.85 2.06 +522.00 0.248 17.135 1.162 1.070 0.320 20.84 0.000 1.00 -0.227 34.18 0.801 9.23 4.07 14.50 3.93 5.15 0.00 23.73 1.00 0.38 0.67 0.78 17.13 5.06 1.14 2.22 1.85 2.09 +521.00 0.248 17.149 1.164 1.072 0.318 20.87 0.000 1.00 -0.222 34.10 0.801 9.28 4.08 14.57 3.94 5.17 0.00 23.85 1.01 0.38 0.67 0.78 17.15 5.06 1.14 2.23 1.84 2.11 +520.00 0.248 17.162 1.166 1.075 0.317 20.89 0.000 1.00 -0.217 34.01 0.802 9.33 4.08 14.62 3.96 5.20 0.00 23.95 1.01 0.38 0.68 0.78 17.16 5.06 1.14 2.23 1.84 2.13 +519.00 0.248 17.175 1.168 1.077 0.315 20.92 0.000 1.00 -0.213 33.93 0.802 9.37 4.08 14.66 3.97 5.22 0.00 24.02 1.01 0.38 0.68 0.78 17.17 5.06 1.13 2.24 1.84 2.16 +518.00 0.248 17.158 1.169 1.077 0.313 20.93 0.000 1.00 -0.207 33.84 0.802 9.37 4.08 14.66 3.97 5.22 0.00 24.03 1.01 0.38 0.68 0.78 17.16 5.06 1.13 2.24 1.83 2.18 +517.00 0.248 17.123 1.168 1.077 0.311 20.93 0.000 1.00 -0.202 33.76 0.802 9.35 4.08 14.62 3.96 5.22 0.00 23.97 1.00 0.38 0.69 0.77 17.12 5.07 1.13 2.24 1.83 2.20 +516.00 0.248 17.078 1.167 1.075 0.310 20.93 0.000 1.00 -0.199 33.67 0.801 9.33 4.07 14.59 3.95 5.20 0.00 23.92 1.00 0.38 0.69 0.76 17.08 5.07 1.13 2.25 1.83 2.23 +515.00 0.248 17.024 1.165 1.074 0.308 20.92 0.000 1.00 -0.199 33.58 0.801 9.10 3.98 14.24 3.85 5.19 0.00 23.34 0.97 0.38 0.69 0.76 17.02 5.07 1.13 2.25 1.83 2.25 +514.00 0.247 17.040 1.155 1.062 0.306 20.95 0.000 1.00 -0.208 33.49 0.800 9.11 3.96 14.24 3.85 5.07 0.00 23.35 0.97 0.37 0.69 0.74 17.04 5.07 1.13 2.25 1.82 2.27 +513.00 0.246 17.032 1.154 1.061 0.304 20.97 0.000 1.00 -0.209 33.42 0.800 9.11 3.94 14.22 3.85 5.06 0.00 23.33 0.97 0.37 0.69 0.74 17.03 5.07 1.13 2.26 1.82 2.29 +512.00 0.246 17.006 1.153 1.060 0.302 20.97 0.000 1.00 -0.207 33.35 0.801 9.10 3.93 14.19 3.84 5.05 0.00 23.29 0.97 0.37 0.70 0.73 17.01 5.07 1.13 2.26 1.82 2.31 +511.00 0.245 16.967 1.152 1.058 0.299 20.97 0.000 1.00 -0.204 33.27 0.801 9.06 3.91 14.14 3.82 5.04 0.00 23.20 0.96 0.37 0.70 0.72 16.97 5.07 1.13 2.27 1.81 2.33 +510.00 0.245 16.921 1.150 1.056 0.297 20.97 0.000 1.00 -0.202 33.20 0.801 9.03 3.90 14.09 3.81 5.01 0.00 23.13 0.96 0.37 0.70 0.72 16.92 5.07 1.13 2.27 1.81 2.35 +509.00 0.244 16.868 1.148 1.054 0.295 20.97 0.000 1.00 -0.202 33.13 0.801 8.94 3.86 13.95 3.77 4.99 0.00 22.89 0.95 0.37 0.70 0.71 16.87 5.07 1.13 2.27 1.81 2.36 +508.00 0.243 16.827 1.143 1.048 0.293 20.96 0.000 1.00 -0.204 33.06 0.801 8.96 3.86 13.99 3.78 4.95 0.00 22.95 0.95 0.37 0.70 0.70 16.83 5.07 1.13 2.28 1.81 2.38 +507.00 0.242 16.778 1.144 1.049 0.291 20.96 0.000 1.00 -0.205 32.99 0.802 8.98 3.87 14.03 3.79 4.95 0.00 23.01 0.95 0.37 0.70 0.70 16.78 5.07 1.13 2.28 1.80 2.40 +506.00 0.241 16.705 1.145 1.050 0.289 20.95 0.000 1.00 -0.203 32.92 0.802 8.97 3.87 14.02 3.79 4.96 0.00 22.99 0.95 0.37 0.70 0.70 16.70 5.07 1.13 2.28 1.80 2.42 +505.00 0.241 16.619 1.145 1.050 0.287 20.92 0.000 1.00 -0.202 32.86 0.803 8.95 3.87 14.00 3.78 4.96 0.00 22.96 0.94 0.37 0.70 0.70 16.62 5.08 1.12 2.29 1.80 2.44 +504.00 0.240 16.541 1.144 1.049 0.285 20.91 0.000 1.00 -0.205 32.79 0.804 8.93 3.87 13.98 3.78 4.95 0.00 22.91 0.94 0.37 0.70 0.69 16.54 5.08 1.12 2.29 1.80 2.45 +503.00 0.239 16.453 1.143 1.048 0.283 20.88 0.000 1.00 -0.208 32.73 0.804 8.90 3.86 13.95 3.77 4.94 0.00 22.85 0.94 0.37 0.70 0.69 16.45 5.08 1.12 2.29 1.79 2.47 +502.00 0.237 16.359 1.142 1.047 0.281 20.86 0.000 1.00 -0.211 32.66 0.805 8.86 3.86 13.90 3.75 4.93 0.00 22.76 0.93 0.37 0.70 0.69 16.36 5.08 1.12 2.30 1.79 2.49 +501.00 0.236 16.263 1.141 1.045 0.279 20.83 0.000 1.00 -0.215 32.60 0.806 8.80 3.84 13.84 3.74 4.91 0.00 22.64 0.93 0.37 0.70 0.68 16.26 5.08 1.12 2.30 1.79 2.50 +500.00 0.235 16.183 1.139 1.043 0.277 20.81 0.000 1.00 -0.221 32.55 0.806 8.76 3.83 13.79 3.72 4.89 0.00 22.55 0.92 0.37 0.70 0.68 16.18 5.08 1.12 2.30 1.79 2.52 +499.00 0.233 16.099 1.137 1.041 0.275 20.79 0.000 1.00 -0.226 32.50 0.807 8.72 3.82 13.74 3.71 4.87 0.00 22.45 0.92 0.37 0.70 0.68 16.10 5.08 1.12 2.30 1.79 2.54 +498.00 0.232 16.028 1.136 1.039 0.273 20.77 0.000 1.00 -0.232 32.45 0.808 8.68 3.80 13.68 3.69 4.86 0.00 22.36 0.91 0.37 0.70 0.67 16.03 5.08 1.12 2.31 1.78 2.55 +497.00 0.230 15.968 1.134 1.037 0.271 20.76 0.000 1.00 -0.237 32.42 0.809 8.64 3.78 13.64 3.68 4.84 0.00 22.28 0.91 0.37 0.69 0.67 15.97 5.08 1.12 2.31 1.78 2.57 +496.00 0.228 15.901 1.132 1.035 0.269 20.75 0.000 1.00 -0.239 32.39 0.810 8.60 3.75 13.57 3.66 4.82 0.00 22.17 0.90 0.37 0.69 0.67 15.90 5.08 1.12 2.31 1.78 2.58 +495.00 0.227 15.848 1.130 1.032 0.266 20.74 0.000 1.00 -0.242 32.36 0.811 8.56 3.73 13.52 3.64 4.80 0.00 22.08 0.90 0.37 0.69 0.66 15.85 5.08 1.12 2.32 1.78 2.60 +494.00 0.225 15.803 1.129 1.030 0.264 20.74 0.000 1.00 -0.245 32.34 0.812 8.52 3.71 13.46 3.62 4.78 0.00 21.99 0.89 0.37 0.69 0.66 15.80 5.09 1.12 2.32 1.77 2.61 +493.00 0.223 15.768 1.127 1.028 0.262 20.74 0.000 1.00 -0.247 32.32 0.813 8.49 3.68 13.40 3.60 4.76 0.00 21.89 0.89 0.36 0.69 0.66 15.77 5.09 1.12 2.32 1.77 2.63 +492.00 0.222 15.743 1.125 1.026 0.260 20.75 0.000 1.00 -0.248 32.31 0.814 8.46 3.65 13.35 3.59 4.73 0.00 21.80 0.89 0.36 0.69 0.65 15.74 5.09 1.12 2.33 1.77 2.64 +491.00 0.220 15.708 1.122 1.023 0.258 20.75 0.000 1.00 -0.246 32.29 0.815 8.41 3.62 13.28 3.57 4.71 0.00 21.69 0.88 0.36 0.68 0.65 15.71 5.09 1.12 2.33 1.77 2.66 +490.00 0.219 15.685 1.120 1.020 0.255 20.76 0.000 1.00 -0.245 32.28 0.815 8.37 3.59 13.21 3.55 4.68 0.00 21.59 0.87 0.36 0.68 0.64 15.68 5.09 1.11 2.33 1.77 2.67 +489.00 0.218 15.671 1.118 1.017 0.253 20.77 0.000 1.00 -0.244 32.27 0.816 8.35 3.56 13.17 3.53 4.66 0.00 21.52 0.87 0.35 0.68 0.64 15.67 5.09 1.11 2.33 1.76 2.68 +488.00 0.216 15.661 1.116 1.016 0.251 20.78 0.000 1.00 -0.242 32.26 0.817 8.32 3.54 13.12 3.52 4.64 0.00 21.44 0.87 0.35 0.68 0.63 15.66 5.09 1.11 2.34 1.76 2.70 +487.00 0.215 15.657 1.114 1.013 0.249 20.80 0.000 1.00 -0.240 32.26 0.817 8.30 3.51 13.07 3.50 4.62 0.00 21.37 0.86 0.35 0.67 0.63 15.66 5.09 1.11 2.34 1.76 2.71 +486.00 0.214 15.641 1.112 1.011 0.246 20.81 0.000 1.00 -0.235 32.25 0.818 8.28 3.49 13.02 3.49 4.60 0.00 21.30 0.86 0.35 0.67 0.62 15.64 5.09 1.11 2.34 1.76 2.72 +485.00 0.213 15.630 1.110 1.009 0.244 20.83 0.000 1.00 -0.232 32.23 0.818 8.26 3.47 12.99 3.48 4.58 0.00 21.26 0.86 0.35 0.67 0.62 15.63 5.09 1.11 2.35 1.76 2.74 +484.00 0.212 15.621 1.109 1.007 0.242 20.84 0.000 1.00 -0.228 32.22 0.819 8.25 3.45 12.96 3.47 4.57 0.00 21.22 0.85 0.35 0.67 0.61 15.62 5.09 1.11 2.35 1.76 2.75 +483.00 0.211 15.614 1.108 1.006 0.240 20.86 0.000 1.00 -0.225 32.20 0.819 8.26 3.43 12.96 3.46 4.55 0.00 21.22 0.85 0.35 0.66 0.61 15.61 5.09 1.11 2.35 1.75 2.76 +482.00 0.210 15.603 1.108 1.006 0.238 20.87 0.000 1.00 -0.221 32.19 0.820 8.25 3.42 12.94 3.46 4.55 0.00 21.19 0.85 0.34 0.66 0.61 15.60 5.09 1.11 2.35 1.75 2.78 +481.00 0.210 15.575 1.107 1.004 0.237 20.88 0.000 1.00 -0.215 32.16 0.820 8.24 3.41 12.92 3.45 4.54 0.00 21.17 0.85 0.34 0.66 0.60 15.58 5.09 1.11 2.36 1.75 2.79 +480.00 0.209 15.550 1.106 1.004 0.235 20.88 0.000 1.00 -0.212 32.14 0.821 8.23 3.40 12.89 3.44 4.53 0.00 21.12 0.84 0.34 0.66 0.60 15.55 5.09 1.11 2.36 1.75 2.80 +479.00 0.209 15.528 1.105 1.002 0.233 20.89 0.000 1.00 -0.210 32.11 0.821 8.21 3.38 12.87 3.43 4.52 0.00 21.08 0.84 0.34 0.66 0.60 15.53 5.10 1.11 2.36 1.75 2.82 +478.00 0.208 15.509 1.104 1.001 0.232 20.90 0.000 1.00 -0.209 32.08 0.822 8.21 3.37 12.86 3.43 4.51 0.00 21.06 0.84 0.34 0.66 0.59 15.51 5.10 1.11 2.36 1.74 2.83 +477.00 0.207 15.490 1.104 1.001 0.230 20.91 0.000 1.00 -0.207 32.05 0.822 8.20 3.36 12.83 3.42 4.50 0.00 21.03 0.84 0.34 0.65 0.59 15.49 5.10 1.11 2.37 1.74 2.84 +476.00 0.206 15.490 1.103 1.000 0.228 20.93 0.000 1.00 -0.207 32.03 0.823 8.21 3.35 12.83 3.42 4.50 0.00 21.04 0.84 0.34 0.65 0.59 15.49 5.10 1.11 2.37 1.74 2.86 +475.00 0.205 15.484 1.103 1.000 0.227 20.95 0.000 1.00 -0.205 32.00 0.823 8.21 3.34 12.83 3.42 4.50 0.00 21.04 0.84 0.34 0.65 0.58 15.48 5.10 1.11 2.37 1.74 2.87 +474.00 0.205 15.474 1.103 0.999 0.225 20.96 0.000 1.00 -0.201 31.98 0.824 8.22 3.33 12.84 3.42 4.49 0.00 21.06 0.84 0.34 0.65 0.58 15.47 5.10 1.11 2.37 1.74 2.88 +473.00 0.204 15.460 1.103 0.999 0.224 20.98 0.000 1.00 -0.198 31.96 0.824 8.23 3.32 12.84 3.42 4.49 0.00 21.07 0.83 0.34 0.65 0.58 15.46 5.10 1.11 2.38 1.73 2.90 +472.00 0.204 15.442 1.103 0.999 0.223 20.99 0.000 1.00 -0.194 31.93 0.825 8.25 3.32 12.86 3.42 4.49 0.00 21.12 0.84 0.34 0.65 0.58 15.44 5.10 1.10 2.38 1.73 2.91 +471.00 0.203 15.434 1.104 1.000 0.221 21.00 0.000 1.00 -0.193 31.91 0.825 8.27 3.32 12.88 3.43 4.50 0.00 21.15 0.84 0.34 0.65 0.58 15.43 5.10 1.10 2.38 1.73 2.92 +470.00 0.203 15.417 1.104 1.001 0.220 21.01 0.000 1.00 -0.190 31.88 0.826 8.28 3.32 12.89 3.43 4.51 0.00 21.16 0.83 0.34 0.65 0.58 15.42 5.10 1.10 2.38 1.73 2.94 +469.00 0.202 15.398 1.104 1.001 0.219 21.02 0.000 1.00 -0.187 31.86 0.826 8.28 3.31 12.89 3.43 4.51 0.00 21.17 0.83 0.34 0.65 0.57 15.40 5.10 1.10 2.38 1.73 2.95 +468.00 0.202 15.377 1.104 1.001 0.218 21.03 0.000 1.00 -0.185 31.83 0.826 8.27 3.30 12.86 3.42 4.51 0.00 21.13 0.83 0.34 0.65 0.57 15.38 5.10 1.10 2.39 1.73 2.96 +467.00 0.202 15.359 1.103 1.000 0.217 21.04 0.000 1.00 -0.183 31.80 0.827 8.24 3.28 12.81 3.41 4.50 0.00 21.05 0.83 0.34 0.65 0.57 15.36 5.10 1.10 2.39 1.72 2.98 +466.00 0.201 15.365 1.102 0.998 0.215 21.06 0.000 1.00 -0.185 31.78 0.827 8.22 3.26 12.77 3.39 4.48 0.00 20.99 0.82 0.34 0.64 0.57 15.37 5.10 1.10 2.39 1.72 2.99 +465.00 0.200 15.374 1.101 0.996 0.214 21.09 0.005 1.00 -0.185 31.76 0.827 8.20 3.24 12.72 3.38 4.47 0.00 20.92 0.82 0.33 0.64 0.56 15.37 5.10 1.10 2.39 1.72 3.00 +464.00 0.200 15.383 1.098 0.994 0.213 21.11 0.008 1.00 -0.178 31.74 0.827 8.17 3.21 12.65 3.36 4.45 0.02 20.81 0.81 0.33 0.64 0.56 15.38 5.10 1.10 2.40 1.72 3.02 +463.00 0.200 15.401 1.096 0.991 0.212 21.14 0.008 1.00 -0.172 31.72 0.827 8.10 3.17 12.53 3.33 4.42 0.03 20.63 0.81 0.33 0.64 0.55 15.40 5.10 1.10 2.40 1.72 3.03 +462.00 0.199 15.437 1.092 0.986 0.211 21.18 0.011 1.00 -0.169 31.70 0.826 8.03 3.12 12.39 3.29 4.38 0.03 20.42 0.80 0.32 0.64 0.54 15.44 5.10 1.10 2.40 1.71 3.04 +461.00 0.199 15.507 1.087 0.981 0.209 21.23 0.013 1.00 -0.167 31.67 0.826 7.99 3.07 12.30 3.26 4.33 0.04 20.29 0.79 0.32 0.64 0.54 15.51 5.10 1.10 2.40 1.71 3.05 +460.00 0.198 15.583 1.083 0.977 0.208 21.29 0.016 1.00 -0.160 31.66 0.825 7.95 3.03 12.20 3.23 4.30 0.04 20.15 0.78 0.31 0.64 0.53 15.58 5.10 1.10 2.41 1.71 3.06 +459.00 0.198 15.666 1.079 0.973 0.206 21.35 0.016 1.00 -0.151 31.64 0.825 7.89 2.97 12.06 3.19 4.26 0.05 19.94 0.77 0.31 0.63 0.52 15.67 5.10 1.10 2.41 1.71 3.07 +458.00 0.198 15.768 1.074 0.967 0.205 21.43 0.019 1.00 -0.144 31.62 0.824 7.82 2.91 11.91 3.15 4.20 0.05 19.73 0.76 0.30 0.63 0.51 15.77 5.10 1.10 2.41 1.71 3.08 +457.00 0.198 15.886 1.068 0.960 0.203 21.50 0.021 1.00 -0.136 31.60 0.823 7.78 2.86 11.79 3.12 4.15 0.06 19.57 0.75 0.30 0.63 0.50 15.89 5.10 1.10 2.41 1.71 3.09 +456.00 0.198 16.010 1.064 0.955 0.202 21.59 0.021 1.00 -0.125 31.58 0.822 7.75 2.81 11.71 3.09 4.10 0.07 19.46 0.75 0.29 0.63 0.49 16.01 5.10 1.10 2.41 1.71 3.10 +455.00 0.198 16.139 1.060 0.951 0.200 21.67 0.024 1.00 -0.115 31.55 0.821 7.72 2.76 11.60 3.06 4.07 0.07 19.33 0.74 0.29 0.62 0.48 16.14 5.10 1.10 2.42 1.70 3.11 +454.00 0.198 16.289 1.056 0.947 0.198 21.76 0.027 1.00 -0.104 31.53 0.820 7.73 2.72 11.55 3.05 4.03 0.08 19.28 0.74 0.28 0.62 0.48 16.29 5.10 1.10 2.42 1.70 3.12 +453.00 0.199 16.431 1.053 0.944 0.197 21.85 0.029 1.00 -0.090 31.49 0.819 7.73 2.69 11.51 3.03 4.01 0.08 19.24 0.73 0.28 0.62 0.47 16.43 5.10 1.10 2.42 1.70 3.13 +452.00 0.200 16.565 1.051 0.941 0.196 21.94 0.029 1.00 -0.073 31.46 0.818 7.74 2.66 11.47 3.02 3.99 0.09 19.21 0.73 0.28 0.61 0.46 16.56 5.10 1.10 2.42 1.70 3.14 +451.00 0.201 16.694 1.049 0.939 0.194 22.02 0.032 1.00 -0.059 31.41 0.816 7.76 2.64 11.45 3.02 3.97 0.09 19.21 0.73 0.28 0.61 0.45 16.69 5.10 1.10 2.42 1.70 3.15 +450.00 0.202 16.811 1.048 0.938 0.193 22.10 0.035 1.00 -0.043 31.36 0.815 7.79 2.62 11.43 3.01 3.96 0.10 19.22 0.73 0.28 0.61 0.45 16.81 5.10 1.10 2.42 1.70 3.16 +449.00 0.203 16.917 1.046 0.937 0.192 22.17 0.038 1.00 -0.027 31.30 0.814 7.82 2.61 11.43 3.02 3.95 0.11 19.25 0.73 0.27 0.61 0.44 16.92 5.10 1.10 2.43 1.70 3.16 +448.00 0.205 17.009 1.046 0.936 0.191 22.23 0.038 1.00 -0.011 31.22 0.812 7.86 2.61 11.45 3.02 3.94 0.12 19.31 0.73 0.27 0.61 0.43 17.01 5.10 1.10 2.43 1.70 3.17 +447.00 0.206 17.087 1.046 0.937 0.190 22.29 0.040 1.00 0.002 31.14 0.811 7.90 2.61 11.48 3.03 3.95 0.12 19.38 0.73 0.27 0.61 0.43 17.09 5.10 1.09 2.43 1.70 3.18 +446.00 0.208 17.166 1.047 0.938 0.190 22.35 0.043 1.00 0.014 31.05 0.810 7.94 2.61 11.50 3.04 3.96 0.13 19.44 0.73 0.27 0.60 0.43 17.17 5.10 1.09 2.43 1.69 3.19 +445.00 0.209 17.228 1.047 0.938 0.189 22.39 0.043 1.00 0.027 30.96 0.808 7.98 2.61 11.53 3.05 3.96 0.14 19.51 0.73 0.28 0.60 0.42 17.23 5.10 1.09 2.43 1.69 3.20 +444.00 0.211 17.277 1.048 0.939 0.189 22.44 0.046 1.00 0.037 30.86 0.807 8.02 2.61 11.54 3.05 3.97 0.14 19.56 0.73 0.28 0.61 0.42 17.28 5.10 1.09 2.43 1.69 3.21 +443.00 0.213 17.314 1.048 0.940 0.188 22.48 0.048 1.00 0.048 30.76 0.805 8.04 2.62 11.56 3.06 3.97 0.14 19.60 0.73 0.28 0.61 0.41 17.31 5.10 1.09 2.43 1.69 3.22 +442.00 0.214 17.340 1.048 0.940 0.188 22.51 0.051 1.00 0.057 30.65 0.804 8.07 2.63 11.58 3.07 3.98 0.15 19.65 0.73 0.28 0.61 0.41 17.34 5.10 1.09 2.44 1.69 3.23 +441.00 0.216 17.373 1.049 0.941 0.188 22.54 0.051 1.00 0.064 30.54 0.803 8.11 2.63 11.61 3.08 3.99 0.16 19.73 0.73 0.28 0.61 0.41 17.37 5.10 1.09 2.44 1.69 3.24 +440.00 0.217 17.394 1.050 0.942 0.188 22.57 0.054 1.00 0.070 30.44 0.802 8.16 2.65 11.66 3.09 4.00 0.16 19.81 0.74 0.28 0.61 0.41 17.39 5.10 1.09 2.44 1.69 3.25 +439.00 0.219 17.398 1.051 0.944 0.188 22.60 0.054 1.00 0.078 30.33 0.800 8.20 2.66 11.70 3.11 4.01 0.17 19.90 0.74 0.28 0.61 0.41 17.40 5.10 1.09 2.44 1.69 3.25 +438.00 0.221 17.391 1.053 0.946 0.188 22.61 0.054 1.00 0.083 30.22 0.799 8.24 2.68 11.75 3.12 4.03 0.17 19.99 0.74 0.28 0.61 0.40 17.39 5.10 1.09 2.44 1.68 3.26 +437.00 0.222 17.371 1.055 0.948 0.188 22.62 0.054 1.00 0.086 30.12 0.798 8.29 2.70 11.81 3.14 4.04 0.17 20.09 0.74 0.29 0.62 0.40 17.37 5.10 1.09 2.44 1.68 3.27 +436.00 0.223 17.338 1.057 0.950 0.188 22.63 0.054 1.00 0.089 30.01 0.798 8.34 2.73 11.88 3.16 4.06 0.18 20.22 0.75 0.29 0.62 0.40 17.34 5.11 1.09 2.44 1.68 3.28 +435.00 0.225 17.289 1.059 0.953 0.189 22.63 0.054 1.00 0.090 29.91 0.797 8.39 2.76 11.96 3.18 4.09 0.18 20.36 0.75 0.29 0.62 0.40 17.29 5.11 1.09 2.44 1.68 3.29 +434.00 0.226 17.225 1.062 0.957 0.189 22.62 0.053 1.00 0.091 29.81 0.797 8.44 2.79 12.03 3.21 4.12 0.18 20.47 0.76 0.30 0.62 0.41 17.22 5.11 1.09 2.45 1.68 3.30 +433.00 0.227 17.149 1.065 0.960 0.190 22.60 0.053 1.00 0.091 29.72 0.796 8.49 2.82 12.12 3.23 4.14 0.18 20.61 0.76 0.30 0.63 0.41 17.15 5.11 1.09 2.45 1.68 3.31 +432.00 0.228 17.058 1.068 0.963 0.190 22.58 0.053 1.00 0.089 29.62 0.796 8.54 2.86 12.20 3.25 4.18 0.18 20.73 0.77 0.30 0.63 0.41 17.06 5.11 1.09 2.45 1.68 3.32 +431.00 0.229 16.956 1.071 0.967 0.191 22.55 0.053 1.00 0.086 29.54 0.796 8.58 2.90 12.28 3.28 4.20 0.18 20.86 0.77 0.31 0.63 0.41 16.96 5.11 1.09 2.45 1.67 3.33 +430.00 0.230 16.844 1.074 0.970 0.191 22.51 0.053 1.00 0.082 29.45 0.796 8.61 2.93 12.35 3.30 4.24 0.18 20.97 0.77 0.31 0.64 0.42 16.84 5.11 1.09 2.45 1.67 3.34 +429.00 0.230 16.723 1.077 0.973 0.192 22.48 0.053 1.00 0.077 29.37 0.797 8.64 2.97 12.42 3.32 4.26 0.18 21.06 0.78 0.32 0.64 0.42 16.72 5.11 1.09 2.45 1.67 3.35 +428.00 0.231 16.596 1.079 0.976 0.193 22.43 0.053 1.00 0.070 29.30 0.797 8.67 3.00 12.49 3.34 4.29 0.18 21.17 0.78 0.32 0.65 0.42 16.60 5.11 1.09 2.45 1.67 3.36 +427.00 0.231 16.463 1.082 0.980 0.193 22.39 0.053 1.00 0.063 29.23 0.797 8.68 3.03 12.53 3.36 4.32 0.18 21.21 0.78 0.32 0.65 0.43 16.46 5.11 1.09 2.45 1.67 3.37 +426.00 0.231 16.315 1.084 0.981 0.194 22.34 0.053 1.00 0.055 29.17 0.798 8.66 3.06 12.55 3.36 4.33 0.19 21.21 0.78 0.33 0.65 0.43 16.31 5.11 1.09 2.45 1.67 3.37 +425.00 0.230 16.175 1.085 0.982 0.194 22.29 0.053 1.00 0.045 29.12 0.798 8.64 3.08 12.55 3.37 4.34 0.19 21.20 0.78 0.33 0.66 0.43 16.17 5.11 1.09 2.46 1.67 3.38 +424.00 0.230 16.044 1.086 0.983 0.195 22.24 0.053 1.00 0.033 29.08 0.799 8.63 3.10 12.57 3.37 4.35 0.19 21.20 0.78 0.33 0.66 0.43 16.04 5.11 1.09 2.46 1.67 3.39 +423.00 0.229 15.920 1.086 0.984 0.195 22.20 0.053 1.00 0.020 29.04 0.800 8.64 3.12 12.61 3.38 4.36 0.19 21.25 0.79 0.33 0.66 0.44 15.92 5.11 1.09 2.46 1.66 3.40 +422.00 0.228 15.796 1.088 0.986 0.195 22.16 0.053 1.00 0.010 29.02 0.801 8.65 3.14 12.65 3.39 4.37 0.19 21.29 0.79 0.34 0.67 0.44 15.80 5.11 1.09 2.46 1.66 3.41 +421.00 0.227 15.655 1.090 0.987 0.196 22.11 0.053 1.00 0.002 29.00 0.802 8.64 3.17 12.67 3.40 4.38 0.19 21.31 0.79 0.34 0.67 0.44 15.66 5.11 1.09 2.46 1.66 3.42 +420.00 0.226 15.520 1.091 0.988 0.196 22.06 0.053 1.00 -0.007 28.99 0.803 8.63 3.19 12.70 3.41 4.40 0.19 21.33 0.79 0.34 0.67 0.45 15.52 5.11 1.09 2.46 1.66 3.43 +419.00 0.225 15.388 1.092 0.990 0.196 22.01 0.072 1.00 -0.017 28.99 0.804 8.65 3.21 12.75 3.42 4.41 0.19 21.40 0.79 0.34 0.67 0.45 15.39 5.12 1.09 2.46 1.66 3.43 +418.00 0.226 15.216 1.093 0.991 0.196 21.94 0.087 1.00 -0.003 28.98 0.804 8.63 3.24 12.78 3.43 4.42 0.25 21.41 0.79 0.35 0.67 0.45 15.22 5.12 1.09 2.46 1.66 3.44 +417.00 0.227 15.040 1.094 0.992 0.196 21.87 0.106 1.00 0.014 28.95 0.803 8.61 3.27 12.80 3.44 4.43 0.31 21.40 0.79 0.35 0.68 0.45 15.04 5.12 1.09 2.46 1.66 3.45 +416.00 0.229 14.844 1.093 0.991 0.197 21.79 0.121 1.00 0.038 28.90 0.802 8.57 3.30 12.79 3.44 4.42 0.38 21.36 0.79 0.36 0.68 0.45 14.84 5.12 1.09 2.46 1.66 3.46 +415.00 0.231 14.639 1.092 0.990 0.197 21.70 0.139 1.00 0.060 28.83 0.799 8.51 3.33 12.77 3.44 4.41 0.43 21.28 0.79 0.36 0.68 0.44 14.64 5.12 1.09 2.47 1.66 3.47 +414.00 0.233 14.442 1.091 0.989 0.198 21.61 0.155 1.00 0.079 28.73 0.797 8.46 3.36 12.75 3.44 4.40 0.49 21.21 0.79 0.36 0.69 0.44 14.44 5.12 1.09 2.47 1.65 3.47 +413.00 0.236 14.240 1.089 0.988 0.198 21.53 0.173 1.00 0.097 28.62 0.795 8.39 3.39 12.71 3.43 4.39 0.55 21.11 0.79 0.37 0.69 0.43 14.24 5.12 1.09 2.47 1.65 3.48 +412.00 0.239 14.033 1.087 0.986 0.199 21.43 0.188 1.00 0.117 28.48 0.792 8.32 3.41 12.66 3.42 4.37 0.61 20.98 0.78 0.37 0.69 0.43 14.03 5.12 1.09 2.47 1.65 3.49 +411.00 0.241 13.830 1.084 0.983 0.200 21.34 0.206 1.00 0.133 28.33 0.789 8.24 3.44 12.61 3.41 4.35 0.66 20.85 0.78 0.37 0.70 0.42 13.83 5.12 1.09 2.47 1.65 3.49 +410.00 0.244 13.641 1.082 0.981 0.200 21.26 0.221 1.00 0.148 28.17 0.786 8.17 3.45 12.56 3.40 4.33 0.72 20.73 0.78 0.37 0.70 0.42 13.64 5.12 1.09 2.47 1.65 3.50 +409.00 0.247 13.455 1.079 0.978 0.201 21.17 0.238 1.00 0.163 28.01 0.783 8.09 3.47 12.49 3.39 4.31 0.77 20.58 0.77 0.37 0.70 0.41 13.45 5.12 1.09 2.47 1.65 3.50 +408.00 0.250 13.267 1.076 0.975 0.202 21.08 0.253 1.00 0.182 27.83 0.779 8.02 3.48 12.43 3.38 4.28 0.83 20.45 0.77 0.38 0.71 0.41 13.27 5.12 1.09 2.47 1.65 3.51 +407.00 0.254 13.083 1.073 0.972 0.203 21.00 0.270 1.00 0.198 27.65 0.776 7.93 3.49 12.35 3.36 4.25 0.88 20.28 0.76 0.38 0.71 0.40 13.08 5.12 1.09 2.47 1.65 3.51 +406.00 0.257 12.901 1.069 0.968 0.203 20.91 0.285 1.00 0.216 27.46 0.772 7.84 3.50 12.27 3.34 4.22 0.93 20.11 0.76 0.38 0.72 0.39 12.90 5.12 1.09 2.47 1.65 3.52 +405.00 0.260 12.726 1.065 0.964 0.204 20.83 0.302 1.00 0.231 27.27 0.768 7.76 3.51 12.19 3.32 4.18 0.98 19.95 0.75 0.38 0.72 0.39 12.73 5.12 1.09 2.47 1.65 3.52 +404.00 0.264 12.553 1.061 0.960 0.205 20.75 0.316 1.00 0.250 27.07 0.764 7.67 3.51 12.10 3.30 4.15 1.03 19.77 0.75 0.38 0.72 0.38 12.55 5.12 1.09 2.47 1.65 3.52 +403.00 0.267 12.388 1.057 0.955 0.205 20.67 0.333 1.00 0.266 26.88 0.759 7.57 3.50 12.00 3.27 4.11 1.07 19.57 0.74 0.38 0.72 0.37 12.39 5.12 1.09 2.47 1.65 3.52 +402.00 0.271 12.228 1.052 0.951 0.206 20.59 0.347 1.00 0.285 26.68 0.755 7.49 3.50 11.92 3.25 4.07 1.12 19.40 0.74 0.38 0.73 0.36 12.23 5.13 1.09 2.47 1.65 3.52 +401.00 0.275 12.075 1.047 0.946 0.207 20.52 0.364 1.00 0.302 26.48 0.750 7.39 3.49 11.80 3.22 4.03 1.15 19.19 0.73 0.38 0.73 0.36 12.07 5.13 1.09 2.47 1.65 3.53 +400.00 0.279 11.927 1.042 0.941 0.207 20.45 0.378 1.00 0.322 26.28 0.745 7.30 3.48 11.71 3.20 3.98 1.20 19.01 0.72 0.37 0.73 0.35 11.93 5.13 1.09 2.47 1.65 3.53 +399.00 0.283 11.787 1.037 0.935 0.208 20.38 0.389 1.00 0.340 26.08 0.740 7.20 3.46 11.58 3.17 3.94 1.23 18.78 0.71 0.37 0.73 0.34 11.79 5.13 1.09 2.47 1.65 3.52 +398.00 0.286 11.680 1.031 0.930 0.208 20.34 0.401 1.00 0.348 25.88 0.735 7.10 3.44 11.46 3.14 3.89 1.26 18.56 0.71 0.37 0.73 0.33 11.68 5.13 1.09 2.47 1.65 3.52 +397.00 0.289 11.600 1.026 0.925 0.209 20.31 0.412 1.00 0.354 25.69 0.731 7.03 3.42 11.36 3.11 3.85 1.29 18.40 0.70 0.37 0.74 0.33 11.60 5.13 1.09 2.47 1.65 3.52 +396.00 0.292 11.536 1.021 0.920 0.209 20.29 0.424 1.00 0.364 25.50 0.727 6.97 3.40 11.26 3.08 3.81 1.31 18.23 0.70 0.37 0.74 0.32 11.54 5.13 1.09 2.47 1.65 3.52 +395.00 0.296 11.472 1.016 0.915 0.209 20.27 0.436 1.00 0.380 25.33 0.722 6.90 3.36 11.16 3.05 3.76 1.34 18.06 0.69 0.36 0.74 0.31 11.47 5.13 1.09 2.47 1.65 3.52 +394.00 0.299 11.425 1.011 0.909 0.210 20.26 0.448 1.00 0.397 25.16 0.717 6.83 3.33 11.05 3.02 3.72 1.36 17.88 0.68 0.36 0.74 0.31 11.42 5.13 1.09 2.47 1.65 3.51 +393.00 0.303 11.394 1.005 0.904 0.210 20.26 0.459 1.00 0.413 24.99 0.712 6.77 3.30 10.96 3.00 3.68 1.39 17.74 0.68 0.35 0.74 0.30 11.39 5.13 1.09 2.47 1.65 3.51 +392.00 0.307 11.374 1.000 0.899 0.210 20.26 0.471 1.00 0.434 24.83 0.707 6.71 3.26 10.85 2.97 3.64 1.41 17.56 0.67 0.35 0.74 0.29 11.37 5.13 1.09 2.47 1.65 3.51 +391.00 0.311 11.353 0.994 0.892 0.210 20.27 0.483 1.00 0.457 24.68 0.700 6.64 3.22 10.75 2.94 3.58 1.43 17.39 0.66 0.35 0.74 0.29 11.35 5.13 1.09 2.47 1.65 3.50 +390.00 0.315 11.346 0.988 0.887 0.210 20.29 0.494 1.00 0.479 24.53 0.694 6.57 3.18 10.63 2.90 3.54 1.45 17.20 0.66 0.34 0.73 0.28 11.35 5.13 1.09 2.46 1.65 3.50 +389.00 0.320 11.355 0.982 0.880 0.210 20.31 0.506 1.00 0.501 24.38 0.688 6.52 3.13 10.53 2.87 3.49 1.47 17.05 0.65 0.34 0.73 0.27 11.35 5.12 1.09 2.46 1.65 3.49 +388.00 0.324 11.374 0.976 0.874 0.210 20.34 0.518 1.00 0.525 24.23 0.681 6.47 3.09 10.43 2.84 3.44 1.49 16.90 0.65 0.33 0.73 0.26 11.37 5.12 1.09 2.46 1.65 3.49 +387.00 0.329 11.403 0.970 0.868 0.210 20.38 0.530 1.00 0.550 24.09 0.674 6.56 3.11 10.55 2.87 3.39 1.54 17.11 0.65 0.33 0.73 0.25 11.40 5.12 1.09 2.46 1.65 3.48 +386.00 0.335 11.409 0.972 0.872 0.210 20.41 0.541 1.00 0.586 23.95 0.669 6.63 3.13 10.65 2.90 3.42 1.59 17.28 0.66 0.33 0.73 0.25 11.41 5.12 1.09 2.46 1.65 3.47 +385.00 0.342 11.384 0.973 0.874 0.210 20.41 0.552 1.00 0.627 23.80 0.664 6.68 3.16 10.74 2.93 3.44 1.63 17.42 0.67 0.34 0.73 0.25 11.38 5.12 1.09 2.46 1.65 3.47 +384.00 0.349 11.335 0.974 0.876 0.211 20.40 0.562 1.00 0.667 23.65 0.657 6.72 3.19 10.80 2.95 3.45 1.68 17.52 0.67 0.34 0.73 0.25 11.33 5.12 1.09 2.46 1.66 3.47 +383.00 0.357 11.270 0.974 0.877 0.212 20.38 0.573 1.00 0.700 23.49 0.650 6.74 3.23 10.85 2.96 3.46 1.72 17.60 0.67 0.34 0.73 0.24 11.27 5.12 1.09 2.46 1.66 3.46 +382.00 0.364 11.210 0.975 0.879 0.213 20.36 0.583 1.00 0.726 23.33 0.644 6.77 3.26 10.90 2.98 3.48 1.76 17.67 0.68 0.35 0.74 0.24 11.21 5.12 1.09 2.46 1.66 3.46 +381.00 0.372 11.138 0.975 0.880 0.214 20.33 0.593 1.00 0.750 23.16 0.637 6.79 3.29 10.95 3.00 3.49 1.80 17.74 0.68 0.35 0.74 0.24 11.14 5.12 1.10 2.46 1.66 3.45 +380.00 0.379 11.056 0.975 0.881 0.216 20.30 0.603 1.00 0.773 22.99 0.630 6.80 3.33 10.98 3.01 3.49 1.84 17.78 0.68 0.35 0.74 0.23 11.06 5.12 1.10 2.46 1.66 3.45 +379.00 0.387 10.970 0.974 0.881 0.217 20.26 0.624 1.00 0.792 22.82 0.623 6.89 3.36 11.16 3.05 3.50 1.89 18.05 0.69 0.36 0.75 0.23 10.97 5.12 1.10 2.45 1.66 3.44 +378.00 0.397 10.835 0.978 0.887 0.219 20.19 0.645 1.00 0.850 22.65 0.615 6.99 3.40 11.36 3.10 3.54 1.99 18.35 0.71 0.36 0.75 0.23 10.83 5.12 1.10 2.45 1.66 3.44 +377.00 0.408 10.650 0.980 0.891 0.221 20.09 0.664 1.00 0.923 22.49 0.606 7.04 3.45 11.49 3.13 3.57 2.07 18.53 0.71 0.37 0.76 0.23 10.65 5.12 1.10 2.45 1.66 3.44 +376.00 0.421 10.439 0.981 0.893 0.224 19.97 0.682 1.00 0.989 22.32 0.594 7.05 3.50 11.59 3.16 3.59 2.15 18.65 0.72 0.37 0.77 0.22 10.44 5.12 1.10 2.45 1.66 3.43 +375.00 0.434 10.214 0.980 0.894 0.226 19.84 0.699 1.00 1.045 22.14 0.582 7.06 3.56 11.68 3.19 3.60 2.23 18.75 0.73 0.38 0.78 0.22 10.21 5.12 1.10 2.45 1.66 3.43 +374.00 0.448 9.996 0.980 0.896 0.229 19.70 0.716 1.00 1.088 21.95 0.570 7.08 3.62 11.79 3.22 3.61 2.31 18.87 0.73 0.38 0.78 0.22 10.00 5.12 1.10 2.45 1.66 3.43 +373.00 0.461 9.765 0.980 0.898 0.231 19.56 0.732 1.00 1.129 21.76 0.558 7.08 3.68 11.87 3.24 3.63 2.38 18.95 0.74 0.39 0.79 0.21 9.77 5.12 1.10 2.45 1.66 3.42 +372.00 0.475 9.531 0.979 0.899 0.234 19.41 0.748 1.00 1.163 21.56 0.545 7.11 3.77 12.01 3.29 3.64 2.47 19.12 0.75 0.40 0.80 0.21 9.53 5.12 1.10 2.44 1.66 3.42 +371.00 0.489 9.282 0.981 0.902 0.238 19.25 0.763 1.00 1.196 21.36 0.534 7.14 3.86 12.15 3.33 3.66 2.55 19.28 0.76 0.41 0.81 0.21 9.28 5.12 1.10 2.44 1.66 3.41 +370.00 0.503 9.022 0.983 0.906 0.241 19.08 0.777 1.00 1.224 21.15 0.523 7.16 3.97 12.29 3.38 3.70 2.64 19.45 0.77 0.42 0.82 0.21 9.02 5.12 1.10 2.44 1.66 3.41 +369.00 0.516 8.769 0.986 0.911 0.245 18.91 0.790 1.00 1.243 20.94 0.513 7.18 4.07 12.42 3.42 3.74 2.72 19.60 0.77 0.43 0.83 0.21 8.77 5.12 1.10 2.44 1.66 3.40 +368.00 0.529 8.508 0.988 0.915 0.248 18.73 0.803 1.00 1.260 20.73 0.503 7.18 4.18 12.53 3.46 3.77 2.80 19.71 0.78 0.44 0.84 0.21 8.51 5.12 1.11 2.44 1.66 3.40 +367.00 0.542 8.248 0.990 0.919 0.252 18.54 0.815 1.00 1.271 20.51 0.493 7.16 4.28 12.60 3.49 3.80 2.87 19.77 0.79 0.45 0.86 0.21 8.25 5.12 1.11 2.43 1.67 3.39 +366.00 0.554 7.996 0.991 0.922 0.256 18.36 0.828 1.00 1.276 20.30 0.483 7.14 4.37 12.67 3.52 3.82 2.94 19.82 0.79 0.46 0.87 0.21 8.00 5.12 1.11 2.43 1.67 3.39 +365.00 0.565 7.766 0.992 0.925 0.260 18.19 0.840 1.00 1.275 20.09 0.475 7.13 4.46 12.74 3.55 3.85 3.01 19.88 0.80 0.46 0.88 0.21 7.77 5.12 1.11 2.43 1.67 3.38 +364.00 0.575 7.541 0.993 0.928 0.264 18.02 0.851 1.00 1.278 19.88 0.466 7.12 4.55 12.82 3.58 3.87 3.08 19.94 0.80 0.47 0.89 0.21 7.54 5.12 1.11 2.43 1.67 3.38 +363.00 0.586 7.320 0.995 0.930 0.268 17.85 0.863 1.00 1.282 19.68 0.459 7.10 4.64 12.87 3.61 3.90 3.14 19.97 0.80 0.48 0.90 0.21 7.32 5.12 1.11 2.42 1.67 3.37 +362.00 0.595 7.107 0.995 0.933 0.272 17.68 0.874 1.00 1.284 19.49 0.451 7.08 4.72 12.92 3.63 3.91 3.21 20.00 0.81 0.49 0.91 0.21 7.11 5.12 1.11 2.42 1.67 3.36 +361.00 0.605 6.916 0.997 0.935 0.276 17.53 0.885 1.00 1.282 19.30 0.444 7.06 4.80 12.97 3.65 3.94 3.27 20.03 0.81 0.50 0.93 0.21 6.92 5.12 1.11 2.42 1.67 3.35 +360.00 0.613 6.731 0.997 0.937 0.280 17.38 0.896 1.00 1.287 19.13 0.437 7.04 4.87 13.01 3.67 3.95 3.33 20.05 0.82 0.50 0.94 0.21 6.73 5.12 1.11 2.42 1.67 3.34 +359.00 0.622 6.553 0.997 0.938 0.284 17.23 0.907 1.00 1.292 18.96 0.430 7.00 4.93 13.02 3.68 3.96 3.38 20.02 0.82 0.51 0.95 0.21 6.55 5.12 1.11 2.41 1.67 3.33 +358.00 0.630 6.385 0.997 0.939 0.288 17.09 0.918 1.00 1.296 18.79 0.423 6.96 4.97 13.01 3.69 3.97 3.43 19.96 0.82 0.51 0.96 0.21 6.39 5.12 1.11 2.41 1.68 3.32 +357.00 0.638 6.231 0.995 0.939 0.292 16.97 0.929 1.00 1.300 18.64 0.415 6.91 5.01 12.98 3.69 3.96 3.47 19.89 0.82 0.51 0.97 0.21 6.23 5.12 1.12 2.41 1.68 3.31 +356.00 0.645 6.091 0.993 0.937 0.295 16.85 0.940 1.00 1.306 18.49 0.408 6.86 5.03 12.94 3.68 3.96 3.51 19.80 0.81 0.51 0.98 0.21 6.09 5.12 1.12 2.40 1.68 3.30 +355.00 0.653 5.964 0.990 0.936 0.299 16.74 0.951 1.00 1.315 18.36 0.400 6.79 5.04 12.88 3.67 3.94 3.54 19.67 0.81 0.51 0.98 0.21 5.96 5.12 1.12 2.40 1.68 3.29 +354.00 0.664 5.812 0.983 0.930 0.302 16.61 0.959 1.00 1.467 18.22 0.386 6.67 5.06 12.71 3.64 3.89 3.89 19.39 0.80 0.51 0.99 0.21 5.81 5.12 1.12 2.40 1.68 3.28 +353.00 0.682 5.633 0.972 0.921 0.305 16.44 0.962 1.00 1.698 18.08 0.364 6.49 5.09 12.43 3.59 3.82 4.20 18.92 0.78 0.52 0.99 0.20 5.63 5.12 1.12 2.39 1.68 3.26 +352.00 0.703 5.457 0.958 0.911 0.307 16.28 0.963 1.00 1.919 17.90 0.336 6.29 5.13 12.13 3.53 3.73 4.49 18.42 0.77 0.52 1.00 0.19 5.46 5.11 1.12 2.39 1.69 3.25 +351.00 0.728 5.295 0.943 0.900 0.310 16.12 0.963 1.00 2.127 17.70 0.304 6.11 5.18 11.84 3.48 3.64 4.77 17.94 0.75 0.52 1.00 0.18 5.29 5.11 1.12 2.39 1.69 3.23 +350.00 0.756 5.147 0.928 0.889 0.312 15.98 0.961 1.00 2.328 17.48 0.269 5.93 5.24 11.56 3.44 3.56 5.04 17.49 0.73 0.53 1.00 0.17 5.15 5.11 1.12 2.38 1.69 3.21 +349.00 0.786 5.012 0.912 0.879 0.314 15.84 0.958 1.00 2.526 17.23 0.231 5.76 5.29 11.27 3.39 3.48 5.29 17.03 0.72 0.53 1.00 0.16 5.01 5.11 1.13 2.38 1.69 3.19 +348.00 0.819 4.881 0.893 0.867 0.316 15.71 0.954 1.00 2.721 16.96 0.188 5.58 5.33 10.97 3.35 3.39 5.51 16.55 0.70 0.53 1.00 0.15 4.88 5.11 1.13 2.38 1.70 3.17 +347.00 0.853 4.750 0.872 0.854 0.318 15.58 0.948 1.00 2.909 16.67 0.141 5.39 5.37 10.63 3.29 3.28 5.70 16.02 0.68 0.54 1.00 0.14 4.75 5.11 1.13 2.37 1.70 3.15 +346.00 0.888 4.640 0.848 0.840 0.320 15.47 0.942 1.00 3.081 16.37 0.091 5.22 5.40 10.34 3.24 3.18 5.89 15.56 0.66 0.54 1.00 0.13 4.64 5.11 1.13 2.37 1.70 3.12 +345.00 0.924 4.533 0.822 0.825 0.322 15.36 0.935 1.00 3.259 16.06 0.038 5.05 5.43 10.03 3.18 3.07 6.05 15.07 0.64 0.54 1.00 0.13 4.53 5.10 1.13 2.36 1.71 3.10 +344.00 0.957 4.479 0.801 0.814 0.323 15.31 0.932 1.00 3.280 15.74 0.000 4.94 5.44 9.84 3.15 2.98 5.97 14.78 0.63 0.54 0.99 0.12 4.48 5.10 1.14 2.36 1.71 3.07 +343.00 0.987 4.449 0.797 0.809 0.325 15.29 0.932 1.00 3.282 15.43 0.000 4.87 5.43 9.70 3.12 2.95 5.92 14.57 0.62 0.53 0.99 0.11 4.45 5.10 1.14 2.36 1.71 3.05 +342.00 1.014 4.465 0.793 0.805 0.327 15.33 0.915 1.00 3.219 15.14 0.000 4.82 5.43 9.58 3.10 2.92 5.76 14.40 0.62 0.53 0.99 0.11 4.47 5.10 1.14 2.35 1.72 3.02 +341.00 1.037 4.500 0.792 0.803 0.328 15.39 0.901 1.00 3.158 14.86 0.000 4.80 5.43 9.53 3.09 2.90 5.67 14.34 0.61 0.53 0.98 0.11 4.50 5.10 1.14 2.35 1.72 3.00 +340.00 1.059 4.541 0.792 0.803 0.330 15.46 0.891 1.00 3.128 14.60 0.000 4.81 5.43 9.53 3.09 2.90 5.60 14.34 0.62 0.53 0.98 0.11 4.54 5.10 1.14 2.34 1.72 2.97 +339.00 1.079 4.566 0.791 0.803 0.331 15.51 0.881 1.00 3.123 14.37 0.000 4.81 5.44 9.51 3.09 2.90 5.54 14.33 0.62 0.53 0.98 0.10 4.57 5.09 1.15 2.34 1.73 2.94 +338.00 1.098 4.575 0.791 0.802 0.333 15.54 0.872 1.00 3.119 14.15 0.000 4.80 5.45 9.49 3.09 2.90 5.49 14.29 0.62 0.53 0.97 0.10 4.58 5.09 1.15 2.33 1.73 2.92 +337.00 1.116 4.571 0.790 0.802 0.335 15.55 0.865 1.00 3.113 13.94 0.000 4.78 5.45 9.45 3.08 2.89 5.43 14.23 0.61 0.53 0.97 0.10 4.57 5.09 1.15 2.33 1.74 2.89 +336.00 1.132 4.558 0.789 0.800 0.337 15.56 0.858 1.00 3.103 13.75 0.000 4.76 5.46 9.41 3.07 2.88 5.38 14.17 0.61 0.52 0.97 0.10 4.56 5.09 1.15 2.33 1.74 2.87 +335.00 1.147 4.535 0.788 0.799 0.338 15.55 0.852 1.00 3.093 13.57 0.000 4.74 5.47 9.36 3.07 2.87 5.33 14.10 0.61 0.52 0.96 0.10 4.53 5.09 1.15 2.32 1.74 2.84 +334.00 1.161 4.514 0.788 0.799 0.340 15.54 0.847 1.00 3.081 13.40 0.000 4.72 5.48 9.33 3.06 2.87 5.30 14.06 0.61 0.52 0.96 0.10 4.51 5.09 1.15 2.32 1.75 2.82 +333.00 1.174 4.480 0.787 0.798 0.342 15.52 0.843 1.00 3.078 13.24 0.000 4.70 5.50 9.30 3.06 2.86 5.27 14.01 0.61 0.52 0.96 0.10 4.48 5.09 1.15 2.31 1.75 2.79 +332.00 1.186 4.432 0.786 0.797 0.344 15.48 0.839 1.00 3.072 13.08 0.000 4.67 5.52 9.25 3.06 2.86 5.23 13.92 0.61 0.52 0.95 0.10 4.43 5.08 1.16 2.31 1.75 2.77 +331.00 1.197 4.376 0.785 0.795 0.346 15.43 0.835 1.00 3.060 12.94 0.000 4.65 5.56 9.23 3.06 2.85 5.22 13.88 0.61 0.53 0.95 0.10 4.38 5.08 1.16 2.31 1.76 2.74 +330.00 1.207 4.307 0.785 0.795 0.348 15.36 0.832 1.00 3.047 12.80 0.000 4.63 5.61 9.19 3.06 2.85 5.20 13.82 0.61 0.53 0.95 0.10 4.31 5.08 1.16 2.30 1.76 2.72 +329.00 1.216 4.229 0.785 0.795 0.351 15.28 0.827 1.00 3.029 12.66 0.000 4.59 5.66 9.14 3.07 2.85 5.19 13.73 0.60 0.53 0.95 0.10 4.23 5.08 1.16 2.30 1.76 2.69 +328.00 1.223 4.174 0.786 0.797 0.353 15.23 0.826 1.00 2.988 12.53 0.000 4.59 5.73 9.16 3.09 2.86 5.21 13.76 0.61 0.54 0.94 0.10 4.17 5.08 1.16 2.29 1.77 2.67 +327.00 1.229 4.120 0.790 0.801 0.356 15.17 0.825 1.00 2.977 12.40 0.000 4.62 5.82 9.22 3.12 2.89 5.26 13.83 0.61 0.54 0.94 0.10 4.12 5.08 1.16 2.29 1.77 2.65 +326.00 1.235 4.064 0.794 0.806 0.358 15.12 0.824 1.00 2.969 12.28 0.000 4.62 5.89 9.25 3.14 2.92 5.29 13.88 0.61 0.55 0.94 0.10 4.06 5.08 1.16 2.28 1.77 2.62 +325.00 1.240 4.008 0.797 0.810 0.362 15.07 0.824 1.00 2.961 12.16 0.000 4.64 5.98 9.30 3.17 2.95 5.34 13.94 0.62 0.56 0.94 0.10 4.01 5.08 1.16 2.28 1.78 2.60 +324.00 1.245 3.949 0.801 0.814 0.365 15.00 0.823 1.00 2.961 12.05 0.000 4.65 6.05 9.33 3.19 2.98 5.38 13.97 0.62 0.56 0.94 0.10 3.95 5.08 1.16 2.27 1.78 2.58 +323.00 1.250 3.891 0.805 0.818 0.368 14.94 0.823 1.00 2.952 11.94 0.000 4.65 6.11 9.34 3.21 3.01 5.40 13.99 0.62 0.57 0.94 0.10 3.89 5.08 1.17 2.27 1.78 2.55 +322.00 1.254 3.836 0.807 0.821 0.372 14.89 0.824 1.00 2.945 11.84 0.000 4.66 6.19 9.38 3.23 3.03 5.44 14.03 0.63 0.57 0.94 0.11 3.84 5.07 1.17 2.27 1.79 2.53 +321.00 1.258 3.778 0.811 0.825 0.375 14.83 0.825 1.00 2.947 11.74 0.000 4.66 6.26 9.41 3.25 3.06 5.49 14.07 0.63 0.58 0.94 0.11 3.78 5.07 1.17 2.26 1.79 2.51 +320.00 1.261 3.721 0.814 0.828 0.379 14.76 0.825 1.00 2.941 11.65 0.000 4.66 6.32 9.42 3.27 3.09 5.52 14.08 0.63 0.58 0.94 0.11 3.72 5.07 1.17 2.26 1.79 2.49 +319.00 1.264 3.666 0.816 0.831 0.383 14.71 0.827 1.00 2.935 11.57 0.000 4.67 6.39 9.45 3.29 3.11 5.56 14.12 0.64 0.58 0.94 0.11 3.67 5.07 1.17 2.25 1.80 2.46 +318.00 1.267 3.607 0.819 0.834 0.387 14.64 0.827 1.00 2.937 11.49 0.000 4.67 6.45 9.46 3.30 3.13 5.60 14.13 0.64 0.59 0.94 0.11 3.61 5.07 1.17 2.25 1.80 2.44 +317.00 1.270 3.564 0.822 0.838 0.391 14.60 0.829 1.00 2.933 11.41 0.000 4.69 6.52 9.52 3.33 3.16 5.66 14.22 0.64 0.59 0.95 0.11 3.56 5.07 1.17 2.24 1.80 2.42 +316.00 1.272 3.513 0.825 0.842 0.396 14.54 0.831 1.00 2.940 11.34 0.000 4.70 6.59 9.56 3.35 3.19 5.71 14.26 0.65 0.60 0.95 0.12 3.51 5.07 1.17 2.24 1.80 2.40 +315.00 1.275 3.470 0.829 0.846 0.400 14.50 0.833 1.00 2.948 11.27 0.000 4.72 6.66 9.60 3.37 3.22 5.76 14.32 0.65 0.60 0.95 0.12 3.47 5.07 1.17 2.23 1.81 2.37 +314.00 1.278 3.422 0.832 0.849 0.404 14.44 0.834 1.00 2.953 11.21 0.000 4.73 6.73 9.64 3.40 3.24 5.81 14.37 0.65 0.61 0.95 0.12 3.42 5.07 1.17 2.23 1.81 2.35 +313.00 1.280 3.372 0.835 0.852 0.409 14.39 0.836 1.00 2.953 11.15 0.000 4.73 6.79 9.65 3.41 3.27 5.84 14.39 0.66 0.61 0.95 0.12 3.37 5.07 1.18 2.22 1.81 2.33 +312.00 1.283 3.332 0.838 0.856 0.414 14.34 0.837 1.00 2.957 11.10 0.000 4.76 6.86 9.72 3.44 3.30 5.91 14.48 0.66 0.61 0.96 0.13 3.33 5.07 1.18 2.22 1.82 2.31 +311.00 1.286 3.285 0.841 0.859 0.418 14.29 0.838 1.00 2.962 11.05 0.000 4.76 6.92 9.74 3.46 3.32 5.95 14.50 0.66 0.62 0.96 0.13 3.29 5.06 1.18 2.21 1.82 2.29 +310.00 1.288 3.249 0.844 0.863 0.423 14.26 0.841 1.00 2.964 11.00 0.000 4.79 6.99 9.80 3.49 3.35 6.01 14.59 0.67 0.62 0.96 0.13 3.25 5.06 1.18 2.21 1.82 2.27 +309.00 1.291 3.203 0.847 0.867 0.428 14.20 0.841 1.00 2.976 10.96 0.000 4.80 7.07 9.83 3.51 3.38 6.06 14.64 0.67 0.63 0.96 0.13 3.20 5.06 1.18 2.20 1.83 2.25 +308.00 1.293 3.168 0.851 0.871 0.433 14.16 0.843 1.00 2.976 10.92 0.000 4.83 7.14 9.89 3.54 3.41 6.12 14.72 0.68 0.63 0.96 0.13 3.17 5.06 1.18 2.20 1.83 2.23 +307.00 1.296 3.136 0.855 0.875 0.438 14.13 0.845 1.00 2.985 10.89 0.000 4.85 7.20 9.95 3.56 3.45 6.17 14.80 0.68 0.63 0.97 0.14 3.14 5.06 1.18 2.19 1.83 2.21 +306.00 1.299 3.095 0.858 0.879 0.443 14.08 0.845 1.00 2.996 10.86 0.000 4.84 7.23 9.93 3.57 3.47 6.19 14.77 0.68 0.64 0.97 0.14 3.09 5.06 1.18 2.19 1.83 2.18 +305.00 1.302 3.071 0.860 0.880 0.449 14.06 0.847 1.00 2.998 10.83 0.000 4.83 7.23 9.92 3.56 3.49 6.20 14.74 0.68 0.63 0.97 0.14 3.07 5.06 1.18 2.18 1.84 2.16 +304.00 1.306 3.059 0.860 0.881 0.454 14.06 0.851 1.00 3.016 10.81 0.000 4.83 7.21 9.91 3.56 3.49 6.21 14.74 0.68 0.63 0.97 0.14 3.06 5.06 1.19 2.18 1.84 2.14 +303.00 1.310 3.054 0.860 0.880 0.459 14.07 0.854 1.00 3.049 10.79 0.000 4.82 7.18 9.90 3.55 3.49 6.22 14.73 0.68 0.62 0.97 0.14 3.05 5.06 1.19 2.17 1.84 2.12 +302.00 1.315 3.058 0.859 0.880 0.463 14.10 0.857 1.00 3.080 10.78 0.000 4.82 7.14 9.89 3.54 3.48 6.22 14.71 0.68 0.62 0.97 0.14 3.06 5.06 1.19 2.17 1.85 2.10 +301.00 1.320 3.059 0.857 0.877 0.468 14.12 0.859 1.00 3.112 10.77 0.000 4.79 7.06 9.83 3.51 3.46 6.18 14.62 0.68 0.61 0.97 0.14 3.06 5.05 1.19 2.16 1.85 2.08 +300.00 1.327 3.076 0.854 0.874 0.473 14.17 0.862 1.00 3.147 10.77 0.000 4.78 6.99 9.80 3.49 3.44 6.16 14.58 0.68 0.60 0.97 0.14 3.08 5.05 1.19 2.16 1.85 2.06 +299.00 1.334 3.104 0.851 0.871 0.477 14.23 0.858 1.00 3.188 10.78 0.000 4.77 6.91 9.75 3.46 3.41 6.14 14.52 0.68 0.59 0.97 0.14 3.10 5.05 1.19 2.15 1.85 2.04 +298.00 1.341 3.147 0.848 0.867 0.481 14.32 0.855 1.00 3.189 10.79 0.000 4.77 6.86 9.75 3.45 3.38 6.10 14.52 0.68 0.59 0.97 0.14 3.15 5.05 1.19 2.15 1.86 2.02 +297.00 1.348 3.189 0.846 0.865 0.485 14.40 0.853 1.00 3.202 10.80 0.000 4.81 6.85 9.80 3.46 3.37 6.10 14.60 0.68 0.58 0.97 0.14 3.19 5.05 1.19 2.15 1.86 2.00 +296.00 1.356 3.223 0.847 0.866 0.489 14.47 0.849 1.00 3.215 10.81 0.000 4.84 6.87 9.86 3.47 3.37 6.10 14.70 0.69 0.58 0.97 0.14 3.22 5.05 1.19 2.14 1.86 1.98 +295.00 1.363 3.249 0.848 0.868 0.493 14.53 0.844 1.00 3.220 10.83 0.000 4.89 6.91 9.93 3.50 3.39 6.11 14.82 0.69 0.59 0.97 0.14 3.25 5.05 1.20 2.14 1.87 1.96 +294.00 1.370 3.266 0.852 0.871 0.497 14.58 0.840 1.00 3.218 10.84 0.000 4.92 6.95 9.98 3.52 3.42 6.11 14.90 0.70 0.59 0.96 0.15 3.27 5.05 1.20 2.13 1.87 1.94 +293.00 1.376 3.280 0.854 0.874 0.502 14.62 0.835 1.00 3.208 10.86 0.000 4.94 6.99 10.03 3.54 3.44 6.11 14.97 0.70 0.59 0.96 0.15 3.28 5.04 1.20 2.13 1.87 1.92 +292.00 1.382 3.291 0.857 0.878 0.506 14.65 0.830 1.00 3.197 10.88 0.000 4.99 7.06 10.12 3.57 3.47 6.13 15.11 0.71 0.59 0.96 0.15 3.29 5.04 1.20 2.12 1.87 1.90 +291.00 1.388 3.293 0.861 0.883 0.511 14.68 0.825 1.00 3.186 10.89 0.000 5.00 7.09 10.12 3.58 3.51 6.11 15.12 0.71 0.59 0.96 0.15 3.29 5.04 1.20 2.12 1.88 1.88 +290.00 1.393 3.300 0.863 0.885 0.516 14.71 0.822 1.00 3.168 10.91 0.000 5.02 7.13 10.16 3.59 3.52 6.11 15.18 0.71 0.60 0.96 0.15 3.30 5.04 1.20 2.11 1.88 1.87 +289.00 1.394 3.335 0.867 0.889 0.521 14.78 0.824 1.00 2.986 10.93 0.000 5.08 7.13 10.26 3.61 3.56 5.85 15.33 0.72 0.59 0.96 0.16 3.33 5.04 1.20 2.11 1.88 1.85 +288.00 1.391 3.383 0.871 0.894 0.526 14.87 0.833 1.00 2.781 10.96 0.000 5.16 7.10 10.40 3.63 3.59 5.63 15.56 0.73 0.59 0.96 0.16 3.38 5.04 1.20 2.11 1.88 1.83 +287.00 1.384 3.420 0.873 0.895 0.531 14.95 0.843 1.00 2.594 10.99 0.000 5.22 7.03 10.49 3.64 3.61 5.39 15.70 0.74 0.58 0.96 0.16 3.42 5.04 1.20 2.10 1.89 1.82 +286.00 1.374 3.464 0.873 0.896 0.536 15.03 0.858 1.00 2.408 11.04 0.000 5.28 6.94 10.59 3.64 3.61 5.17 15.86 0.75 0.57 0.96 0.17 3.46 5.04 1.20 2.10 1.89 1.80 +285.00 1.361 3.497 0.871 0.894 0.541 15.10 0.876 1.00 2.229 11.10 0.000 5.32 6.82 10.64 3.62 3.59 4.92 15.96 0.75 0.56 0.97 0.17 3.50 5.04 1.20 2.09 1.89 1.79 +284.00 1.346 3.539 0.869 0.891 0.545 15.18 0.897 1.00 2.046 11.17 0.000 5.36 6.68 10.71 3.60 3.57 4.68 16.07 0.76 0.55 0.97 0.17 3.54 5.04 1.20 2.09 1.89 1.77 +283.00 1.328 3.584 0.865 0.887 0.550 15.27 0.922 1.00 1.870 11.25 0.000 5.39 6.50 10.73 3.56 3.54 4.42 16.12 0.76 0.53 0.97 0.17 3.58 5.04 1.20 2.09 1.89 1.76 +282.00 1.308 3.626 0.858 0.879 0.554 15.34 0.950 1.00 1.690 11.34 0.000 5.39 6.30 10.72 3.52 3.48 4.15 16.12 0.76 0.52 0.97 0.17 3.63 5.04 1.20 2.08 1.90 1.74 +281.00 1.286 3.682 0.851 0.871 0.558 15.45 0.983 1.00 1.502 11.44 0.000 5.42 6.09 10.75 3.47 3.41 3.89 16.17 0.76 0.50 0.96 0.17 3.68 5.04 1.20 2.08 1.90 1.73 +280.00 1.262 3.734 0.843 0.861 0.561 15.54 1.019 1.00 1.316 11.56 0.000 5.45 5.89 10.77 3.43 3.34 3.62 16.21 0.77 0.48 0.96 0.17 3.73 5.04 1.20 2.08 1.90 1.72 +279.00 1.240 3.754 0.833 0.850 0.564 15.59 1.051 1.00 1.333 11.68 0.000 5.45 5.73 10.75 3.39 3.25 3.69 16.20 0.77 0.47 0.96 0.17 3.75 5.04 1.20 2.07 1.90 1.70 +278.00 1.222 3.745 0.824 0.840 0.567 15.59 1.075 1.00 1.426 11.80 0.000 5.41 5.60 10.68 3.35 3.17 3.72 16.09 0.76 0.46 0.96 0.17 3.75 5.04 1.20 2.07 1.90 1.69 +277.00 1.207 3.739 0.816 0.831 0.569 15.60 1.097 1.00 1.496 11.92 0.000 5.39 5.50 10.64 3.32 3.11 3.76 16.03 0.76 0.45 0.95 0.17 3.74 5.04 1.20 2.07 1.91 1.68 +276.00 1.194 3.721 0.810 0.824 0.571 15.60 1.114 1.00 1.557 12.04 0.000 5.35 5.40 10.55 3.28 3.05 3.78 15.90 0.75 0.44 0.95 0.17 3.72 5.04 1.20 2.06 1.91 1.66 +275.00 1.183 3.702 0.803 0.816 0.573 15.59 1.130 1.00 1.599 12.15 0.000 5.31 5.32 10.48 3.25 3.00 3.79 15.79 0.75 0.43 0.94 0.17 3.70 5.04 1.20 2.06 1.91 1.65 +274.00 1.173 3.697 0.798 0.811 0.575 15.60 1.144 1.00 1.633 12.27 0.000 5.29 5.25 10.44 3.22 2.96 3.81 15.73 0.75 0.43 0.94 0.17 3.70 5.04 1.20 2.06 1.91 1.63 +273.00 1.165 3.686 0.794 0.806 0.577 15.60 1.157 1.00 1.671 12.38 0.000 5.25 5.18 10.36 3.19 2.92 3.82 15.61 0.74 0.42 0.93 0.17 3.69 5.04 1.20 2.06 1.91 1.62 +272.00 1.158 3.678 0.789 0.800 0.578 15.61 1.167 1.00 1.699 12.48 0.000 5.21 5.10 10.27 3.15 2.88 3.81 15.47 0.74 0.41 0.93 0.17 3.68 5.04 1.21 2.05 1.92 1.61 +271.00 1.152 3.689 0.784 0.794 0.580 15.65 1.179 1.00 1.721 12.58 0.000 5.17 5.01 10.19 3.12 2.84 3.81 15.36 0.73 0.41 0.92 0.17 3.69 5.04 1.21 2.05 1.92 1.59 +270.00 1.147 3.701 0.778 0.788 0.581 15.68 1.189 1.00 1.752 12.68 0.000 5.12 4.91 10.07 3.08 2.79 3.78 15.20 0.72 0.40 0.92 0.17 3.70 5.04 1.21 2.05 1.92 1.58 +269.00 1.142 3.735 0.772 0.781 0.582 15.75 1.201 1.00 1.777 12.78 0.000 5.11 4.84 10.03 3.05 2.74 3.79 15.14 0.72 0.39 0.91 0.16 3.74 5.04 1.21 2.05 1.92 1.57 +268.00 1.139 3.764 0.767 0.775 0.583 15.81 1.209 1.00 1.816 12.87 0.000 5.09 4.77 9.98 3.02 2.70 3.78 15.07 0.72 0.38 0.91 0.16 3.76 5.03 1.21 2.04 1.92 1.55 +267.00 1.137 3.791 0.763 0.770 0.584 15.87 1.216 1.00 1.849 12.96 0.000 5.07 4.70 9.92 3.00 2.67 3.77 14.99 0.71 0.38 0.90 0.16 3.79 5.03 1.21 2.04 1.92 1.54 +266.00 1.136 3.833 0.759 0.766 0.585 15.95 1.224 1.00 1.874 13.05 0.000 5.07 4.64 9.89 2.98 2.64 3.77 14.97 0.71 0.37 0.89 0.16 3.83 5.03 1.21 2.04 1.93 1.53 +265.00 1.136 3.867 0.756 0.763 0.586 16.01 1.229 1.00 1.907 13.13 0.000 5.07 4.60 9.87 2.97 2.62 3.77 14.94 0.71 0.37 0.89 0.16 3.87 5.03 1.21 2.04 1.93 1.52 +264.00 1.136 3.897 0.753 0.759 0.587 16.08 1.232 1.00 1.934 13.21 0.000 5.06 4.55 9.83 2.95 2.60 3.76 14.89 0.71 0.36 0.88 0.16 3.90 5.03 1.21 2.04 1.93 1.50 +263.00 1.136 3.941 0.751 0.757 0.588 16.16 1.236 1.00 1.952 13.29 0.000 5.05 4.49 9.78 2.93 2.58 3.74 14.83 0.71 0.36 0.88 0.16 3.94 5.03 1.21 2.03 1.93 1.49 +262.00 1.138 3.985 0.747 0.753 0.589 16.24 1.240 1.00 1.973 13.37 0.000 5.04 4.44 9.74 2.91 2.55 3.73 14.78 0.70 0.35 0.87 0.16 3.99 5.03 1.21 2.03 1.93 1.48 +261.00 1.139 4.028 0.744 0.749 0.590 16.31 1.242 1.00 1.994 13.44 0.000 5.04 4.39 9.71 2.90 2.53 3.72 14.75 0.70 0.35 0.87 0.15 4.03 5.03 1.21 2.03 1.93 1.47 +260.00 1.141 4.083 0.742 0.747 0.591 16.41 1.245 1.00 2.011 13.51 0.000 5.05 4.35 9.69 2.88 2.51 3.71 14.75 0.70 0.35 0.86 0.15 4.08 5.03 1.21 2.03 1.94 1.46 +259.00 1.144 4.131 0.740 0.745 0.592 16.49 1.246 1.00 2.035 13.58 0.000 5.09 4.34 9.74 2.89 2.50 3.73 14.83 0.71 0.35 0.86 0.15 4.13 5.03 1.21 2.03 1.94 1.45 +258.00 1.147 4.164 0.741 0.745 0.593 16.56 1.244 1.00 2.062 13.65 0.000 5.11 4.33 9.76 2.90 2.50 3.73 14.87 0.71 0.34 0.85 0.15 4.16 5.03 1.21 2.02 1.94 1.44 +257.00 1.150 4.190 0.741 0.746 0.595 16.61 1.242 1.00 2.078 13.72 0.000 5.17 4.37 9.85 2.92 2.50 3.75 15.03 0.72 0.35 0.85 0.15 4.19 5.03 1.21 2.02 1.94 1.43 +256.00 1.154 4.181 0.744 0.749 0.596 16.62 1.235 1.00 2.100 13.78 0.000 5.24 4.43 9.97 2.96 2.53 3.78 15.21 0.73 0.35 0.84 0.15 4.18 5.03 1.21 2.02 1.94 1.42 +255.00 1.158 4.154 0.750 0.755 0.598 16.60 1.227 1.00 2.104 13.84 0.000 5.32 4.53 10.14 3.02 2.57 3.83 15.45 0.74 0.36 0.84 0.16 4.15 5.03 1.21 2.02 1.94 1.41 +254.00 1.161 4.106 0.757 0.764 0.600 16.56 1.218 1.00 2.100 13.90 0.000 5.44 4.68 10.39 3.10 2.63 3.90 15.83 0.76 0.37 0.84 0.16 4.11 5.03 1.21 2.02 1.94 1.40 +253.00 1.165 4.024 0.769 0.777 0.603 16.47 1.206 1.00 2.091 13.95 0.000 5.57 4.88 10.67 3.20 2.72 3.99 16.24 0.78 0.38 0.84 0.17 4.02 5.03 1.21 2.01 1.94 1.39 +252.00 1.167 3.900 0.782 0.792 0.607 16.31 1.190 1.00 2.064 14.00 0.000 5.68 5.11 10.94 3.30 2.82 4.07 16.63 0.80 0.40 0.84 0.17 3.90 5.03 1.21 2.01 1.95 1.39 +251.00 1.169 3.758 0.796 0.809 0.611 16.13 1.175 1.00 2.003 14.05 0.000 5.77 5.36 11.18 3.40 2.94 4.13 16.95 0.81 0.42 0.85 0.18 3.76 5.03 1.21 2.01 1.95 1.38 +250.00 1.168 3.609 0.810 0.824 0.615 15.94 1.162 1.00 1.920 14.09 0.000 5.75 5.52 11.22 3.44 3.06 4.14 16.97 0.82 0.43 0.85 0.19 3.61 5.03 1.21 2.01 1.95 1.38 +249.00 1.164 3.485 0.818 0.833 0.620 15.77 1.154 1.00 1.822 14.12 0.000 5.88 5.79 11.53 3.56 3.12 4.25 17.41 0.84 0.45 0.85 0.20 3.48 5.03 1.22 2.00 1.95 1.38 +248.00 1.160 3.326 0.832 0.849 0.626 15.55 1.144 1.00 1.748 14.15 0.000 6.02 6.14 11.90 3.71 3.24 4.39 17.92 0.87 0.48 0.86 0.21 3.33 5.03 1.22 2.00 1.95 1.38 +247.00 1.152 3.149 0.851 0.870 0.632 15.28 1.133 1.00 1.647 14.18 0.000 6.01 6.38 11.96 3.77 3.41 4.42 17.97 0.87 0.50 0.87 0.22 3.15 5.03 1.22 2.00 1.95 1.37 +246.00 1.143 2.998 0.861 0.882 0.638 15.05 1.128 1.00 1.523 14.20 0.000 5.88 6.46 11.80 3.75 3.50 4.38 17.68 0.86 0.50 0.88 0.23 3.00 5.03 1.22 2.00 1.95 1.37 +245.00 1.131 2.894 0.862 0.883 0.644 14.90 1.132 1.00 1.427 14.22 0.000 5.74 6.41 11.55 3.69 3.51 4.33 17.29 0.84 0.50 0.88 0.24 2.89 5.03 1.22 1.99 1.95 1.37 +244.00 1.118 2.819 0.855 0.876 0.649 14.79 1.141 1.00 1.375 14.24 0.000 5.57 6.28 11.25 3.60 3.45 4.26 16.83 0.82 0.49 0.89 0.24 2.82 5.03 1.22 1.99 1.95 1.37 +243.00 1.106 2.784 0.846 0.865 0.654 14.74 1.156 1.00 1.361 14.26 0.000 5.44 6.11 11.00 3.51 3.37 4.20 16.44 0.80 0.47 0.89 0.23 2.78 5.03 1.22 1.99 1.95 1.36 +242.00 1.095 2.774 0.835 0.852 0.658 14.75 1.172 1.00 1.383 14.28 0.000 5.34 5.93 10.79 3.43 3.27 4.16 16.13 0.79 0.46 0.89 0.23 2.77 5.03 1.22 1.99 1.95 1.36 +241.00 1.086 2.779 0.824 0.839 0.661 14.77 1.189 1.00 1.423 14.31 0.000 5.28 5.78 10.66 3.37 3.17 4.15 15.94 0.78 0.45 0.89 0.23 2.78 5.03 1.22 1.98 1.95 1.35 +240.00 1.079 2.776 0.814 0.828 0.664 14.79 1.201 1.00 1.464 14.34 0.000 5.25 5.69 10.61 3.34 3.09 4.16 15.86 0.78 0.44 0.89 0.22 2.78 5.03 1.22 1.98 1.95 1.34 +239.00 1.073 2.770 0.809 0.823 0.667 14.80 1.211 1.00 1.498 14.37 0.000 5.32 5.73 10.74 3.38 3.05 4.23 16.06 0.79 0.44 0.89 0.22 2.77 5.03 1.22 1.98 1.95 1.33 +238.00 1.068 2.740 0.811 0.825 0.670 14.76 1.215 1.00 1.525 14.41 0.000 5.46 5.89 11.03 3.47 3.06 4.36 16.48 0.81 0.45 0.89 0.23 2.74 5.03 1.22 1.98 1.95 1.33 +237.00 1.064 2.672 0.821 0.836 0.673 14.66 1.212 1.00 1.519 14.44 0.000 5.58 6.11 11.30 3.57 3.15 4.48 16.88 0.83 0.47 0.89 0.23 2.67 5.03 1.22 1.98 1.96 1.32 +236.00 1.058 2.582 0.833 0.850 0.677 14.51 1.205 1.00 1.468 14.47 0.000 5.58 6.25 11.34 3.61 3.25 4.50 16.92 0.83 0.48 0.89 0.24 2.58 5.03 1.22 1.97 1.96 1.32 +235.00 1.052 2.503 0.839 0.857 0.681 14.38 1.202 1.00 1.396 14.50 0.000 5.55 6.33 11.31 3.62 3.31 4.50 16.86 0.83 0.49 0.89 0.25 2.50 5.03 1.22 1.97 1.96 1.31 +234.00 1.044 2.449 0.843 0.862 0.685 14.29 1.205 1.00 1.352 14.54 0.000 5.50 6.33 11.24 3.61 3.34 4.50 16.74 0.82 0.49 0.89 0.26 2.45 5.03 1.22 1.97 1.96 1.31 +233.00 1.037 2.408 0.842 0.860 0.688 14.23 1.210 1.00 1.331 14.57 0.000 5.41 6.26 11.08 3.56 3.33 4.45 16.49 0.81 0.48 0.90 0.26 2.41 5.03 1.22 1.97 1.96 1.30 +232.00 1.029 2.386 0.836 0.854 0.692 14.21 1.219 1.00 1.329 14.60 0.000 5.29 6.10 10.83 3.47 3.28 4.38 16.13 0.79 0.47 0.90 0.26 2.39 5.03 1.22 1.96 1.96 1.29 +231.00 1.023 2.389 0.827 0.843 0.695 14.23 1.232 1.00 1.351 14.63 0.000 5.15 5.87 10.54 3.36 3.20 4.29 15.69 0.77 0.45 0.89 0.26 2.39 5.03 1.22 1.96 1.96 1.29 +230.00 1.018 2.418 0.813 0.827 0.697 14.31 1.248 1.00 1.398 14.67 0.000 5.02 5.61 10.26 3.25 3.08 4.20 15.28 0.75 0.43 0.89 0.25 2.42 5.03 1.22 1.96 1.96 1.28 +229.00 1.015 2.468 0.797 0.810 0.699 14.42 1.266 1.00 1.464 14.70 0.000 5.11 5.57 10.42 3.28 2.95 4.29 15.53 0.77 0.43 0.89 0.24 2.47 5.03 1.22 1.96 1.96 1.27 +228.00 1.014 2.480 0.797 0.809 0.700 14.47 1.271 1.00 1.534 14.74 0.000 5.13 5.54 10.43 3.27 2.94 4.30 15.56 0.77 0.42 0.88 0.24 2.48 5.03 1.22 1.96 1.96 1.26 +227.00 1.014 2.486 0.795 0.807 0.702 14.50 1.274 1.00 1.559 14.78 0.000 5.13 5.52 10.43 3.27 2.93 4.30 15.56 0.77 0.42 0.88 0.24 2.49 5.03 1.22 1.95 1.96 1.25 +226.00 1.014 2.499 0.795 0.807 0.704 14.54 1.277 1.00 1.580 14.82 0.000 5.14 5.50 10.45 3.27 2.93 4.31 15.60 0.77 0.42 0.88 0.24 2.50 5.03 1.22 1.95 1.97 1.25 +225.00 1.015 2.505 0.794 0.806 0.706 14.57 1.278 1.00 1.598 14.86 0.000 5.15 5.49 10.46 3.26 2.92 4.32 15.61 0.77 0.42 0.87 0.24 2.51 5.02 1.22 1.95 1.97 1.24 +224.00 1.016 2.509 0.794 0.805 0.708 14.60 1.278 1.00 1.606 14.90 0.000 5.15 5.48 10.45 3.26 2.92 4.31 15.61 0.77 0.42 0.87 0.24 2.51 5.02 1.22 1.95 1.97 1.23 +223.00 1.017 2.511 0.793 0.805 0.710 14.62 1.277 1.00 1.611 14.93 0.000 5.15 5.47 10.45 3.26 2.92 4.30 15.60 0.77 0.41 0.87 0.24 2.51 5.02 1.22 1.95 1.97 1.22 +222.00 1.018 2.514 0.793 0.804 0.712 14.65 1.276 1.00 1.614 14.97 0.000 5.16 5.46 10.45 3.26 2.91 4.30 15.61 0.77 0.41 0.87 0.24 2.51 5.02 1.22 1.95 1.97 1.22 +221.00 1.019 2.526 0.794 0.805 0.714 14.69 1.277 1.00 1.625 15.00 0.000 5.18 5.46 10.49 3.27 2.92 4.32 15.67 0.77 0.41 0.86 0.24 2.53 5.02 1.22 1.94 1.97 1.21 +220.00 1.021 2.531 0.794 0.806 0.716 14.72 1.276 1.00 1.636 15.04 0.000 5.19 5.46 10.50 3.27 2.92 4.31 15.69 0.78 0.41 0.86 0.24 2.53 5.02 1.22 1.94 1.97 1.20 +219.00 1.023 2.534 0.794 0.806 0.718 14.74 1.275 1.00 1.639 15.07 0.000 5.20 5.47 10.52 3.27 2.92 4.32 15.72 0.78 0.41 0.86 0.24 2.53 5.02 1.22 1.94 1.97 1.20 +218.00 1.024 2.534 0.795 0.807 0.720 14.76 1.272 1.00 1.639 15.10 0.000 5.21 5.47 10.53 3.28 2.93 4.31 15.74 0.78 0.41 0.86 0.24 2.53 5.02 1.22 1.94 1.97 1.19 +217.00 1.026 2.533 0.795 0.807 0.722 14.78 1.270 1.00 1.637 15.13 0.000 5.22 5.48 10.54 3.28 2.93 4.31 15.75 0.78 0.41 0.86 0.24 2.53 5.02 1.22 1.94 1.97 1.19 +216.00 1.028 2.543 0.797 0.809 0.725 14.82 1.270 1.00 1.642 15.17 0.000 5.25 5.49 10.59 3.30 2.95 4.33 15.84 0.78 0.41 0.86 0.24 2.54 5.02 1.22 1.94 1.97 1.18 +215.00 1.030 2.544 0.798 0.811 0.727 14.84 1.268 1.00 1.648 15.20 0.000 5.27 5.51 10.63 3.31 2.96 4.34 15.90 0.79 0.41 0.86 0.25 2.54 5.02 1.22 1.93 1.98 1.18 +214.00 1.031 2.540 0.800 0.812 0.729 14.85 1.265 1.00 1.646 15.23 0.000 5.28 5.53 10.64 3.31 2.97 4.34 15.92 0.79 0.41 0.85 0.25 2.54 5.02 1.22 1.93 1.98 1.17 +213.00 1.033 2.536 0.801 0.814 0.732 14.86 1.262 1.00 1.639 15.26 0.000 5.29 5.55 10.67 3.32 2.98 4.34 15.96 0.79 0.42 0.85 0.25 2.54 5.02 1.23 1.93 1.98 1.17 +212.00 1.034 2.530 0.802 0.815 0.734 14.87 1.259 1.00 1.632 15.28 0.000 5.30 5.56 10.68 3.33 2.99 4.34 15.98 0.79 0.42 0.85 0.25 2.53 5.02 1.23 1.93 1.98 1.16 +211.00 1.036 2.535 0.804 0.817 0.737 14.90 1.259 1.00 1.632 15.31 0.000 5.33 5.58 10.74 3.35 3.00 4.36 16.07 0.80 0.42 0.85 0.25 2.54 5.02 1.23 1.93 1.98 1.16 +210.00 1.037 2.532 0.806 0.819 0.740 14.91 1.256 1.00 1.636 15.34 0.000 5.34 5.60 10.75 3.35 3.02 4.36 16.09 0.80 0.42 0.85 0.25 2.53 5.02 1.23 1.93 1.98 1.15 +209.00 1.039 2.528 0.807 0.820 0.742 14.92 1.254 1.00 1.630 15.37 0.000 5.34 5.60 10.75 3.35 3.03 4.35 16.09 0.80 0.42 0.85 0.25 2.53 5.02 1.23 1.92 1.98 1.15 +208.00 1.040 2.525 0.807 0.821 0.745 14.94 1.252 1.00 1.625 15.40 0.000 5.33 5.59 10.72 3.35 3.03 4.33 16.05 0.80 0.42 0.85 0.26 2.53 5.02 1.23 1.92 1.98 1.15 +207.00 1.041 2.515 0.805 0.819 0.748 14.94 1.249 1.00 1.615 15.42 0.000 5.31 5.58 10.67 3.33 3.02 4.31 15.98 0.79 0.41 0.85 0.26 2.52 5.02 1.23 1.92 1.98 1.14 +206.00 1.042 2.514 0.805 0.818 0.750 14.96 1.248 1.00 1.606 15.45 0.000 5.29 5.56 10.64 3.32 3.01 4.29 15.94 0.79 0.41 0.85 0.26 2.51 5.02 1.23 1.92 1.98 1.14 +205.00 1.042 2.505 0.803 0.816 0.752 14.96 1.247 1.00 1.599 15.47 0.000 5.25 5.53 10.56 3.30 2.99 4.25 15.81 0.78 0.41 0.85 0.25 2.51 5.02 1.23 1.92 1.98 1.13 +204.00 1.043 2.509 0.800 0.813 0.755 14.99 1.247 1.00 1.594 15.49 0.000 5.23 5.48 10.50 3.28 2.97 4.23 15.73 0.78 0.41 0.85 0.25 2.51 5.02 1.23 1.92 1.98 1.13 +203.00 1.043 2.518 0.798 0.810 0.757 15.02 1.249 1.00 1.602 15.52 0.000 5.20 5.43 10.44 3.26 2.95 4.21 15.65 0.78 0.40 0.85 0.25 2.52 5.02 1.23 1.91 1.98 1.12 +202.00 1.044 2.521 0.794 0.806 0.759 15.05 1.249 1.00 1.607 15.54 0.000 5.17 5.38 10.36 3.23 2.92 4.17 15.53 0.77 0.40 0.85 0.25 2.52 5.02 1.23 1.91 1.98 1.12 +201.00 1.045 2.533 0.791 0.802 0.761 15.09 1.251 1.00 1.613 15.56 0.000 5.13 5.31 10.28 3.20 2.89 4.14 15.41 0.76 0.39 0.85 0.25 2.53 5.02 1.23 1.91 1.98 1.11 +200.00 1.046 2.541 0.786 0.796 0.762 15.13 1.252 1.00 1.620 15.58 0.000 5.09 5.25 10.18 3.16 2.85 4.10 15.27 0.76 0.39 0.84 0.25 2.54 5.02 1.23 1.91 1.99 1.11 +199.00 1.047 2.560 0.782 0.792 0.764 15.18 1.255 1.00 1.630 15.60 0.000 5.06 5.18 10.11 3.14 2.82 4.07 15.18 0.75 0.38 0.84 0.24 2.56 5.01 1.23 1.91 1.99 1.10 +198.00 1.048 2.583 0.778 0.787 0.765 15.24 1.257 1.00 1.649 15.62 0.000 5.04 5.12 10.05 3.11 2.79 4.05 15.10 0.75 0.38 0.84 0.24 2.58 5.01 1.23 1.91 1.99 1.09 +197.00 1.050 2.608 0.774 0.783 0.767 15.31 1.260 1.00 1.670 15.64 0.000 5.02 5.05 10.00 3.09 2.76 4.02 15.02 0.74 0.37 0.83 0.24 2.61 5.01 1.23 1.91 1.99 1.09 +196.00 1.052 2.637 0.770 0.779 0.768 15.39 1.262 1.00 1.691 15.66 0.000 5.00 4.98 9.93 3.06 2.73 3.99 14.93 0.74 0.37 0.83 0.23 2.64 5.01 1.23 1.90 1.99 1.08 +195.00 1.055 2.669 0.766 0.774 0.769 15.47 1.264 1.00 1.712 15.68 0.000 4.95 4.88 9.80 3.01 2.70 3.94 14.75 0.73 0.36 0.83 0.23 2.67 5.01 1.23 1.90 1.99 1.08 +194.00 1.058 2.714 0.760 0.767 0.770 15.57 1.268 1.00 1.734 15.70 0.000 4.92 4.78 9.71 2.97 2.65 3.90 14.63 0.72 0.35 0.82 0.23 2.71 5.01 1.23 1.90 1.99 1.07 +193.00 1.061 2.751 0.753 0.759 0.771 15.66 1.270 1.00 1.759 15.72 0.000 4.88 4.70 9.61 2.94 2.60 3.86 14.49 0.72 0.34 0.82 0.22 2.75 5.01 1.23 1.90 1.99 1.06 +192.00 1.064 2.797 0.748 0.753 0.772 15.76 1.272 1.00 1.780 15.74 0.000 4.86 4.62 9.54 2.91 2.55 3.82 14.41 0.71 0.34 0.82 0.22 2.80 5.01 1.23 1.90 1.99 1.06 +191.00 1.068 2.845 0.743 0.748 0.773 15.87 1.274 1.00 1.806 15.75 0.000 4.84 4.54 9.47 2.88 2.52 3.79 14.32 0.71 0.33 0.81 0.21 2.85 5.01 1.23 1.90 1.99 1.05 +190.00 1.072 2.897 0.739 0.743 0.773 15.98 1.276 1.00 1.831 15.77 0.000 4.74 4.39 9.24 2.80 2.48 3.69 13.98 0.69 0.32 0.81 0.21 2.90 5.01 1.23 1.90 1.99 1.04 +189.00 1.076 2.978 0.727 0.730 0.774 16.14 1.282 1.00 1.845 15.79 0.000 4.83 4.37 9.36 2.82 2.40 3.74 14.18 0.70 0.32 0.80 0.20 2.98 5.01 1.23 1.90 2.00 1.03 +188.00 1.081 3.039 0.729 0.732 0.774 16.26 1.283 1.00 1.902 15.81 0.000 4.95 4.42 9.54 2.87 2.41 3.80 14.49 0.71 0.32 0.80 0.20 3.04 5.01 1.23 1.89 2.00 1.03 +187.00 1.088 3.061 0.735 0.739 0.775 16.32 1.275 1.00 1.948 15.82 0.000 5.02 4.47 9.66 2.90 2.45 3.83 14.67 0.72 0.33 0.79 0.21 3.06 5.01 1.23 1.89 2.00 1.02 +186.00 1.094 3.078 0.740 0.745 0.776 16.37 1.268 1.00 1.957 15.84 0.000 5.09 4.53 9.78 2.94 2.50 3.86 14.87 0.73 0.33 0.79 0.21 3.08 5.01 1.24 1.89 2.00 1.02 +185.00 1.100 3.076 0.746 0.751 0.778 16.39 1.257 1.00 1.957 15.86 0.000 5.15 4.60 9.88 2.98 2.54 3.88 15.03 0.74 0.33 0.79 0.21 3.08 5.01 1.24 1.89 2.00 1.01 +184.00 1.106 3.077 0.752 0.758 0.780 16.41 1.248 1.00 1.943 15.87 0.000 5.24 4.71 10.06 3.04 2.59 3.92 15.30 0.75 0.34 0.79 0.21 3.08 5.01 1.24 1.89 2.00 1.01 +183.00 1.111 3.053 0.760 0.767 0.782 16.39 1.237 1.00 1.933 15.89 0.000 5.28 4.78 10.13 3.07 2.65 3.93 15.41 0.76 0.35 0.79 0.22 3.05 5.01 1.24 1.89 2.00 1.01 +182.00 1.116 3.041 0.766 0.774 0.784 16.39 1.228 1.00 1.903 15.91 0.000 5.33 4.86 10.24 3.11 2.70 3.95 15.56 0.77 0.35 0.79 0.22 3.04 5.01 1.24 1.89 2.00 1.01 +181.00 1.120 3.019 0.772 0.781 0.787 16.37 1.219 1.00 1.882 15.92 0.000 5.34 4.91 10.26 3.12 2.74 3.94 15.61 0.77 0.36 0.79 0.23 3.02 5.01 1.24 1.89 2.00 1.00 +180.00 1.123 3.013 0.776 0.785 0.789 16.38 1.213 1.00 1.856 15.93 0.000 5.36 4.94 10.30 3.14 2.77 3.94 15.66 0.77 0.36 0.79 0.23 3.01 5.01 1.24 1.88 2.00 1.00 +179.00 1.126 3.005 0.778 0.788 0.792 16.39 1.208 1.00 1.841 15.95 0.000 5.36 4.96 10.30 3.14 2.79 3.93 15.66 0.77 0.36 0.79 0.23 3.01 5.01 1.24 1.88 2.00 1.00 +178.00 1.129 3.013 0.780 0.790 0.795 16.42 1.206 1.00 1.829 15.96 0.000 5.40 4.98 10.36 3.16 2.81 3.94 15.75 0.78 0.36 0.79 0.23 3.01 5.01 1.24 1.88 2.00 1.00 +177.00 1.131 3.011 0.782 0.792 0.797 16.44 1.202 1.00 1.830 15.97 0.000 5.42 5.01 10.39 3.17 2.82 3.95 15.81 0.78 0.36 0.80 0.23 3.01 5.00 1.24 1.88 2.00 1.00 +176.00 1.134 3.018 0.785 0.795 0.800 16.47 1.200 1.00 1.828 15.99 0.000 5.43 5.01 10.39 3.17 2.84 3.94 15.82 0.78 0.36 0.80 0.24 3.02 5.00 1.24 1.88 2.00 1.00 +175.00 1.136 3.036 0.785 0.796 0.803 16.52 1.199 1.00 1.830 16.00 0.000 5.44 4.99 10.39 3.17 2.85 3.93 15.83 0.78 0.36 0.80 0.24 3.04 5.00 1.24 1.88 2.00 1.00 +174.00 1.139 3.063 0.786 0.796 0.805 16.59 1.200 1.00 1.841 16.02 0.000 5.40 4.92 10.31 3.14 2.85 3.90 15.71 0.77 0.35 0.80 0.24 3.06 5.00 1.24 1.88 2.00 0.99 +173.00 1.141 3.099 0.781 0.792 0.808 16.67 1.201 1.00 1.851 16.03 0.000 5.36 4.83 10.18 3.10 2.82 3.85 15.54 0.76 0.35 0.80 0.24 3.10 5.00 1.24 1.88 2.00 0.99 +172.00 1.144 3.159 0.776 0.786 0.810 16.79 1.205 1.00 1.865 16.05 0.000 5.38 4.77 10.18 3.08 2.78 3.84 15.56 0.76 0.34 0.80 0.23 3.16 5.00 1.24 1.87 2.00 0.99 +171.00 1.148 3.220 0.775 0.784 0.812 16.91 1.207 1.00 1.901 16.06 0.000 5.44 4.75 10.24 3.09 2.76 3.86 15.68 0.77 0.34 0.80 0.23 3.22 5.00 1.24 1.87 2.00 0.99 +170.00 1.152 3.261 0.774 0.784 0.814 17.00 1.206 1.00 1.939 16.08 0.000 5.48 4.74 10.28 3.10 2.76 3.87 15.76 0.77 0.34 0.80 0.23 3.26 5.00 1.24 1.87 2.00 0.99 +169.00 1.157 3.301 0.776 0.785 0.816 17.08 1.203 1.00 1.959 16.10 0.000 5.54 4.75 10.36 3.12 2.77 3.89 15.90 0.78 0.34 0.80 0.23 3.30 5.00 1.24 1.87 2.00 0.98 +168.00 1.162 3.336 0.779 0.788 0.818 17.16 1.200 1.00 1.978 16.12 0.000 5.58 4.76 10.41 3.13 2.80 3.89 15.99 0.78 0.34 0.80 0.23 3.34 5.00 1.24 1.87 2.00 0.98 +167.00 1.167 3.360 0.780 0.790 0.820 17.22 1.195 1.00 1.990 16.14 0.000 5.56 4.73 10.36 3.12 2.81 3.85 15.92 0.78 0.34 0.80 0.23 3.36 5.00 1.24 1.87 2.00 0.98 +166.00 1.172 3.404 0.779 0.789 0.822 17.31 1.193 1.00 1.987 16.15 0.000 5.55 4.67 10.29 3.09 2.80 3.82 15.84 0.77 0.33 0.80 0.23 3.40 5.00 1.24 1.87 2.00 0.98 +165.00 1.177 3.452 0.776 0.785 0.824 17.40 1.191 1.00 1.994 16.17 0.000 5.55 4.62 10.25 3.08 2.77 3.79 15.80 0.77 0.33 0.80 0.23 3.45 5.00 1.24 1.87 2.00 0.98 +164.00 1.182 3.514 0.774 0.783 0.826 17.52 1.190 1.00 2.006 16.19 0.000 5.59 4.59 10.27 3.08 2.76 3.79 15.86 0.77 0.33 0.80 0.23 3.51 5.00 1.24 1.87 2.00 0.97 +163.00 1.187 3.576 0.774 0.783 0.828 17.64 1.189 1.00 2.028 16.21 0.000 5.63 4.57 10.30 3.08 2.76 3.79 15.93 0.77 0.33 0.80 0.23 3.58 5.00 1.24 1.86 2.00 0.97 +162.00 1.193 3.623 0.774 0.783 0.830 17.73 1.185 1.00 2.053 16.23 0.000 5.65 4.55 10.30 3.08 2.76 3.78 15.96 0.77 0.32 0.80 0.23 3.62 5.00 1.24 1.86 2.00 0.97 +161.00 1.199 3.678 0.774 0.783 0.831 17.83 1.182 1.00 2.063 16.24 0.000 5.71 4.55 10.35 3.09 2.76 3.78 16.06 0.78 0.32 0.80 0.23 3.68 5.00 1.24 1.86 2.00 0.97 +160.00 1.205 3.716 0.775 0.785 0.833 17.91 1.177 1.00 2.081 16.26 0.000 5.74 4.54 10.37 3.10 2.77 3.77 16.11 0.78 0.32 0.81 0.23 3.72 5.00 1.25 1.86 2.00 0.97 +159.00 1.211 3.762 0.777 0.786 0.835 18.00 1.172 1.00 2.087 16.28 0.000 5.78 4.54 10.41 3.10 2.78 3.76 16.18 0.78 0.32 0.81 0.23 3.76 5.00 1.25 1.86 2.00 0.96 +158.00 1.217 3.769 0.776 0.785 0.837 18.03 1.164 1.00 2.099 16.30 0.000 5.75 4.52 10.35 3.09 2.78 3.72 16.10 0.78 0.32 0.81 0.22 3.77 5.00 1.25 1.86 2.01 0.96 +157.00 1.222 3.750 0.773 0.782 0.839 18.02 1.155 1.00 2.087 16.31 0.000 5.71 4.52 10.27 3.07 2.75 3.67 15.97 0.77 0.32 0.81 0.22 3.75 4.99 1.25 1.86 2.01 0.96 +156.00 1.227 3.726 0.771 0.779 0.840 18.01 1.146 1.00 2.055 16.33 0.000 5.65 4.51 10.18 3.05 2.73 3.62 15.84 0.77 0.32 0.81 0.22 3.73 4.99 1.25 1.86 2.01 0.96 +155.00 1.231 3.685 0.767 0.776 0.842 17.97 1.138 1.00 2.022 16.34 0.000 5.59 4.51 10.09 3.03 2.71 3.57 15.68 0.76 0.32 0.80 0.22 3.68 4.99 1.25 1.86 2.01 0.96 +154.00 1.233 3.644 0.765 0.773 0.843 17.93 1.131 1.00 1.980 16.34 0.000 5.54 4.52 10.02 3.02 2.69 3.54 15.56 0.75 0.32 0.80 0.22 3.64 4.99 1.25 1.86 2.01 0.95 +153.00 1.235 3.584 0.762 0.770 0.844 17.86 1.124 1.00 1.943 16.35 0.000 5.49 4.54 9.96 3.01 2.67 3.50 15.45 0.75 0.32 0.80 0.21 3.58 4.99 1.25 1.86 2.01 0.95 +152.00 1.235 3.522 0.761 0.768 0.846 17.78 1.118 1.00 1.897 16.35 0.000 5.45 4.57 9.91 3.01 2.66 3.48 15.36 0.75 0.32 0.80 0.21 3.52 4.99 1.25 1.85 2.01 0.94 +151.00 1.235 3.440 0.759 0.766 0.847 17.68 1.111 1.00 1.851 16.35 0.000 5.39 4.60 9.84 3.00 2.64 3.45 15.23 0.74 0.32 0.80 0.21 3.44 4.99 1.25 1.85 2.01 0.94 +150.00 1.233 3.359 0.758 0.765 0.848 17.57 1.106 1.00 1.794 16.35 0.000 5.31 4.61 9.74 2.98 2.64 3.41 15.05 0.73 0.33 0.79 0.21 3.36 4.99 1.25 1.85 2.01 0.94 +149.00 1.230 3.280 0.756 0.762 0.849 17.46 1.102 1.00 1.745 16.34 0.000 5.25 4.64 9.68 2.97 2.62 3.39 14.93 0.73 0.33 0.79 0.21 3.28 4.99 1.25 1.85 2.01 0.93 +148.00 1.227 3.235 0.757 0.764 0.850 17.41 1.103 1.00 1.705 16.34 0.000 5.24 4.66 9.67 2.98 2.62 3.40 14.91 0.73 0.33 0.79 0.21 3.23 4.99 1.25 1.85 2.01 0.93 +147.00 1.224 3.192 0.757 0.764 0.852 17.36 1.104 1.00 1.695 16.33 0.000 5.23 4.69 9.69 2.98 2.63 3.41 14.92 0.73 0.33 0.79 0.22 3.19 4.99 1.25 1.85 2.01 0.92 +146.00 1.220 3.161 0.759 0.766 0.853 17.33 1.106 1.00 1.692 16.33 0.000 5.25 4.72 9.73 3.00 2.64 3.43 14.97 0.73 0.33 0.78 0.22 3.16 4.99 1.25 1.85 2.01 0.92 +145.00 1.217 3.121 0.760 0.768 0.855 17.28 1.107 1.00 1.696 16.33 0.000 5.24 4.74 9.72 3.00 2.65 3.43 14.96 0.73 0.33 0.78 0.22 3.12 4.99 1.25 1.85 2.01 0.91 +144.00 1.214 3.095 0.762 0.769 0.856 17.26 1.108 1.00 1.694 16.32 0.000 5.25 4.76 9.75 3.01 2.66 3.45 15.00 0.73 0.33 0.78 0.22 3.09 4.99 1.25 1.85 2.01 0.91 +143.00 1.212 3.074 0.763 0.771 0.858 17.24 1.111 1.00 1.701 16.32 0.000 5.26 4.78 9.79 3.02 2.68 3.47 15.05 0.74 0.34 0.78 0.22 3.07 4.99 1.25 1.84 2.01 0.91 +142.00 1.209 3.042 0.764 0.772 0.860 17.21 1.111 1.00 1.709 16.32 0.000 5.25 4.79 9.78 3.02 2.68 3.47 15.03 0.74 0.34 0.78 0.22 3.04 4.99 1.25 1.84 2.01 0.90 +141.00 1.207 3.023 0.765 0.773 0.861 17.19 1.112 1.00 1.708 16.32 0.000 5.26 4.81 9.80 3.03 2.69 3.49 15.06 0.74 0.34 0.78 0.23 3.02 4.99 1.25 1.84 2.01 0.90 +140.00 1.205 2.995 0.766 0.774 0.863 17.17 1.112 1.00 1.713 16.32 0.000 5.25 4.82 9.80 3.03 2.69 3.49 15.05 0.74 0.34 0.78 0.23 2.99 4.99 1.25 1.84 2.01 0.90 +139.00 1.203 2.977 0.767 0.775 0.865 17.16 1.114 1.00 1.713 16.32 0.000 5.30 4.87 9.89 3.06 2.70 3.52 15.19 0.75 0.34 0.78 0.23 2.98 4.99 1.25 1.84 2.01 0.90 +138.00 1.202 3.020 0.775 0.784 0.867 17.25 1.122 1.00 1.743 16.32 0.000 5.47 4.93 10.16 3.13 2.77 3.63 15.62 0.77 0.34 0.78 0.24 3.02 4.99 1.25 1.84 2.01 0.89 +137.00 1.202 3.096 0.787 0.798 0.869 17.40 1.131 1.00 1.828 16.33 0.000 5.73 5.05 10.58 3.24 2.87 3.79 16.31 0.80 0.35 0.78 0.24 3.10 4.99 1.25 1.84 2.01 0.89 +136.00 1.205 3.161 0.802 0.815 0.873 17.53 1.134 1.00 1.931 16.35 0.000 6.00 5.19 11.03 3.37 2.99 3.95 17.03 0.83 0.36 0.78 0.26 3.16 4.99 1.25 1.84 2.01 0.90 +135.00 1.211 3.232 0.820 0.836 0.876 17.67 1.134 1.00 2.019 16.37 0.000 6.28 5.34 11.48 3.49 3.14 4.10 17.76 0.87 0.37 0.79 0.27 3.23 4.99 1.25 1.84 2.01 0.90 +134.00 1.219 3.295 0.838 0.855 0.881 17.80 1.130 1.00 2.092 16.39 0.000 6.55 5.50 11.90 3.62 3.29 4.23 18.45 0.90 0.38 0.80 0.28 3.30 4.99 1.25 1.83 2.01 0.91 +133.00 1.228 3.359 0.855 0.875 0.885 17.92 1.124 1.00 2.147 16.42 0.000 6.81 5.65 12.30 3.73 3.44 4.34 19.10 0.93 0.39 0.81 0.29 3.36 4.99 1.25 1.83 2.01 0.91 +132.00 1.238 3.442 0.872 0.894 0.891 18.08 1.118 1.00 2.196 16.46 0.000 7.09 5.80 12.72 3.86 3.60 4.46 19.81 0.96 0.40 0.82 0.30 3.44 4.99 1.25 1.83 2.01 0.92 +131.00 1.250 3.523 0.888 0.913 0.896 18.23 1.109 1.00 2.245 16.49 0.000 7.38 5.96 13.16 3.98 3.75 4.57 20.53 0.99 0.41 0.83 0.32 3.52 4.99 1.25 1.83 2.01 0.93 +130.00 1.263 3.617 0.906 0.933 0.902 18.39 1.100 1.00 2.288 16.53 0.000 7.70 6.13 13.64 4.13 3.92 4.69 21.34 1.03 0.43 0.85 0.33 3.62 4.99 1.25 1.83 2.01 0.94 +129.00 1.277 3.700 0.924 0.953 0.909 18.54 1.087 1.00 2.329 16.58 0.000 7.97 6.27 14.01 4.24 4.09 4.77 21.98 1.05 0.43 0.87 0.34 3.70 4.99 1.25 1.83 2.01 0.95 +128.00 1.292 3.741 0.936 0.967 0.915 18.63 1.071 1.00 2.348 16.62 0.000 8.12 6.40 14.24 4.32 4.21 4.78 22.36 1.07 0.44 0.89 0.35 3.74 4.99 1.25 1.83 2.00 0.97 +127.00 1.306 3.774 0.946 0.978 0.922 18.70 1.055 1.00 2.339 16.66 0.000 8.25 6.51 14.40 4.38 4.31 4.78 22.65 1.08 0.45 0.90 0.36 3.77 4.99 1.26 1.83 2.00 0.98 +126.00 1.319 3.807 0.954 0.988 0.928 18.77 1.041 1.00 2.325 16.70 0.000 8.34 6.59 14.52 4.42 4.39 4.76 22.86 1.09 0.46 0.92 0.36 3.81 4.98 1.26 1.83 2.00 0.99 +125.00 1.331 3.847 0.961 0.996 0.935 18.85 1.029 1.00 2.314 16.74 0.000 8.44 6.66 14.64 4.47 4.46 4.75 23.09 1.10 0.46 0.94 0.37 3.85 4.98 1.26 1.83 2.00 1.00 +124.00 1.342 3.904 0.968 1.004 0.941 18.95 1.019 1.00 2.312 16.78 0.000 8.55 6.70 14.75 4.50 4.53 4.74 23.30 1.10 0.46 0.95 0.37 3.90 4.98 1.26 1.83 2.00 1.01 +123.00 1.353 3.960 0.973 1.009 0.946 19.06 1.009 1.00 2.317 16.82 0.000 8.64 6.73 14.85 4.53 4.58 4.73 23.49 1.11 0.46 0.97 0.38 3.96 4.98 1.26 1.82 2.00 1.02 +122.00 1.364 4.018 0.977 1.014 0.952 19.16 1.000 1.00 2.323 16.85 0.000 8.74 6.76 14.94 4.56 4.63 4.72 23.69 1.12 0.47 0.98 0.38 4.02 4.98 1.26 1.82 2.00 1.03 +121.00 1.375 4.077 0.981 1.019 0.957 19.27 0.991 1.00 2.330 16.89 0.000 8.82 6.77 15.00 4.58 4.67 4.70 23.82 1.12 0.47 1.00 0.38 4.08 4.98 1.26 1.82 1.99 1.04 +120.00 1.385 4.141 0.984 1.022 0.962 19.38 0.982 1.00 2.336 16.93 0.000 8.91 6.78 15.07 4.60 4.70 4.68 23.98 1.12 0.47 1.01 0.38 4.14 4.98 1.26 1.82 1.99 1.05 +119.00 1.395 4.207 0.988 1.026 0.967 19.49 0.974 1.00 2.346 16.96 0.000 8.99 6.78 15.13 4.62 4.74 4.66 24.12 1.13 0.47 1.03 0.39 4.21 4.98 1.26 1.82 1.99 1.06 +118.00 1.405 4.276 0.990 1.029 0.972 19.61 0.966 1.00 2.356 17.00 0.000 9.07 6.77 15.17 4.63 4.76 4.63 24.24 1.13 0.46 1.04 0.39 4.28 4.98 1.26 1.82 1.99 1.07 +117.00 1.415 4.350 0.992 1.031 0.976 19.73 0.958 1.00 2.366 17.03 0.000 9.14 6.75 15.20 4.64 4.79 4.60 24.34 1.13 0.46 1.05 0.39 4.35 4.98 1.26 1.82 1.99 1.07 +116.00 1.425 4.429 0.994 1.033 0.980 19.86 0.951 1.00 2.378 17.07 0.000 9.22 6.73 15.24 4.65 4.80 4.57 24.46 1.13 0.46 1.06 0.39 4.43 4.98 1.26 1.82 1.99 1.08 +115.00 1.436 4.510 0.996 1.035 0.984 19.99 0.944 1.00 2.392 17.10 0.000 9.31 6.71 15.28 4.66 4.82 4.55 24.58 1.14 0.46 1.07 0.39 4.51 4.98 1.26 1.82 1.99 1.09 +114.00 1.446 4.592 0.997 1.037 0.987 20.12 0.936 1.00 2.406 17.13 0.000 9.39 6.64 15.31 4.65 4.84 4.51 24.70 1.14 0.45 1.08 0.39 4.59 4.98 1.26 1.82 1.99 1.09 +113.00 1.456 4.673 0.997 1.036 0.991 20.25 0.928 1.00 2.432 17.17 0.000 9.79 6.80 15.86 4.81 4.83 4.62 25.66 1.18 0.46 1.09 0.39 4.67 4.97 1.26 1.82 1.99 1.10 +112.00 1.469 4.669 1.011 1.052 0.995 20.27 0.914 1.00 2.467 17.20 0.000 10.00 6.94 16.18 4.91 4.98 4.64 26.18 1.20 0.47 1.10 0.40 4.67 4.97 1.26 1.82 1.99 1.10 +111.00 1.480 4.643 1.022 1.064 0.999 20.25 0.900 1.00 2.462 17.24 0.000 10.10 7.05 16.36 4.97 5.10 4.63 26.45 1.22 0.48 1.11 0.41 4.64 4.97 1.26 1.82 1.98 1.11 +110.00 1.491 4.622 1.030 1.074 1.003 20.25 0.888 1.00 2.443 17.27 0.000 10.21 7.15 16.54 5.03 5.19 4.62 26.75 1.23 0.49 1.12 0.41 4.62 4.97 1.27 1.82 1.98 1.12 +109.00 1.501 4.602 1.037 1.082 1.007 20.24 0.877 1.00 2.427 17.30 0.000 10.29 7.23 16.67 5.08 5.27 4.61 26.96 1.24 0.49 1.13 0.42 4.60 4.97 1.27 1.81 1.98 1.12 +108.00 1.509 4.561 1.042 1.087 1.011 20.21 0.866 1.00 2.410 17.33 0.000 10.31 7.29 16.74 5.10 5.32 4.57 27.05 1.24 0.50 1.14 0.42 4.56 4.97 1.27 1.81 1.98 1.13 +107.00 1.517 4.515 1.045 1.091 1.015 20.18 0.857 1.00 2.386 17.36 0.000 10.30 7.33 16.75 5.11 5.36 4.53 27.05 1.24 0.50 1.15 0.42 4.52 4.97 1.27 1.81 1.98 1.14 +106.00 1.523 4.487 1.048 1.094 1.019 20.16 0.849 1.00 2.363 17.39 0.000 10.30 7.35 16.76 5.12 5.39 4.50 27.07 1.24 0.50 1.16 0.42 4.49 4.97 1.27 1.81 1.98 1.14 +105.00 1.529 4.454 1.049 1.095 1.023 20.14 0.842 1.00 2.348 17.41 0.000 10.30 7.36 16.77 5.12 5.40 4.46 27.07 1.24 0.50 1.17 0.43 4.45 4.97 1.27 1.81 1.98 1.15 +104.00 1.534 4.419 1.050 1.096 1.026 20.11 0.836 1.00 2.334 17.43 0.000 10.28 7.38 16.77 5.12 5.41 4.43 27.05 1.24 0.50 1.18 0.43 4.42 4.97 1.27 1.81 1.98 1.15 +103.00 1.538 4.382 1.050 1.097 1.029 20.09 0.830 1.00 2.319 17.46 0.000 10.27 7.39 16.78 5.13 5.41 4.40 27.05 1.24 0.50 1.19 0.43 4.38 4.97 1.27 1.81 1.98 1.15 +102.00 1.542 4.343 1.051 1.097 1.032 20.06 0.825 1.00 2.305 17.48 0.000 10.24 7.39 16.75 5.12 5.42 4.37 26.99 1.24 0.50 1.20 0.43 4.34 4.97 1.27 1.81 1.98 1.16 +101.00 1.546 4.320 1.051 1.098 1.035 20.04 0.821 1.00 2.293 17.50 0.000 10.23 7.38 16.74 5.11 5.43 4.34 26.97 1.24 0.50 1.20 0.43 4.32 4.97 1.27 1.81 1.98 1.16 +100.00 1.549 4.291 1.050 1.097 1.038 20.03 0.817 1.00 2.287 17.52 0.000 10.22 7.38 16.74 5.11 5.42 4.32 26.97 1.24 0.50 1.21 0.43 4.29 4.97 1.27 1.81 1.98 1.16 + 99.00 1.551 4.256 1.050 1.097 1.040 20.00 0.813 1.00 2.279 17.54 0.000 10.11 7.35 16.58 5.07 5.42 4.27 26.68 1.23 0.50 1.21 0.43 4.26 4.97 1.27 1.81 1.98 1.17 + 98.00 1.553 4.216 1.046 1.092 1.042 19.97 0.810 1.00 2.253 17.55 0.000 9.97 7.31 16.38 5.02 5.36 4.21 26.35 1.21 0.49 1.22 0.42 4.22 4.97 1.27 1.81 1.98 1.17 + 97.00 1.554 4.176 1.040 1.085 1.044 19.93 0.808 1.00 2.226 17.57 0.000 9.82 7.25 16.17 4.96 5.30 4.15 26.00 1.20 0.49 1.22 0.42 4.18 4.97 1.27 1.81 1.98 1.17 + 96.00 1.554 4.150 1.034 1.079 1.045 19.92 0.807 1.00 2.203 17.58 0.000 9.70 7.18 15.98 4.91 5.24 4.10 25.68 1.18 0.48 1.22 0.42 4.15 4.97 1.27 1.80 1.98 1.16 + 95.00 1.553 4.116 1.028 1.071 1.046 19.89 0.806 1.00 2.185 17.59 0.000 9.55 7.10 15.75 4.84 5.17 4.04 25.30 1.17 0.48 1.22 0.41 4.12 4.97 1.27 1.80 1.98 1.16 + 94.00 1.552 4.082 1.020 1.063 1.047 19.87 0.806 1.00 2.165 17.60 0.000 9.40 7.02 15.52 4.77 5.08 3.98 24.92 1.15 0.47 1.21 0.40 4.08 4.97 1.27 1.80 1.98 1.16 + 93.00 1.550 4.045 1.012 1.054 1.047 19.84 0.806 1.00 2.145 17.61 0.000 9.21 6.91 15.23 4.69 5.00 3.91 24.44 1.13 0.47 1.21 0.40 4.05 4.97 1.27 1.80 1.98 1.15 + 92.00 1.548 4.016 1.003 1.043 1.047 19.82 0.808 1.00 2.125 17.61 0.000 9.02 6.79 14.94 4.60 4.90 3.84 23.97 1.11 0.46 1.20 0.39 4.02 4.97 1.27 1.80 1.98 1.15 + 91.00 1.545 4.006 0.994 1.033 1.047 19.83 0.810 1.00 2.111 17.62 0.000 8.88 6.67 14.70 4.52 4.80 3.79 23.58 1.09 0.45 1.19 0.38 4.01 4.97 1.27 1.80 1.98 1.14 + 90.00 1.543 3.988 0.984 1.021 1.046 19.82 0.812 1.00 2.105 17.62 0.000 8.75 6.56 14.48 4.45 4.69 3.74 23.22 1.07 0.44 1.19 0.37 3.99 4.97 1.27 1.80 1.98 1.13 + 89.00 1.540 3.961 0.975 1.011 1.045 19.80 0.813 1.00 2.095 17.63 0.000 8.70 6.54 14.41 4.43 4.60 3.73 23.10 1.07 0.44 1.18 0.37 3.96 4.97 1.27 1.80 1.98 1.13 + 88.00 1.537 3.947 0.973 1.009 1.044 19.81 0.816 1.00 2.092 17.63 0.000 8.81 6.61 14.59 4.49 4.58 3.79 23.39 1.08 0.44 1.17 0.37 3.95 4.97 1.27 1.80 1.98 1.12 + 87.00 1.535 3.892 0.977 1.014 1.044 19.75 0.815 1.00 2.096 17.63 0.000 8.80 6.66 14.62 4.50 4.62 3.80 23.42 1.09 0.45 1.16 0.37 3.89 4.97 1.27 1.80 1.98 1.11 + 86.00 1.533 3.844 0.979 1.016 1.044 19.70 0.816 1.00 2.080 17.63 0.000 8.80 6.71 14.65 4.52 4.65 3.81 23.44 1.09 0.45 1.16 0.37 3.84 4.97 1.27 1.80 1.98 1.11 + 85.00 1.530 3.786 0.980 1.017 1.044 19.63 0.816 1.00 2.063 17.63 0.000 8.77 6.75 14.65 4.52 4.66 3.82 23.42 1.09 0.45 1.15 0.37 3.79 4.97 1.27 1.80 1.99 1.10 + 84.00 1.527 3.740 0.982 1.019 1.045 19.58 0.817 1.00 2.044 17.63 0.000 8.76 6.78 14.66 4.53 4.67 3.83 23.42 1.09 0.46 1.15 0.38 3.74 4.97 1.27 1.80 1.99 1.10 + 83.00 1.523 3.700 0.983 1.021 1.045 19.54 0.818 1.00 2.032 17.63 0.000 8.76 6.81 14.69 4.54 4.69 3.84 23.45 1.09 0.46 1.14 0.38 3.70 4.97 1.27 1.80 1.99 1.09 + 82.00 1.520 3.648 0.983 1.021 1.046 19.49 0.819 1.00 2.020 17.64 0.000 8.72 6.84 14.67 4.54 4.69 3.85 23.38 1.09 0.46 1.14 0.38 3.65 4.97 1.27 1.79 1.99 1.09 + 81.00 1.516 3.610 0.984 1.022 1.046 19.45 0.821 1.00 2.005 17.64 0.000 8.71 6.86 14.68 4.55 4.70 3.86 23.38 1.09 0.46 1.14 0.38 3.61 4.97 1.27 1.79 1.99 1.09 + 80.00 1.512 3.561 0.984 1.021 1.047 19.39 0.822 1.00 1.993 17.64 0.000 8.66 6.87 14.64 4.54 4.69 3.86 23.30 1.09 0.46 1.13 0.38 3.56 4.97 1.27 1.79 1.99 1.08 + 79.00 1.508 3.526 0.984 1.021 1.048 19.36 0.824 1.00 1.980 17.64 0.000 8.66 6.89 14.66 4.54 4.69 3.87 23.31 1.09 0.46 1.13 0.38 3.53 4.97 1.27 1.79 1.99 1.08 + 78.00 1.504 3.493 0.984 1.022 1.049 19.33 0.826 1.00 1.975 17.64 0.000 8.67 6.92 14.70 4.56 4.70 3.90 23.37 1.10 0.46 1.13 0.39 3.49 4.97 1.27 1.79 1.99 1.08 + 77.00 1.501 3.458 0.986 1.024 1.050 19.30 0.828 1.00 1.971 17.64 0.000 8.68 6.95 14.73 4.57 4.72 3.91 23.41 1.10 0.47 1.13 0.39 3.46 4.97 1.27 1.79 1.99 1.07 + 76.00 1.497 3.437 0.988 1.026 1.051 19.28 0.830 1.00 1.970 17.64 0.000 8.73 6.99 14.82 4.60 4.74 3.95 23.55 1.10 0.47 1.13 0.39 3.44 4.97 1.27 1.79 1.99 1.07 + 75.00 1.494 3.405 0.990 1.029 1.052 19.25 0.832 1.00 1.970 17.65 0.000 8.76 7.04 14.90 4.62 4.76 3.98 23.66 1.11 0.47 1.13 0.40 3.40 4.97 1.27 1.79 1.99 1.07 + 74.00 1.491 3.366 0.993 1.032 1.053 19.21 0.833 1.00 1.963 17.65 0.000 8.77 7.09 14.96 4.65 4.79 4.00 23.73 1.11 0.47 1.13 0.40 3.37 4.97 1.27 1.79 1.99 1.07 + 73.00 1.488 3.327 0.995 1.034 1.055 19.17 0.833 1.00 1.951 17.66 0.000 8.80 7.15 15.03 4.67 4.82 4.03 23.83 1.12 0.48 1.13 0.40 3.33 4.97 1.27 1.79 1.99 1.07 + 72.00 1.485 3.284 0.998 1.038 1.056 19.12 0.834 1.00 1.939 17.66 0.000 8.81 7.21 15.09 4.70 4.85 4.05 23.91 1.13 0.48 1.13 0.41 3.28 4.97 1.27 1.79 1.99 1.07 + 71.00 1.482 3.255 1.002 1.042 1.058 19.09 0.836 1.00 1.930 17.67 0.000 8.86 7.27 15.19 4.73 4.89 4.09 24.05 1.13 0.49 1.13 0.41 3.25 4.97 1.27 1.79 1.99 1.07 + 70.00 1.478 3.216 1.005 1.045 1.060 19.05 0.836 1.00 1.923 17.67 0.000 8.87 7.32 15.24 4.75 4.92 4.11 24.11 1.14 0.49 1.13 0.42 3.22 4.97 1.27 1.79 1.99 1.07 + 69.00 1.475 3.178 1.007 1.048 1.061 19.00 0.837 1.00 1.910 17.68 0.000 8.86 7.35 15.25 4.75 4.94 4.12 24.11 1.14 0.49 1.13 0.42 3.18 4.97 1.27 1.78 1.99 1.07 + 68.00 1.472 3.144 1.008 1.049 1.063 18.97 0.838 1.00 1.898 17.69 0.000 8.85 7.37 15.26 4.76 4.95 4.13 24.10 1.14 0.49 1.13 0.42 3.14 4.97 1.27 1.78 1.99 1.07 + 67.00 1.469 3.115 1.009 1.050 1.065 18.94 0.840 1.00 1.889 17.69 0.000 8.84 7.39 15.27 4.77 4.96 4.14 24.12 1.14 0.49 1.14 0.42 3.12 4.97 1.27 1.78 1.99 1.07 + 66.00 1.465 3.088 1.010 1.051 1.066 18.91 0.842 1.00 1.883 17.70 0.000 8.88 7.44 15.35 4.79 4.97 4.17 24.23 1.14 0.50 1.14 0.43 3.09 4.97 1.27 1.78 1.99 1.07 + 65.00 1.462 3.054 1.012 1.053 1.068 18.87 0.842 1.00 1.875 17.71 0.000 8.84 7.44 15.31 4.78 4.99 4.17 24.14 1.14 0.50 1.14 0.43 3.05 4.97 1.27 1.78 1.99 1.07 + 64.00 1.459 3.030 1.011 1.053 1.070 18.85 0.844 1.00 1.866 17.72 0.000 8.80 7.42 15.26 4.77 4.99 4.16 24.06 1.14 0.49 1.14 0.43 3.03 4.97 1.27 1.78 1.99 1.07 + 63.00 1.456 3.014 1.010 1.052 1.071 18.85 0.846 1.00 1.865 17.73 0.000 8.78 7.40 15.22 4.75 4.98 4.16 23.99 1.13 0.49 1.14 0.43 3.01 4.97 1.27 1.78 1.99 1.07 + 62.00 1.453 3.004 1.009 1.050 1.073 18.85 0.849 1.00 1.868 17.74 0.000 8.77 7.38 15.21 4.75 4.96 4.17 23.98 1.13 0.49 1.14 0.43 3.00 4.97 1.27 1.78 1.99 1.07 + 61.00 1.451 2.992 1.008 1.049 1.074 18.85 0.850 1.00 1.872 17.75 0.000 8.76 7.36 15.20 4.74 4.95 4.17 23.96 1.13 0.49 1.14 0.43 2.99 4.97 1.27 1.78 1.99 1.07 + 60.00 1.449 2.982 1.007 1.048 1.075 18.86 0.852 1.00 1.876 17.76 0.000 8.75 7.34 15.16 4.73 4.94 4.17 23.91 1.13 0.49 1.14 0.43 2.98 4.97 1.27 1.78 1.99 1.07 + 59.00 1.447 2.975 1.006 1.047 1.076 18.87 0.854 1.00 1.879 17.77 0.000 8.75 7.33 15.16 4.73 4.93 4.17 23.91 1.13 0.49 1.14 0.43 2.97 4.97 1.27 1.78 1.99 1.06 + 58.00 1.446 2.980 1.006 1.047 1.077 18.90 0.856 1.00 1.891 17.78 0.000 8.77 7.31 15.17 4.72 4.94 4.18 23.94 1.13 0.49 1.15 0.43 2.98 4.97 1.27 1.78 1.99 1.06 + 57.00 1.445 2.991 1.007 1.048 1.078 18.94 0.858 1.00 1.909 17.80 0.000 8.81 7.30 15.22 4.73 4.94 4.20 24.03 1.14 0.48 1.15 0.43 2.99 4.97 1.27 1.78 1.99 1.06 + 56.00 1.446 3.003 1.008 1.049 1.079 18.98 0.859 1.00 1.928 17.81 0.000 8.83 7.27 15.23 4.73 4.95 4.20 24.06 1.14 0.48 1.15 0.44 3.00 4.97 1.27 1.78 1.99 1.06 + 55.00 1.446 3.022 1.008 1.049 1.080 19.04 0.860 1.00 1.947 17.83 0.000 8.88 7.25 15.27 4.74 4.95 4.22 24.15 1.14 0.48 1.15 0.44 3.02 4.97 1.27 1.78 1.99 1.06 + 54.00 1.448 3.054 1.009 1.051 1.081 19.12 0.862 1.00 1.974 17.85 0.000 8.99 7.26 15.39 4.77 4.97 4.25 24.37 1.15 0.48 1.15 0.44 3.05 4.97 1.27 1.78 1.99 1.06 + 53.00 1.450 3.074 1.012 1.053 1.082 19.18 0.861 1.00 1.997 17.86 0.000 9.07 7.28 15.50 4.80 4.99 4.27 24.57 1.16 0.48 1.15 0.44 3.07 4.97 1.27 1.78 1.99 1.06 + 52.00 1.453 3.087 1.015 1.057 1.084 19.22 0.860 1.00 2.010 17.88 0.000 9.17 7.33 15.62 4.83 5.02 4.30 24.79 1.17 0.49 1.15 0.44 3.09 4.97 1.27 1.78 1.99 1.06 + 51.00 1.456 3.093 1.019 1.061 1.085 19.26 0.857 1.00 2.017 17.90 0.000 9.26 7.38 15.75 4.87 5.07 4.32 25.00 1.17 0.49 1.15 0.44 3.09 4.97 1.27 1.77 1.99 1.06 + 50.00 1.459 3.096 1.023 1.066 1.087 19.28 0.855 1.00 2.019 17.92 0.000 9.34 7.45 15.88 4.92 5.11 4.35 25.22 1.18 0.49 1.16 0.45 3.10 4.97 1.27 1.77 1.99 1.06 + 49.00 1.462 3.095 1.028 1.071 1.088 19.30 0.852 1.00 2.018 17.93 0.000 9.38 7.48 15.92 4.93 5.17 4.35 25.29 1.19 0.50 1.16 0.45 3.10 4.97 1.27 1.77 1.99 1.07 + 48.00 1.464 3.065 1.027 1.071 1.090 19.27 0.847 1.00 1.996 17.95 0.000 9.30 7.48 15.82 4.91 5.16 4.31 25.12 1.18 0.50 1.16 0.45 3.06 4.97 1.27 1.77 1.99 1.07 + 47.00 1.465 3.018 1.024 1.067 1.091 19.21 0.843 1.00 1.953 17.96 0.000 9.18 7.48 15.65 4.88 5.13 4.25 24.83 1.17 0.49 1.17 0.45 3.02 4.97 1.27 1.77 1.99 1.07 + 46.00 1.465 2.980 1.021 1.064 1.092 19.16 0.840 1.00 1.913 17.97 0.000 9.05 7.44 15.47 4.83 5.09 4.20 24.52 1.15 0.49 1.17 0.45 2.98 4.97 1.27 1.77 1.99 1.07 + 45.00 1.464 2.935 1.015 1.057 1.093 19.10 0.839 1.00 1.873 17.98 0.000 8.90 7.39 15.25 4.77 5.03 4.14 24.15 1.14 0.49 1.17 0.44 2.93 4.97 1.27 1.77 1.99 1.07 + 44.00 1.461 2.902 1.009 1.051 1.093 19.06 0.839 1.00 1.842 17.99 0.000 8.77 7.33 15.06 4.71 4.97 4.09 23.83 1.12 0.48 1.16 0.44 2.90 4.97 1.27 1.77 1.99 1.06 + 43.00 1.458 2.871 1.003 1.044 1.094 19.03 0.839 1.00 1.818 17.99 0.000 8.65 7.25 14.87 4.66 4.90 4.04 23.52 1.11 0.48 1.16 0.43 2.87 4.97 1.27 1.77 1.99 1.06 + 42.00 1.455 2.831 0.996 1.035 1.094 18.98 0.840 1.00 1.790 18.00 0.000 8.49 7.18 14.64 4.59 4.82 3.99 23.14 1.09 0.47 1.16 0.43 2.83 4.97 1.27 1.77 1.99 1.06 + 41.00 1.451 2.799 0.989 1.027 1.093 18.94 0.841 1.00 1.765 18.00 0.000 8.36 7.09 14.43 4.53 4.75 3.94 22.79 1.08 0.47 1.15 0.42 2.80 4.97 1.27 1.77 1.99 1.05 + 40.00 1.447 2.757 0.980 1.018 1.093 18.88 0.842 1.00 1.736 18.00 0.000 8.21 7.01 14.22 4.46 4.66 3.89 22.42 1.06 0.46 1.14 0.41 2.76 4.97 1.27 1.77 1.99 1.05 + 39.00 1.442 2.723 0.973 1.010 1.092 18.84 0.845 1.00 1.712 18.00 0.000 8.10 6.95 14.06 4.42 4.59 3.86 22.17 1.05 0.46 1.14 0.41 2.72 4.97 1.27 1.77 1.99 1.04 + 38.00 1.437 2.685 0.967 1.003 1.091 18.78 0.847 1.00 1.690 18.00 0.000 8.01 6.91 13.94 4.38 4.52 3.84 21.95 1.04 0.46 1.13 0.40 2.69 4.97 1.27 1.77 2.00 1.04 + 37.00 1.431 2.642 0.962 0.997 1.090 18.72 0.848 1.00 1.664 18.00 0.000 7.92 6.88 13.81 4.35 4.47 3.82 21.73 1.03 0.45 1.12 0.40 2.64 4.97 1.27 1.77 2.00 1.03 + 36.00 1.425 2.607 0.959 0.993 1.090 18.67 0.851 1.00 1.644 18.00 0.000 7.86 6.86 13.74 4.33 4.44 3.81 21.60 1.03 0.45 1.11 0.40 2.61 4.97 1.27 1.77 2.00 1.02 + 35.00 1.420 2.559 0.954 0.988 1.089 18.60 0.852 1.00 1.617 18.00 0.000 7.76 6.83 13.62 4.29 4.39 3.79 21.38 1.02 0.45 1.11 0.40 2.56 4.97 1.27 1.77 2.00 1.02 + 34.00 1.413 2.508 0.950 0.983 1.088 18.51 0.854 1.00 1.581 18.00 0.000 7.69 6.83 13.54 4.28 4.35 3.78 21.23 1.01 0.45 1.10 0.39 2.51 4.97 1.27 1.77 2.00 1.01 + 33.00 1.406 2.449 0.947 0.980 1.087 18.41 0.855 1.00 1.539 17.99 0.000 7.64 6.87 13.51 4.27 4.32 3.78 21.14 1.01 0.45 1.09 0.39 2.45 4.97 1.27 1.77 2.00 1.00 + 32.00 1.399 2.380 0.946 0.978 1.086 18.29 0.855 1.00 1.486 17.99 0.000 7.57 6.93 13.47 4.27 4.31 3.78 21.04 1.01 0.46 1.08 0.39 2.38 4.97 1.27 1.77 2.00 1.00 + 31.00 1.390 2.317 0.946 0.979 1.086 18.17 0.857 1.00 1.437 17.99 0.000 7.49 6.95 13.40 4.26 4.31 3.78 20.90 1.00 0.46 1.08 0.40 2.32 4.97 1.27 1.76 2.00 0.99 + 30.00 1.381 2.249 0.944 0.976 1.085 18.04 0.858 1.00 1.380 17.98 0.000 7.40 6.97 13.31 4.24 4.29 3.77 20.71 1.00 0.46 1.07 0.40 2.25 4.97 1.27 1.76 2.00 0.99 + 29.00 1.371 2.179 0.941 0.973 1.085 17.91 0.860 1.00 1.320 17.97 0.000 7.30 6.99 13.21 4.22 4.26 3.76 20.51 0.99 0.46 1.06 0.40 2.18 4.98 1.27 1.76 2.00 0.98 + 28.00 1.360 2.121 0.940 0.972 1.085 17.80 0.863 1.00 1.274 17.97 0.000 7.25 7.02 13.17 4.22 4.25 3.77 20.42 0.99 0.46 1.06 0.40 2.12 4.98 1.27 1.76 2.00 0.98 + 27.00 1.349 2.075 0.940 0.972 1.084 17.71 0.868 1.00 1.251 17.97 0.000 7.23 7.05 13.18 4.23 4.25 3.80 20.41 0.99 0.46 1.05 0.40 2.08 4.98 1.27 1.76 2.00 0.97 + 26.00 1.339 2.021 0.940 0.971 1.084 17.60 0.872 1.00 1.217 17.96 0.000 7.19 7.08 13.17 4.23 4.25 3.81 20.35 0.99 0.47 1.05 0.41 2.02 4.98 1.27 1.76 2.00 0.97 + 25.00 1.328 1.976 0.941 0.972 1.084 17.51 0.876 1.00 1.193 17.96 0.000 7.20 7.14 13.24 4.25 4.26 3.85 20.44 0.99 0.47 1.04 0.41 1.98 4.98 1.27 1.76 2.01 0.96 + 24.00 1.317 1.918 0.942 0.974 1.084 17.39 0.879 1.00 1.149 17.96 0.000 7.19 7.23 13.29 4.28 4.27 3.89 20.47 1.00 0.48 1.04 0.41 1.92 4.98 1.27 1.76 2.01 0.96 + 23.00 1.306 1.855 0.944 0.976 1.084 17.25 0.880 1.00 1.089 17.96 0.000 7.13 7.28 13.25 4.28 4.29 3.90 20.37 1.00 0.48 1.03 0.42 1.86 4.98 1.27 1.76 2.01 0.95 + 22.00 1.294 1.807 0.946 0.978 1.084 17.15 0.884 1.00 1.052 17.96 0.000 7.09 7.31 13.23 4.28 4.31 3.91 20.32 0.99 0.48 1.03 0.43 1.81 4.98 1.27 1.76 2.01 0.95 + 21.00 1.282 1.756 0.945 0.977 1.085 17.03 0.888 1.00 1.008 17.96 0.000 7.05 7.36 13.23 4.29 4.30 3.93 20.28 0.99 0.48 1.03 0.43 1.76 4.98 1.27 1.76 2.01 0.95 + 20.00 1.270 1.712 0.946 0.979 1.085 16.93 0.892 1.00 0.979 17.97 0.000 7.08 7.44 13.32 4.32 4.31 3.99 20.40 1.00 0.49 1.03 0.43 1.71 4.98 1.27 1.76 2.01 0.95 + 19.00 1.258 1.656 0.948 0.981 1.085 16.80 0.894 1.00 0.921 17.98 0.000 7.04 7.50 13.31 4.33 4.33 4.00 20.34 1.00 0.49 1.02 0.44 1.66 4.98 1.27 1.76 2.01 0.94 + 18.00 1.246 1.611 0.951 0.984 1.086 16.69 0.898 1.00 0.882 17.98 0.000 7.07 7.61 13.43 4.37 4.36 4.06 20.50 1.01 0.50 1.02 0.45 1.61 4.98 1.27 1.76 2.01 0.94 + 17.00 1.233 1.562 0.955 0.989 1.086 16.57 0.901 1.00 0.835 17.99 0.000 7.10 7.74 13.54 4.42 4.40 4.12 20.65 1.02 0.51 1.02 0.46 1.56 4.98 1.27 1.76 2.01 0.94 + 16.00 1.220 1.512 0.960 0.995 1.087 16.45 0.903 1.00 0.781 18.01 0.000 7.07 7.81 13.55 4.44 4.46 4.14 20.62 1.02 0.51 1.02 0.47 1.51 4.98 1.27 1.76 2.01 0.94 + 15.00 1.208 1.469 0.963 0.998 1.088 16.34 0.907 1.00 0.741 18.02 0.000 7.03 7.83 13.52 4.43 4.48 4.16 20.55 1.02 0.52 1.02 0.48 1.47 4.98 1.27 1.76 2.01 0.94 + 14.00 1.195 1.433 0.963 0.998 1.088 16.25 0.912 1.00 0.717 18.04 0.000 6.98 7.83 13.47 4.42 4.49 4.17 20.46 1.01 0.52 1.02 0.48 1.43 4.98 1.27 1.76 2.01 0.94 + 13.00 1.183 1.403 0.962 0.997 1.089 16.17 0.918 1.00 0.704 18.06 0.000 6.96 7.82 13.46 4.41 4.47 4.19 20.42 1.01 0.51 1.02 0.49 1.40 4.98 1.27 1.76 2.01 0.94 + 12.00 1.172 1.375 0.961 0.996 1.089 16.10 0.923 1.00 0.693 18.08 0.000 6.94 7.81 13.45 4.41 4.46 4.21 20.39 1.01 0.51 1.02 0.49 1.37 4.98 1.27 1.76 2.01 0.94 + 11.00 1.161 1.348 0.961 0.995 1.090 16.04 0.928 1.00 0.681 18.11 0.000 6.92 7.82 13.46 4.41 4.46 4.24 20.38 1.01 0.52 1.02 0.49 1.35 4.98 1.26 1.76 2.01 0.94 + 10.00 1.151 1.322 0.962 0.995 1.090 15.97 0.933 1.00 0.668 18.13 0.006 6.92 7.84 13.49 4.42 4.46 4.26 20.41 1.01 0.52 1.02 0.50 1.32 4.98 1.26 1.75 2.01 0.93 + 9.00 1.141 1.296 0.967 0.997 1.090 15.91 0.936 1.00 0.651 18.16 0.015 6.90 7.85 13.47 4.42 4.47 4.27 20.36 1.01 0.52 1.02 0.50 1.30 4.98 1.26 1.75 2.01 0.93 + 8.00 1.132 1.272 0.970 0.998 1.090 15.85 0.939 1.00 0.638 18.19 0.024 6.87 7.85 13.45 4.41 4.48 4.29 20.32 1.01 0.52 1.02 0.51 1.27 4.99 1.26 1.75 2.01 0.93 + 7.00 1.124 1.250 0.972 0.998 1.090 15.79 0.943 1.00 0.628 18.23 0.031 6.86 7.86 13.45 4.41 4.48 4.30 20.32 1.01 0.52 1.02 0.51 1.25 4.99 1.26 1.75 2.01 0.93 + 6.00 1.116 1.236 0.977 1.000 1.090 15.77 0.947 1.00 0.644 18.26 0.040 6.92 7.90 13.57 4.45 4.50 4.36 20.49 1.02 0.52 1.02 0.52 1.24 4.99 1.26 1.75 2.01 0.93 + 5.00 1.109 1.214 0.982 1.003 1.090 15.71 0.948 1.00 0.621 18.30 0.049 6.93 7.97 13.63 4.47 4.53 4.39 20.56 1.03 0.53 1.02 0.52 1.21 4.99 1.26 1.75 2.01 0.93 + 4.00 1.103 1.191 0.987 1.007 1.090 15.65 0.949 1.00 0.591 18.34 0.059 6.90 7.98 13.58 4.46 4.57 4.38 20.48 1.02 0.53 1.02 0.53 1.19 4.99 1.26 1.75 2.01 0.93 + 3.00 1.096 1.173 0.990 1.008 1.090 15.61 0.951 1.00 0.576 18.38 0.065 6.88 7.98 13.56 4.46 4.57 4.38 20.43 1.02 0.53 1.02 0.54 1.17 4.99 1.26 1.75 2.01 0.93 + 2.00 1.089 1.158 0.991 1.008 1.089 15.57 0.953 1.00 0.567 18.42 0.071 6.88 8.00 13.58 4.46 4.57 4.40 20.45 1.02 0.53 1.02 0.54 1.16 4.99 1.26 1.75 2.01 0.93 + 1.00 1.084 1.148 0.996 1.011 1.089 15.55 0.957 1.00 0.583 18.46 0.078 6.97 8.08 13.76 4.52 4.60 4.47 20.72 1.04 0.53 1.02 0.54 1.15 4.99 1.26 1.76 2.01 0.93 + 0.00 1.079 1.128 1.002 1.016 1.089 15.50 0.956 1.00 0.549 18.51 0.087 6.95 8.13 13.75 4.52 4.65 4.47 20.69 1.03 0.54 1.02 0.55 1.13 4.99 1.26 1.76 2.01 0.93 diff --git a/examples/copse/COPSE_test_output/g3_outputs_avg.mat b/examples/copse/COPSE_test_output/g3_outputs_avg.mat new file mode 100644 index 0000000..32ebbdd Binary files /dev/null and b/examples/copse/COPSE_test_output/g3_outputs_avg.mat differ diff --git a/examples/copse/COPSE_test_output/g3_outputs_avg_paleo.mat b/examples/copse/COPSE_test_output/g3_outputs_avg_paleo.mat new file mode 100644 index 0000000..29c1782 Binary files /dev/null and b/examples/copse/COPSE_test_output/g3_outputs_avg_paleo.mat differ diff --git a/examples/copse/COPSE_test_output/reloaded/original_baseline.mat b/examples/copse/COPSE_test_output/reloaded/original_baseline.mat new file mode 100644 index 0000000..74ef143 Binary files /dev/null and b/examples/copse/COPSE_test_output/reloaded/original_baseline.mat differ diff --git a/examples/copse/COPSE_test_output/reloaded/reloaded_baseline.mat b/examples/copse/COPSE_test_output/reloaded/reloaded_baseline.mat new file mode 100644 index 0000000..07d5b9c Binary files /dev/null and b/examples/copse/COPSE_test_output/reloaded/reloaded_baseline.mat differ diff --git a/examples/copse/copse_bergman2004_bergman2004_expts.m b/examples/copse/copse_bergman2004_bergman2004_expts.m new file mode 100644 index 0000000..1c7d017 --- /dev/null +++ b/examples/copse/copse_bergman2004_bergman2004_expts.m @@ -0,0 +1,198 @@ +function run = copse_bergman2004_bergman2004_expts(baseline, expt) +% COPSE experiments from Bergman (2004), Table 3 + additional examples + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% 'The model': Create and set parameters from config file +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +run = paleo_run; + +run.tm = paleo_modelbuilder.createModel('COPSE_bergman2004_bergman2004_cfg.yaml','copse5_14_base'); +tm = run.tm; + +% string for plot labelling +run.baseconfig = ''; +run.config = 'copse_bergman2004_bergman2004_expts'; +% text strings for plot labelling etc +run.expt = expt; +fprintf('Experiment %s\n',run.expt); + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% calculate unknowns assuming present day steady state +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +run.tm.pars.k17_oxidw = run.tm.pars.k2_mocb + run.tm.pars.k5_locb -run.tm.pars.k13_ocdeg ; +run.tm.pars.k_silw = -run.tm.pars.k2_mocb -run.tm.pars.k5_locb + run.tm.pars.k17_oxidw + run.tm.pars.k13_ocdeg + run.tm.pars.k12_ccdeg ; +run.tm.pars.k10_phosw = ( run.tm.pars.k2_mocb/run.tm.pars.CPsea0 +run.tm.pars.k7_capb +run.tm.pars.k6_fepb ) / (1-run.tm.pars.k11_landfrac) ; + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%%%%%%% Set forcing mode for this run (defines time supplied to historical +%%%%%%% forcings) +run.tm.forcemode = 'TimeDep'; +% SteadyState fixes historical forcing at timeforceSteadyState +%runctrl.forcemode = 'SteadyState' +%runctrl.timeforceSteadyState = run.tm.pars.time_present_yr-550e6 + +%%%%%%%% Set forcing functions for this run +run.tm.force = {copse_force_CK_solar; copse_force_UDWEbergman2004(1); copse_force_B; copse_force_CPlandrel}; % historical forcings from COPSE +run.tm.perturb = {}; + +%%%%%%% Set duration for this run +% For historical forcings, run from before present day to present day +run.Tstart = paleo_const.time_present_yr-600e6; % for COPSE historical forcings + +% Integrate method +run.integrator = paleo_integrate_ode(600e6); +%%%%%%% Set maximum step size for solver (to avoid omitting short-timescale +%%%%%%% change in forcings) +run.integrator.odeoptions = odeset(run.integrator.odeoptions, 'maxstep',1e6) ; + +%%%%%%% Budget calculations (derived after solution calculated) +run.postprocessors = copse_budgets_base(); + +%%%%% Plot configuration + +run.analyzers = paleo_plotlist(); +run.analyzers.plotters = {@copse_plot_base}; +run.analyzers.listplots={ 'PhysForc'; 'EvolForc'; 'O2'; 'CO2'; 'Temp'; 'OceanNP'; 'Biota'; 'LandBiota';'FireIgnit'; + 'O2';'O2Diff'; 'SIsotopes';'CO2';'CO2Diff';'SIsotopesDiff';'CIsotopes';'CIsotopesDiff';'newpage'; + 'CResChange';'SResChange';'RedoxChange';'CaResChange';'newpage'; + 'CDegass'; 'CPWeath'; 'PWeath';'WeathFac'; 'WeathFacNorm';'PBurial'; 'CPBurialratio'; 'orgCBurial'; 'FRatio'; 'CIsotopes'; 'CRes'; 'CCrustRes'; + 'SDegass'; 'SWeath'; 'SBurial'; 'GYPPYR'; 'SCAL'; 'SIsotopes'; + }; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% END run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% Modify base configuration for requested expt +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +switch expt + case 'baseline' + % Baseline configuration + + case 'run2' + % Marine CP ratio depends on anoxia + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_CPsea', 'VCI' ); + + case 'run3' + % Oxidative weathering not dependent on O2 + run.tm.pars = copse_modify_struct( run.tm.pars,'f_oxwO','SatO2'); + run.tm.pars.f_oxw_halfsat = 1e-6; % not defined in base configuration + + %Bergman (2004) uses this, which limits fall of pO2 prior to Ordovician + %run.tm.pars = copse_modify_struct( run.tm.pars,'f_ocdeg','O2copsecrashprevent'); + + case 'run6' + % strong fire feedback + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',20); + + case 'run7' + % no fire feedback, + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',1e10); %to effectively switch off fire feedback + + case 'run8' + % Pyrite burial not dependent on oxygen + run.tm.pars = copse_modify_struct( run.tm.pars,'f_pyrburial','copse_noO2'); + + case 'run9' + % no S cycle + run.tm.pars = copse_modify_struct( run.tm.pars,'Scycle','None'); + + case 'run11' + % C isotope fractionation independent of oxygen + run.tm.pars = copse_modify_struct( run.tm.pars,'f_cisotopefrac','copse_noO2'); + + case 'run12' + % S isotope fractionation dependent on oxygen + if ~isfield(run.tm.pars,'f_sisotopefrac'); error 'no parameter'; end; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_sisotopefrac','copse_O2'); + + case 'run3VCI' + % Oxidative weathering not dependent on O2 + % Marine CP ratio depends on anoxia + + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_CPsea', 'VCI' ); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_oxwO','SatO2'); + run.tm.pars.f_oxw_halfsat = 1e-6; % not defined in base configuration + + %Bergman (2004) uses this, which limits fall of pO2 prior to Ordovician + %run.tm.pars = copse_modify_struct( run.tm.pars,'f_ocdeg','O2copsecrashprevent'); + + case 'fixedcisotopefrac' + % Fixed C isotope fractions + run.tm.pars = copse_modify_struct( run.tm.pars,'f_cisotopefrac','fixed'); + + case 'longspinup' + %Baseline config, with longer spinup + %Illustrates that crustal reservoirs need ~200My to equilibrate from + %Modern starting values to steady-state (less C burial in low O) + %(which might not be right, of course... no Neoproterozoic events here) + + run.Tstart = paleo_const.time_present_yr-1000e6; % longer spinup + run.integrator.timetoadd = 1000e6; + run.tm.pars = copse_modify_struct(run.tm.pars, 'Ainit', 20*run.tm.pars.A0); % high CO2 - modify default initialisation + + case 'carbwC' + % Carbonate weathering proportional to C reservoir size + % very small change as expected, as C only varies by ~2% + + run.tm.pars = copse_modify_struct( run.tm.pars,'f_carbw','Cprop'); + + case 'modernperturb' + % Forcing perturbations against Modern steady-state + + % SteadyState fixes historical forcing at timeforceSteadyState + run.tm.forcemode = 'SteadyState'; + run.tm.timeforceSteadyState = paleo_const.time_present_yr; + + % Add perturbations to forcing + run.tm.perturb{end+1} = copse_force_examples; + % copse_force_co2pulse(size, duration, tstart,d13C) + run.tm.perturb{end+1} = copse_force_co2pulse(3e18, 10e3,600000e3,-30) ; + + %%%%%%% Set duration for this run + + % For eg perturbation experiments that don't use historical forcings, can start from zero for convenience + run.Tstart = 100e6; + run.integrator.timetoadd= 550e6; + + % Identifiy any discontinuities and force restart with small step size + %runctrl.timerestarts = []; + run.integrator.timerestarts = [600e6]; + + case 'cambperturb' + % Forcing perturbations against Cambrian steady-state + + % SteadyState fixes historical forcing at timeforceSteadyState + run.tm.forcemode = 'SteadyState'; + run.tm.timeforceSteadyState = paleo_const.time_present_yr-550e6; + + % Add perturbations to forcing + run.tm.perturb{end+1} = copse_force_examples; + % copse_force_co2pulse(size, duration, tstart,d13C) + run.tm.perturb{end+1} = copse_force_co2pulse(3e18, 10e3,600000e3,-30) ; + + %%%%%%% Set duration for this run + + % For eg perturbation experiments that don't use historical forcings, can start from zero for convenience + run.Tstart = 100e6; + run.integrator.timetoadd=550e6; + + % Identifiy any discontinuities and force restart with small step size + %runctrl.timerestarts = []; + run.integrator.timerestarts = [600e6]; + + + + otherwise + error('unknown runctrl.expt %s\n',runctrl.expt); +end diff --git a/examples/copse/copse_millsg3_millsg3_expts.m b/examples/copse/copse_millsg3_millsg3_expts.m new file mode 100644 index 0000000..c3aecd6 --- /dev/null +++ b/examples/copse/copse_millsg3_millsg3_expts.m @@ -0,0 +1,258 @@ +function run = copse_millsg3_millsg3_expts(basemodel, expt, comparedata) +% COPSE reloaded experiments + + +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +run = paleo_run; +run.config = 'copse_millsg3_millsg3_expts'; +run.expt = sprintf('%s', expt); +run.baseconfig = basemodel; +fprintf('Basemodel %s Experiment %s\n',basemodel, expt); + +%%%%%%% Set duration for this run +% For historical forcings, run from before present day to present day +run.Tstart = paleo_const.time_present_yr-250e6; % run for Mesozoic only + +% Integrate method +run.integrator = paleo_integrate_ode(250e6); +%%%%%%% Set maximum step size for solver (to avoid omitting short-timescale +%%%%%%% change in forcings) +run.integrator.odeoptions = odeset(run.integrator.odeoptions, 'maxstep',1e6) ; + +%%%%%%% Budget calculations (derived after solution calculated) +run.postprocessors = copse_budgets_base(); + +%%%%%%% Plot configuration +run.analyzers = paleo_plotlist(); +run.analyzers.plotters = {@copse_plot_sfbw;@copse_plot_base}; + + +%%%% model does not output necessary fields for WeathFacNorm, so removed from plotlist +run.analyzers.listplots={ 'PhysForc'; 'EvolForc'; 'O2'; 'CO2'; 'Temp'; 'OceanNP'; 'Biota'; 'LandBiota';'FireIgnit'; + 'O2';'O2Diff'; 'SIsotopes';'CO2';'CO2Diff';'SIsotopesDiff';'CIsotopes';'CIsotopesDiff';'newpage'; + 'CResChange';'SResChange';'RedoxChange';'CaResChange';'newpage'; + 'CDegass'; 'CPWeath'; 'PWeath';'WeathFac2';'PBurial'; 'CPBurialratio'; 'orgCBurial'; 'FRatio'; 'CIsotopes'; 'CIsotopesIO'; 'CRes'; 'CCrustRes'; + 'SDegass'; 'SWeath'; 'SBurial'; 'GYPPYR'; 'SCAL'; 'SIsotopes'; 'SFW'; 'Srconc'; 'Srfluxes'; 'Srfrac'; 'BasaltArea'; + }; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% END run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Set base model +switch basemodel + + + case 'g3mills2014nobugs' + % Mills etal (2014) G3 update + run.tm = paleo_modelbuilder.createModel('COPSE_millsg3_millsg3_cfg.yaml','copse_millsg3_2014'); + + case 'g3mills2014withbugs' + % Mills etal (2014) G3 update + run.tm = paleo_modelbuilder.createModel('COPSE_millsg3_millsg3_cfg.yaml','copse_millsg3_2014'); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%% add in bugs to make model match paper runs exactly + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%% implement G3 2014 bug in land biota temp response + run.tm.pars = copse_modify_struct( run.tm.pars,'f_bug_g32014_landbiotatemp','Yes'); + + %%%% Replicate Sr system concentration bug from Mills 2014 G3 + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_bug_g32014_Srconc', 'Yes'); + + %%%% Original Granite area calc, not very good + run.tm.pars = copse_modify_struct( run.tm.pars,'f_granitearea', 'G3original'); + + %%%% Silicate weathering rates used 288K offset, resulting ~1% difference in pCO2 + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_act_energies', 'split_bug_g32014_Toffset'); + + otherwise + error('unknown basemodel %s',basemodel); +end + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Choose an 'experiment' (a delta to the base model) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +switch expt + + case 'baseline' + % Baseline configuration + + + + %%%% Model experiments related to G-cubed paper (Mills et al. 2014) + + case 'sfwalpha' + % alternate seafloor weathering, with alpha=0 (no CO2 dependence) + run.tm.pars = copse_modify_struct( run.tm.pars,'k_sfw', 1.75e12 ); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_sfw_alpha', 0); + + case {'g3revBAavg','g3revBAmin','g3revBAmax'} + % avg (default) / min / max basalt area forcing + BAstr = expt(6:end) ; + % Locate copse_force_revision_ba in the list of forcings + baforce = copse_find_force( run.tm, 'copse_force_revision_ba', false ); + + % set property controlling the field from spreadsheet to use + baforce.estimate = BAstr; + + case {'LipNoCO2';'LipCO2min';'LipCO2max'} + % Spreadsheet-based LIP forcings + % Requires g3-based model with basalt area etc + + % Locate copse_force_revision_ba in the list of forcings (to be replaced it with spreadsheet-based version) + [~, baforceidx] = copse_find_force( run.tm, 'copse_force_revision_ba', false ); + + % Locate degass forcing (needed for normalisation check as this supplies oib_area) + [vandforce, ~] = copse_find_force( run.tm, 'copse_force_vandermeer', false); + + LIPstr = expt(4:end) ; + % Add LIB basalt area + phanlip = copse_load_phanlip('mills2014g3'); + LIPtrange = [-Inf Inf]; % all lips + smoothempl = false; % true for pre-revision G3, false for revised paper + present_day_CFB_area = 4.8e6; + % Create list of LIPs, no CO2 + [flips, default_lambda, ~] = phanlip.create_LIP_forcing(run.Tstart, run.Tstart+run.integrator.timetoadd, ... + LIPstr, present_day_CFB_area, LIPtrange, smoothempl); + fprintf('default_lambda = %g yr-1 to match present day CFB area %g km2\n', default_lambda, present_day_CFB_area); + + fprintf('replacing copse_force_revision_ba forcing with spreadsheet-based LIP forcing\n'); + run.tm.force{baforceidx} = flips; + + % evaluate the new forcing functions at present day to get present-day basalt area + D.CFB_area = 0; + D.LIP_CO2 = 0; + D.LIP_CO2moldelta = 0; + D.oib_area = 0; + D = vandforce.force(paleo_const.time_present_yr, D); + D = flips.force(paleo_const.time_present_yr, D); + + fprintf('updating run.tm.pars.k_present_basalt_area old %g\n',run.tm.pars.k_present_basalt_area); + run.tm.pars = copse_modify_struct(run.tm.pars, 'k_present_basalt_area', D.CFB_area + D.oib_area); + fprintf(' new CFB %g + OIB %g = %g\n', ... + D.CFB_area, D.oib_area, run.tm.pars.k_present_basalt_area); + + % Enable basalt area forcing (present-day value for normalisation calculated below) + run.tm.pars.f_basaltarea = 'g3_2014_construct_from_lips'; + + % Add new plots + run.analyzers.listplots{end+1} = 'LIPCO2'; + + case 'weather' + %try Ben's initialisation for 250 Ma + run.tm.pars = copse_modify_struct(run.tm.pars, 'Ginit', run.tm.pars.G0*1.0); + run.tm.pars = copse_modify_struct(run.tm.pars, 'Cinit', run.tm.pars.C0*1.0); + run.tm.pars = copse_modify_struct(run.tm.pars, 'PYRinit', run.tm.pars.PYR0*1.1); + run.tm.pars = copse_modify_struct(run.tm.pars, 'GYPinit', run.tm.pars.GYP0*0.9); + run.tm.pars = copse_modify_struct(run.tm.pars, 'Oinit', run.tm.pars.O0*1.0); + run.tm.pars = copse_modify_struct(run.tm.pars, 'Sinit', run.tm.pars.S0*0.8); + run.tm.pars = copse_modify_struct(run.tm.pars, 'Ainit', run.tm.pars.A0*1.0); + %run.tm.forcemode = 'SteadyState'; + %run.tm.timeforceSteadyState = paleo_const.time_present_yr; + %run.tm.pars.k15_plantenhance=0.25; + %run.tm.pars.f_co2fert = 'geocarb3'; + %run.tm.pars = copse_modify_struct(run.tm.pars, 'f_vegweath', 'new'); + run.tm.pars = copse_modify_struct( run.tm.pars,'k_Psilw',0.56); %0.5 + run.tm.pars = copse_modify_struct( run.tm.pars,'k_Pcarbw',0.21); %0.2 + run.tm.pars = copse_modify_struct( run.tm.pars,'k_Poxidw',0.23); %0.3 + %run.tm.pars = copse_modify_struct( run.tm.pars,'f_p_kinetics','yes'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_p_apportion','yes'); + %also change seafloor weathering + %run.tm.pars = copse_modify_struct( run.tm.pars,'f_sfw_opt','sfw_Tbotw'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_sfw_opt','sfw_temp'); + % Experiment strengthening fire feedback in early Cretaceous + %run.tm.perturb{end+1} = copse_force_ramp('fireforcing', [0 -0.8], [-135e6 -100e6], '+') + % Similar experiment based on bookchapter formulation + %run.tm.pars = copse_modify_struct( run.tm.pars,'f_ignit','bookchapter'); + %run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',20); + %run.tm.perturb{end+1} = copse_force_ramp('fireforcing', [0 -0.85], [-135e6 -100e6], '+') + + %%%% example model perturbation experiment + + case 'modernperturb' + + % Forcing perturbations against Modern steady-state + + % SteadyState fixes historical forcing at timeforceSteadyState + run.tm.forcemode = 'SteadyState'; + run.tm.timeforceSteadyState = paleo_const.time_present_yr; + + % Add perturbations to forcing + run.tm.perturb{end+1} = copse_force_examples; + % copse_force_co2pulse(size, duration, tstart,d13C) + run.tm.perturb{end+1} = copse_force_co2pulse(3e18, 10e3,600000e3,-30) ; + + %%%%%%% Set duration for this run + + % For eg perturbation experiments that don't use historical forcings, can start from zero for convenience + run.Tstart = 100e6; + run.integrator.timetoadd= 550e6; + + % Identifiy any discontinuities and force restart with small step size + %runctrl.timerestarts = []; + run.integrator.timerestarts = [600e6]; + + +otherwise + error('unknown expt %s\n', expt); +end + + +% optionally plot against proxy data +if nargin >= 3 && comparedata + run.analyzers.listplots = [run.analyzers.listplots; + {'newpage';'datamrO2'; 'datapO2'; 'dataCO2'; 'dataSO4'; 'datad13C'; 'datad34Smov'; 'data8786Sr' } ]; + run.analyzers.plotters = [run.analyzers.plotters; {@copse_plot_data}]; +end + + +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% calculate unknowns assuming present day steady state +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% S burial to balance S weathering + S degassing +run.tm.pars.k_mpsb = run.tm.pars.k21_pyrw + run.tm.pars.k_pyrdeg ; +run.tm.pars.k_mgsb = run.tm.pars.k22_gypw + run.tm.pars.k_gypdeg ; +% oxidw to balance degassing and carbon burial +run.tm.pars.k17_oxidw = run.tm.pars.k2_mocb + run.tm.pars.k5_locb -run.tm.pars.k13_ocdeg ; +% silicate weathering to balance degassing +/- organic C cycle +run.tm.pars.k_silw = run.tm.pars.k17_oxidw - (run.tm.pars.k2_mocb + run.tm.pars.k5_locb - run.tm.pars.k13_ocdeg) + run.tm.pars.k12_ccdeg - run.tm.pars.k_sfw ; +% SD include sulphur degassing (for 'f_SRedoxAlk' == 'degassing') +%run.tm.pars.k_silw = run.tm.pars.k17_oxidw - (run.tm.pars.k2_mocb + run.tm.pars.k5_locb - run.tm.pars.k13_ocdeg) + run.tm.pars.k12_ccdeg - run.tm.pars.k_sfw + (run.tm.pars.k_pyrdeg + run.tm.pars.k_gypdeg) ; +run.tm.pars.k_granw = run.tm.pars.k_silw*(1-run.tm.pars.k_basfrac); +run.tm.pars.k_basw = run.tm.pars.k_silw*(run.tm.pars.k_basfrac); +% P weathering to balance P burial +%run.tm.pars.k10_phosw = ( run.tm.pars.k2_mocb/run.tm.pars.CPsea0 +run.tm.pars.k7_capb +run.tm.pars.k6_fepb ) / (1-run.tm.pars.k11_landfrac) ; +%TL alternative approach to avoid redundancy and derive k11 +run.tm.pars.k10_phosw = ( run.tm.pars.k2_mocb/run.tm.pars.CPsea0 +run.tm.pars.k7_capb +run.tm.pars.k6_fepb ) + (run.tm.pars.k5_locb/run.tm.pars.CPland0) ; +run.tm.pars.k11_landfrac = (run.tm.pars.k5_locb/run.tm.pars.CPland0)/run.tm.pars.k10_phosw ; +% N fixation to balance denit + monb +run.tm.pars.k3_nfix = 2*run.tm.pars.k4_denit + run.tm.pars.k2_mocb/run.tm.pars.CNsea0; + +%%% Make sure Sr fluxes follow basfrac apportioning +run.tm.pars.k_Sr_igg = run.tm.pars.k_Sr_total_igw * (1 - run.tm.pars.k_basfrac); +run.tm.pars.k_Sr_igb = run.tm.pars.k_Sr_total_igw * run.tm.pars.k_basfrac; +%%%% calculate unknowns for Sr system +run.tm.pars.k_Sr_total_burial = run.tm.pars.k_Sr_sedw + run.tm.pars.k_Sr_mantle + run.tm.pars.k_Sr_total_igw ; %%%% sum for total burial +%%% assume same fraction of Sr is buried by sfw as carbonates +run.tm.pars.k_Sr_sfw = run.tm.pars.k_Sr_total_burial * ( run.tm.pars.k_sfw / ( run.tm.pars.k14_carbw + run.tm.pars.k_silw + run.tm.pars.k_sfw) ) ; +%%% aternative set sfw to equal mantle input (Francois and Walker 1992) +%run.tm.pars.k_Sr_sfw = run.tm.pars.k_Sr_mantle ; +%%% calculate sed burial of Sr for stability +run.tm.pars.k_Sr_sedb = run.tm.pars.k_Sr_total_burial - run.tm.pars.k_Sr_sfw ; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%% Set run.tm.Tstart %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +run.tm.Tstart = run.Tstart ; + + + +end diff --git a/examples/copse/copse_output_load.m b/examples/copse/copse_output_load.m new file mode 100644 index 0000000..7e3a23d --- /dev/null +++ b/examples/copse/copse_output_load.m @@ -0,0 +1,143 @@ +function test_output = copse_output_load(copse_version, copse_configuration) +% Load test model output, and convert format + + % Core tests output, available as part of repository / release package + COPSE_test_output_dir = fullfile(paleo_paths.paleo_root(), 'examples/copse/COPSE_test_output'); + + % Extra tests, available as a separate optional download + COPSE_test_output_dir_full = fullfile(paleo_paths.paleo_root(), 'examples/copse/COPSE_test_output_full'); + + + + switch copse_version + case 'bergman2004' + test_output = copse_output_load_bergman2004(COPSE_test_output_dir); + case 'millsg3' + % load comparison dataset G3 model + load(fullfile(COPSE_test_output_dir, 'g3_outputs_avg_paleo.mat')); + test_output = g3; + + case 'lenton2016paleozoic' + fname = sprintf('Lenton2016%s', copse_configuration); + output_dirs = {COPSE_test_output_dir, COPSE_test_output_dir_full}; + folderpath = find_copse_output(output_dirs, fname); + test_output = paleo_run.loadoutput(fname, folderpath); + % add field for delta_mccb + test_output.diag.delta_mccb = test_output.diag.delta_A + test_output.diag.d_mccb; + case 'reloaded' + output_dirs = {fullfile(COPSE_test_output_dir, 'reloaded'), fullfile(COPSE_test_output_dir_full, 'reloaded')}; + folderpath = find_copse_output(output_dirs, copse_configuration); + test_output = paleo_run.loadoutput(copse_configuration, folderpath); + + % add field for delta_mccb + test_output.diag.delta_mccb = test_output.diag.delta_A + test_output.diag.d_mccb; + + otherwise + error('unrecognized copse_version %s', copse_version) + end + +end + + +function folderpath = find_copse_output(dirs, fname) +% Check a list of folder paths for specified fname.mat + + folderpath = ''; + for i =1:length(dirs) + testpath = fullfile(dirs{i}, [fname '.mat']); + if exist(testpath, 'file') + folderpath = dirs{i}; + break; + end + end + + if isempty(folderpath) + error('test output file %s not found', fname); + end +end + +function C_514=copse_output_load_bergman2004(COPSE_test_output_dir) +% COPSE_OUTPUT_LOAD Load data from Noam's COPSE run (header changed to remove brackets) +% + +% Convert to PALEO format + +C_514=struct; +C_514.outputfile = fullfile(COPSE_test_output_dir, 'base_514_namechange.txt'); +COPSE_514 = importdata(C_514.outputfile) ; +% Add a copy of the original data +C_514.COPSE_514 = COPSE_514; + +% Define normalisation values f +C_514.tm.pars.P0 = 3.1000e+15; +C_514.tm.pars.N0 = 4.3500e+16; +C_514.tm.pars.O0 = 3.7000e+19; +C_514.tm.pars.C0 = 1e+21; +C_514.tm.pars.G0 = 1e+21; +C_514.tm.pars.A0 = 3.1930e+18; +C_514.tm.pars.PYR0 = 1e+20; +C_514.tm.pars.GYP0 = 1e+20; +C_514.tm.pars.S0 = 4.0000e+19; +C_514.tm.pars.CAL0 = 1.3970e+19; + +C_514.tm.pars.k1_oxfrac = 0.8600; +C_514.tm.pars.k6_fepb = 6.0000e+09; +C_514.tm.pars.k7_capb = 1.5000e+10; +C_514.tm.pars.k11_landfrac = 0.1035; + +%%%% loop over columns and convert to named fields in output struct +for u = 1:length(COPSE_514.colheaders) + fieldname=char(COPSE_514.colheaders(u)); + switch fieldname + case 'time_My_' + %%%% convert time to forwards in years + C_514.T = paleo_const.time_present_yr - 1e6 *COPSE_514.data(:,u) ; + case 'O2' + C_514.S.O = COPSE_514.data(:,u)*C_514.tm.pars.O0; + C_514.diag.pO2PAL = COPSE_514.data(:,u); + case {'A','P','N','S','C','G','PYR','GYP','CAL'} + norm0 = C_514.tm.pars.([fieldname '0']); + C_514.S.(fieldname) = COPSE_514.data(:,u)*norm0; + case 'CO2' + C_514.diag.pCO2PAL = COPSE_514.data(:,u); + case 'T' + C_514.diag.TEMP = COPSE_514.data(:,u) + paleo_const.k_CtoK; + + case 'anox' + C_514.diag.ANOX = COPSE_514.data(:,u); + case 'V' + C_514.diag.VEG = COPSE_514.data(:,u); + case {'silw','carbw','pyrw','gypw','mocb','locb','mccb'} + C_514.diag.(fieldname) = COPSE_514.data(:,u)*1e12; + case 'pyrb' + C_514.diag.mpsb = COPSE_514.data(:,u)*1e12; + case 'gypb' + C_514.diag.mgsb = COPSE_514.data(:,u)*1e12; + case 'phsw' + C_514.diag.phosw = COPSE_514.data(:,u)*1e10; + case 'oxdw' + C_514.diag.oxidw = COPSE_514.data(:,u)*1e12; + case 'd13C' % d13 of mccb + C_514.diag.delta_mccb = COPSE_514.data(:,u); + case 'd34S' % d34S of S reservoir + C_514.diag.delta_S = COPSE_514.data(:,u); + case 'Alk' + % ignore as not used + end +end + +% Add some derived P burial fractions +C_514.diag.capb = C_514.tm.pars.k7_capb .* (C_514.diag.mocb/4.5e12) ; +C_514.diag.fepb = (C_514.tm.pars.k6_fepb./C_514.tm.pars.k1_oxfrac).*(1-C_514.diag.ANOX) ; +C_514.diag.mopb = C_514.diag.mocb / 250 ; +C_514.diag.psea = C_514.diag.phosw .* ( 1 - C_514.tm.pars.k11_landfrac.*C_514.diag.VEG) ; + +% Add budget checks + +C_514.diag.clc_RedoxS = 2*(C_514.S.GYP + C_514.S.S); +C_514.diag.clc_RedoxC = C_514.S.C + C_514.S.A; +C_514.diag.clc_RedoxNet = C_514.diag.clc_RedoxC + C_514.diag.clc_RedoxS + C_514.S.O; + + + +end \ No newline at end of file diff --git a/examples/copse/copse_reloaded_bergman2004_expts.m b/examples/copse/copse_reloaded_bergman2004_expts.m new file mode 100644 index 0000000..57bf4ba --- /dev/null +++ b/examples/copse/copse_reloaded_bergman2004_expts.m @@ -0,0 +1,329 @@ +function run = copse_reloaded_bergman2004_expts(basemodel, expt, comparedata) +% COPSE reloaded experiments + + +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +run = paleo_run; +run.config = 'copse_reloaded_bergman2004_expts'; +run.expt = sprintf('%s',expt); +run.baseconfig = basemodel; +fprintf('Basemodel %s Experiment %s\n',basemodel, expt); + +%%%%%%% Set duration for this run +% For historical forcings, run from before present day to present day +run.Tstart = paleo_const.time_present_yr-600e6; % for COPSE historical forcings + +% Integrate method +run.integrator = paleo_integrate_ode(600e6); +%%%%%%% Set maximum step size for solver (to avoid omitting short-timescale +%%%%%%% change in forcings) +run.integrator.odeoptions = odeset(run.integrator.odeoptions, 'maxstep',1e6) ; + +%%%%%%% Budget calculations (derived after solution calculated) +run.postprocessors = copse_budgets_base(); + +%%%%%%% Plot configuration +run.analyzers = paleo_plotlist(); +run.analyzers.plotters = {@copse_plot_sfbw;@copse_plot_base}; + + +%%%% model does not output necessary fields for WeathFacNorm, so removed from plotlist +run.analyzers.listplots={ 'PhysForc'; 'EvolForc'; 'O2'; 'CO2'; 'Temp'; 'OceanNP'; 'Biota'; 'LandBiota';'FireIgnit'; + 'O2';'O2Diff'; 'SIsotopes';'CO2';'CO2Diff';'SIsotopesDiff';'CIsotopes';'CIsotopesDiff';'newpage'; + 'CResChange';'SResChange';'RedoxChange';'CaResChange';'newpage'; + 'CDegass'; 'CPWeath'; 'PWeath';'WeathFac2';'PBurial'; 'CPBurialratio'; 'orgCBurial'; 'FRatio'; 'CIsotopes'; 'CIsotopesIO'; 'CRes'; 'CCrustRes'; + 'SDegass'; 'SWeath'; 'SBurial'; 'GYPPYR'; 'SCAL'; 'SIsotopes'; 'SFW'; 'Srconc'; 'Srfluxes'; 'Srfrac'; + }; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% END run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Set base model +switch basemodel + + + case 'bergman2004' + %%%% this is a reconstruction of the Bergman (2004) AJS COPSE original model + %%%% run for Phanerozoic to reproduce Bergman et al 2004 results + run.Tstart = paleo_const.time_present_yr-600e6; + run.integrator.timetoadd = 600e6 ; + + % Lenton et al 'COPSE reloaded' + run.tm = paleo_modelbuilder.createModel('COPSE_reloaded_bergman2004_cfg.yaml','copse5_14_base'); + + otherwise + error('unknown basemodel %s',basemodel); +end + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Choose an 'experiment' (a delta to the base model) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +switch expt + + case 'baseline' + % Baseline configuration + + %%%% Experiments in Bergman et al. (2004) + + case 'run2' + % Marine CP ratio depends on anoxia + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_CPsea', 'VCI' ); + + case 'run3' + % Oxidative weathering not dependent on O2 + run.tm.pars = copse_modify_struct( run.tm.pars,'f_oxwO','SatO2'); + run.tm.pars.f_oxw_halfsat = 1e-6; % not defined in base configuration + + %Bergman (2004) uses this, which limits fall of pO2 prior to Ordovician + %run.tm.pars = copse_modify_struct( run.tm.pars,'f_ocdeg','O2copsecrashprevent'); + + case 'run6' + % strong fire feedback + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',20); + + case 'run7' + % no fire feedback, + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',1e10); %to effectively switch off fire feedback + + case 'run8' + % Pyrite burial not dependent on oxygen + run.tm.pars = copse_modify_struct( run.tm.pars,'f_pyrburial','copse_noO2'); + + case 'run9' + % no S cycle + run.tm.pars = copse_modify_struct( run.tm.pars,'Scycle','None'); + + case 'run11' + % C isotope fractionation independent of oxygen + run.tm.pars = copse_modify_struct( run.tm.pars,'f_cisotopefrac','copse_noO2'); + + case 'run12' + % S isotope fractionation dependent on oxygen + if ~isfield(run.tm.pars,'f_sisotopefrac'); error 'no parameter'; end; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_sisotopefrac','copse_O2'); + + case 'run3VCI' + % Oxidative weathering not dependent on O2 + % Marine CP ratio depends on anoxia + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_CPsea', 'VCI' ); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_oxwO','SatO2'); + run.tm.pars.f_oxw_halfsat = 1e-6; % not defined in base configuration + %Bergman (2004) uses the following, which limits fall of pO2 prior to Ordovician + %run.tm.pars = copse_modify_struct( run.tm.pars,'f_ocdeg','O2copsecrashprevent'); + + %%%% Subsequent papers that are simple variants of original COPSE + + case 'bookchapter' + % Book chapter for Claire (Lenton, 2013) + run.tm.pars = copse_modify_struct( run.tm.pars,'f_ignit','bookchapter'); + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',3); + + case 'ordovician' + % Ordovician model as in Lenton et al. (2012) [without smoothing geologic forcing] + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 1], [-460e6 -458e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -1], [-458e6 -456e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 2], [-447e6 -445e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -2], [-445e6 -443e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-475e6 -460e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.75], [-475e6 -460e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.25], [-115e6 -100e6], '+') ; + + case 'paleozoic_base' + % Paleozoic model as in Lenton et al. (2016) - baseline + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + case 'paleozoic_blue' + % Paleozoic model as in Lenton et al. (2016) - blue run + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + %Paleozoic paper forcing of E + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + case 'paleozoic_cyan' + % Paleozoic model as in Lenton et al. (2016) - cyan run + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + %Paleozoic paper forcing of E + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + %Paleozoic forcing of C/P land + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 1], [-465e6 -445e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-355e6 -345e6], '+') ; + case 'paleozoic_magenta' + % Paleozoic model as in Lenton et al. (2016) - magenta run + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + %Paleozoic paper forcing of E + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + %Paleozoic paper forcing of W + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.25], [-115e6 -100e6], '+') ; + case 'paleozoic_green' + % Paleozoic model as in Lenton et al. (2016) - green run + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + %Paleozoic paper forcing of E + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + %Paleozoic paper forcing of W + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.25], [-115e6 -100e6], '+') ; + %Paleozoic forcing of C/P land + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 1], [-465e6 -445e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-355e6 -345e6], '+') ; + case 'paleozoic_yellow' + % Paleozoic model as in Lenton et al. (2016) - yellow run + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + %Paleozoic paper forcing of E + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + %Paleozoic paper forcing of W + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.25], [-115e6 -100e6], '+') ; + %Ramp up P weathering to get +2 per mil d13C plateau + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 0.5], [-465e6 -445e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -0.5], [-410e6 -400e6], '+') ; + case 'paleozoic_red' + % Paleozoic model as in Lenton et al. (2016) - red run + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + %Paleozoic paper forcing of E + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + %Paleozoic paper forcing of W + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.25], [-115e6 -100e6], '+') ; + %Paleozoic forcing of C/P land + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 1], [-465e6 -445e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-355e6 -345e6], '+') ; + %Ramp up P weathering to get +2 per mil d13C plateau + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 0.25], [-465e6 -445e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -0.25], [-410e6 -400e6], '+') ; + case 'paleozoic_black' + % Paleozoic model as in Lenton et al. (2016) - black run + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + %Paleozoic paper forcing of E + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.1], [-400e6 -380e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.5], [-380e6 -330e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('EVO', [0 0.25], [-330e6 -300e6], '+') ; + %Paleozoic paper forcing of W + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.perturb{end+1} = copse_force_ramp('W', [0 0.25], [-115e6 -100e6], '+') ; + %Paleozoic forcing of C/P land + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 1], [-465e6 -445e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-355e6 -345e6], '+') ; + %P weathering spikes + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 1.5], [-453e6 -452.5e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -1.5], [-452.5e6 -452e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 2.5], [-445e6 -444.5e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -2.5], [-444.5e6 -444e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 1], [-433.25e6 -433e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -1], [-432e6 -431.5e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 0.5], [-430e6 -429e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -0.5], [-429e6 -428e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 2], [-424.75e6 -424.25e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -2], [-424.25e6 -423e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 1.25], [-420e6 -419e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -1.25], [-419e6 -418e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 0.5], [-416e6 -415e6], '+') ; + run.tm.perturb{end+1} = copse_force_ramp('F_EPSILON', [0 -0.5], [-408e6 -404e6], '+') ; + + + + %%%% example model perturbation experiment + + case 'modernperturb' + + % Forcing perturbations against Modern steady-state + + % SteadyState fixes historical forcing at timeforceSteadyState + run.tm.forcemode = 'SteadyState'; + run.tm.timeforceSteadyState = paleo_const.time_present_yr; + + % Add perturbations to forcing + run.tm.perturb{end+1} = copse_force_examples; + % copse_force_co2pulse(size, duration, tstart,d13C) + run.tm.perturb{end+1} = copse_force_co2pulse(3e18, 10e3,600000e3,-30) ; + + %%%%%%% Set duration for this run + + % For eg perturbation experiments that don't use historical forcings, can start from zero for convenience + run.Tstart = 100e6; + run.integrator.timetoadd= 550e6; + + % Identifiy any discontinuities and force restart with small step size + %runctrl.timerestarts = []; + run.integrator.timerestarts = [600e6]; + + +otherwise + error('unknown expt %s\n', expt); +end + + +% optionally plot against proxy data +if nargin >= 3 && comparedata + run.analyzers.listplots = [run.analyzers.listplots; + {'newpage';'datamrO2'; 'datapO2'; 'dataCO2'; 'dataSO4'; 'datad13C'; 'datad13Cnew'; 'datad34Smov'; 'datad34Sbinmov'; 'data8786Sr' } ]; + run.analyzers.plotters = [run.analyzers.plotters; {@copse_plot_data}]; +end + + + +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% calculate unknowns assuming present day steady state +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% S burial to balance S weathering + S degassing +run.tm.pars.k_mpsb = run.tm.pars.k21_pyrw + run.tm.pars.k_pyrdeg ; +run.tm.pars.k_mgsb = run.tm.pars.k22_gypw + run.tm.pars.k_gypdeg ; +% oxidw to balance degassing and carbon burial +run.tm.pars.k17_oxidw = run.tm.pars.k2_mocb + run.tm.pars.k5_locb -run.tm.pars.k13_ocdeg ; +% silicate weathering to balance degassing +/- organic C cycle +run.tm.pars.k_silw = run.tm.pars.k17_oxidw - (run.tm.pars.k2_mocb + run.tm.pars.k5_locb - run.tm.pars.k13_ocdeg) + run.tm.pars.k12_ccdeg - run.tm.pars.k_sfw ; +% SD include sulphur degassing (for 'f_SRedoxAlk' == 'degassing') +%run.tm.pars.k_silw = run.tm.pars.k17_oxidw - (run.tm.pars.k2_mocb + run.tm.pars.k5_locb - run.tm.pars.k13_ocdeg) + run.tm.pars.k12_ccdeg - run.tm.pars.k_sfw + (run.tm.pars.k_pyrdeg + run.tm.pars.k_gypdeg) ; +run.tm.pars.k_granw = run.tm.pars.k_silw*(1-run.tm.pars.k_basfrac); +run.tm.pars.k_basw = run.tm.pars.k_silw*(run.tm.pars.k_basfrac); +% P weathering to balance P burial +%run.tm.pars.k10_phosw = ( run.tm.pars.k2_mocb/run.tm.pars.CPsea0 +run.tm.pars.k7_capb +run.tm.pars.k6_fepb ) / (1-run.tm.pars.k11_landfrac) ; +%TL alternative approach to avoid redundancy and derive k11 +run.tm.pars.k10_phosw = ( run.tm.pars.k2_mocb/run.tm.pars.CPsea0 +run.tm.pars.k7_capb +run.tm.pars.k6_fepb ) + (run.tm.pars.k5_locb/run.tm.pars.CPland0) ; +run.tm.pars.k11_landfrac = (run.tm.pars.k5_locb/run.tm.pars.CPland0)/run.tm.pars.k10_phosw ; +% N fixation to balance denit + monb +run.tm.pars.k3_nfix = 2*run.tm.pars.k4_denit + run.tm.pars.k2_mocb/run.tm.pars.CNsea0; + +%%% Make sure Sr fluxes follow basfrac apportioning +run.tm.pars.k_Sr_igg = run.tm.pars.k_Sr_total_igw * (1 - run.tm.pars.k_basfrac); +run.tm.pars.k_Sr_igb = run.tm.pars.k_Sr_total_igw * run.tm.pars.k_basfrac; +%%%% calculate unknowns for Sr system +run.tm.pars.k_Sr_total_burial = run.tm.pars.k_Sr_sedw + run.tm.pars.k_Sr_mantle + run.tm.pars.k_Sr_total_igw ; %%%% sum for total burial +%%% assume same fraction of Sr is buried by sfw as carbonates +run.tm.pars.k_Sr_sfw = run.tm.pars.k_Sr_total_burial * ( run.tm.pars.k_sfw / ( run.tm.pars.k14_carbw + run.tm.pars.k_silw + run.tm.pars.k_sfw) ) ; +%%% aternative set sfw to equal mantle input (Francois and Walker 1992) +%run.tm.pars.k_Sr_sfw = run.tm.pars.k_Sr_mantle ; +%%% calculate sed burial of Sr for stability +run.tm.pars.k_Sr_sedb = run.tm.pars.k_Sr_total_burial - run.tm.pars.k_Sr_sfw ; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +end diff --git a/examples/copse/copse_reloaded_reloaded_expts.m b/examples/copse/copse_reloaded_reloaded_expts.m new file mode 100644 index 0000000..ebd9a4a --- /dev/null +++ b/examples/copse/copse_reloaded_reloaded_expts.m @@ -0,0 +1,621 @@ +function run = copse_reloaded_reloaded_expts(basemodel, expt, comparedata) +% COPSE reloaded experiments + + +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +run = paleo_run; +run.config = 'copse_reloaded_reloaded_expts'; +run.expt = sprintf('%s', expt); +run.baseconfig = basemodel; +fprintf('Basemodel %s Experiment %s\n',basemodel, expt); + +%%%%%%% Set duration for this run +% For historical forcings, run from before present day to present day +run.Tstart = paleo_const.time_present_yr-1000e6; % Phanerozoic with longer spinup + +% Integrate method +run.integrator = paleo_integrate_ode(1000e6); +%%%%%%% Set maximum step size for solver (to avoid omitting short-timescale +%%%%%%% change in forcings) +run.integrator.odeoptions = odeset(run.integrator.odeoptions, 'maxstep',1e6) ; + +%%%%%%% Budget calculations (derived after solution calculated) +run.postprocessors = copse_budgets_base(); + +%%%%%%% Plot configuration +run.analyzers = paleo_plotlist(); +run.analyzers.plotters = {@copse_plot_sfbw;@copse_plot_base}; + + +%%%% model does not output necessary fields for WeathFacNorm, so removed from plotlist +run.analyzers.listplots={ 'PhysForc'; 'EvolForc'; 'O2'; 'CO2'; 'Temp'; 'OceanNP'; 'Biota'; 'LandBiota';'FireIgnit'; + 'O2';'O2Diff'; 'SIsotopes';'CO2';'CO2Diff';'SIsotopesDiff';'CIsotopes';'CIsotopesDiff';'SrfracDiff'; + 'CResChange';'SResChange';'RedoxChange';'CaResChange';'newpage'; + 'CDegass'; 'CPWeath'; 'PWeath';'WeathFac2';'PBurial'; 'CPBurialratio'; 'orgCBurial'; 'FRatio'; 'CIsotopes'; 'CIsotopesIO'; 'CRes'; 'CCrustRes'; + 'SDegass'; 'SWeath'; 'SBurial'; 'GYPPYR'; 'SCAL'; 'SIsotopes'; 'SFW'; 'Srconc'; 'Srfluxes'; 'Srfrac'; + }; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% END run control +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Set base model +switch basemodel + + case 'reloaded' + %%%% this is the Lenton et al 'COPSE reloaded' new baseline model, + % with updated LIP lambda decay rate to generate present-day CFB area = 4.8e6 km2 + run.tm = paleo_modelbuilder.createModel('COPSE_reloaded_reloaded_cfg.yaml','copse_reloaded'); + + %%% SET UP THE MODEL FORCING FACTORS + + %%%%%%%%%%%% ADD NEW LIPS FORCING DIRECTLY FROM DATA TABLE + phanlip = copse_load_phanlip('copseRL'); + LIPtrange = [-Inf Inf]; % all lips + smoothempl = false; % true for pre-revision G3, false for revised paper + present_day_CFB_area = 4.8e6; + + [flips, default_lambda, ~] = phanlip.create_LIP_forcing(run.Tstart, run.Tstart+run.integrator.timetoadd, ... + 'NoCO2', present_day_CFB_area, LIPtrange, smoothempl); + fprintf('default_lambda = %g yr-1 to match present day CFB area %g km2\n', default_lambda, present_day_CFB_area); + %%% add to forcing list + run.tm.force{end+1} = flips ; + + % get two contributions to present day basalt area + fdegass = copse_find_force( run.tm, 'copse_force_haq_D'); % NB this is needed for OIB_area + present_basalt_area = present_day_CFB_area + fdegass.present_day_OIB_area(); + + fprintf('updating run.tm.pars.k_present_basalt_area old %g\n',run.tm.pars.k_present_basalt_area); + run.tm.pars = copse_modify_struct(run.tm.pars, 'k_present_basalt_area', present_basalt_area); + fprintf(' new CFB %g + OIB %g = %g\n', ... + present_day_CFB_area, fdegass.present_day_OIB_area(), run.tm.pars.k_present_basalt_area); + %%% Enable basalt area forcing (present-day value for normalisation calculated above) + run.tm.pars.f_basaltarea = 'g3_2014_construct_from_lips'; + %%%%%%%%%% FINISH LIPS THING + + % Add new plots + run.analyzers.listplots{end+1} = 'BasaltArea'; + run.analyzers.listplots{end+1} = 'LIPCO2'; + run.analyzers.listplots{end+1} = 'SilicateArea'; + run.analyzers.listplots{end+1} = 'CoalFrac'; + + case 'original' + %%%% this is a reconstruction of the original COPSE model + %%%% run for Phanerozoic with long spin-up as in COPSE reloaded + % Lenton et al 'COPSE reloaded' + run.tm = paleo_modelbuilder.createModel('COPSE_reloaded_bergman2004_cfg.yaml','copse5_14_base'); + + case 'newbase' + %%%% this is the new baseline COPSE model structure + %%%% but without flux updates and additional forcing factors + %%%% run for Phanerozoic with long spin-up as in COPSE reloaded + + run.tm = paleo_modelbuilder.createModel('COPSE_reloaded_reloaded_cfg.yaml','copse_reloaded'); + + %%% SET UP THE MODEL FORCING FACTORS + % Reset (all) forcings to original + run.tm.force = {copse_force_CK_solar; copse_force_UDWEbergman2004(1); copse_force_B; copse_force_CPlandrel}; % historical forcings from COPSE + % Include updates to original forcing factors, plus [Ca++] forcing + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.force{end+1} = copse_force_calcium('calnorm'); + + % Accept new model structure from .yaml except... + run.tm.pars = copse_modify_struct( run.tm.pars,'f_granitearea','Fixed'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_basaltarea','DefaultForced'); + + %%% Adopt G-cubed paper flux parameters + %%% S cycle original fluxes + run.tm.pars.k_gypdeg = 0e12; + run.tm.pars.k_pyrdeg = 0e12; + run.tm.pars.k21_pyrw = 0.53e12; + run.tm.pars.k22_gypw = 1.0e12; + %%% G-cubed paper seafloor weathering flux + run.tm.pars.k_sfw = 1.75e12; + %%% Inorganic C cycle original fluxes: + run.tm.pars.k12_ccdeg = 6.65e12; + run.tm.pars.k14_carbw = 13.35e12; + run.tm.pars.k_basfrac = 0.35; + %%% Organic C cycle original fluxes: + run.tm.pars.k2_mocb = 4.5e12; + run.tm.pars.k5_locb = 4.5e12; + %%% Original P cycle + run.tm.pars.k_Psilw = (2/12); + run.tm.pars.k_Pcarbw = (5/12); + run.tm.pars.k_Poxidw = (5/12); + run.tm.pars.k6_fepb = 6e9; + run.tm.pars.k7_capb = 1.5e10; + + % Add new plots + run.analyzers.listplots{end+1} = 'BasaltArea'; + run.analyzers.listplots{end+1} = 'LIPCO2'; + run.analyzers.listplots{end+1} = 'SilicateArea'; + run.analyzers.listplots{end+1} = 'CoalFrac'; + + otherwise + error('unknown basemodel %s',basemodel); +end + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Choose an 'experiment' (a delta to the base model) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +switch expt + + case 'baseline' + % Baseline configuration + + %%%% Experiments in Fig. 5-7 of COPSE reloaded (for basemodel 'original') + case 'DB' + % Fig.5 blue + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + case 'U' + % Fig.5 red + run.tm.force{end+1} = copse_force_berner_fr(1); + case 'EWCP' + % Fig.5 green + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + case 'DUEWBCP' + % Fig.5 black / Fig.6 black dashed / Fig.7 black dashed + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + case 'sfw' + % Fig.6 blue + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars.k_sfw = 1.75e12; + case 'basnoU' + % Fig.6 red + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars.f_bas_link_u = 'no'; + case 'Easplit' + % Fig.6 cyan + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_act_energies','split'); + case 'vegweath' + % Fig.6 green + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_vegweath', 'new2'); + case 'bernerT' + % Fig.6 magenta + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_temp', 'Berner' ); + case 'newweath' + % Fig.6 black + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars.k_sfw = 1.75e12; + run.tm.pars.f_bas_link_u = 'no'; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_act_energies','split'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_vegweath', 'new2'); + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_temp', 'Berner' ); + case 'CAL' + % Fig.7 blue + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.force{end+1} = copse_force_calcium('calnorm'); + run.tm.pars = copse_modify_struct( run.tm.pars,'CALcycle','None'); + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_gypburial', 'Caforced' ); + case 'ignit' + % Fig.7 red + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_ignit','bookchapter'); + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',3); + case 'pyrweath' + % Fig.7 cyan + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_pyrweather', 'copse_noO2' ); + case 'newweathredox' + % Fig.7 green + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars.k_sfw = 1.75e12; + run.tm.pars.f_bas_link_u = 'no'; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_act_energies','split'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_vegweath', 'new2'); + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_temp', 'Berner' ); + run.tm.force{end+1} = copse_force_calcium('calnorm'); + run.tm.pars = copse_modify_struct( run.tm.pars,'CALcycle','None'); + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_gypburial', 'Caforced' ); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_ignit','bookchapter'); + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',3); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_pyrweather', 'copse_noO2' ); + case 'newbase' + % Fig.7 black + run.tm.force{end+1} = copse_force_haq_D(); + run.tm.force{end+1} = copse_force_ramp('Bforcing', [0.75 1.0], [-150e6 -0e6], '=') ; + run.tm.force{end+1} = copse_force_berner_fr(1); + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.15], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('EVO', [0 0.85], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.75], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('W', [0 0.25], [-400e6 -350e6], '+') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-290e6 -280e6], '+') ; + run.tm.pars.k_sfw = 1.75e12; + run.tm.pars.f_bas_link_u = 'no'; + run.tm.pars = copse_modify_struct( run.tm.pars,'f_act_energies','split'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_vegweath', 'new2'); + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_temp', 'Berner' ); + run.tm.force{end+1} = copse_force_calcium('calnorm'); + run.tm.pars = copse_modify_struct( run.tm.pars,'CALcycle','None'); + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_gypburial', 'Caforced' ); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_ignit','bookchapter'); + run.tm.pars = copse_modify_struct( run.tm.pars,'k_fire',3); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_pyrweather', 'copse_noO2' ); + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_atfrac', 'quadratic' ); + run.tm.pars = copse_modify_struct(run.tm.pars,'f_carbwC','Cprop'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_gypweather', 'alternative' ); + run.tm.pars = copse_modify_struct(run.tm.pars, 'f_anoxia', 'newanoxia'); + run.tm.pars.k_logistic = 12.0 ; + run.tm.pars.k_uptake = 0.5 ; + run.tm.pars.k1_oxfrac = 1.0 - 1.0/(1.0 + exp(-run.tm.pars.k_logistic*(run.tm.pars.k_uptake-1.0))); + run.tm.pars = copse_modify_struct(run.tm.pars, 'f_denit', 'new'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_fepb','pdep'); + + %%%% Experiments in Fig. 8-9 of COPSE reloaded (for basemodel 'newbase') + case 'highS' + % Fig.8 blue + run.tm.pars.k_gypdeg = 0.5e12; + run.tm.pars.k_pyrdeg = 0.25e12; + run.tm.pars.k21_pyrw = 0.45e12; + run.tm.pars.k22_gypw = 2.0e12; + case 'highCin' + % Fig.8 red + run.tm.pars.k_sfw = 3e12; + run.tm.pars.k12_ccdeg = 15e12; + run.tm.pars.k14_carbw = 8e12; + run.tm.pars.k_basfrac = 0.25; + case 'lowCorg' + % Fig.8 green + run.tm.pars.k2_mocb = 2.5e12; + run.tm.pars.k5_locb = 2.5e12; + case 'Pweath' + % Fig.8 cyan + run.tm.pars.k_Psilw = 0.8; + run.tm.pars.k_Pcarbw = 0.14; + run.tm.pars.k_Poxidw = 0.06; + case 'newfluxes' + % Fig.8 black / Fig.9 black dashed + run.tm.pars.k_gypdeg = 0.5e12; + run.tm.pars.k_pyrdeg = 0.25e12; + run.tm.pars.k21_pyrw = 0.45e12; + run.tm.pars.k22_gypw = 2.0e12; + run.tm.pars.k_sfw = 3e12; + run.tm.pars.k12_ccdeg = 15e12; + run.tm.pars.k14_carbw = 8e12; + run.tm.pars.k_basfrac = 0.25; + run.tm.pars.k2_mocb = 2.5e12; + run.tm.pars.k5_locb = 2.5e12; + run.tm.pars.k_Psilw = 0.8; + run.tm.pars.k_Pcarbw = 0.14; + run.tm.pars.k_Poxidw = 0.06; + run.tm.pars.k6_fepb = 1e10; + run.tm.pars.k7_capb = 2e10; + case 'basalt' + % Fig.9 blue + run.tm.pars.k_gypdeg = 0.5e12; + run.tm.pars.k_pyrdeg = 0.25e12; + run.tm.pars.k21_pyrw = 0.45e12; + run.tm.pars.k22_gypw = 2.0e12; + run.tm.pars.k_sfw = 3e12; + run.tm.pars.k12_ccdeg = 15e12; + run.tm.pars.k14_carbw = 8e12; + run.tm.pars.k_basfrac = 0.25; + run.tm.pars.k2_mocb = 2.5e12; + run.tm.pars.k5_locb = 2.5e12; + run.tm.pars.k_Psilw = 0.8; + run.tm.pars.k_Pcarbw = 0.14; + run.tm.pars.k_Poxidw = 0.06; + run.tm.pars.k6_fepb = 1e10; + run.tm.pars.k7_capb = 2e10; + + % Add new LIPs forcing + phanlip = copse_load_phanlip('copseRL'); + LIPtrange = [-Inf Inf]; % all lips + smoothempl = false; % true for pre-revision G3, false for revised paper + present_day_CFB_area = 4.8e6; + + [flips, default_lambda, ~] = phanlip.create_LIP_forcing(run.Tstart, run.Tstart+run.integrator.timetoadd, ... + 'NoCO2', present_day_CFB_area, LIPtrange, smoothempl); + fprintf('default_lambda = %g yr-1 to match present day CFB area %g km2\n', default_lambda, present_day_CFB_area); + %%% add to forcing list + run.tm.force{end+1} = flips ; + + % get two contributions to present day basalt area + fdegass = copse_find_force( run.tm, 'copse_force_haq_D'); % NB this is needed for OIB_area + present_basalt_area = present_day_CFB_area + fdegass.present_day_OIB_area(); + + fprintf('updating run.tm.pars.k_present_basalt_area old %g\n',run.tm.pars.k_present_basalt_area); + run.tm.pars = copse_modify_struct(run.tm.pars, 'k_present_basalt_area', present_basalt_area); + fprintf(' new CFB %g + OIB %g = %g\n', ... + present_day_CFB_area, fdegass.present_day_OIB_area(), run.tm.pars.k_present_basalt_area); + %%% Enable basalt area forcing (present-day value for normalisation calculated above) + run.tm.pars.f_basaltarea = 'g3_2014_construct_from_lips'; + + case 'granite' + % Fig.9 red + run.tm.pars.k_gypdeg = 0.5e12; + run.tm.pars.k_pyrdeg = 0.25e12; + run.tm.pars.k21_pyrw = 0.45e12; + run.tm.pars.k22_gypw = 2.0e12; + run.tm.pars.k_sfw = 3e12; + run.tm.pars.k12_ccdeg = 15e12; + run.tm.pars.k14_carbw = 8e12; + run.tm.pars.k_basfrac = 0.25; + run.tm.pars.k2_mocb = 2.5e12; + run.tm.pars.k5_locb = 2.5e12; + run.tm.pars.k_Psilw = 0.8; + run.tm.pars.k_Pcarbw = 0.14; + run.tm.pars.k_Poxidw = 0.06; + run.tm.pars.k6_fepb = 1e10; + run.tm.pars.k7_capb = 2e10; + run.tm.force{end+1} = copse_force_org_evap_area('orgevapnorm'); + run.tm.force{end+1} = copse_force_granite('silnorm'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_granitearea','OrgEvapForced'); + case 'PG' + % Fig.9 cyan + run.tm.pars.k_gypdeg = 0.5e12; + run.tm.pars.k_pyrdeg = 0.25e12; + run.tm.pars.k21_pyrw = 0.45e12; + run.tm.pars.k22_gypw = 2.0e12; + run.tm.pars.k_sfw = 3e12; + run.tm.pars.k12_ccdeg = 15e12; + run.tm.pars.k14_carbw = 8e12; + run.tm.pars.k_basfrac = 0.25; + run.tm.pars.k2_mocb = 2.5e12; + run.tm.pars.k5_locb = 2.5e12; + run.tm.pars.k_Psilw = 0.8; + run.tm.pars.k_Pcarbw = 0.14; + run.tm.pars.k_Poxidw = 0.06; + run.tm.pars.k6_fepb = 1e10; + run.tm.pars.k7_capb = 2e10; + run.tm.force{end+1} = copse_force_royer_fD(1); + case 'bcoal' + % Fig.9 green + run.tm.pars.k_gypdeg = 0.5e12; + run.tm.pars.k_pyrdeg = 0.25e12; + run.tm.pars.k21_pyrw = 0.45e12; + run.tm.pars.k22_gypw = 2.0e12; + run.tm.pars.k_sfw = 3e12; + run.tm.pars.k12_ccdeg = 15e12; + run.tm.pars.k14_carbw = 8e12; + run.tm.pars.k_basfrac = 0.25; + run.tm.pars.k2_mocb = 2.5e12; + run.tm.pars.k5_locb = 2.5e12; + run.tm.pars.k_Psilw = 0.8; + run.tm.pars.k_Pcarbw = 0.14; + run.tm.pars.k_Poxidw = 0.06; + run.tm.pars.k6_fepb = 1e10; + run.tm.pars.k7_capb = 2e10; + run.tm.force{end+1} = copse_force_coal('coalnorm'); + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [1 2], [-465e6 -445e6], '=') ; + run.tm.force{end+1} = copse_force_ramp('CPland_relative', [0 -1], [-345e6 -300e6], '+') ; + + %%%% Experiments in Figs. 10-12 of COPSE reloaded (for basemodel 'reloaded') + case 'k15025' + % Fig.10 blue + run.tm.pars.k15_plantenhance=0.25; + case 'k1501' + % Fig.10 red + run.tm.pars.k15_plantenhance=0.1; + case 'newnpp' + % Fig.10 green + run.tm.pars = copse_modify_struct( run.tm.pars,'f_vegweath', 'newnpp'); + case 'sfwstrong' + % Fig.10 cyan + run.tm.pars = copse_modify_struct( run.tm.pars,'f_sfw_opt','sfw_strong'); + case 'sfwnoT' + % Fig.10 magenta + run.tm.pars = copse_modify_struct( run.tm.pars,'f_sfw_opt','sfw_noT'); + + case 'climsens15' + % Fig.11 blue + run.tm.pars.k_c = 2.164; %1.5 + case 'climsens225' + % Fig.11 green + run.tm.pars.k_c = 3.246; %2.25 + case 'climsens45' + % Fig.11 cyan + run.tm.pars.k_c = 6.492; %4.5 + case 'climsens6' + % Fig.11 red + run.tm.pars.k_c = 8.656; %6 + + case 'locbU' + % Fig.12 blue + run.tm.pars = copse_modify_struct( run.tm.pars,'f_locb','split'); + case 'mocbU' + % Fig.12 red + run.tm.pars = copse_modify_struct( run.tm.pars,'f_mocb','Uforced'); + case 'locbUmocbU' + % Fig.12 green + run.tm.pars = copse_modify_struct( run.tm.pars,'f_locb','split'); + run.tm.pars = copse_modify_struct( run.tm.pars,'f_mocb','Uforced'); + case 'mocbO2' + % Fig.12 cyan + run.tm.pars = copse_modify_struct( run.tm.pars,'f_mocb','O2dep'); + case 'VCI' + % Fig.12 magenta + run.tm.pars = copse_modify_struct( run.tm.pars, 'f_CPsea', 'VCI' ); + + %%%% example model perturbation experiment + + case 'modernperturb' + + % Forcing perturbations against Modern steady-state + + % SteadyState fixes historical forcing at timeforceSteadyState + run.tm.forcemode = 'SteadyState'; + run.tm.timeforceSteadyState = paleo_const.time_present_yr; + + % Add perturbations to forcing + run.tm.perturb{end+1} = copse_force_examples; + % copse_force_co2pulse(size, duration, tstart,d13C) + run.tm.perturb{end+1} = copse_force_co2pulse(3e18, 10e3,600000e3,-30) ; + + %%%%%%% Set duration for this run + + % For eg perturbation experiments that don't use historical forcings, can start from zero for convenience + run.Tstart = 100e6; + run.integrator.timetoadd= 550e6; + + % Identifiy any discontinuities and force restart with small step size + %runctrl.timerestarts = []; + run.integrator.timerestarts = [600e6]; + + +otherwise + error('unknown expt %s\n', expt); +end + + +% optionally plot against proxy data +if nargin >= 3 && comparedata + run.analyzers.listplots = [run.analyzers.listplots; + {'newpage';'datamrO2'; 'datapO2'; 'dataCO2'; 'dataSO4'; 'datad13C'; 'datad13Cnew'; 'datad34Smov'; 'datad34Sbinmov'; 'data8786Sr' } ]; + run.analyzers.plotters = [run.analyzers.plotters; {@copse_plot_data}]; +end + + +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% calculate unknowns assuming present day steady state +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% S burial to balance S weathering + S degassing +run.tm.pars.k_mpsb = run.tm.pars.k21_pyrw + run.tm.pars.k_pyrdeg ; +run.tm.pars.k_mgsb = run.tm.pars.k22_gypw + run.tm.pars.k_gypdeg ; +% oxidw to balance degassing and carbon burial +run.tm.pars.k17_oxidw = run.tm.pars.k2_mocb + run.tm.pars.k5_locb -run.tm.pars.k13_ocdeg ; +% silicate weathering to balance degassing +/- organic C cycle +if strcmp(run.tm.pars.f_SRedoxAlk, 'degassing') + % SD include sulphur degassing + run.tm.pars.k_silw = run.tm.pars.k17_oxidw - (run.tm.pars.k2_mocb + run.tm.pars.k5_locb - run.tm.pars.k13_ocdeg) + run.tm.pars.k12_ccdeg - run.tm.pars.k_sfw + (run.tm.pars.k_pyrdeg + run.tm.pars.k_gypdeg) ; +else + run.tm.pars.k_silw = run.tm.pars.k17_oxidw - (run.tm.pars.k2_mocb + run.tm.pars.k5_locb - run.tm.pars.k13_ocdeg) + run.tm.pars.k12_ccdeg - run.tm.pars.k_sfw ; +end +run.tm.pars.k_granw = run.tm.pars.k_silw*(1-run.tm.pars.k_basfrac); +run.tm.pars.k_basw = run.tm.pars.k_silw*(run.tm.pars.k_basfrac); +% P weathering to balance P burial +%run.tm.pars.k10_phosw = ( run.tm.pars.k2_mocb/run.tm.pars.CPsea0 +run.tm.pars.k7_capb +run.tm.pars.k6_fepb ) / (1-run.tm.pars.k11_landfrac) ; +%TL alternative approach to avoid redundancy and derive k11 +run.tm.pars.k10_phosw = ( run.tm.pars.k2_mocb/run.tm.pars.CPsea0 +run.tm.pars.k7_capb +run.tm.pars.k6_fepb ) + (run.tm.pars.k5_locb/run.tm.pars.CPland0) ; +run.tm.pars.k11_landfrac = (run.tm.pars.k5_locb/run.tm.pars.CPland0)/run.tm.pars.k10_phosw ; +% N fixation to balance denit + monb +run.tm.pars.k3_nfix = 2*run.tm.pars.k4_denit + run.tm.pars.k2_mocb/run.tm.pars.CNsea0; + +%%% Make sure Sr fluxes follow basfrac apportioning +run.tm.pars.k_Sr_igg = run.tm.pars.k_Sr_total_igw * (1 - run.tm.pars.k_basfrac); +run.tm.pars.k_Sr_igb = run.tm.pars.k_Sr_total_igw * run.tm.pars.k_basfrac; +%%%% calculate unknowns for Sr system +run.tm.pars.k_Sr_total_burial = run.tm.pars.k_Sr_sedw + run.tm.pars.k_Sr_mantle + run.tm.pars.k_Sr_total_igw ; %%%% sum for total burial +%%% assume same fraction of Sr is buried by sfw as carbonates +run.tm.pars.k_Sr_sfw = run.tm.pars.k_Sr_total_burial * ( run.tm.pars.k_sfw / ( run.tm.pars.k14_carbw + run.tm.pars.k_silw + run.tm.pars.k_sfw) ) ; +%%% aternative set sfw to equal mantle input (Francois and Walker 1992) +%run.tm.pars.k_Sr_sfw = run.tm.pars.k_Sr_mantle ; +%%% calculate sed burial of Sr for stability +run.tm.pars.k_Sr_sedb = run.tm.pars.k_Sr_total_burial - run.tm.pars.k_Sr_sfw ; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +end diff --git a/examples/copse/copse_tests.xlsx b/examples/copse/copse_tests.xlsx new file mode 100644 index 0000000..2147bd8 Binary files /dev/null and b/examples/copse/copse_tests.xlsx differ diff --git a/examples/copse/reloadedplots/empty_datafig_revised2_notick.fig b/examples/copse/reloadedplots/empty_datafig_revised2_notick.fig new file mode 100644 index 0000000..ee08e91 Binary files /dev/null and b/examples/copse/reloadedplots/empty_datafig_revised2_notick.fig differ diff --git a/examples/copse/reloadedplots/plot_uncertainty_range.m b/examples/copse/reloadedplots/plot_uncertainty_range.m new file mode 100644 index 0000000..2fc85e3 --- /dev/null +++ b/examples/copse/reloadedplots/plot_uncertainty_range.m @@ -0,0 +1,167 @@ +function plot_uncertainty_range(best_guess, range) +% Plot uncertainty range as region and overlay best guess model +% +% Args: +% best_guess (paleo_run): best guess model output +% range (cell array of paleo_run): model runs encompassing uncertainty range + +xlims = [-550, 0]; + +% time grid to interpolate to, to find min/max +% compromise between resolution and figure size +%tgrid = xlims(1)*1e6:1e4:xlims(2)*1e6; +tgrid = xlims(1)*1e6:1e5:xlims(2)*1e6; + +% light grey for filled region +fillcol = 0.85*[1, 1, 1]; +% line width for overlayed best guess +bglw = 1.0; + + +figure; + +% pCO2 +subplot(3, 2, 1); +[pCO2PALmin, pCO2PALmax] = find_uncertainty_range(tgrid, range, 'diag', 'pCO2PAL'); +% filled region for range +fill(horzcat(tgrid, fliplr(tgrid))/1e6, ... + horzcat(pCO2PALmin, fliplr(pCO2PALmax)), ... + fillcol, 'EdgeColor', 'none'); +% overlay best guess +hold all; +plot(best_guess.T/1e6, ... + best_guess.diag.pCO2PAL, 'k', 'LineWidth', bglw); +addIDlbl('A'); +xlabel('Time (Ma)'); +ylabel('pCO_2 (PAL)'); +xlim(xlims); +ylim([0 20]); + +% Temperature +subplot(3, 2, 3); +[TEMPmin, TEMPmax] = find_uncertainty_range(tgrid, range, 'diag', 'TEMP'); +% filled region for range +fill(horzcat(tgrid, fliplr(tgrid))/1e6, ... + horzcat(TEMPmin, fliplr(TEMPmax)) - paleo_const.k_CtoK, ... + fillcol, 'EdgeColor', 'none'); +% overlay best guess +hold all; +plot(best_guess.T/1e6, ... + best_guess.diag.TEMP - paleo_const.k_CtoK, 'k', 'LineWidth', bglw); +addIDlbl('B'); +xlabel('Time (Ma)'); +ylabel(sprintf('Temperature (%cC)', char(176))); +xlim(xlims); +ylim([8 24]); + +% marine N +subplot(3, 2, 5); +[Nmin, Nmax] = find_uncertainty_range(tgrid, range, 'S', 'N'); +% filled region for range +fill(horzcat(tgrid, fliplr(tgrid))/1e6, ... + 1e6*horzcat(Nmin, fliplr(Nmax))/best_guess.tm.pars.k18_oceanmass, ... + fillcol, 'EdgeColor', 'none'); +% overlay best guess +hold all; +plot(best_guess.T/1e6, ... + 1e6*best_guess.S.N/best_guess.tm.pars.k18_oceanmass, 'k', 'LineWidth', bglw); +addIDlbl('C'); +xlabel('Time (Ma)'); +ylabel('[NO_3] (\mumol/kg)'); +xlim(xlims); +ylim([20 45]); + +% pO2 +% TODO mixing ratio ? +subplot(3, 2, 2); +%[mrO2min, mrO2max] = find_uncertainty_range(tgrid, range, 'diag', 'mrO2'); +[pO2PALmin, pO2PALmax] = find_uncertainty_range(tgrid, range, 'diag', 'pO2PAL'); +% filled region for range +fill(horzcat(tgrid, fliplr(tgrid))/1e6, ... + horzcat(pO2PALmin, fliplr(pO2PALmax)), ... %21.*horzcat(pO2PALmin, fliplr(pO2PALmax)), ... % 100*horzcat(mrO2min, fliplr(mrO2max)), ... % + fillcol, 'EdgeColor', 'none'); +% overlay best guess +hold all; +plot(best_guess.T/1e6, ... + best_guess.diag.pO2PAL, 'k', 'LineWidth', bglw); + %100*best_guess.diag.mrO2, 'k', 'LineWidth', bglw); +addIDlbl('D'); +xlabel('Time (Ma)'); +ylabel('pO_2 (PAL)'); +%ylabel('O_2 (%)'); +xlim(xlims); +ylim([0 1.6]); +%ylim([0 35]); + +% anoxic fraction +subplot(3, 2, 4); +[ANOXmin,ANOXmax] = find_uncertainty_range(tgrid, range, 'diag', 'ANOX'); +% filled region for range +fill(horzcat(tgrid, fliplr(tgrid))/1e6, ... + horzcat(ANOXmin, fliplr(ANOXmax)), ... + fillcol, 'EdgeColor', 'none'); +% overlay best guess +hold all; +plot(best_guess.T/1e6, ... + best_guess.diag.ANOX, 'k', 'LineWidth', bglw); +addIDlbl('E'); +xlabel('Time (Ma)'); +ylabel('Anoxic Fraction'); +xlim(xlims); +ylim([0 1]); + +% marine P +subplot(3, 2, 6); +[Pmin, Pmax] = find_uncertainty_range(tgrid, range, 'S', 'P'); +% filled region for range +fill(horzcat(tgrid, fliplr(tgrid))/1e6, ... + 1e6*horzcat(Pmin, fliplr(Pmax))/best_guess.tm.pars.k18_oceanmass, ... + fillcol, 'EdgeColor', 'none'); +% overlay best guess +hold all; +plot(best_guess.T/1e6, ... + 1e6*best_guess.S.P/best_guess.tm.pars.k18_oceanmass, 'k', 'LineWidth', bglw); +addIDlbl('F'); +xlabel('Time (Ma)'); +ylabel('[PO_4] (\mumol/kg)'); +xlim(xlims); +ylim([0 8]); + +end + + +function [vmin, vmax] = find_uncertainty_range(tgrid, range, rstruct, rfield) +% Find min, max of time-series variable v, where T = range{i}.T, v = range{i}.(rstruct).(rfield) +% +% Args: +% tgrid (vector): time grid to interpolate to +% range (cell array of model output): model output encompassing uncertainty range +% rstruct (str): name of struct in model output +% rfield (str): name of field in model output, so v = range{i}.(rstruct).(rfield) +% Returns: +% vmin (vector): min v, interpolated to tgrid +% vmax (vector): max v, interpolated to tgrid + +% initialise to unlikely values +vmin = 1e30*ones(1, length(tgrid)); +vmax = -1e30*ones(1, length(tgrid)); + +% iterate through supplied model output and update vmin, vmax +for i = 1:length(range) + T = range{i}.T; + v = range{i}.(rstruct).(rfield); + + vinterp = interp1(T, v, tgrid); + + vmin = min(vmin, vinterp); + vmax = max(vmax, vinterp); + +end + +end + + +function addIDlbl(lbl) +% add lbl (eg 'A') to panel +text(0.9, 0.9, lbl, 'Units', 'normalized', 'FontSize', 14, 'FontWeight', 'bold'); +end \ No newline at end of file diff --git a/examples/copse/reloadedplots/reloaded_plot_full_col.m b/examples/copse/reloadedplots/reloaded_plot_full_col.m new file mode 100644 index 0000000..1e58bb2 --- /dev/null +++ b/examples/copse/reloadedplots/reloaded_plot_full_col.m @@ -0,0 +1,61 @@ +function fighandle = reloaded_plot_full_col(modeldata, linecolstyle, fighandle) + +% Plot PALEO/COPSE output against geologic data after model run +% call from command window once you have results in workspace +% +% run - model run +% lincolstyle - character string specifying color and style +% (see 'help plot') +% +% Examples: +% +% reloaded_plot_full_col(run, 'b--') % dashed blue line +% reloaded_plot_full_col(run, 'r') % solid red line + +if nargin < 3 + %%%% call empty figure + % Load precalculated figure background + fighandle = openfig('empty_datafig_revised2_notick.fig','new') ; + % Create figure 'background' from datasets + % fighandle = create_datafig(); +end + +text('Interpreter','latex') + +%%%% find subplots +subs=get(fighandle,'children'); + +%%%% open existing subplots and plot PALEO outputs +% +subplot(subs(1)) ; +box on +%plot(modeldata.T./1e6, 21.* modeldata.diag.pO2PAL, linecolstyle ) ; +plot(modeldata.T./1e6, 100*modeldata.diag.mrO2, linecolstyle) ; % mixing ratio +%ylabel('pO_{2} (vol%)') +% +subplot(subs(5)) ; +box on +plot(modeldata.T./1e6, 280.*modeldata.diag.pCO2PAL, linecolstyle); +%ylabel('pCO_{2} (ppmv)') +% +subplot(subs(2)) ; +box on +plot(modeldata.T./1e6, 28.* ( modeldata.S.S/modeldata.tm.pars.S0 ), linecolstyle ); +%ylabel('SO_{4} (mmol/kg)') +% +subplot(subs(4)) ; +box on +plot(modeldata.T./1e6, modeldata.diag.delta_A+modeldata.diag.d_mccb, linecolstyle); +%ylabel('\delta^{13}C (^{\fontsize{7}o}/{\fontsize{7}oo})') +% +subplot(subs(3)) ; +box on +plot(modeldata.T./1e6,modeldata.S.moldelta_S./modeldata.S.S, linecolstyle) +%ylabel('\delta^{34}S (^{\fontsize{7}o}/{\fontsize{7}oo})') +% +subplot(subs(6)) ; +box on +plot(modeldata.T./1e6,modeldata.diag.delta_Sr_ocean, linecolstyle) +%ylabel('^{87}Sr/^{86}Sr') + +end \ No newline at end of file diff --git a/examples/copse/reloadedplots/run_plot_reloaded.m b/examples/copse/reloadedplots/run_plot_reloaded.m new file mode 100644 index 0000000..d20d048 --- /dev/null +++ b/examples/copse/reloadedplots/run_plot_reloaded.m @@ -0,0 +1,205 @@ +% Generate plots for COPSE reloaded Lenton etal (2017). +% Edit ops= below to choose whether to rerun the model, or load saved output + +%%%% Start logger +timestamp = paleo_log.getTimestamp(); +LN = 'run_plot_reloaded'; paleo_log.initialise(); L = paleo_log.getLogger(); +% Optionally set logging to file +%L.setLogFile(paleo_log.getOutputPathTimeStamped('run_plot_reloaded', timestamp)); +% and disable/enable logging to terminal +% L.setCommandWindowLevel(L.DEBUG); + +% Edit ops= below to choose whether to rerun or load saved output +% rerun everything +%ops = {'runall', 'loadall', 'Fig5', 'Fig6', 'Fig7', 'Fig8', 'Fig9', 'Fig10', 'Fig11', 'Fig12', 'Fig13'}; +% load and plot saved output +% NB: load is from current output folder, not the archived comparison output. +% ops = {'loadall', 'Fig5', 'Fig6', 'Fig7', 'Fig8', 'Fig9', 'Fig10', 'Fig11', 'Fig12', 'Fig13'}; + ops = {'loadall', 'Fig12'}; + +% define runs +RL_runs = { ... + 'original', 'baseline'; ... % "original" reconstructs the original COPSE for whole Phanerozoic + % Variants in Fig. 5 + 'original', 'DB'; ... + 'original', 'U'; ... + 'original', 'EWCP'; ... + 'original', 'DUEWBCP'; ... + % Variants in Fig. 6 + 'original', 'sfw'; ... + 'original', 'basnoU'; ... + 'original', 'Easplit'; ... + 'original', 'vegweath'; ... + 'original', 'bernerT'; ... + 'original', 'newweath'; ... + % Variants in Fig. 7 + 'original', 'CAL'; ... + 'original', 'ignit'; ... + 'original', 'pyrweath'; ... + 'original', 'newweathredox'; ... + 'original', 'newbase'; ... + %%%% "newbase" runs the new COPSE structure with old fluxes and without additional forcings for whole Phanerozoic + 'newbase', 'baseline'; ... + %%%% Variants in Fig. 8 + 'newbase', 'highS'; ... + 'newbase', 'highCin'; ... + 'newbase', 'lowCorg'; ... + 'newbase', 'Pweath'; ... + 'newbase', 'newfluxes'; ... + %%%% Variants in Fig. 9 + 'newbase', 'basalt'; ... + 'newbase', 'granite'; ... + 'newbase', 'PG'; ... + 'newbase', 'bcoal'; ... + %%%% "reloaded" runs the new COPSE reloaded for whole Phanerozoic + 'reloaded', 'baseline'; ... + %%%% Variants in Fig. 10 + 'reloaded', 'k15025'; ... + 'reloaded', 'k1501'; ... + 'reloaded', 'newnpp'; ... + 'reloaded', 'sfwstrong'; ... + 'reloaded', 'sfwnoT'; ... + %%%% Variants in Fig. 11 + 'reloaded', 'climsens15'; ... + 'reloaded', 'climsens225'; ... + 'reloaded', 'climsens45'; ... + 'reloaded', 'climsens6'; ... + %%%% Variants in Fig. 12 + 'reloaded', 'locbU'; ... + 'reloaded', 'mocbU'; ... + 'reloaded', 'locbUmocbU'; ... + 'reloaded', 'mocbO2'; ... + 'reloaded', 'VCI'; ... + }; + +for i = 1:length(ops) + op = ops{i}; + switch op + case 'runall' + fprintf('about to rerun all model runs (edit this script and change ''opts=...'' to use previously saved output)\n'); + checkuser = input('continue ? [y/n]', 's'); + if strncmpi(checkuser, 'Y', 1) + % iterate through list, execute and save all runs + for j = 1:size(RL_runs, 1) + baseline = RL_runs{j, 1}; + expt = RL_runs{j, 2}; + runname = sprintf('%s_%s', baseline, expt); + % execute run, results will be in workspace + eval(sprintf('%s=copse_reloaded_reloaded_expts(''%s'', ''%s'', true)', ... + runname, baseline, expt)); + eval(sprintf('%s.initialise', runname)); + eval(sprintf('%s.integrate', runname)); + eval(sprintf('%s.postprocess', runname)); + % save run + eval(sprintf('%s.saveoutput(''%s'')', runname, runname)); + end + else + fprintf('exiting\n'); + return; + end + + case 'loadall' + % iterate through list loading all runs into workspace + for j = 1:size(RL_runs, 1) + baseline = RL_runs{j, 1}; + expt = RL_runs{j, 2}; + runname = sprintf('%s_%s', baseline, expt); + % load run, results will be in workspace + eval(sprintf('%s=paleo_run.loadoutput(''%s'')', ... + runname, runname)); + end + case 'Fig5' + fh = reloaded_plot_full_col(original_DB, 'b'); + reloaded_plot_full_col(original_U, 'r', fh); + reloaded_plot_full_col(original_EWCP, 'g', fh); + reloaded_plot_full_col(original_DUEWBCP, 'k', fh); + % dashed line last although first in caption + reloaded_plot_full_col(original_baseline, 'k--', fh); + % then 'copy options' check 'preserve information', 'match figure screen size' + % 'copy figure' + % paste into Word + case 'Fig6' + fh = reloaded_plot_full_col(original_sfw, 'b'); + reloaded_plot_full_col(original_basnoU, 'r', fh); + reloaded_plot_full_col(original_Easplit, 'c', fh); + reloaded_plot_full_col(original_vegweath, 'g', fh); + reloaded_plot_full_col(original_Easplit, 'c', fh); + reloaded_plot_full_col(original_bernerT, 'm', fh); + reloaded_plot_full_col(original_newweath, 'k', fh); + % dashed line last although first in caption + reloaded_plot_full_col(original_DUEWBCP, 'k--', fh); + case 'Fig7' + fh = reloaded_plot_full_col(original_CAL, 'b'); + reloaded_plot_full_col(original_ignit, 'r', fh); + reloaded_plot_full_col(original_pyrweath, 'c', fh); + reloaded_plot_full_col(original_newweathredox, 'g', fh); + reloaded_plot_full_col(original_newbase, 'k', fh); + % dashed line last although first in caption + reloaded_plot_full_col(original_DUEWBCP, 'k--', fh); + case 'Fig8' + fh = reloaded_plot_full_col(newbase_highS, 'b'); + reloaded_plot_full_col(newbase_highCin, 'r', fh); + reloaded_plot_full_col(newbase_lowCorg, 'g', fh); + reloaded_plot_full_col(newbase_Pweath, 'c', fh); + reloaded_plot_full_col(newbase_newfluxes, 'k', fh); + % dashed line last although first in caption + reloaded_plot_full_col(newbase_baseline, 'k--', fh); + case 'Fig9' + fh = reloaded_plot_full_col(newbase_basalt, 'b'); + reloaded_plot_full_col(newbase_granite, 'r', fh); + reloaded_plot_full_col(newbase_PG, 'c', fh); + reloaded_plot_full_col(newbase_bcoal, 'g', fh); + reloaded_plot_full_col(reloaded_baseline, 'k', fh); + % dashed line last although first in caption + reloaded_plot_full_col(newbase_newfluxes, 'k--', fh); + case 'Fig10' + fh = reloaded_plot_full_col(reloaded_k15025, 'b'); + reloaded_plot_full_col(reloaded_k1501, 'r', fh); + reloaded_plot_full_col(reloaded_newnpp, 'g', fh); + reloaded_plot_full_col(reloaded_sfwstrong, 'c', fh); + reloaded_plot_full_col(reloaded_sfwnoT, 'm', fh); + % dashed line last although first in caption + reloaded_plot_full_col(reloaded_baseline, 'k--', fh); + case 'Fig11' + fh = reloaded_plot_full_col(reloaded_climsens15, 'b'); + reloaded_plot_full_col(reloaded_climsens225, 'g', fh); + reloaded_plot_full_col(reloaded_climsens45, 'c', fh); + reloaded_plot_full_col(reloaded_climsens6, 'r', fh); + % dashed line last although first in caption + reloaded_plot_full_col(reloaded_baseline, 'k--', fh); + case 'Fig12' + fh = reloaded_plot_full_col(reloaded_locbU, 'b'); + reloaded_plot_full_col(reloaded_mocbU, 'r', fh); + reloaded_plot_full_col(reloaded_locbUmocbU, 'g', fh); + reloaded_plot_full_col(reloaded_mocbO2, 'c', fh); + reloaded_plot_full_col(reloaded_VCI, 'm', fh); + % dashed line last although first in caption + reloaded_plot_full_col(reloaded_baseline, 'k--', fh); + case 'Fig13' + fig13runs = { ... + reloaded_baseline; ... + reloaded_k15025; ... + reloaded_k1501; ... + reloaded_newnpp; ... + reloaded_sfwstrong; ... + reloaded_sfwnoT; ... + reloaded_climsens225; ... + reloaded_climsens45; ... + reloaded_locbU; ... + reloaded_mocbU; ... + reloaded_mocbO2; ... + reloaded_VCI; ... + }; + plot_uncertainty_range(reloaded_baseline, fig13runs); + % SD with 1e5 yr interpolation steps, fig->copy_figure OK + % SD with 1e4 yr interpolation steps. + % at least on my laptop, fig->copy_figure fails (Matlab error) + % workaround - print to pdf and then copy from that (makes a _huge_ pdf ~16MB) + % copse_fig.printpdf(9, 'Fig_13.pdf') + otherwise + L.log(L.ERROR, LN, sprintf('unrecognized op %s\n', op)); + end +end + + + diff --git a/examples/copse/run_copse_tests.m b/examples/copse/run_copse_tests.m new file mode 100644 index 0000000..efa455f --- /dev/null +++ b/examples/copse/run_copse_tests.m @@ -0,0 +1,147 @@ +function [nfail, npass] = run_copse_tests(run_IDs) + % Run tests for current code against archived COPSE model output + % + % run_IDs - [optional] array of test IDs to run (default is [] ie run all tests) + % + % Tests list of configurations and error tolerance as specified in copse_tests.xlsx + % NB: this spreadsheet needs a very specific format (you can add rows for configurations, + % add columns for fields to test, but the layout needs to stay fixed). + + if nargin < 1 + run_IDs = [100, 200, 300, 310, 400, 500, 550]; + fprintf('using default minimum set of run_IDs '); + fprintf('%g ', run_IDs); + fprintf('\n'); + elseif ischar(run_IDs) && strcmp(run_IDs, 'all') + run_IDs = []; % every test + end + + nheader_rows = 4; % number of header rows to skip when looking for model configurations + % fields-to-test are read from spreadsheet + irow_fieldnames = nheader_rows-1; % 1-based + irow_fieldmethod = nheader_rows; + % columns (1 based indices) + icol_ID = 1; % A + icol_expts = 2; % B + icol_baseline = 3; % C + icol_expt = 4; % D + icol_copse_version = 6; % F + icol_copse_configuration = 7; % G + icol_first_test_field = 9; % I + + + LN = 'run_copse_tests'; paleo_log.initialise(); L = paleo_log.getLogger(); + % Optionally set logging to file + L.setLogFile('run_copse_tests.txt'); + L.setFileLevel(L.INFO) + % and disable/enable logging to terminal + % L.setCommandWindowLevel(L.DEBUG); + + % get list of tests, comparison output, and comparison fields from spreadsheet + [~, xls_txt, xls_raw] = xlsread('copse_tests'); + + % check we have expected spreadsheet contents + if strcmp(xls_txt{nheader_rows-2, icol_ID}, 'Test Run') ~= 1 + error('unexpected spreadsheet contents'); + end + + % gather commands to run tests, stripping blank lines + % strip any row without ID (allows blank / comment rows) + test_region = xls_raw((nheader_rows+1):end, icol_ID); + test_rows = horzcat(false(1, nheader_rows), ~isnan([test_region{:}])); % indices of non-header, non-blank rows + % gather commands + test_IDs = xls_raw(test_rows, icol_ID); + test_cmds = xls_txt(test_rows, icol_expts); + test_baseline = xls_txt(test_rows, icol_baseline); + test_expt = xls_txt(test_rows, icol_expt); + + % gather parameters to read output + copse_version = xls_txt(test_rows, icol_copse_version); + copse_configuration = xls_txt(test_rows, icol_copse_configuration); + + % gather comparison fields and method + % find rows containing fields-to-test, stripping blank columns + fields_region = xls_txt(irow_fieldnames, icol_first_test_field:end); + field_columns = horzcat(false(1, icol_first_test_field-1), ~strcmp(fields_region, '')); + comp_fields = xls_txt(irow_fieldnames, field_columns); + comp_method = xls_txt(irow_fieldmethod, field_columns); + L.log(L.INFO, LN, sprintf('comparison fields:\n')); + for j = 1:length(comp_fields) + L.log(L.INFO, LN, sprintf('\tdiag.%s\t(%s)\n', comp_fields{j}, comp_method{j})); + end + + + % gather comparison tolerance + % (blank cells will be read as NaN meaning no comparison on this field) + comp_tol = xls_raw(test_rows, icol_first_test_field:end); + + % iterate through tests, comparing against archived data + + npass = 0; + nfail = 0; + + tests_to_run = []; + for i = 1:length(test_cmds) + if isempty(run_IDs) || any(test_IDs{i} == run_IDs) + tests_to_run(end+1) = i; + end + end + + L.log(L.INFO, LN, sprintf('running %i tests out of total %i\n', length(tests_to_run), length(test_IDs))); + + for i = tests_to_run + L.log(L.INFO, LN, sprintf('-------------------------------------------------------------\n')); + L.log(L.INFO, LN, sprintf('Start test_ID %i\n', test_IDs{i})); + % string to be evaluated to run test model + test_eval = sprintf('%s(''%s'', ''%s'')', test_cmds{i}, test_baseline{i}, test_expt{i}); + L.log(L.INFO, LN, sprintf('testing run=%s\n', test_eval)); + L.log(L.INFO, LN, ... + sprintf('against copse_output_load(''%s'', ''%s'')\n', ... + copse_version{i}, copse_configuration{i})); + + % read comparison output + compoutput = copse_output_load(copse_version{i}, copse_configuration{i}); + + % run model + testrun = eval(test_eval); + testrun.initialise() + testrun.integrate(); + testrun.postprocess(); + tlimits = [testrun.T(1), testrun.T(end)]; + + % iterate through fields and check RMS + testOK = true; + for c = 1:length(comp_fields) + fname = comp_fields{c}; + ftol = comp_tol{i, c}; + if ~isnan(ftol) + [ tcomp, fdiff, frms ] = copse_diff(tlimits, comp_method{c}, ... + compoutput.T, compoutput.diag.(fname), ... + testrun.T, testrun.diag.(fname)); + if (frms <= ftol) + L.log(L.INFO, LN, sprintf('RMS diag.%s %g <= tol %g, OK\n', fname, frms, ftol)); + else + L.log(L.INFO, LN, sprintf('RMS diag.%s %g > tol %g, FAIL\n', fname, frms, ftol)); + testOK = false; + end + else + L.log(L.INFO, LN, sprintf('no test on field diag.%s\n', fname)); + end + end + + if testOK + L.log(L.INFO, LN, sprintf('PASS\n')); + npass = npass + 1; + else + L.log(L.WARN, LN, sprintf('FAIL\n')); + nfail = nfail + 1; + end + L.log(L.INFO, LN, sprintf('-------------------------------------------------------------\n')); + end + + ntests = npass + nfail; + L.log(L.INFO, LN, sprintf('%g tests %g pass %g fail\n', ntests, npass, nfail)); + + fprintf('see log file %s\n', L.fullpath); +end + diff --git a/libraries/YAMLMatlab_0.4.3/DateTime.m b/libraries/YAMLMatlab_0.4.3/DateTime.m new file mode 100644 index 0000000..9c0a1be --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/DateTime.m @@ -0,0 +1,286 @@ +classdef DateTime + % This class enclapsulates date time value but behaves in a very + % similar way as typical array of timestamps in datenum format + %====================================================================== + %{ + Copyright (c) 2011 + This program is a result of a joined cooperation of Energocentrum + PLUS, s.r.o. and Czech Technical University (CTU) in Prague. + The program is maintained by Energocentrum PLUS, s.r.o. and + licensed under the terms of MIT license. Full text of the license + is included in the program release. + + Author(s): + Jiri Cigler, Dept. of Control Engineering, CTU Prague & Automatic Control Laboratory, ETH Zurich + Jan Siroky, Energocentrum PLUS s.r.o. + + Implementation and Revisions: + + Auth Date Description of change + ---- --------- ------------------------------------------------- + jc 01-Mar-11 First implementation + jc 30-Sep-11 Added function colon + jc 07-Jan-12 Added functions addtodate,datevec,weekday + %} + %====================================================================== + + + % TODO + + +%ate and Time Operations +%addtodateModify date number by fieldcalendarCalendar for specified monthclockCurrent time as date vectorcputimeElapsed CPU timedateCurrent date stringdatenumConvert date and time to serial date numberdatestrConvert date and time to string formatdatevecConvert date and time to vector of componentseomdayLast day of monthetimeTime elapsed between date vectorsnowCurrent date and timeweekdayDay of wee + + + properties + serialDate + end + methods + function this = DateTime(varargin) + if numel(varargin)==1 && isa(varargin{1},'java.util.Date') + df = java.text.SimpleDateFormat( 'yyyy-MM-dd HH:mm:ss' ); + tz = java.util.TimeZone.getTimeZone ('UTC'); + df.setTimeZone( tz ); + this.serialDate=datenum(char(df.format(varargin{1}))); + %this.serialDate = datenum(char(varargin{1}.toString)) - varargin{1}.getTimezoneOffset/60/24; + %disp ( [ char(varargin{1}.toGMTString), '---' char(varargin{1}.toString ), '---', char(varargin{1}.toLocaleString )]); + %if (varargin{1}.getTimezoneOffset)~=-120 + % disp(1); + %end + else + this.serialDate=datenum(varargin{:}); + end + end + function this = plus(this,val) + o =@plus; + this = doFun(this,o,val); + end + function this = minus(this,val) + o =@minus; + this = doFun(this,o,val); + end + function this = times(this,val) + o =@times; + this = doFun(this,o,val); + end + + function this = mtimes(this,val) + o =@mtimes; + this = doFun(this,o,val); + end + + function this = mrdivide(this,val) + o =@mrdivide; + this = doFun(this,o,val); + end + + function this = rdivide(this,val) + o =@rdivide; + this = doFun(this,o,val); + end + + + + function this = horzcat(this,varargin) + %this.serialDate = [this.serialDate, n.serialDate]; + for i=1:numel(varargin) + this.serialDate = [this.serialDate, varargin{i}.serialDate]; + end + end + + function out = colon(this,step,to) + vect = [double(this):double(step):double(to)]'; + + out =DateTime(vect); + end + + function this = vertcat(this,varargin) + for i=1:numel(varargin) + this.serialDate = [this.serialDate; varargin{i}.serialDate]; + end + end + + + function this = ctranspose(this) + this.serialDate = this.serialDate'; + end + + function this = transpose(this) + this.serialDate = this.serialDate'; + end + function disp(this) + disp([this.serialDate]) + end + function out = double(this) + out = this.serialDate; + end + function out = length(this) + out = length(this.serialDate); + end + + function out = size(this,varargin) + out = size(this.serialDate,varargin{:}); + end + + function out = numel(this) + out = numel(this.serialDate); + end + function out = isreal(this) + out = isreal(this.serialDate); + end + function out = isnan(this) + out = isnan(this.serialDate); + end + function out = isfinite(this) + out = isfinite(this.serialDate); + end + + function out = le(this,B) + if isa(B,'DateTime') + out = le(this.serialDate,B.serialDate); + else + out = le(this.serialDate,B); + end + end + + function out = lt(this,B) + fun=@lt; + if isa(B,'DateTime') + out = fun(this.serialDate,B.serialDate); + else + out = fun(this.serialDate,B); + end + end + function out = gt(this,B) + fun=@gt; + if isa(B,'DateTime') + out = fun(this.serialDate,B.serialDate); + else + out = fun(this.serialDate,B); + end + end + function out = eq(this,B) + fun=@eq; + if isa(B,'DateTime') + out = fun(this.serialDate,B.serialDate); + else + out = fun(this.serialDate,B); + end + end + function out = diff(this) + out = diff(this.serialDate); + end + + function out = norm(this,varargin) + out = norm(this.serialDate,varargin{:}); + end + + function [this k] = sort(this,varargin) + [this.serialDate k] = sort(this.serialDate,varargin{:}); + end + + function this = subsref(this,S) + if isa(S.subs{1},'DateTime') + S.subs{1}=double(S.subs{1}); + end + + this.serialDate = subsref(this.serialDate,S); + end + + function idx = subsindex(this) + idx = double(this)-1; + end + + function endidx = end(this,k,n) + if size(this.serialDate,1)==1 || size(this.serialDate,2)==1 + endidx=numel(this.serialDate); + else + endidx = size(this.serialDate,k); + end + end + + function this = subsasgn(this, S, B) + if not(isa(B,'DateTime')) + B=DateTime(B); + end + + this.serialDate =subsasgn(this.serialDate, S, B); + end + + function res = bsxfun(fun,A,B) + res = fun(A,B); + end + + function out =superiorfloat (x,y,xi) + if isa(x,'DateTime') && isa(xi,'DateTime') + out = superiorfloat(x.serialDate,y,xi.serialDate); + elseif isa(x,'DateTime') && not(isa(xi,'DateTime')) + out = superiorfloat(x.serialDate,y,xi); + elseif not(isa(x,'DateTime')) && isa(xi,'DateTime') + out = superiorfloat(x,y,xi.serialDate); + else + out = superiorfloat(x,y,xi); + end + end + + function this = floor(this) + this.serialDate = floor(this.serialDate); + end + function this = max(this,varargin) + this.serialDate = max(this.serialDate,varargin{:}); + end + function this = min(this,varargin) + this.serialDate = min(this.serialDate,varargin{:}); + end + function out = datestr(this,varargin) + out = datestr(this.serialDate,varargin{:}); + end + + function out = addtodate(this,varargin) + out = addtodate(this.serialDate,varargin{:}); + end + function varargout= datevec(this,varargin) + nout = nargout; + if nout <=1 + varargout{1} = datevec(this.serialDate,varargin{:}); + elseif nout ==2 + [varargout{1} varargout{2}] = datevec(this.serialDate,varargin{:}); + + + elseif nout ==3 + [varargout{1} varargout{2} varargout{3}] = datevec(this.serialDate,varargin{:}); + + elseif nout ==4 + [varargout{1} varargout{2} varargout{3} varargout{4}] = datevec(this.serialDate,varargin{:}); + + elseif nout ==5 + [varargout{1} varargout{2} varargout{3} varargout{4} varargout{5} ] = datevec(this.serialDate,varargin{:}); + + elseif nout ==6 + [varargout{1} varargout{2} varargout{3} varargout{4} varargout{5} varargout{6} ] = datevec(this.serialDate,varargin{:}); + else + error('Unknown function call'); + end + end + + + end + + methods (Access = private) + function this = doFun (this,o, val) + if isa(val,'DateTime') && isa(this,'DateTime') + this.serialDate=o(this.serialDate, val.serialDate); + elseif isa(val,'DateTime') && not(isa(this,'DateTime')) + val.serialDate=o(this, val.serialDate); + this = val; + elseif not(isa(val,'DateTime')) && (isa(this,'DateTime')) + this.serialDate=o(this.serialDate, val); + else + this.serialDate=DateTime(o(this, val)); + end + end + + + end + +end diff --git a/libraries/YAMLMatlab_0.4.3/MIT-license.txt b/libraries/YAMLMatlab_0.4.3/MIT-license.txt new file mode 100644 index 0000000..fac5711 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/MIT-license.txt @@ -0,0 +1,22 @@ +Copyright (c) 2011 CTU in Prague and Energocentrum PLUS s.r.o. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/ReadYaml.m b/libraries/YAMLMatlab_0.4.3/ReadYaml.m new file mode 100644 index 0000000..f42aceb --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/ReadYaml.m @@ -0,0 +1,66 @@ +%========================================================================== +% Actually reads YAML file and transforms it using several mechanisms: +% +% - Transforms mappings and lists into Matlab structs and cell arrays, +% for timestamps uses DateTime class, performs all imports (when it +% finds a struct field named 'import' it opens file(s) named in the +% field content and substitutes the filename by their content. +% - Deflates outer imports into inner imports - see deflateimports(...) +% for details. +% - Merges imported structures with the structure from where the import +% was performed. This is actually the same process as inheritance with +% the difference that parent is located in a different file. +% - Does inheritance - see doinheritance(...) for details. +% - Makes matrices from cell vectors - see makematrices(...) for details. +% +% Parameters: +% filename ... name of an input yaml file +% nosuchfileaction ... Determines what to do if a file to read is missing +% 0 or not present - missing file will only throw a +% warning +% 1 - missing file throws an +% exception and halts the process +% makeords ... Determines whether to convert cell array to +% ordinary matrix whenever possible (1). +% dictionary ... Dictionary of of labels that will be replaced, +% struct is expected +function result = ReadYaml(filename, nosuchfileaction, makeords, treatasdata, dictionary) + if ~exist('nosuchfileaction','var') + nosuchfileaction = 0; + end; + if ~ismember(nosuchfileaction,[0,1]) + error('nosuchfileexception parameter must be 0,1 or missing.'); + end; + if ~exist('makeords','var') + makeords = 0; + end; + if ~ismember(makeords,[0,1]) + error('makeords parameter must be 0,1 or missing.'); + end; + if(~exist('treatasdata','var')) + treatasdata = 0; + end; + if ~ismember(treatasdata,[0,1]) + error('treatasdata parameter must be 0,1 or missing.'); + end; + + + ry = ReadYamlRaw(filename, 0, nosuchfileaction, treatasdata); + ry = deflateimports(ry); + if iscell(ry) && ... + length(ry) == 1 && ... + isstruct(ry{1}) && ... + length(fields(ry{1})) == 1 && ... + isfield(ry{1},'import') + ry = ry{1}; + end; + ry = mergeimports(ry); + ry = doinheritance(ry); + ry = makematrices(ry, makeords); + if exist('dictionary','var') + ry = dosubstitution(ry, dictionary); + end; + + result = ry; + clear global nsfe; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/ReadYamlRaw.m b/libraries/YAMLMatlab_0.4.3/ReadYamlRaw.m new file mode 100644 index 0000000..bdc5f7a --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/ReadYamlRaw.m @@ -0,0 +1,251 @@ +%========================================================================== +% Reads YAML file, converts YAML sequences to MATLAB cell columns and YAML +% mappings to MATLAB structs +% +% filename ... name of yaml file to be imported +% verbose ... verbosity level (0 or absent = no messages, +% 1 = notify imports) +%========================================================================== +function result = ReadYamlRaw(filename, verbose, nosuchfileaction, treatasdata) + if ~exist('verbose','var') + verbose = 0; + end; + + if ~exist('nosuchfileaction','var') + nosuchfileaction = 0; + end; + if ~ismember(nosuchfileaction,[0,1]) + error('nosuchfileexception parameter must be 0,1 or missing.'); + end; + + if(~exist('treatasdata','var')) + treatasdata = 0; + end; + if ~ismember(treatasdata,[0,1]) + error('treatasdata parameter must be 0,1 or missing.'); + end; + + [pth,~,~] = fileparts(mfilename('fullpath')); + try + import('org.yaml.snakeyaml.*'); + javaObject('Yaml'); + catch + dp = [pth filesep 'external' filesep 'snakeyaml-1.9.jar']; + if not(ismember(dp, javaclasspath ('-dynamic'))) + javaaddpath(dp); % javaaddpath clears global variables...!? + end + import('org.yaml.snakeyaml.*'); + end; + + setverblevel(verbose); + % import('org.yaml.snakeyaml.Yaml'); % import here does not affect import in load_yaml ...!? + result = load_yaml(filename, nosuchfileaction, treatasdata); +end + +%-------------------------------------------------------------------------- +% Actually performs YAML load. +% - If this is a first call during recursion it changes cwd to the path of +% given filename and stores the old path. Then it calls the YAML parser +% and runs the recursive transformation. After transformation or when an +% error occurs, it sets cwd back to the stored value. +% - Otherwise just calls the parser and runs the transformation. +% +function result = load_yaml(inputfilename, nosuchfileaction, treatasdata) + + persistent nsfe; + + if exist('nosuchfileaction','var') %isempty(nsfe) && + nsfe = nosuchfileaction; + end; + + persistent tadf; + + if isempty(tadf) && exist('treatasdata','var') + tadf = treatasdata; + end; + + yaml = org.yaml.snakeyaml.Yaml(); % It appears that Java objects cannot be persistent...!? + if ~tadf + [filepath, filename, fileext] = fileparts(inputfilename); + if isempty(filepath) + pathstore = cd(); + else + pathstore = cd(filepath); + end; + end; + try + if ~tadf + result = scan(yaml.load(fileread([filename, fileext]))); + else + result = scan(yaml.load(inputfilename)); + end; + catch ex + if ~tadf + cd(pathstore); + end; + switch ex.identifier + case 'MATLAB:fileread:cannotOpenFile' + if nsfe == 1 + error('MATLAB:MATYAML:FileNotFound', ['No such file to read: ',filename,fileext]); + elseif nsfe == 0 + warning('MATLAB:MATYAML:FileNotFound', ['No such file to read: ',filename,fileext]); + result = struct(); + return; + end; + end; + rethrow(ex); + end; + if ~tadf + cd(pathstore); + end; +end + +%-------------------------------------------------------------------------- +% Determine node type and call appropriate conversion routine. +% +function result = scan(r) + if isa(r, 'char') + result = scan_string(r); + elseif isa(r, 'double') + result = scan_numeric(r); + elseif isa(r, 'logical') + result = scan_logical(r); + elseif isa(r, 'java.util.Date') + result = scan_datetime(r); + elseif isa(r, 'java.util.List') + result = scan_list(r); + elseif isa(r, 'java.util.Map') + result = scan_map(r); + else + error(['Unknown data type: ' class(r)]); + end; +end + +%-------------------------------------------------------------------------- +% Transforms Java String to MATLAB char +% +function result = scan_string(r) + result = char(r); +end + +%-------------------------------------------------------------------------- +% Transforms Java double to MATLAB double +% +function result = scan_numeric(r) + result = double(r); +end + +%-------------------------------------------------------------------------- +% Transforms Java boolean to MATLAB logical +% +function result = scan_logical(r) + result = logical(r); +end + +%-------------------------------------------------------------------------- +% Transforms Java Date class to MATLAB DateTime class +% +function result = scan_datetime(r) + result = DateTime(r); +end + +%-------------------------------------------------------------------------- +% Transforms Java List to MATLAB cell column running scan(...) recursively +% for all ListS items. +% +function result = scan_list(r) + result = cell(r.size(),1); + it = r.iterator(); + ii = 1; + while it.hasNext() + i = it.next(); + result{ii} = scan(i); + ii = ii + 1; + end; +end + +%-------------------------------------------------------------------------- +% Transforms Java Map to MATLAB struct running scan(...) recursively for +% content of every Map field. +% When there is field, which is recognized to be the >import keyword<, an +% attempt is made to import file given by the field content. +% +% The result of import is so far stored as a content of the item named 'import'. +% +function result = scan_map(r) + it = r.keySet().iterator(); + while it.hasNext() + next = it.next(); + i = next; + ich = char(i); + if iskw_import(ich) + result.(ich) = perform_import(r.get(java.lang.String(ich))); + else + result.(genvarname(ich)) = scan(r.get(java.lang.String(ich))); + end; + end; + if not(exist('result','var')) + result={}; + end +end + +%-------------------------------------------------------------------------- +% Determines whether r contains a keyword denoting import. +% +function result = iskw_import(r) + result = isequal(r, 'import'); +end + +%-------------------------------------------------------------------------- +% Transforms input hierarchy the usual way. If the result is char, then +% tries to load file denoted by this char. If the result is cell then tries +% to do just mentioned for each cellS item. +% +function result = perform_import(r) + r = scan(r); + if iscell(r) && all(cellfun(@ischar, r)) + result = cellfun(@load_yaml, r, 'UniformOutput', 0); + elseif ischar(r) + result = {load_yaml(r)}; + else + disp(r); + error(['Importer does not unterstand given filename. '... + 'Invalid node displayed above.']); + end; +end + +%-------------------------------------------------------------------------- +% Sets verbosity level for all load_yaml infos. +% +function setverblevel(level) + global verbose_readyaml; + verbose_readyaml = 0; + if exist('level','var') + verbose_readyaml = level; + end; +end + +%-------------------------------------------------------------------------- +% Returns current verbosity level. +% +function result = getverblevel() + global verbose_readyaml; + result = verbose_readyaml; +end + +%-------------------------------------------------------------------------- +% For debugging purposes. Displays a message as level is more than or equal +% the current verbosity level. +% +function info(level, text, value_to_display) + if getverblevel() >= level + fprintf(text); + if exist('value_to_display','var') + disp(value_to_display); + else + fprintf('\n'); + end; + end; +end +%========================================================================== + diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file1.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file1.yaml new file mode 100644 index 0000000..4e9cb13 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file1.yaml @@ -0,0 +1,2 @@ +f1a: 47 +f1b: 78 \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file2.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file2.yaml new file mode 100644 index 0000000..5f7b001 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file2.yaml @@ -0,0 +1,2 @@ +f2a: 99 +f2b: 111 diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file3.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file3.yaml new file mode 100644 index 0000000..c5dcc51 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file3.yaml @@ -0,0 +1,2 @@ +f3a: 999 +f3b: 142 \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file4.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file4.yaml new file mode 100644 index 0000000..dae7148 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/file4.yaml @@ -0,0 +1,2 @@ +f4a: 123 +f4b: 456 diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import.mat new file mode 100644 index 0000000..f4f26e6 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import.yaml new file mode 100644 index 0000000..ca60ada --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import.yaml @@ -0,0 +1,7 @@ + - import: + - ../test_primitives/time.yaml + - ../test_inheritance/inheritance.yaml + #- ..\test_primitives\time_variants.yaml + - import: [../test_primitives/matrices.yaml, ../test_primitives/sequence_mapping.yaml] + + diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_def.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_def.mat new file mode 100644 index 0000000..00e7d05 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_def.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_def.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_def.yaml new file mode 100644 index 0000000..9fd7491 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_def.yaml @@ -0,0 +1,5 @@ +import: + - file1.yaml + - file2.yaml + - file3.yaml + - file4.yaml \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_nonex.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_nonex.yaml new file mode 100644 index 0000000..eb9e5e4 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/import_nonex.yaml @@ -0,0 +1,7 @@ +import: + - time_variants.yaml + - inheritance.yaml + - non-exists.yaml +import: [matrices.yaml, sequence_mapping.yaml, non-ex.yaml] + + diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/selftest_report.html b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/selftest_report.html new file mode 100644 index 0000000..816e078 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/selftest_report.html @@ -0,0 +1 @@ + ::SELFTEST REPORT::

Selftest report from:05-Oct-2012 09:59:21

test_ReadYaml

test_ReadYaml:

Passed

test_RY_FloatingPoints:

Failed, Crash

test_RY_Import:

Failed, Crash

test_RY_ImportDef:

Failed, Crash

test_RY_ImportNonex:

Failed, Crash

test_RY_Indentation:

Failed, Crash

test_RY_Inheritance:

Failed, Crash

test_RY_InheritanceLoop:

Failed, Crash

test_RY_InheritanceMultiple:

Failed, Crash

test_RY_Matrices:

Failed, Crash

test_RY_SequenceMapping:

Failed, Crash

test_RY_Simple:

Failed, Crash

test_RY_Time:

Failed, Crash

test_RY_TimeVariants:

Failed, Crash

test_RY_usecase_01:

Failed, Crash

test_WriteYaml

test_WriteYaml:

Passed

test_WY_ComplexStructure:

Passed

test_WY_FloatingPoints:

Passed

test_WY_Indentation:

Passed

test_WY_Matrices:

Passed

test_WY_SequenceMapping:

Passed

test_WY_Simple:

Passed

test_WY_Time:

Passed

test_WY_usecase_01:

Failed, Wrong values loaded
\ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/~temporary.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/~temporary.yaml new file mode 100644 index 0000000..4c88bd4 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_import/~temporary.yaml @@ -0,0 +1,594 @@ +in: +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 01_q_Conv, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 03_q_Conv, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_01_RadiantCeiling, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_02_RadiantCeiling, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_03_RadiantCeiling, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_01_RadiantCeiling, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_03_RadiantCeiling, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 07_q_Conv, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 09_q_Conv, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_07_RadiantCeiling, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_08_RadiantCeiling, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_09_RadiantCeiling, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_07_RadiantCeiling, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_09_RadiantCeiling, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 04_q_Conv, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1700.0, + Delta: 85.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 06_q_Conv, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2385.0, + Delta: 119.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_04_RadiantCeiling, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_05_RadiantCeiling, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_06_RadiantCeiling, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_04_RadiantCeiling, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_06_RadiantCeiling, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 19_q_Conv, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 850.0, + Delta: 42.5} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 21_q_Conv, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_19_RadiantCeiling, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_20_RadiantCeiling, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_21_RadiantCeiling, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_19_RadiantCeiling, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_21_RadiantCeiling, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 16_q_Conv, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 18_q_Conv, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_16_RadiantCeiling, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_17_RadiantCeiling, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_18_RadiantCeiling, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_16_RadiantCeiling, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_18_RadiantCeiling, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 22_q_Conv, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 24_q_Conv, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_22_RadiantCeiling, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_23_RadiantCeiling, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_24_RadiantCeiling, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_22_RadiantCeiling, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_24_RadiantCeiling, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 10_q_Conv, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1700.0, + Delta: 85.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 12_q_Conv, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2650.0, + Delta: 132.5} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_10_RadiantCeiling, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_11_RadiantCeiling, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_12_RadiantCeiling, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_10_RadiantCeiling, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_12_RadiantCeiling, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 13_q_Conv, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 850.0, + Delta: 42.5} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 15_q_Conv, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_13_RadiantCeiling, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_14_RadiantCeiling, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_15_RadiantCeiling, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_13_RadiantCeiling, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_15_RadiantCeiling, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +out: +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_ML_ME, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_ML_OS, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_ML_MI, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_ML_UN, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_ML_ME, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_ML_MI, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_ML_MI, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_ML_ME, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +dist: +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 01_03_A1_OL_SO_equip, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 02_03_A1_ML_ME_equip, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 03_03_A1_IL_OS_equip, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 01_03_A1_OL_SO_occup, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 02_03_A1_ML_ME_occup, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 03_03_A1_IL_OS_occup, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 01_03_A1_OL_SO_light, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 02_03_A1_ML_ME_light, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 03_03_A1_IL_OS_light, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_ML_ME, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 07_03_B1_OL_MI_equip, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 08_03_B1_ML_OS_equip, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 09_03_B1_IL_OS_equip, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 07_03_B1_OL_MI_occup, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 08_03_B1_ML_OS_occup, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 09_03_B1_IL_OS_occup, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 07_03_B1_OL_MI_light, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 08_03_B1_ML_OS_light, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 09_03_B1_IL_OS_light, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_ML_OS, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 04_03_A2_OL_SO_equip, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 05_03_A2_ML_MI_equip, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 06_03_A2_IL_MI_equip, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 04_03_A2_OL_SO_occup, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 05_03_A2_ML_MI_occup, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 06_03_A2_IL_MI_occup, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 04_03_A2_OL_SO_light, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 05_03_A2_ML_MI_light, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 06_03_A2_IL_MI_light, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_ML_MI, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 19_03_D1_OL_SO_equip, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 21_03_D1_IL_MI_equip, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 19_03_D1_OL_SO_occup, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 21_03_D1_IL_MI_occup, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 19_03_D1_OL_SO_light, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 20_03_D1_ML_UN_light, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 21_03_D1_IL_MI_light, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_ML_UN, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 16_03_C2_OL_MI_equip, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 17_03_C2_ML_ME_equip, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 18_03_C2_IL_OS_equip, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 16_03_C2_OL_MI_occup, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 17_03_C2_ML_ME_occup, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 18_03_C2_IL_OS_occup, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 16_03_C2_OL_MI_light, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 17_03_C2_ML_ME_light, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 18_03_C2_IL_OS_light, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_ML_ME, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 22_03_D2_OL_MI_equip, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 23_03_D2_ML_MI_equip, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 24_03_D2_IL_OS_equip, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 22_03_D2_OL_MI_occup, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 23_03_D2_ML_MI_occup, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 24_03_D2_IL_OS_occup, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 22_03_D2_OL_MI_light, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 23_03_D2_ML_MI_light, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 24_03_D2_IL_OS_light, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_ML_MI, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 10_03_B2_OL_SO_equip, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 11_03_B2_ML_MI_equip, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 12_03_B2_IL_OS_equip, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 10_03_B2_OL_SO_occup, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 11_03_B2_ML_MI_occup, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 12_03_B2_IL_OS_occup, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 10_03_B2_OL_SO_light, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 11_03_B2_ML_MI_light, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 12_03_B2_IL_OS_light, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_ML_MI, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 13_03_C1_OL_SO_equip, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 14_03_C1_ML_ME_equip, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 15_03_C1_IL_OS_equip, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 13_03_C1_OL_SO_occup, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 14_03_C1_ML_ME_occup, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 15_03_C1_IL_OS_occup, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 13_03_C1_OL_SO_light, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 14_03_C1_ML_ME_light, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 15_03_C1_IL_OS_light, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_ML_ME, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance.mat new file mode 100644 index 0000000..8c17a76 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance.yaml new file mode 100644 index 0000000..37a73fa --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance.yaml @@ -0,0 +1,49 @@ +cars: + - color: blue + label: JJ-XX-1500 + parent: + - manufacturer.skoda + - insurance.mandatory.Allianz + - insurance.optional.Kooperativa + + ins_note: IMPORTANT_1 + info: {aaa: 2} + + - color: red + label: DD-XX-1500 + ins_note: IMPORTANT_2 + parent : [ manufacturer.audi, insurance.mandatory.Allianz ] + +manufacturer: + skoda: + established: cca 1900 + place: MB + info: + aaa: 1 + bbb: 11 + audi: + established: cca 1900 + place: Germany + +insurance: + mandatory: + Allianz: + ins_price: 4000 + ins_unit : CZK + Kooperativa: + ins_price: 4100 + ins_unit : CZK + ins_note : umfty dumf + + optional: + CP: + ins_price: 1000 CZK + Kooperativa: + ins_price: 1100 CZK + + + + + + + diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_loop.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_loop.yaml new file mode 100644 index 0000000..aded224 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_loop.yaml @@ -0,0 +1,4 @@ +# loop in inheritance +students: + s1: { name: jan, parent: students.s2} + s2: { name: pepa, parent: students.s1} diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_multiple.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_multiple.mat new file mode 100644 index 0000000..4fab3f3 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_multiple.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_multiple.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_multiple.yaml new file mode 100644 index 0000000..a436b19 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_inheritance/inheritance_multiple.yaml @@ -0,0 +1,14 @@ +a: + v1: 10 + parent: [b,c] + +b: + w1: 111 + parent: d + +c: + w2: 798 + parent: d + +d: + x: 113 diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/bug6.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/bug6.yaml new file mode 100644 index 0000000..466dceb --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/bug6.yaml @@ -0,0 +1,8 @@ +# http://code.google.com/p/yamlmatlab/issues/detail?id=6 +# read-in this file in windows like environment +test: + - [16.0, 2.0, 3.0, 13.0] + - [5.0, 11.0, 10.0, 8.0] + - [9.0, 7.0, 6.0, 12.0] + - [4.0, 14.0, 15.0, 1.0] + diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/dos_CRLF.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/dos_CRLF.yaml new file mode 100644 index 0000000..656d628 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/dos_CRLF.yaml @@ -0,0 +1,8 @@ +american: + - Boston Red Sox + - Detroit Tigers + - New York Yankees +national: + - New York Mets + - Chicago Cubs + - Atlanta Braves diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/miscellaneous.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/miscellaneous.yaml new file mode 100644 index 0000000..bbd321a --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/miscellaneous.yaml @@ -0,0 +1,5 @@ +null: ~ +true: y +false: n +string: '12345' +foo: [] # see http://code.google.com/p/yamlmatlab/issues/detail?id=5 diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/spec_chars_utf8.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/spec_chars_utf8.yaml new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/spec_chars_utf8.yaml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/unix_LF.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/unix_LF.yaml new file mode 100644 index 0000000..656d628 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_misc/unix_LF.yaml @@ -0,0 +1,8 @@ +american: + - Boston Red Sox + - Detroit Tigers + - New York Yankees +national: + - New York Mets + - Chicago Cubs + - Atlanta Braves diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/floating_points.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/floating_points.mat new file mode 100644 index 0000000..7f55f68 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/floating_points.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/floating_points.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/floating_points.yaml new file mode 100644 index 0000000..d09d5f5 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/floating_points.yaml @@ -0,0 +1,6 @@ +canonical: 1.23015e+3 +exponential: 12.3015e+02 +sexagecimal: 20:30.15 +fixed: 1230.15 +negative_infinity: -.inf +not_a_number: .NaN diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/indentation.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/indentation.mat new file mode 100644 index 0000000..e9f09de Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/indentation.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/indentation.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/indentation.yaml new file mode 100644 index 0000000..9f66d88 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/indentation.yaml @@ -0,0 +1,7 @@ +name: Mark McGwire +accomplishment: > + Mark set a major league + home run record in 1998. +stats: | + 65 Home Runs + 0.278 Batting Average diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/matrices.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/matrices.mat new file mode 100644 index 0000000..f7f71b5 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/matrices.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/matrices.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/matrices.yaml new file mode 100644 index 0000000..e33ea22 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/matrices.yaml @@ -0,0 +1,13 @@ +--- +Matrix1: [[1, 5],[1 , 3]] +Matrix2: + - [2 , 3] + - [4 , 5] +ColVect: + - [1] + - [2] +RowVect: [1, 2] +... + + + diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/sequence_mapping.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/sequence_mapping.mat new file mode 100644 index 0000000..6573e04 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/sequence_mapping.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/sequence_mapping.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/sequence_mapping.yaml new file mode 100644 index 0000000..a9ffc95 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/sequence_mapping.yaml @@ -0,0 +1,11 @@ +sequence: + - + name: Mark McGwire + hr: 65 + avg: 0.278 + - + name: Sammy Sosa + hr: [63, 43] + avg: + - 0.288 + - 12 diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/simple.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/simple.mat new file mode 100644 index 0000000..0473803 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/simple.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/simple.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/simple.yaml new file mode 100644 index 0000000..8759cf3 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/simple.yaml @@ -0,0 +1,3 @@ +- {name: John Smith, age: 33} +- name: Mary Smith + age: 27 \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time.mat new file mode 100644 index 0000000..47f81d6 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time.yaml new file mode 100644 index 0000000..bd9e428 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time.yaml @@ -0,0 +1,3 @@ +Data: + B1_S_SW: + [!!timestamp '2011-03-29T18:09:20.4543750+02:00', 23.80] \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time_variants.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time_variants.mat new file mode 100644 index 0000000..7f9a48b Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time_variants.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time_variants.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time_variants.yaml new file mode 100644 index 0000000..8af7932 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/time_variants.yaml @@ -0,0 +1,8 @@ +canonical: !!timestamp 2001-12-15T02:59:43.1Z +iso8601: !!timestamp 2001-12-14t21:59:43.10-05:00 +spaced: !!timestamp 2001-12-14 21:59:43.10 -5 +date: !!timestamp 2002-12-14 +matrix: + - [!!timestamp '2001-12-15T02:59:43.1Z', 1] + - [!!timestamp '2001-12-15T03:59:43.1Z', 2] + diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/usecase_struct_01.mat b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/usecase_struct_01.mat new file mode 100644 index 0000000..97bd8fc Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/usecase_struct_01.mat differ diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/usecase_struct_01.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/usecase_struct_01.yaml new file mode 100644 index 0000000..d6c9aad --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/usecase_struct_01.yaml @@ -0,0 +1,566 @@ +in: +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 01_q_Conv, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 03_q_Conv, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_01_RadiantCeiling, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_02_RadiantCeiling, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_03_RadiantCeiling, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_01_RadiantCeiling, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_03_RadiantCeiling, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 07_q_Conv, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 09_q_Conv, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_07_RadiantCeiling, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_08_RadiantCeiling, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_09_RadiantCeiling, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_07_RadiantCeiling, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_09_RadiantCeiling, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 04_q_Conv, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1700.0, + Delta: 85.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 06_q_Conv, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2385.0, + Delta: 119.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_04_RadiantCeiling, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_05_RadiantCeiling, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_06_RadiantCeiling, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_04_RadiantCeiling, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_06_RadiantCeiling, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 19_q_Conv, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 850.0, + Delta: 42.5} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 21_q_Conv, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_19_RadiantCeiling, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_20_RadiantCeiling, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_21_RadiantCeiling, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_19_RadiantCeiling, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_21_RadiantCeiling, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 16_q_Conv, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 18_q_Conv, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_16_RadiantCeiling, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_17_RadiantCeiling, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_18_RadiantCeiling, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_16_RadiantCeiling, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_18_RadiantCeiling, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 22_q_Conv, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 24_q_Conv, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_22_RadiantCeiling, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_23_RadiantCeiling, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_24_RadiantCeiling, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_22_RadiantCeiling, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_24_RadiantCeiling, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 10_q_Conv, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1700.0, + Delta: 85.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 12_q_Conv, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2650.0, + Delta: 132.5} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_10_RadiantCeiling, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_11_RadiantCeiling, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_12_RadiantCeiling, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_10_RadiantCeiling, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_12_RadiantCeiling, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 13_q_Conv, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 850.0, + Delta: 42.5} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 15_q_Conv, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_13_RadiantCeiling, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_14_RadiantCeiling, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_15_RadiantCeiling, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_13_RadiantCeiling, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_15_RadiantCeiling, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +out: +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_ML_ME, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_ML_OS, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_ML_MI, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_ML_UN, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_ML_ME, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_ML_MI, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_ML_MI, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_ML_ME, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +dist: +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 01_03_A1_OL_SO_equip, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 02_03_A1_ML_ME_equip, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 03_03_A1_IL_OS_equip, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 01_03_A1_OL_SO_occup, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 02_03_A1_ML_ME_occup, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 03_03_A1_IL_OS_occup, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 01_03_A1_OL_SO_light, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 02_03_A1_ML_ME_light, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 03_03_A1_IL_OS_light, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_ML_ME, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 07_03_B1_OL_MI_equip, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 08_03_B1_ML_OS_equip, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 09_03_B1_IL_OS_equip, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 07_03_B1_OL_MI_occup, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 08_03_B1_ML_OS_occup, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 09_03_B1_IL_OS_occup, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 07_03_B1_OL_MI_light, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 08_03_B1_ML_OS_light, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 09_03_B1_IL_OS_light, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_ML_OS, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: ODBT, VariableCategory: Outdoor Dry Bulb Temperature, Identifier: Environment_Outdoor_Dry_Bulb, + ZoneName: Environment, ZoneID: '', VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 04_03_A2_OL_SO_equip, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 05_03_A2_ML_MI_equip, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 06_03_A2_IL_MI_equip, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 04_03_A2_OL_SO_occup, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 05_03_A2_ML_MI_occup, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 06_03_A2_IL_MI_occup, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 04_03_A2_OL_SO_light, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 05_03_A2_ML_MI_light, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 06_03_A2_IL_MI_light, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_ML_MI, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 19_03_D1_OL_SO_equip, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 21_03_D1_IL_MI_equip, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 19_03_D1_OL_SO_occup, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 21_03_D1_IL_MI_occup, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 19_03_D1_OL_SO_light, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 20_03_D1_ML_UN_light, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 21_03_D1_IL_MI_light, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_ML_UN, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: ODBT, VariableCategory: Outdoor Dry Bulb Temperature, Identifier: Environment_Outdoor_Dry_Bulb, + ZoneName: Environment, ZoneID: '', VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 16_03_C2_OL_MI_equip, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 17_03_C2_ML_ME_equip, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 18_03_C2_IL_OS_equip, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 16_03_C2_OL_MI_occup, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 17_03_C2_ML_ME_occup, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 18_03_C2_IL_OS_occup, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 16_03_C2_OL_MI_light, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 17_03_C2_ML_ME_light, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 18_03_C2_IL_OS_light, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_ML_ME, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 22_03_D2_OL_MI_equip, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 23_03_D2_ML_MI_equip, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 24_03_D2_IL_OS_equip, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 22_03_D2_OL_MI_occup, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 23_03_D2_ML_MI_occup, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 24_03_D2_IL_OS_occup, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 22_03_D2_OL_MI_light, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 23_03_D2_ML_MI_light, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 24_03_D2_IL_OS_light, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_ML_MI, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: ODBT, VariableCategory: Outdoor Dry Bulb Temperature, Identifier: Environment_Outdoor_Dry_Bulb, + ZoneName: Environment, ZoneID: '', VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 10_03_B2_OL_SO_equip, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 11_03_B2_ML_MI_equip, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 12_03_B2_IL_OS_equip, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 10_03_B2_OL_SO_occup, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 11_03_B2_ML_MI_occup, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 12_03_B2_IL_OS_occup, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 10_03_B2_OL_SO_light, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 11_03_B2_ML_MI_light, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 12_03_B2_IL_OS_light, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_ML_MI, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 13_03_C1_OL_SO_equip, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 14_03_C1_ML_ME_equip, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 15_03_C1_IL_OS_equip, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 13_03_C1_OL_SO_occup, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 14_03_C1_ML_ME_occup, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 15_03_C1_IL_OS_occup, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 13_03_C1_OL_SO_light, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 14_03_C1_ML_ME_light, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 15_03_C1_IL_OS_light, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_ML_ME, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: ODBT, VariableCategory: Outdoor Dry Bulb Temperature, Identifier: Environment_Outdoor_Dry_Bulb, + ZoneName: Environment, ZoneID: '', VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} diff --git a/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/whitespaces.yaml b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/whitespaces.yaml new file mode 100644 index 0000000..ea016fe --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/Data/test_primitives/whitespaces.yaml @@ -0,0 +1,3 @@ +YAML: 1.0 +Image file: 00032009.jpg +Contours count: 8 \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/selftest_report.html b/libraries/YAMLMatlab_0.4.3/Tests/selftest_report.html new file mode 100644 index 0000000..12bf79b --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/selftest_report.html @@ -0,0 +1 @@ + ::SELFTEST REPORT::

Selftest report from:05-Oct-2012 10:08:53

test_ReadYaml

test_ReadYaml:

Passed

test_RY_FloatingPoints:

Passed

test_RY_Import:

Passed

test_RY_ImportDef:

Passed

test_RY_ImportNonex:

Passed

test_RY_Indentation:

Passed

test_RY_Inheritance:

Passed

test_RY_InheritanceLoop:

Passed

test_RY_InheritanceMultiple:

Passed

test_RY_Matrices:

Passed

test_RY_SequenceMapping:

Passed

test_RY_Simple:

Passed

test_RY_Time:

Passed

test_RY_TimeVariants:

Passed

test_RY_Whitespaces:

Passed

test_RY_usecase_01:

Passed

test_WriteYaml

test_WriteYaml:

Passed

test_WY_ComplexStructure:

Passed

test_WY_FloatingPoints:

Passed

test_WY_Indentation:

Passed

test_WY_Matrices:

Passed

test_WY_SequenceMapping:

Passed

test_WY_Simple:

Passed

test_WY_Time:

Passed

test_WY_usecase_01:

Failed, Wrong values loaded
\ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/selftest_yamlmatlab.m b/libraries/YAMLMatlab_0.4.3/Tests/selftest_yamlmatlab.m new file mode 100644 index 0000000..10353c4 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/selftest_yamlmatlab.m @@ -0,0 +1,95 @@ +function selftest_yamlmatlab(varargin) +% This function tests consistency of YAMLMatlab, by default, the results +% are stored in selftest_report.html in current work folder. +% Example +% >> selftest_yamlmatlab() +% >> selftest_yamlmatlab(outFileName) +% +% %====================================================================== +%{ + Copyright (c) 2011 + This program is a result of a joined cooperation of Energocentrum + PLUS, s.r.o. and Czech Technical University (CTU) in Prague. + The program is maintained by Energocentrum PLUS, s.r.o. and + licensed under the terms of MIT license. Full text of the license + is included in the program release. + + Author(s): + Jiri Cigler, Dept. of Control Engineering, CTU Prague + Jan Siroky, Energocentrum PLUS s.r.o. + + Implementation and Revisions: + + Auth Date Description of change + ---- --------- ------------------------------------------------- + jc 25-May-11 First implementation +%} +%====================================================================== + + fprintf('Running tests.\n'); + outFname = 'selftest_report.html'; + if numel(varargin) + outFname = varargin{1}; + end + + outStr = getHTMLHeader(); + + outStr = strcat(outStr,'

Selftest report from:',datestr(now),'

'); + + tests = dir([fileparts(which('selftest_yamlmatlab')) filesep 'test*.m']); + + for test=tests' + [~,func]=fileparts(test.name); + + fhandle = str2func(func); + stat = fhandle(); + + outStr = strcat(outStr, '

',func, '

', stat2html(stat,func),'
'); + + end + + outStr = strcat(outStr,''); + + + fid = fopen(outFname,'w'); + fprintf(fid,outStr); + fclose(fid); + + fprintf('Opening internal browser.\n'); + + web(outFname,'-new'); +end + +function html = stat2html(stat,name) + if not(isstruct(stat)) + error('Input argument must be a struct'); + end + + html = ''; + + fn = fieldnames(stat); + if all(ismember({'ok','desc'},fn)) + if stat.ok + flag = 'Passed'; + else + flag = 'Failed,'; + end + html = strcat(html,'

',name,':

', flag, ' ', stat.desc,'
' ); + end + html = [html, '']; + for test = setdiff(fn',{'ok','desc'}) + html = [html, '']; + html = strcat(html, stat2html(stat.(test{1}),test{1})); + html = [html, '']; + end + html = [html, '
']; +end + + +function str = getHTMLHeader() + str = [ '' ... + ' ' ... + ''... + '::SELFTEST REPORT::'... + '']; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/test_ReadYaml.m b/libraries/YAMLMatlab_0.4.3/Tests/test_ReadYaml.m new file mode 100644 index 0000000..5dbf6f4 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/test_ReadYaml.m @@ -0,0 +1,351 @@ +function stat = test_ReadYaml() +% this function tests reading in the yaml file + +stat.ok = 1; +stat.desc = ''; +try + %stat.test_ReadYaml_SimpleStructure = test_ReadYaml_SimpleStructure(); + %stat.test_ReadYaml_DateTime = test_ReadYaml_DateTime(); + fprintf('Testing read '); + stat.test_RY_Matrices = test_RY_Matrices(); + fprintf('.'); + stat.test_RY_Whitespaces = test_RY_Whitespaces(); + fprintf('.'); + stat.test_RY_FloatingPoints = test_RY_FloatingPoints(); + fprintf('.'); + stat.test_RY_Indentation = test_RY_Indentation(); + fprintf('.'); + stat.test_RY_SequenceMapping = test_RY_SequenceMapping(); + fprintf('.'); + stat.test_RY_Simple = test_RY_Simple(); + fprintf('.'); + stat.test_RY_Time = test_RY_Time(); + fprintf('.'); + stat.test_RY_TimeVariants = test_RY_TimeVariants(); + fprintf('.'); + stat.test_RY_Import = test_RY_Import(); + fprintf('.'); + stat.test_RY_ImportDef = test_RY_ImportDef(); + fprintf('.'); + stat.test_RY_ImportNonex = test_RY_ImportNonex(); + fprintf('.'); + stat.test_RY_Inheritance = test_RY_Inheritance(); + fprintf('.'); + stat.test_RY_InheritanceMultiple = test_RY_InheritanceMultiple(); + fprintf('.'); + stat.test_RY_InheritanceLoop = test_RY_InheritanceLoop(); + fprintf('.'); + stat.test_RY_usecase_01 = test_RY_usecase_01(); + fprintf('.\n'); + +catch + stat.ok = 0; + stat.desc = 'Program crash'; +end + +end + +function result = PTH_PRIMITIVES() + result = sprintf('Data%stest_primitives%s',filesep,filesep); +end + +function result = PTH_IMPORT() + result = sprintf('Data%stest_import%s',filesep,filesep); +end + +function result = PTH_INHERITANCE() + result = sprintf('Data%stest_inheritance%s',filesep,filesep); +end + +function stat = test_RY_Matrices() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'matrices.yaml']); + tv = load([PTH_PRIMITIVES() 'matrices.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_FloatingPoints() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'floating_points.yaml']); + tv = load([PTH_PRIMITIVES() 'floating_points.mat']); + if ~isequalwithequalnans(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_Indentation() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'indentation.yaml']); + tv = load([PTH_PRIMITIVES() 'indentation.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_SequenceMapping() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'sequence_mapping.yaml']); + tv = load([PTH_PRIMITIVES() 'sequence_mapping.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_Simple() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'simple.yaml']); + tv = load([PTH_PRIMITIVES() 'simple.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_Time() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'time.yaml']); + tv = load([PTH_PRIMITIVES() 'time.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_TimeVariants() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'time_variants.yaml']); + tv = load([PTH_PRIMITIVES() 'time_variants.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_Import() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_IMPORT() 'import.yaml']); + tv = load([PTH_IMPORT() 'import.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_ImportDef() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_IMPORT() 'import_def.yaml']); + tv = load([PTH_IMPORT() 'import_def.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_ImportNonex() + stat.ok = 0; + stat.desc = 'Did not end with any exception.'; + try + try + ry = ReadYaml([PTH_IMPORT() 'import_nonex.yaml'],1); + catch ex + if strcmp(ex.identifier, 'MATLAB:MATYAML:FileNotFound') + stat.desc = ''; + stat.ok = 1; + else + rethrow(ex); + end; + end; + + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_Inheritance() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_INHERITANCE() 'inheritance.yaml']); + tv = load([PTH_INHERITANCE() 'inheritance.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_InheritanceMultiple() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_INHERITANCE() 'inheritance_multiple.yaml']); + tv = load([PTH_INHERITANCE() 'inheritance_multiple.mat']); + if ~isequal(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_InheritanceLoop() + stat.ok = 0; + stat.desc = 'Did not end with any exception.'; + try + try + ry = ReadYaml([PTH_INHERITANCE() 'inheritance_loop.yaml']); + catch ex + if strcmp(ex.identifier, 'MATLAB:MATYAML:inheritedtwice') + stat.desc = ''; + stat.ok = 1; + else + rethrow(ex); + end; + end; + + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_Whitespaces() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'whitespaces.yaml']); + if ~isfield(ry,'ImageFile') || ~isfield(ry,'ContoursCount') + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + +function stat = test_RY_usecase_01() + stat.ok = 1; + stat.desc = ''; + try + ry = ReadYaml([PTH_PRIMITIVES() 'usecase_struct_01.yaml']); + tv = load([PTH_PRIMITIVES() 'usecase_struct_01.mat']); + if ~isequalwithequalnans(ry, tv.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end + + +function stat = test_ReadYaml_SimpleStructure() + +stat.ok = 1; +stat.desc = ''; +try + s = ReadYaml('simple.yaml'); + + ages = [s.age]; + + if not(isequal([33 27], ages)) || not(all(ismember({'John Smith', 'Mary Smith'}, {s.name}) )) + stat.desc = ' Wrong values loaded'; + stat.ok = 0; + end + +catch + stat.desc = 'Program crash'; + stat.ok = 0; +end + + +end + +function stat = test_ReadYaml_DateTime() + +stat.ok = 1; +stat.desc = ''; +try + s = ReadYaml('time.yaml'); + + if ~isa(s.Data.B1_S_SW{1},'DateTime') + stat.desc = ' Wrong data type of datetick'; + stat.ok = 0; + end + if isa(s.Data.B1_S_SW{2},'DateTime') + stat.desc = ' Wrong data type of datetick'; + stat.ok = 0; + end +catch + stat.desc = 'Program crash'; + stat.ok = 0; +end +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/test_WriteYaml.m b/libraries/YAMLMatlab_0.4.3/Tests/test_WriteYaml.m new file mode 100644 index 0000000..65af685 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/test_WriteYaml.m @@ -0,0 +1,57 @@ +function stat = test_WriteYaml() + +stat.ok = 1; +stat.desc = ''; +try + fprintf('Testing write '); + stat.test_WY_Matrices = test_WY_Universal(PTH_PRIMITIVES(), 'matrices'); + fprintf('.'); + stat.test_WY_FloatingPoints = test_WY_Universal(PTH_PRIMITIVES(), 'floating_points'); + fprintf('.'); + stat.test_WY_Indentation = test_WY_Universal(PTH_PRIMITIVES(), 'indentation'); + fprintf('.'); + stat.test_WY_SequenceMapping = test_WY_Universal(PTH_PRIMITIVES(), 'sequence_mapping'); + fprintf('.'); + stat.test_WY_Simple = test_WY_Universal(PTH_PRIMITIVES(), 'simple'); + fprintf('.'); + stat.test_WY_Time = test_WY_Universal(PTH_PRIMITIVES(), 'time'); + fprintf('.'); + stat.test_WY_ComplexStructure = test_WY_Universal(PTH_IMPORT(), 'import'); + fprintf('.'); + stat.test_WY_usecase_01 = test_WY_Universal(PTH_PRIMITIVES(), 'usecase_struct_01'); + fprintf('.\n'); +catch + stat.ok = 0; + stat.desc = 'Program crash'; +end + +end + +function result = PTH_PRIMITIVES() + result = sprintf('Data%stest_primitives%s',filesep,filesep); +end + +function result = PTH_IMPORT() + result = sprintf('Data%stest_import%s',filesep,filesep); +end + +function result = PTH_INHERITANCE() + result = sprintf('Data%stest_inheritance%s',filesep,filesep); +end + +function stat = test_WY_Universal(path, filename) + stat.ok = 1; + stat.desc = ''; + try + data = load([path, filesep, filename, '.mat']); + WriteYaml('~temporary.yaml',data.testval); + ry = ReadYaml('~temporary.yaml'); + if ~isequalwithequalnans(ry, data.testval) + stat.desc = 'Wrong values loaded'; + stat.ok = 0; + end; + catch + stat.ok = 0; + stat.desc = 'Crash'; + end; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/Tests/~temporary.yaml b/libraries/YAMLMatlab_0.4.3/Tests/~temporary.yaml new file mode 100644 index 0000000..4c88bd4 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/Tests/~temporary.yaml @@ -0,0 +1,594 @@ +in: +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 01_q_Conv, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 03_q_Conv, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_01_RadiantCeiling, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_02_RadiantCeiling, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_03_RadiantCeiling, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_01_RadiantCeiling, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_03_RadiantCeiling, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 07_q_Conv, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 09_q_Conv, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_07_RadiantCeiling, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_08_RadiantCeiling, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_09_RadiantCeiling, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_07_RadiantCeiling, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_09_RadiantCeiling, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 04_q_Conv, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1700.0, + Delta: 85.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 06_q_Conv, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2385.0, + Delta: 119.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_04_RadiantCeiling, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_05_RadiantCeiling, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_06_RadiantCeiling, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_04_RadiantCeiling, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_06_RadiantCeiling, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 19_q_Conv, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 850.0, + Delta: 42.5} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 21_q_Conv, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_19_RadiantCeiling, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_20_RadiantCeiling, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_21_RadiantCeiling, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_19_RadiantCeiling, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_21_RadiantCeiling, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 16_q_Conv, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 18_q_Conv, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_16_RadiantCeiling, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_17_RadiantCeiling, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_18_RadiantCeiling, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_16_RadiantCeiling, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_18_RadiantCeiling, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 22_q_Conv, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2380.0, + Delta: 119.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 24_q_Conv, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1325.0, + Delta: 66.25} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_22_RadiantCeiling, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_23_RadiantCeiling, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_24_RadiantCeiling, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_22_RadiantCeiling, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_24_RadiantCeiling, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +- - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 10_q_Conv, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1700.0, + Delta: 85.0} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 12_q_Conv, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 2650.0, + Delta: 132.5} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_10_RadiantCeiling, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_11_RadiantCeiling, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_12_RadiantCeiling, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_10_RadiantCeiling, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_12_RadiantCeiling, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 13_q_Conv, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 850.0, + Delta: 42.5} + - - {VarCategoryId: Q_CONV, VariableCategory: Convector heating rate, Identifier: 15_q_Conv, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: 1060.0, + Delta: 53.0} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_13_RadiantCeiling, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_14_RadiantCeiling, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPCR, VariableCategory: Zone Ceiling Panel Cooling Rate, Identifier: Hydronic_Low_Temp_Radiant_Cooling_Rate_15_RadiantCeiling, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_13_RadiantCeiling, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} + - - {VarCategoryId: ZCPHR, VariableCategory: Zone Ceiling Panel Heating Rate, Identifier: Hydronic_Low_Temp_Radiant_Heating_Rate_15_RadiantCeiling, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SI, Unit: W, MinValue: 0.0, MaxValue: .NaN, + Delta: .NaN} +out: +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_ML_ME, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_ML_OS, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_ML_MI, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_ML_UN, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_ML_ME, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_ML_MI, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +- - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_ML_MI, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_ML_ME, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: ZT, VariableCategory: Zone Temperature, Identifier: Zone_Mean_Air_Temperature_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: SO, Unit: degC, MinValue: .NaN, + MaxValue: 200.0} + - - {VarCategoryId: totEPD, VariableCategory: Total Energy Power Demand, Identifier: Total Energy Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} + - - {VarCategoryId: totHPD, VariableCategory: Total Heat Power Demand, Identifier: Total Heat Power Demand, + ZoneName: '-', ZoneID: '-', VarType: SO, Unit: W, MinValue: 0.0, MaxValue: .NaN} +dist: +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 01_03_A1_OL_SO_equip, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 02_03_A1_ML_ME_equip, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 03_03_A1_IL_OS_equip, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 01_03_A1_OL_SO_occup, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 02_03_A1_ML_ME_occup, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 03_03_A1_IL_OS_occup, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 01_03_A1_OL_SO_light, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 02_03_A1_ML_ME_light, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 03_03_A1_IL_OS_light, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_ML_ME, + ZoneName: 03_A1_ML_ME, ZoneID: '02', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A1_IL_OS, + ZoneName: 03_A1_IL_OS, ZoneID: '03', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A1_OL_SO, + ZoneName: 03_A1_OL_SO, ZoneID: '01', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 07_03_B1_OL_MI_equip, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 08_03_B1_ML_OS_equip, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 09_03_B1_IL_OS_equip, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 07_03_B1_OL_MI_occup, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 08_03_B1_ML_OS_occup, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 09_03_B1_IL_OS_occup, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 07_03_B1_OL_MI_light, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 08_03_B1_ML_OS_light, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 09_03_B1_IL_OS_light, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_ML_OS, + ZoneName: 03_B1_ML_OS, ZoneID: '08', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B1_IL_OS, + ZoneName: 03_B1_IL_OS, ZoneID: '09', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B1_OL_MI, + ZoneName: 03_B1_OL_MI, ZoneID: '07', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 04_03_A2_OL_SO_equip, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 05_03_A2_ML_MI_equip, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 06_03_A2_IL_MI_equip, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 04_03_A2_OL_SO_occup, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 05_03_A2_ML_MI_occup, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 06_03_A2_IL_MI_occup, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 04_03_A2_OL_SO_light, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 05_03_A2_ML_MI_light, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 06_03_A2_IL_MI_light, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_ML_MI, + ZoneName: 03_A2_ML_MI, ZoneID: '05', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A2_IL_MI, + ZoneName: 03_A2_IL_MI, ZoneID: '06', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_A2_OL_SO, + ZoneName: 03_A2_OL_SO, ZoneID: '04', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 19_03_D1_OL_SO_equip, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 21_03_D1_IL_MI_equip, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 19_03_D1_OL_SO_occup, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 21_03_D1_IL_MI_occup, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 19_03_D1_OL_SO_light, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 20_03_D1_ML_UN_light, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 21_03_D1_IL_MI_light, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_ML_UN, + ZoneName: 03_D1_ML_UN, ZoneID: '20', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D1_IL_MI, + ZoneName: 03_D1_IL_MI, ZoneID: '21', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D1_OL_SO, + ZoneName: 03_D1_OL_SO, ZoneID: '19', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 16_03_C2_OL_MI_equip, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 17_03_C2_ML_ME_equip, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 18_03_C2_IL_OS_equip, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 16_03_C2_OL_MI_occup, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 17_03_C2_ML_ME_occup, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 18_03_C2_IL_OS_occup, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 16_03_C2_OL_MI_light, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 17_03_C2_ML_ME_light, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 18_03_C2_IL_OS_light, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_ML_ME, + ZoneName: 03_C2_ML_ME, ZoneID: '17', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C2_IL_OS, + ZoneName: 03_C2_IL_OS, ZoneID: '18', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C2_OL_MI, + ZoneName: 03_C2_OL_MI, ZoneID: '16', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 22_03_D2_OL_MI_equip, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 23_03_D2_ML_MI_equip, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 24_03_D2_IL_OS_equip, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 22_03_D2_OL_MI_occup, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 23_03_D2_ML_MI_occup, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 24_03_D2_IL_OS_occup, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 22_03_D2_OL_MI_light, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 23_03_D2_ML_MI_light, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 24_03_D2_IL_OS_light, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_ML_MI, + ZoneName: 03_D2_ML_MI, ZoneID: '23', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT11_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D2_IL_OS, + ZoneName: 03_D2_IL_OS, ZoneID: '24', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_D2_OL_MI, + ZoneName: 03_D2_OL_MI, ZoneID: '22', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' +- - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 10_03_B2_OL_SO_equip, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 11_03_B2_ML_MI_equip, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 12_03_B2_IL_OS_equip, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 10_03_B2_OL_SO_occup, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 11_03_B2_ML_MI_occup, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 12_03_B2_IL_OS_occup, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 10_03_B2_OL_SO_light, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 11_03_B2_ML_MI_light, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 12_03_B2_IL_OS_light, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_ML_MI, + ZoneName: 03_B2_ML_MI, ZoneID: '11', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B2_IL_OS, + ZoneName: 03_B2_IL_OS, ZoneID: '12', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_B2_OL_SO, + ZoneName: 03_B2_OL_SO, ZoneID: '10', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 13_03_C1_OL_SO_equip, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: 7 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 14_03_C1_ML_ME_equip, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: 2 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: EG, VariableCategory: Equipment Gains, Identifier: 15_03_C1_IL_OS_equip, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: 10 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 13_03_C1_OL_SO_occup, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 14_03_C1_ML_ME_occup, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: OG, VariableCategory: Occupancy Gains, Identifier: 15_03_C1_IL_OS_occup, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: '-', MinValue: '0', MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 13_03_C1_OL_SO_light, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 14_03_C1_ML_ME_light, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: LG, VariableCategory: Lighting Gains, Identifier: 15_03_C1_IL_OS_light, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: 6.6 W/m2, MinValue: '0', + MaxValue: '1'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_ML_ME, + ZoneName: 03_C1_ML_ME, ZoneID: '14', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: FP, VariableCategory: Fan Power, Identifier: FanPower_RLT10_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: W, MinValue: '0', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C1_IL_OS, + ZoneName: 03_C1_IL_OS, ZoneID: '15', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: SS, VariableCategory: SolarStuff, Identifier: SS_03_C1_OL_SO, + ZoneName: 03_C1_OL_SO, ZoneID: '13', VarType: V, Unit: W, MinValue: '-', MaxValue: '-'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_A_Core, + ZoneName: 03_A_Core, ZoneID: A, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_B_Core, + ZoneName: 03_B_Core, ZoneID: B, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_C_Core, + ZoneName: 03_C_Core, ZoneID: C, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - {VarCategoryId: CT, VariableCategory: Core Temperature, Identifier: Zone_Mean_Air_Temperature_03_D_Core, + ZoneName: 03_D_Core, ZoneID: D, VarType: V, Unit: degC, MinValue: '-', MaxValue: '200'} + - - VarCategoryId: ODBT + VariableCategory: Outdoor Dry Bulb Temperature + Identifier: Environment_Outdoor_Dry_Bulb + ZoneName: Environment + ZoneID: [] + VarType: V + Unit: degC + MinValue: '-' + MaxValue: '200' diff --git a/libraries/YAMLMatlab_0.4.3/WriteYaml.m b/libraries/YAMLMatlab_0.4.3/WriteYaml.m new file mode 100644 index 0000000..9777dbd --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/WriteYaml.m @@ -0,0 +1,269 @@ +%========================================================================== +% Recursively walks through a Matlab hierarchy and converts it to the +% hierarchy of java.util.ArrayListS and java.util.MapS. Then calls +% Snakeyaml to write it to a file. +%========================================================================= +function result = WriteYaml(filename, data, flowstyle) + if ~exist('flowstyle','var') + flowstyle = 0; + end; + if ~ismember(flowstyle, [0,1]) + error('Flowstyle must be 0,1 or empty.'); + end; + result = []; + [pth,~,~] = fileparts(mfilename('fullpath')); + try + import('org.yaml.snakeyaml.*'); + javaObject('Yaml'); + catch + dp = [pth filesep 'external' filesep 'snakeyaml-1.9.jar']; + if not(ismember(dp, javaclasspath ('-dynamic'))) + javaaddpath(dp); % javaaddpath clears global variables...!? + end + import('org.yaml.snakeyaml.*'); + end; + javastruct = scan(data); + dumperopts = DumperOptions(); + dumperopts.setLineBreak(... + javaMethod('getPlatformLineBreak',... + 'org.yaml.snakeyaml.DumperOptions$LineBreak')); + if flowstyle + classes = dumperopts.getClass.getClasses; + flds = classes(3).getDeclaredFields(); + fsfld = flds(1); + if ~strcmp(char(fsfld.getName), 'FLOW') + error(['Accessed another field instead of FLOW. Please correct',... + 'class/field indices (this error maybe caused by new snakeyaml version).']); + end; + dumperopts.setDefaultFlowStyle(fsfld.get([])); + end; + yaml = Yaml(dumperopts); + + output = yaml.dump(javastruct); + if ~isempty(filename) + fid = fopen(filename,'w'); + fprintf(fid,'%s',char(output) ); + fclose(fid); + else + result = output; + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan(r) + if ischar(r) + result = scan_char(r); + elseif iscell(r) + result = scan_cell(r); + elseif isord(r) + result = scan_ord(r); + elseif isstruct(r) + result = scan_struct(r); + elseif isnumeric(r) + result = scan_numeric(r); + elseif islogical(r) + result = scan_logical(r); + elseif isa(r,'DateTime') + result = scan_datetime(r); + else + error(['Cannot handle type: ' class(r)]); + end +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_numeric(r) + if isempty(r) + result = java.util.ArrayList(); + else + result = java.lang.Double(r); + end +end + +%-------------------------------------------------------------------------- +% +% + +function result = scan_logical(r) + if isempty(r) + result = java.util.ArrayList(); + else + result = java.lang.Boolean(r); + end +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_char(r) + if isempty(r) + result = java.util.ArrayList(); + else + result = java.lang.String(r); + end +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_datetime(r) + % datestr 30..in ISO8601 format + %java.text.SimpleDateFormat('yyyymmdd'T'HH:mm:ssz" ); + + [Y, M, D, H, MN,S] = datevec(double(r)); + result = java.util.GregorianCalendar(Y, M-1, D, H, MN,S); + result.setTimeZone(java.util.TimeZone.getTimeZone('UTC')); + + %tz = java.util.TimeZone.getTimeZone('UTC'); + %cal = java.util.GregorianCalendar(tz); + %cal.set + %result = java.util.Date(datestr(r)); +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_cell(r) + if(isrowvector(r)) + result = scan_cell_row(r); + elseif(iscolumnvector(r)) + result = scan_cell_column(r); + elseif(ismymatrix(r)) + result = scan_cell_matrix(r); + elseif(issingle(r)); + result = scan_cell_single(r); + elseif(isempty(r)) + result = java.util.ArrayList(); + else + error('Unknown cell content.'); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_ord(r) + if(isrowvector(r)) + result = scan_ord_row(r); + elseif(iscolumnvector(r)) + result = scan_ord_column(r); + elseif(ismymatrix(r)) + result = scan_ord_matrix(r); + elseif(issingle(r)) + result = scan_ord_single(r); + elseif(isempty(r)) + result = java.util.ArrayList(); + else + error('Unknown ordinary array content.'); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_cell_row(r) + result = java.util.ArrayList(); + for ii = 1:size(r,2) + result.add(scan(r{ii})); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_cell_column(r) + result = java.util.ArrayList(); + for ii = 1:size(r,1) + tmp = r{ii}; + if ~iscell(tmp) + tmp = {tmp}; + end; + result.add(scan(tmp)); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_cell_matrix(r) + result = java.util.ArrayList(); + for ii = 1:size(r,1) + i = r(ii,:); + result.add(scan_cell_row(i)); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_cell_single(r) + result = java.util.ArrayList(); + result.add(scan(r{1})); +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_ord_row(r) + result = java.util.ArrayList(); + for i = r + result.add(scan(i)); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_ord_column(r) + result = java.util.ArrayList(); + for i = 1:size(r,1) + result.add(scan_ord_row(r(i))); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_ord_matrix(r) + result = java.util.ArrayList(); + for i = r' + result.add(scan_ord_row(i')); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_ord_single(r) + result = java.util.ArrayList(); + for i = r' + result.add(r); + end; +end + + +%-------------------------------------------------------------------------- +% +% +function result = scan_struct(r) + result = java.util.LinkedHashMap(); + for i = fields(r)' + key = i{1}; + val = r.(key); + result.put(key,scan(val)); + end; +end + + + + + + + + + + + diff --git a/libraries/YAMLMatlab_0.4.3/datadump.m b/libraries/YAMLMatlab_0.4.3/datadump.m new file mode 100644 index 0000000..4f29120 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/datadump.m @@ -0,0 +1,39 @@ +function datadump(data) + recurse(data, 0, []); +end + +function result = recurse(data, level, addit) + indent = repmat(' | ',1,level); + if iscell(data) && ~ismymatrix(data) + result = iter_cell(data, level, addit); + elseif isstruct(data) + result = iter_struct(data, level, addit); + else + fprintf([indent,' +-Some data: ']); + disp(data); + result = data; + end; +end + +function result = iter_cell(data, level, addit) + indent = repmat(' | ',1,level); + result = {}; + fprintf([indent,'cell {\n']); + for i = 1:length(data) + result{i} = recurse(data{i}, level + 1, addit); + end; + fprintf([indent,'} cell\n']); +end + +function result = iter_struct(data, level, addit) + indent = repmat(' | ',1,level); + result = struct(); + fprintf([indent,'struct {\n']); + for i = fields(data)' + fld = char(i); + fprintf([indent,' +-field ',fld,':\n']); + result.(fld) = recurse(data.(fld), level + 1, addit); + end; + fprintf([indent,'} struct\n']); +end + diff --git a/libraries/YAMLMatlab_0.4.3/deflateimports.m b/libraries/YAMLMatlab_0.4.3/deflateimports.m new file mode 100644 index 0000000..c129a16 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/deflateimports.m @@ -0,0 +1,70 @@ +%========================================================================== +% Transforms structures: +% - import: A, B +% - import: C +% - import: D, E, F +% +% into: +% - import: A, B, C, D, F, F +% +%========================================================================== +function result = deflateimports(r) + result = recurse(r, 0, []); +end + +function result = recurse(data, level, addit) + if iscell(data) && ~ismymatrix(data) + result = iter_cell(data, level, addit); + elseif isstruct(data) + result = iter_struct(data, level, addit); + else + %disp(data); + result = data; + end; +end + +function result = iter_cell(data, level, addit) + result = {}; + icollect = {}; + ii = 1; + for i = 1:length(data) + datai = data{i}; + if issingleimport(datai) + if ~iscell(datai.import) + datai.import = {datai.import}; + end; + for j = 1:length(datai.import) + icollect{end + 1} = datai.import{j}; + end; + else + result{ii} = recurse(datai, level + 1, addit); + ii = ii + 1; + end; + end; + if ~isempty(icollect) + result{end + 1} = struct('import',{icollect}); + end; +end + +function result = iter_struct(data, level, addit) + result = struct(); + for i = fields(data)' + fld = char(i); + result.(fld) = recurse(data.(fld), level + 1, addit); + end; +end + +function result = issingleimport_all(r) + result = all(cellfun(@issingleimport, r)); +end + +function result = issingleimport(r) + result = isstruct(r) && length(fields(r)) == 1 && isfield(r, 'import'); +end + +function result = addall(list1, list2) + for i = 1:length(list2) + list1{end + 1} = list2{i}; + end; + result = list1; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/doinheritance.m b/libraries/YAMLMatlab_0.4.3/doinheritance.m new file mode 100644 index 0000000..25ae805 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/doinheritance.m @@ -0,0 +1,106 @@ +%========================================================================== +% Searches through some hierarchy and performs inheritance. Whenever finds +% struct field named 'parent' it tries to find all points, defined by its +% content and uses them as the struct ancestors. Example: +% +% Given: +% +% s.a.a = 1 +% s.a.b = 2 +% s.a.parent: 'b' +% +% s.b.a = 3 +% s.b.c = 4 +% +% the result of r = doinheritance(s) is: +% +% r.a = 1 +% r.c = 4 +% r.b = 2 +% r.parent = 'b' +% +% Multiple inheritance is allowed using cell array of parent point strings +% instead of one simple string. +% +%========================================================================== +function result = doinheritance(r, tr) + if ~exist('tr','var') + tr = r; + end; + result = recurse(r, 0, {tr}); +end + +function result = recurse(data, level, addit) + if iscell(data) && ~ismymatrix(data) + result = iter_cell(data, level, addit); + elseif isstruct(data) + result = iter_struct(data, level, addit); + else + result = data; + end; +end + +function result = iter_cell(data, level, addit) + result = {}; + for i = 1:length(data) + result{i} = recurse(data{i}, level + 1, addit); + end; + + for i = 1:length(data) + if isstruct(result{i}) && isfield(result{i}, kwd_parent()) + result{i} = inherit(result{i}, result{i}.(kwd_parent()), [], addit{1}, {}); % !!! + end; + end; +end + +function result = iter_struct(data, level, addit) + result = data; + for i = fields(data)' + fld = char(i); + result.(fld) = recurse(data.(fld), level + 1, addit); + end; + + for i = fields(result)' + fld = char(i); + if isstruct(result.(fld)) && isfield(result.(fld), kwd_parent()) + result.(fld) = inherit(result.(fld), result.(fld).(kwd_parent()), [], addit{1}, {}); + end; + end; +end + +function result = inherit(child, parent_chr, container, oaroot, loc_imported) + result = child; + if ~iscell(parent_chr) + parent_chr = {parent_chr}; + end; + for i = length(parent_chr):-1:1 + if contains(loc_imported, parent_chr{i}) + error('MATLAB:MATYAML:inheritedtwice',['Cyclic inheritance: ', parent_chr{i}]); + end; + try + parentstruct = eval(['oaroot.',parent_chr{i}]); + catch ex + switch ex.identifier + case {'MATLAB:nonExistentField', 'MATLAB:badsubscript'} + error('MATLAB:MATYAML:NonExistentParent', ['Parent was not found: ',parent_chr{i}]); + end; + rethrow(ex); + end; + if isstruct(parentstruct) && isfield(parentstruct, kwd_parent()) + next_loc_imported = loc_imported; + next_loc_imported{end + 1} = parent_chr{i}; + result = merge_struct(inherit(parentstruct, parentstruct.(kwd_parent()), [], oaroot, next_loc_imported), result, {'import'}); + end; + result = merge_struct(parentstruct, result, {'import'}); + end; +end + +function result = contains(list, chr) + for i = 1:length(list) + if strcmp(list{i}, chr) + result = true; + return; + end; + end; + result = false; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/dosubstitution.m b/libraries/YAMLMatlab_0.4.3/dosubstitution.m new file mode 100644 index 0000000..3b9d598 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/dosubstitution.m @@ -0,0 +1,36 @@ +%========================================================================== + +%========================================================================== +function result = dosubstitution(r, dictionary) + if ~exist('dictionary','var') + dictionary = {}; + end; + result = recurse(r, 0, dictionary); +end + +function result = recurse(data, level, dictionary) + if iscell(data) && ~ismymatrix(data) + result = iter_cell(data, level, dictionary); + elseif isstruct(data) + result = iter_struct(data, level, dictionary); + elseif ischar(data) && isfield(dictionary, data) + result = dictionary.(data); + else + result = data; + end; +end + +function result = iter_cell(data, level, dictionary) + result = {}; + for i = 1:length(data) + result{i} = recurse(data{i}, level + 1, dictionary); + end; +end + +function result = iter_struct(data, level, dictionary) + result = data; + for i = fields(data)' + fld = char(i); + result.(fld) = recurse(data.(fld), level + 1, dictionary); + end; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/external/LICENSE-2.0.txt b/libraries/YAMLMatlab_0.4.3/external/LICENSE-2.0.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/external/LICENSE-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libraries/YAMLMatlab_0.4.3/external/snakeyaml-1.9.jar b/libraries/YAMLMatlab_0.4.3/external/snakeyaml-1.9.jar new file mode 100644 index 0000000..7e24a71 Binary files /dev/null and b/libraries/YAMLMatlab_0.4.3/external/snakeyaml-1.9.jar differ diff --git a/libraries/YAMLMatlab_0.4.3/extras/GetYamlVals.m b/libraries/YAMLMatlab_0.4.3/extras/GetYamlVals.m new file mode 100644 index 0000000..b3b69df --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/extras/GetYamlVals.m @@ -0,0 +1,28 @@ +function [vals, timeaxis] = GetYamlVals(yamldata) +% this function converts data formatted in yaml style (cells containing timestamps and values) +% into matlab user friendly matrices. + +% obtain number of samples +n = max(size(yamldata)); + +if n + if not(iscell(yamldata{1})) + timeaxis = double(yamldata{1}); + vals = cell2mat(yamldata(2:end)); + else + + % create output matrices + timeaxis = NaN*ones(n,1); + if n % only if there are some elements of timeaxis + vals = NaN*ones(n,numel(yamldata{1})-1); + end + for i=1:n + timeaxis(i) = double(yamldata{i}{1}); + vals(i,:) = cell2mat(yamldata{i}(2:end)); + end + end + +end + +end % end of function + diff --git a/libraries/YAMLMatlab_0.4.3/extras/TimeVals2Cell.m b/libraries/YAMLMatlab_0.4.3/extras/TimeVals2Cell.m new file mode 100644 index 0000000..54e9fef --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/extras/TimeVals2Cell.m @@ -0,0 +1,13 @@ +function s = TimeVals2Cell(time,datavalues,header) +% creates a typical struct with field named by header. Values are cell of +% date and vals. +% synopsis: +% s = TimeVals2Cell(time,datavalues,header) +if ~iscell(header) + header = {header}; +end + +for i=1:numel(header) + s.(header{i}) = [num2cell(DateTime(time)) num2cell(datavalues(:,i))]; +end +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/iscolumnvector.m b/libraries/YAMLMatlab_0.4.3/iscolumnvector.m new file mode 100644 index 0000000..750a303 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/iscolumnvector.m @@ -0,0 +1,3 @@ +function result = iscolumnvector(obj) + result = isvector(obj) && size(obj,2) == 1 && size(obj,1) > 1 && ndims(obj) == 2; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/ismymatrix.m b/libraries/YAMLMatlab_0.4.3/ismymatrix.m new file mode 100644 index 0000000..f37c062 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/ismymatrix.m @@ -0,0 +1,3 @@ +function result = ismymatrix(obj) + result = ndims(obj) == 2 && all(size(obj) > 1); +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/isord.m b/libraries/YAMLMatlab_0.4.3/isord.m new file mode 100644 index 0000000..4e1e384 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/isord.m @@ -0,0 +1,3 @@ +function result = isord(obj) + result = ~iscell(obj) && any(size(obj) > 1); +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/isrowvector.m b/libraries/YAMLMatlab_0.4.3/isrowvector.m new file mode 100644 index 0000000..5a14fc8 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/isrowvector.m @@ -0,0 +1,3 @@ +function result = isrowvector(obj) + result = isvector(obj) && size(obj,1) == 1 && size(obj,2) > 1 && ndims(obj) == 2; +end diff --git a/libraries/YAMLMatlab_0.4.3/issingle.m b/libraries/YAMLMatlab_0.4.3/issingle.m new file mode 100644 index 0000000..c39e104 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/issingle.m @@ -0,0 +1,3 @@ +function result = issingle(obj) + result = all(size(obj) == 1) ; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/kwd_parent.m b/libraries/YAMLMatlab_0.4.3/kwd_parent.m new file mode 100644 index 0000000..f2a1f27 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/kwd_parent.m @@ -0,0 +1,3 @@ +function result = kwd_parent() + result = 'parent'; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/makematrices.m b/libraries/YAMLMatlab_0.4.3/makematrices.m new file mode 100644 index 0000000..dfde364 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/makematrices.m @@ -0,0 +1,191 @@ +%========================================================================== +% Recursively walks through a Matlab hierarchy and substitutes cell vectors +% by a matrix when possible. +% Specifically substitutes cell objects like +% +% {{1,2,3},{4,5,6}} +% +% by +% +% {1,2,3;4,5,6} +% +% It leaves other objects unchanged except that it may change cell +% orientations (from column to row, etc.) +% +% Parameter makeords determines whether to convert from cells to normal +% matrices whenever possible (1) or leave matrices as cells (0). +%========================================================================== +function result = makematrices(r, makeords) + result = recurse(r, 0, [], makeords); +end + +%-------------------------------------------------------------------------- +% +% +function result = recurse(data, level, addit, makeords) + if iscell(data) + result = iter_cell(data, level, addit, makeords); + elseif isstruct(data) + result = iter_struct(data, level, addit, makeords); + else + result = scan_data(data, level, addit); + end; +end + +%-------------------------------------------------------------------------- +% Iterates through cell array data. A cell array here is treated as a +% simple sequence, hence it is processed regardless its shape. The array is +% transformed to a cell matrix if it satisfies following conditions: +% - It is vector +% - All its items are cells +% - All its items are vectors +% - All its items are alligned (are of the same size) +% - All its items are rows of a matrix (see ismatrixrow(...)) +% Otherwise the content is left unchanged. +% +function result = iter_cell(data, level, addit, makeords) + if isvector(data) && ... + iscell_all(data) && ... + isvector_all(data) && ... + isaligned_all(data) && ... + ismatrixrow_all(data) + + tmp = data; + tmp = cellfun(@cell2mat, tmp, 'UniformOutput', 0); + tmp = cellfun(@torow, tmp, 'UniformOutput', 0); + tmp = tocolumn(tmp); + tmp = cell2mat(tmp); + if ~makeords + tmp = num2cell(tmp); + end; + result = tmp; + elseif isempty(data) + result = []; + else + result = {}; + for i = 1:length(data) + result{i} = recurse(data{i}, level + 1, addit, makeords); + end; + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = iter_struct(data, level, addit, makeords) + result = struct(); + for i = fields(data)' + fld = char(i); + result.(fld) = recurse(data.(fld), level + 1, addit, makeords); + end; +end + +%-------------------------------------------------------------------------- +% +% +function result = scan_data(data, level, addit) + result = data; +end + +%-------------------------------------------------------------------------- +% +% +function result = iscell_all(cellvec) + result = all(cellfun(@iscell, cellvec)); +end + +%-------------------------------------------------------------------------- +% Determines whether all items of cellvec are of the same length. +% +function result = isaligned_all(cellvec) + siz = numel(cellvec{1}); + result = all(cellfun(@numel, cellvec) == siz); +end + +%-------------------------------------------------------------------------- +% +% +function result = ismatrixrow_all(cellvec) + result = all(cellfun(@ismatrixrow, cellvec)); +end + +%-------------------------------------------------------------------------- +% Determines whether cellvec can constitute a matrix row. The vector is a +% matrix row candidate if: +% - all of its items are numeric +% - all of its items are single (neither vectors nor matrices etc.) +% - all of its items are compatible for concatenation to an ordinary +% vector (this is maybe automatically reached by isnumeric_all) +% +function result = ismatrixrow(cellvec) + result = ... + (isnumeric_all(cellvec) || islogical_all(cellvec) || isstruct_all(cellvec)) && ... + issingle_all(cellvec) && ... + iscompatible_all(cellvec); +end + +%-------------------------------------------------------------------------- +% +% +function result = isnumeric_all(cellvec) + result = all(cellfun(@isnumeric, cellvec)); +end + +%-------------------------------------------------------------------------- +% +% +function result = islogical_all(cellvec) + result = all(cellfun(@islogical, cellvec)); +end + +%-------------------------------------------------------------------------- +% +% +function result = issingle_all(cellvec) + result = all(cellfun(@issingle, cellvec)); +end + +%-------------------------------------------------------------------------- +% +% +function result = iscompatible_all(cellvec) + result = true; + for i = 1:(length(cellvec) - 1) + result = result && iscompatible(cellvec{i}, cellvec{i + 1}); + end +end + +%-------------------------------------------------------------------------- +% +% +function result = iscompatible(obj1, obj2) + result = isequal(class(obj1), class(obj2)); +end + +%-------------------------------------------------------------------------- +% +% +function result = isvector_all(cellvec) + result = all(cellfun(@isvector, cellvec)); +end + +%-------------------------------------------------------------------------- +% +% +function result = isstruct_all(cellvec) + result = all(cellfun(@isstruct, cellvec)); +end + +%-------------------------------------------------------------------------- +% +% +function result = torow(vec) + result = tocolumn(vec).'; +end + +%-------------------------------------------------------------------------- +% +% +function result = tocolumn(vec) + result = vec(:); +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/merge_struct.m b/libraries/YAMLMatlab_0.4.3/merge_struct.m new file mode 100644 index 0000000..5a6c044 --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/merge_struct.m @@ -0,0 +1,43 @@ + +%-------------------------------------------------------------------------- +% Does merge of two structures. The result is structure which is union of +% fields of p and s. If there are equal field names in p and s, fields in p +% are overwriten with their peers from s. +% +function result = merge_struct(p, s, donotmerge, deep) + if ~( isstruct(p) && isstruct(s) ) + error('Only structures can be merged.'); + end; + if ~exist('donotmerge','var') + donotmerge = {}; + end + if ~exist('deep','var') + deep = 0; + elseif strcmp(deep, 'deep') + deep = 1; + end; + + + + result = p; + for i = fields(s)' + fld = char(i); + if any(cellfun(@(x)isequal(x, fld), donotmerge)) + continue; + end; + % if isfield(result, fld) + % % Just give the user a hint that there may be some information + % % lost. + % fprintf(['Overwriting field ',fld,'\n']); + % end; + %disp('Assigning:') + %disp(['fieldname: ',fld]); + %disp(s.(fld)); + %disp('----------'); + if deep == 1 && isfield(result, fld) && isstruct(result.(fld)) && isstruct(s.(fld)) + result.(fld) = merge_struct(result.(fld), s.(fld), donotmerge, deep); + else + result.(fld) = s.(fld); + end; + end; +end \ No newline at end of file diff --git a/libraries/YAMLMatlab_0.4.3/mergeimports.m b/libraries/YAMLMatlab_0.4.3/mergeimports.m new file mode 100644 index 0000000..49c059e --- /dev/null +++ b/libraries/YAMLMatlab_0.4.3/mergeimports.m @@ -0,0 +1,124 @@ +%========================================================================== +% Walks through a tree structure data. Whenever it finds a structure, which +% have field named 'import' it assumes that in that field is a cell array +% and merges all structures found in that array. Parameter verb is used for +% debugging purposes. +%========================================================================== +function result = mergeimports(data, verb) + if ~exist('verb','var') + verb = 0; + end; + result = recurse(data, 0, [], verb); +end + +%-------------------------------------------------------------------------- +% Recursion dispatcher, calls appropriate method for cell/structure or +% displays data if the parameter data is not of mentioned type. +% addit ... for possible future use, now unused +% verb ... for debugging +% +function result = recurse(data, level, addit, verb) + indent = repmat(' | ',1,level); % for debugging + if iscell(data) + result = iter_cell(data, level, addit, verb); + elseif isstruct(data) + result = iter_struct(data, level, addit, verb); + else + if any(verb == 1) % for debugging + fprintf([indent,'Some data: ']); + disp(data); + end; + result = data; + end; +end + +%-------------------------------------------------------------------------- +% Walks through a cell array and calls recurse on every field. +% data ... Assumed to be a cell. Data to be walked. +% level ... Level in the tree, root has zero. +% addit, verb ... for debugging +% +function result = iter_cell(data, level, addit, verb) + indent = repmat(' | ',1,level); % for debugging + result = {}; + if any(verb == 1); fprintf([indent,'cell {\n']); end; % for debugging + for i = 1:length(data) + itemcontent = recurse(data{i}, level + 1, addit, verb); + result{end + 1} = itemcontent; + end; + if any(verb == 1); fprintf([indent,'} cell\n']); end; % for debugging +end + +%-------------------------------------------------------------------------- +% Walks through a struct and calls recurse on every field. If there is a +% field called 'import' it calls process_import_field on its content. Then +% merges processed import with the rest of the structure. Meaning of all +% parameters is similar to those of iter_cell. +% +function result = iter_struct(data, level, addit, verb) + indent = repmat(' | ',1,level); % for debugging + result = struct(); + collected_imports = {}; + if any(verb == 1); fprintf([indent,'struct {\n']); end; % for debugging + for i = fields(data)' + fld = char(i); + if any(verb == 1); fprintf([indent,' +-field ',fld,':\n']); end; % for debugging + result.(fld) = recurse(data.(fld), level + 1, addit, verb); + % Tree back-pass - all potential underlying imports were processed, + % so process import here, if needed. + if isequal(fld, 'import') + processed_import = process_import_field(result.(fld)); + result = rmfield(result, 'import'); + if isstruct(processed_import) + collected_imports{end+1} = processed_import; + % It is maybe useless to collect imports to the array since + % there can be only one field named 'import' per structure. + % collected_imports is proposed to be changed to a simple + % variable. + else + % One of imports was not a struct. In following versions it + % probably won't be an error and will merge to a cell with + % structs. + disp(processed_import); + error('Expected struct, otherwise it cannot be merged with the rest.'); + end; + end; + end; + for i = 1:length(collected_imports) + result = merge_struct(result, collected_imports{i}, {}, 'deep'); + end; + if any(verb == 1); fprintf([indent,'} struct\n']); end; % for debugging +end + +%-------------------------------------------------------------------------- +% Walks through the data parameter, which is assumed to be a cell. Merges +% all structures in that cell and returns them as a struct or possibly as a +% cell of merged struct and unmeregeable data. +% +function result = process_import_field(data) + if iscell(data) + merged_structs = struct(); + collected_nonstruct = {}; + for i = 1:length(data) + if isstruct(data{i}) + merged_structs = merge_struct(merged_structs, data{i}, {}, 'deep'); + else + collected_nonstruct{end+1} = data{i}; + end; + end; + if isempty(collected_nonstruct) + result = merged_structs; + elseif isempty(merged_structs) + result = collected_nonstruct; + else + result = {merged_structs; collected_nonstruct}; + end; + else + % For clarity and simplicity, the whole transformation is done so + % that every import field in a struct is cell array even there is + % only one object to be imported. + error('BUG: import field should always contain a cell.'); + end; +end + +%========================================================================== \ No newline at end of file