[19105] | 1 | %Test Name: SquareSheetShelfDiadSSA3dDakotaSamp
|
---|
[13975] | 2 | md=triangle(model(),'../Exp/Square.exp',150000.);
|
---|
[9641] | 3 | md=setmask(md,'../Exp/SquareShelf.exp','');
|
---|
[5118] | 4 | md=parameterize(md,'../Par/SquareSheetShelf.par');
|
---|
[16137] | 5 | md=setflowequation(md,'SSA','all');
|
---|
[8589] | 6 | md.cluster=generic('name',oshostname(),'np',3);
|
---|
[9636] | 7 | md.materials.rho_ice=10^7; %involved in the mass flux, make it easy
|
---|
[9691] | 8 | md.geometry.thickness(:)=1; %make it easy
|
---|
[20500] | 9 | md.geometry.surface=md.geometry.base+md.geometry.thickness;
|
---|
[5118] | 10 |
|
---|
| 11 | %constrain all velocities to 1 m/yr, in the y-direction
|
---|
[16137] | 12 | md.stressbalance.spcvx(:)=0;
|
---|
| 13 | md.stressbalance.spcvy(:)=1;
|
---|
| 14 | md.stressbalance.spcvz(:)=0;
|
---|
[5118] | 15 |
|
---|
| 16 | %Dakota options
|
---|
[20500] | 17 |
|
---|
| 18 | %dakota version
|
---|
| 19 | version=IssmConfig('_DAKOTA_VERSION_'); version=version(1:3); version=str2num(version);
|
---|
| 20 |
|
---|
[25836] | 21 | %partitioning
|
---|
| 22 | npart=20;
|
---|
| 23 | partition=partitioner(md,'package','chaco','npart',npart,'weighting','on')-1;
|
---|
| 24 | md.qmu.isdakota=1;
|
---|
[5118] | 25 |
|
---|
[25836] | 26 | md.qmu.variables.drag_coefficient=normal_uncertain('descriptor','scaled_FrictionCoefficient',...
|
---|
| 27 | 'mean',ones(npart,1),...
|
---|
| 28 | 'stddev',.01*ones(npart,1),...
|
---|
| 29 | 'partition',partition);
|
---|
[5118] | 30 |
|
---|
[25836] | 31 | md.qmu.responses.MaxVel=response_function('descriptor','MaxVel');
|
---|
| 32 | md.qmu.responses.MassFlux1=response_function('descriptor','indexed_MassFlux_1');
|
---|
| 33 | md.qmu.responses.MassFlux2=response_function('descriptor','indexed_MassFlux_2');
|
---|
| 34 | md.qmu.responses.MassFlux3=response_function('descriptor','indexed_MassFlux_3');
|
---|
| 35 | md.qmu.responses.MassFlux4=response_function('descriptor','indexed_MassFlux_4');
|
---|
| 36 | md.qmu.responses.MassFlux5=response_function('descriptor','indexed_MassFlux_5');
|
---|
| 37 | md.qmu.responses.MassFlux6=response_function('descriptor','indexed_MassFlux_6');
|
---|
| 38 | md.qmu.responses.MassFlux7=response_function('descriptor','indexed_MassFlux_7');
|
---|
| 39 |
|
---|
[5118] | 40 | %mass flux profiles
|
---|
[11176] | 41 | 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'};
|
---|
[9652] | 42 | md.qmu.mass_flux_profile_directory=pwd;
|
---|
[5118] | 43 |
|
---|
| 44 |
|
---|
| 45 | %% nond_sampling study
|
---|
| 46 |
|
---|
[9652] | 47 | md.qmu.method =dakota_method('nond_samp');
|
---|
| 48 | md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
|
---|
[5118] | 49 | 'seed',1234,...
|
---|
| 50 | 'samples',20,...
|
---|
| 51 | 'sample_type','lhs');
|
---|
| 52 |
|
---|
| 53 | %% a variety of parameters
|
---|
[24313] | 54 | md.qmu.params.interval_type='forward';
|
---|
[18301] | 55 | md.qmu.params.direct=true;
|
---|
| 56 | md.qmu.params.tabular_graphics_data=true;
|
---|
[5118] | 57 |
|
---|
[20500] | 58 | if version>=6,
|
---|
| 59 | md.qmu.params.analysis_driver='matlab';
|
---|
| 60 | md.qmu.params.evaluation_scheduling='master';
|
---|
| 61 | md.qmu.params.processors_per_evaluation=2;
|
---|
| 62 | else
|
---|
| 63 | md.qmu.params.analysis_driver='stressbalance';
|
---|
| 64 | md.qmu.params.evaluation_concurrency=1;
|
---|
| 65 | end
|
---|
| 66 |
|
---|
| 67 |
|
---|
[5118] | 68 |
|
---|
[16137] | 69 | md.stressbalance.reltol=10^-5; %tighten for qmu analyses
|
---|
[5118] | 70 |
|
---|
[21341] | 71 | md=solve(md,'Stressbalance','overwrite','y');
|
---|
[5118] | 72 |
|
---|
| 73 | %Fields and tolerances to track changes
|
---|
[13021] | 74 | md.qmu.results=md.results.dakota;
|
---|
[5118] | 75 |
|
---|
| 76 | %ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
|
---|
| 77 | %we recover those mass fluxes through the mean of the response.
|
---|
| 78 | %also, we recover the max velo, which should be 1m/yr.
|
---|
| 79 | %we put all that data in the montecarlo field, which we will use to test for success.
|
---|
| 80 | %also, check that the stddev are 0.
|
---|
| 81 | md.results.dakota.montecarlo=[];
|
---|
[11176] | 82 | for i=1:8,
|
---|
[5118] | 83 | md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).mean];
|
---|
| 84 | end
|
---|
[11176] | 85 | for i=1:8,
|
---|
[5118] | 86 | md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).stddev];
|
---|
| 87 | end
|
---|
| 88 | field_names ={'montecarlo'};
|
---|
| 89 | field_tolerances={1e-11};
|
---|
| 90 | field_values={...
|
---|
| 91 | md.results.dakota.montecarlo,...
|
---|
| 92 | };
|
---|