1 | %Test Name: SquareSheetShelfSteaEnthalpyHO3dDakotaSampNeff
|
---|
2 |
|
---|
3 | % TODO:
|
---|
4 | % - Figure out why test fails intermittently on Mac with "Index exceeds array bounds."
|
---|
5 | %
|
---|
6 |
|
---|
7 | md=triangle(model(),'../Exp/Square.exp',150000.);
|
---|
8 | md=setmask(md,'../Exp/SquareShelf.exp','');
|
---|
9 | md=parameterize(md,'../Par/SquareSheetShelf.par');
|
---|
10 | md=extrude(md,3,2.);
|
---|
11 | md=setflowequation(md,'HO','all');
|
---|
12 | md.cluster=generic('name',oshostname(),'np',3);
|
---|
13 | md.timestepping.time_step=0.;
|
---|
14 | md.thermal.isenthalpy=1;
|
---|
15 | md.thermal.isdynamicbasalspc=1;
|
---|
16 | md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
|
---|
17 | md.initialization.watercolumn=zeros(md.mesh.numberofvertices,1);
|
---|
18 |
|
---|
19 | md.friction.coupling=3;
|
---|
20 | md.friction.effective_pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness+md.materials.rho_water*md.constants.g*md.geometry.base;
|
---|
21 |
|
---|
22 | %dakota version
|
---|
23 | version=IssmConfig('_DAKOTA_VERSION_');
|
---|
24 | version=version(1:3);
|
---|
25 | version=str2num(version);
|
---|
26 |
|
---|
27 | %partitioning
|
---|
28 | npart=10;
|
---|
29 | partition=partitioner(md,'package','chaco','npart',npart,'weighting','on')-1;
|
---|
30 | md.qmu.isdakota=1;
|
---|
31 |
|
---|
32 | %variables
|
---|
33 | md.qmu.variables.neff=normal_uncertain('descriptor','scaled_FrictionEffectivePressure',...
|
---|
34 | 'mean',ones(npart,1),...
|
---|
35 | 'stddev',.05*ones(npart,1),...
|
---|
36 | 'partition',partition);
|
---|
37 | md.qmu.variables.geoflux=normal_uncertain('descriptor','scaled_BasalforcingsGeothermalflux',...
|
---|
38 | 'mean',ones(npart,1),...
|
---|
39 | 'stddev',.05*ones(npart,1),...
|
---|
40 | 'partition',partition);
|
---|
41 |
|
---|
42 | %responses
|
---|
43 | md.qmu.responses.MaxVel=response_function('descriptor','MaxVel');
|
---|
44 | md.qmu.responses.MassFlux1=response_function('descriptor','indexed_MassFlux_1');
|
---|
45 | md.qmu.responses.MassFlux2=response_function('descriptor','indexed_MassFlux_2');
|
---|
46 | md.qmu.responses.MassFlux3=response_function('descriptor','indexed_MassFlux_3');
|
---|
47 | md.qmu.responses.MassFlux4=response_function('descriptor','indexed_MassFlux_4');
|
---|
48 | md.qmu.responses.MassFlux5=response_function('descriptor','indexed_MassFlux_5');
|
---|
49 | md.qmu.responses.MassFlux6=response_function('descriptor','indexed_MassFlux_6');
|
---|
50 | md.qmu.responses.MassFlux7=response_function('descriptor','indexed_MassFlux_7');
|
---|
51 |
|
---|
52 | %mass flux profiles
|
---|
53 | md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp'};
|
---|
54 | md.qmu.mass_flux_profile_directory=pwd;
|
---|
55 |
|
---|
56 | md.qmu.method =dakota_method('nond_samp');
|
---|
57 | md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
|
---|
58 | 'seed',1234,...
|
---|
59 | 'samples',20,...
|
---|
60 | 'sample_type','random');
|
---|
61 |
|
---|
62 | %% a variety of parameters
|
---|
63 | md.qmu.params.direct=true;
|
---|
64 | md.qmu.params.analysis_components='';
|
---|
65 | md.qmu.params.tabular_graphics_data=true;
|
---|
66 |
|
---|
67 | if version>=6,
|
---|
68 | md.qmu.params.analysis_driver='matlab';
|
---|
69 | md.qmu.params.evaluation_scheduling='master';
|
---|
70 | md.qmu.params.processors_per_evaluation=2;
|
---|
71 | else
|
---|
72 | md.qmu.params.analysis_driver='stressbalance';
|
---|
73 | md.qmu.params.evaluation_concurrency=1;
|
---|
74 | end
|
---|
75 |
|
---|
76 |
|
---|
77 | md.stressbalance.reltol=10^-5; %tighten for qmu analyses
|
---|
78 |
|
---|
79 | md=solve(md,'Steadystate','overwrite','y');
|
---|
80 |
|
---|
81 | %Fields and tolerances to track changes
|
---|
82 | md.qmu.results=md.results.dakota;
|
---|
83 |
|
---|
84 | %we put all the mean and stdev data in the montecarlo field, which we will use to test for success.
|
---|
85 | md.results.dakota.montecarlo=[];
|
---|
86 | for i=1:8,
|
---|
87 | md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).mean];
|
---|
88 | end
|
---|
89 | for i=1:8,
|
---|
90 | md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).stddev];
|
---|
91 | end
|
---|
92 | field_names ={'montecarlo'};
|
---|
93 | field_tolerances={2e-10};
|
---|
94 | field_values={...
|
---|
95 | md.results.dakota.montecarlo,...
|
---|
96 | };
|
---|
97 |
|
---|