1 | %Test Name: EarthSlr
|
---|
2 |
|
---|
3 | %mesh earth:
|
---|
4 | md=model;
|
---|
5 | md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %500 km resolution mesh
|
---|
6 | md.cluster.np=2
|
---|
7 |
|
---|
8 | %parameterize slr solution:
|
---|
9 | %slr loading: {{{
|
---|
10 | nt=100;
|
---|
11 | md.slr.deltathickness=zeros(md.mesh.numberofelements+1,nt);
|
---|
12 | md.slr.deltathickness(end,:)=2000.5:1:2099.5;
|
---|
13 | md.slr.sealevel=zeros(md.mesh.numberofvertices,1);
|
---|
14 | md.dsl.global_average_thermosteric_sea_level_change=[0;0];
|
---|
15 | md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
|
---|
16 | md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
|
---|
17 | %antarctica
|
---|
18 | late=sum(md.mesh.lat(md.mesh.elements),2)/3;
|
---|
19 | longe=sum(md.mesh.long(md.mesh.elements),2)/3;
|
---|
20 | posa=find(late <-80);
|
---|
21 | md.slr.deltathickness(posa,:)=-100;
|
---|
22 | %greenland
|
---|
23 | posg=find(late > 70 & late < 80 & longe>-60 & longe<-30);
|
---|
24 | md.slr.deltathickness(posg,:)=-100;
|
---|
25 |
|
---|
26 |
|
---|
27 | %elastic loading from love numbers:
|
---|
28 | nlov=101;
|
---|
29 | md.slr.love_h = love_numbers('h','CM'); md.slr.love_h(nlov+1:end)=[];
|
---|
30 | md.slr.love_k = love_numbers('k','CM'); md.slr.love_k(nlov+1:end)=[];
|
---|
31 | md.slr.love_l = love_numbers('l','CM'); md.slr.love_l(nlov+1:end)=[];
|
---|
32 |
|
---|
33 | %}}}
|
---|
34 | %mask: {{{
|
---|
35 | mask=gmtmask(md.mesh.lat,md.mesh.long);
|
---|
36 | icemask=ones(md.mesh.numberofvertices,1);
|
---|
37 | pos=find(mask==0); icemask(pos)=-1;
|
---|
38 | pos=find(sum(mask(md.mesh.elements),2)<3); icemask(md.mesh.elements(pos,:))=-1;
|
---|
39 | md.mask.ice_levelset=icemask;
|
---|
40 | md.mask.ocean_levelset=-icemask;
|
---|
41 |
|
---|
42 | %make sure that the elements that have loads are fully grounded:
|
---|
43 | pos=find(sum(md.slr.deltathickness(1:end-1,:),2));
|
---|
44 | md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
|
---|
45 |
|
---|
46 | %make sure wherever there is an ice load, that the mask is set to ice:
|
---|
47 | md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
|
---|
48 | % }}}
|
---|
49 |
|
---|
50 | md.slr.ocean_area_scaling=0;
|
---|
51 |
|
---|
52 | %Geometry for the bed, arbitrary:
|
---|
53 | md.geometry.bed=-ones(md.mesh.numberofvertices,1);
|
---|
54 |
|
---|
55 | %Materials:
|
---|
56 | md.materials=materials('hydro');
|
---|
57 |
|
---|
58 | %New stuff
|
---|
59 | md.slr.spcthickness = NaN(md.mesh.numberofvertices,1);
|
---|
60 | md.slr.hydro_rate = zeros(md.mesh.numberofvertices,1);
|
---|
61 |
|
---|
62 | %Miscellaneous
|
---|
63 | md.miscellaneous.name='test2002';
|
---|
64 |
|
---|
65 | %Solution parameters
|
---|
66 | md.slr.reltol=NaN;
|
---|
67 | md.slr.abstol=1e-3;
|
---|
68 | md.slr.geodetic=1;
|
---|
69 |
|
---|
70 | % max number of iteration reverted back to 10 (i.e., the original default value)
|
---|
71 | md.slr.maxiter=10;
|
---|
72 |
|
---|
73 | %initialize GIA:
|
---|
74 | md.gia=giamme();
|
---|
75 | md.gia.Ngia=ones(md.mesh.numberofvertices,10);
|
---|
76 | md.gia.Ugia=ones(md.mesh.numberofvertices,10);
|
---|
77 | for i=1:10,
|
---|
78 | md.gia.Ngia(i)=i;
|
---|
79 | md.gia.Ugia(i)=i;
|
---|
80 | end
|
---|
81 | md.gia.modelid=1;
|
---|
82 |
|
---|
83 | %Uncertainty Quantification%{{{
|
---|
84 | md.qmu.variables=struct();;
|
---|
85 |
|
---|
86 | ns=size(md.gia.Ngia,2);
|
---|
87 | ids=(1:(ns+1))';
|
---|
88 | p=rand(ns,1);
|
---|
89 | probs=[p(1:ns); 0]; probs=probs/sum(probs);
|
---|
90 | md.qmu.variables.giamodelid=histogram_bin_uncertain('GiaModelid',ns+1,ids,probs);
|
---|
91 |
|
---|
92 | %partitioning
|
---|
93 | npart=2;
|
---|
94 | partition=-ones(md.mesh.numberofelements,1);
|
---|
95 | partition(posg)=0;
|
---|
96 | partition(posa)=1;
|
---|
97 |
|
---|
98 | %variables:
|
---|
99 | md.qmu.variables.deltathickness=normal_uncertain('descriptor','scaled_SealevelriseDeltathickness',...
|
---|
100 | 'mean',ones(2,nt),...
|
---|
101 | 'stddev',[.1*ones(1,nt);.2*ones(1,nt)],...
|
---|
102 | 'partition',partition,'nsteps',nt);
|
---|
103 |
|
---|
104 | md.qmu.correlation_matrix=zeros(npart*nt,npart*nt);
|
---|
105 | for i=1:npart,
|
---|
106 | for j=1:nt,
|
---|
107 | indi=(i-1)*nt+j;
|
---|
108 | for k=1:npart,
|
---|
109 | for l=1:nt,
|
---|
110 | indj=(k-1)*nt+l;
|
---|
111 | if i~=k,
|
---|
112 | md.qmu.correlation_matrix(indi,indj)=0;
|
---|
113 | else
|
---|
114 | %same partition:
|
---|
115 | if j==l,
|
---|
116 | md.qmu.correlation_matrix(indi,indj)=1;
|
---|
117 | else
|
---|
118 | md.qmu.correlation_matrix(indi,indj)=.2;
|
---|
119 | end
|
---|
120 | end
|
---|
121 | end
|
---|
122 | end
|
---|
123 | end
|
---|
124 | end
|
---|
125 | md.qmu.correlation_matrix=[];
|
---|
126 |
|
---|
127 |
|
---|
128 |
|
---|
129 | %responses
|
---|
130 | md.qmu.responses.sealevel1=response_function('descriptor','Outputdefinition1');
|
---|
131 | md.qmu.responses.sealevel2=response_function('descriptor','Outputdefinition2');
|
---|
132 | md.qmu.responses.sealevel3=response_function('descriptor','Outputdefinition3');
|
---|
133 | md.qmu.responses.sealevel4=response_function('descriptor','Outputdefinition4');
|
---|
134 | md.qmu.responses.sealevel5=response_function('descriptor','Outputdefinition5');
|
---|
135 | md.qmu.responses.sealevel6=response_function('descriptor','Outputdefinition6');
|
---|
136 | md.qmu.responses.sealevel7=response_function('descriptor','Outputdefinition7');
|
---|
137 | md.qmu.responses.sealevel8=response_function('descriptor','Outputdefinition8');
|
---|
138 | md.qmu.responses.sealevel8=response_function('descriptor','Outputdefinition9');
|
---|
139 | md.qmu.responses.sealevel10=response_function('descriptor','Outputdefinition10');
|
---|
140 |
|
---|
141 | %output definitions:
|
---|
142 | for i=1:10,
|
---|
143 | if i==1,
|
---|
144 | md.outputdefinition.definitions={nodalvalue('name','SNode','definitionstring','Outputdefinition1', ...
|
---|
145 | 'model_string','Sealevel','node',i)};
|
---|
146 | else
|
---|
147 | md.outputdefinition.definitions{end+1}=nodalvalue('name','SNode','definitionstring',['Outputdefinition' num2str(i)], ...
|
---|
148 | 'model_string','Sealevel','node',i);
|
---|
149 | end
|
---|
150 | end
|
---|
151 | %algorithm:
|
---|
152 | md.qmu.method =dakota_method('nond_samp');
|
---|
153 | md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
|
---|
154 | 'seed',1234,...
|
---|
155 | 'samples',3,...
|
---|
156 | 'sample_type','lhs');
|
---|
157 |
|
---|
158 | %parameters
|
---|
159 | md.qmu.params.direct=true;
|
---|
160 | md.qmu.params.interval_type='forward';
|
---|
161 | md.qmu.params.analysis_driver='matlab';
|
---|
162 | md.qmu.params.evaluation_scheduling='master';
|
---|
163 | md.qmu.params.processors_per_evaluation=1;
|
---|
164 | md.qmu.params.tabular_graphics_data=true;
|
---|
165 | %}}}
|
---|
166 | md.qmu.output=1;
|
---|
167 |
|
---|
168 | %transient:
|
---|
169 | md.timestepping.start_time=2000;
|
---|
170 | md.timestepping.interp_forcings=0;
|
---|
171 | md.timestepping.final_time=2002;
|
---|
172 | md.transient.issmb=0;
|
---|
173 | md.transient.ismasstransport=0;
|
---|
174 | md.transient.isstressbalance=0;
|
---|
175 | md.transient.isthermal=0;
|
---|
176 | md.transient.isslr=1;
|
---|
177 | md.transient.isgia=1;
|
---|
178 | md.slr.requested_outputs= {'default',...
|
---|
179 | 'SealevelriseDeltathickness','Sealevel','SealevelRSLRate','SealevelriseCumDeltathickness',...
|
---|
180 | 'SealevelNEsaRate', 'SealevelUEsaRate', 'NGiaRate', 'UGiaRate',...
|
---|
181 | 'SealevelEustaticMask','SealevelEustaticOceanMask'};
|
---|
182 |
|
---|
183 | %hack:
|
---|
184 | md.geometry.thickness=ones(md.mesh.numberofvertices,1);
|
---|
185 | md.geometry.base=-ones(md.mesh.numberofvertices,1);
|
---|
186 | md.geometry.surface=zeros(md.mesh.numberofvertices,1);
|
---|
187 |
|
---|
188 | %eustatic + rigid + elastic + rotation run:
|
---|
189 | md.verbose=verbose('11111111111');
|
---|
190 | %md.verbose.qmu=1;
|
---|
191 | md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=1;
|
---|
192 | md.qmu.isdakota=1;
|
---|
193 | md=solve(md,'slr');
|
---|
194 |
|
---|