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