1 | md=triangle(model(),'../Exp/Square.exp',150000.);
|
---|
2 | md=setmask(md,'../Exp/SquareShelf.exp','');
|
---|
3 | md=parameterize(md,'../Par/SquareSheetShelf.par');
|
---|
4 | md=setflowequation(md,'macayeal','all');
|
---|
5 | md.cluster=generic('name',oshostname(),'np',3);
|
---|
6 | md.materials.rho_ice=10^7; %involved in the mass flux, make it easy
|
---|
7 | md.geometry.thickness(:)=1; %make it easy
|
---|
8 |
|
---|
9 | %constrain all velocities to 1 m/yr, in the y-direction
|
---|
10 | md.diagnostic.spcvx(:)=0;
|
---|
11 | md.diagnostic.spcvy(:)=1;
|
---|
12 | md.diagnostic.spcvz(:)=0;
|
---|
13 |
|
---|
14 | %Dakota options
|
---|
15 | md.qmu.variables.drag_coefficient=normal_uncertain('scaled_FrictionCoefficient',1,0.01);
|
---|
16 |
|
---|
17 | md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
18 | md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
19 | md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
20 | md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
21 | md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
22 | md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
23 | md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
24 | md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
|
---|
25 |
|
---|
26 | %mass flux profiles
|
---|
27 | 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'};
|
---|
28 | md.qmu.mass_flux_profile_directory=pwd;
|
---|
29 |
|
---|
30 |
|
---|
31 | %% nond_sampling study
|
---|
32 |
|
---|
33 | md.qmu.method =dakota_method('nond_samp');
|
---|
34 | md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
|
---|
35 | 'seed',1234,...
|
---|
36 | 'samples',20,...
|
---|
37 | 'sample_type','lhs');
|
---|
38 |
|
---|
39 | %% a variety of parameters
|
---|
40 | md.qmu.params.evaluation_concurrency=1;
|
---|
41 | md.qmu.params.analysis_driver='';
|
---|
42 | md.qmu.params.analysis_components='';
|
---|
43 |
|
---|
44 | %partitioning
|
---|
45 | md.qmu.numberofpartitions=20;
|
---|
46 | md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
|
---|
47 | md.qmu.partition=md.qmu.partition-1;
|
---|
48 | md.qmu.isdakota=1;
|
---|
49 |
|
---|
50 | md.diagnostic.reltol=10^-5; %tighten for qmu analyses
|
---|
51 |
|
---|
52 | md=solve(md,DiagnosticSolutionEnum(),'overwrite','y');
|
---|
53 |
|
---|
54 | %Fields and tolerances to track changes
|
---|
55 | md.qmu.results=md.results.dakota;
|
---|
56 |
|
---|
57 | %ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
|
---|
58 | %we recover those mass fluxes through the mean of the response.
|
---|
59 | %also, we recover the max velo, which should be 1m/yr.
|
---|
60 | %we put all that data in the montecarlo field, which we will use to test for success.
|
---|
61 | %also, check that the stddev are 0.
|
---|
62 | md.results.dakota.montecarlo=[];
|
---|
63 | for i=1:8,
|
---|
64 | md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).mean];
|
---|
65 | end
|
---|
66 | for i=1:8,
|
---|
67 | md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).stddev];
|
---|
68 | end
|
---|
69 | field_names ={'montecarlo'};
|
---|
70 | field_tolerances={1e-11};
|
---|
71 | field_values={...
|
---|
72 | md.results.dakota.montecarlo,...
|
---|
73 | };
|
---|