1 | %Test Name: SquareShelfSMBautoregression
|
---|
2 | md=triangle(model(),'../Exp/Square.exp',80000.);
|
---|
3 | md=setmask(md,'all','');
|
---|
4 | md=parameterize(md,'../Par/SquareShelfConstrained.par');
|
---|
5 | md=setflowequation(md,'SSA','all');
|
---|
6 | md.cluster=generic('name',oshostname(),'np',3);
|
---|
7 | md.transient.requested_outputs={'default','IceVolume','SmbMassBalance',};
|
---|
8 |
|
---|
9 | ymax = max(md.mesh.y);
|
---|
10 | xmax = max(md.mesh.x);
|
---|
11 | %Generate basin IDs for 3 basins
|
---|
12 | idbasin = zeros(md.mesh.numberofelements,1);
|
---|
13 | iid1 = find(md.mesh.y>=2/3*ymax);
|
---|
14 | iid2 = intersect(find(md.mesh.y<2/3*ymax),find(md.mesh.x>=1/3*xmax));
|
---|
15 | iid3 = intersect(find(md.mesh.y<2/3*ymax),find(md.mesh.x<1/3*xmax));
|
---|
16 | for ii=1:md.mesh.numberofelements
|
---|
17 | for vertex=1:3
|
---|
18 | if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
|
---|
19 | idbasin(ii) = 1;
|
---|
20 | end
|
---|
21 | end
|
---|
22 | if idbasin(ii)==0 %no vertex was found in basin 1
|
---|
23 | for vertex=1:3
|
---|
24 | if any(iid2==md.mesh.elements(ii,vertex)) %one vertex in basin 2
|
---|
25 | idbasin(ii) = 2;
|
---|
26 | end
|
---|
27 | end
|
---|
28 | end
|
---|
29 | if idbasin(ii)==0 %no vertex was found in basin 1 and 2
|
---|
30 | idbasin(ii) = 3;
|
---|
31 | end
|
---|
32 | end
|
---|
33 |
|
---|
34 | %SMB parameters
|
---|
35 | md.timestepping.start_time = 0;
|
---|
36 | md.timestepping.time_step = 1;
|
---|
37 | md.timestepping.final_time = 5;
|
---|
38 | md.smb = SMBautoregression();
|
---|
39 | md.smb.num_basins = 3; %number of basins
|
---|
40 | md.smb.basin_id = idbasin; %prescribe basin ID number to elements
|
---|
41 | md.smb.beta0 = [0.5,1.2,1.5]; %intercept values of SMB in basins [m ice eq./yr]
|
---|
42 | md.smb.beta1 = [0.0,0.01,-0.01]; %trend values of SMB in basins [m ice eq./yr^2]
|
---|
43 | md.smb.ar_initialtime = md.timestepping.start_time;
|
---|
44 | md.smb.ar_order = 4;
|
---|
45 | md.smb.ar_timestep = 2.0; %timestep of the autoregressive model [yr]
|
---|
46 | md.smb.phi = [[0.2,0.1,0.05,0.01];[0.4,0.2,-0.2,0.1];[0.4,-0.4,0.1,-0.1]];
|
---|
47 | md.smb.covmat = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]];
|
---|
48 | md.smb.randomflag = 0; %fixed random seeds
|
---|
49 |
|
---|
50 | md=solve(md,'Transient');
|
---|
51 |
|
---|
52 | %Fields and tolerances to track changes
|
---|
53 | field_names ={'Vx1','Vy1','Vel1','Thickness1','Volume1','SmbMassBalance1','Vx2','Vy2','Vel2','Thickness2','Volume2','SmbMassBalance2','Vx3','Vy3','Vel3','Thickness3','Volume3','SmbMassBalance3'};
|
---|
54 | field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
|
---|
55 | 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
|
---|
56 | 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
|
---|
57 | field_values={...
|
---|
58 | (md.results.TransientSolution(1).Vx),...
|
---|
59 | (md.results.TransientSolution(1).Vy),...
|
---|
60 | (md.results.TransientSolution(1).Vel),...
|
---|
61 | (md.results.TransientSolution(1).Pressure),...
|
---|
62 | (md.results.TransientSolution(1).Base),...
|
---|
63 | (md.results.TransientSolution(1).Surface),...
|
---|
64 | (md.results.TransientSolution(1).Thickness),...
|
---|
65 | (md.results.TransientSolution(1).IceVolume),...
|
---|
66 | (md.results.TransientSolution(1).SmbMassBalance),...
|
---|
67 | (md.results.TransientSolution(2).Vx),...
|
---|
68 | (md.results.TransientSolution(2).Vy),...
|
---|
69 | (md.results.TransientSolution(2).Vel),...
|
---|
70 | (md.results.TransientSolution(2).Pressure),...
|
---|
71 | (md.results.TransientSolution(2).Base),...
|
---|
72 | (md.results.TransientSolution(2).Surface),...
|
---|
73 | (md.results.TransientSolution(2).Thickness),...
|
---|
74 | (md.results.TransientSolution(2).IceVolume),...
|
---|
75 | (md.results.TransientSolution(2).SmbMassBalance),...
|
---|
76 | (md.results.TransientSolution(3).Vx),...
|
---|
77 | (md.results.TransientSolution(3).Vy),...
|
---|
78 | (md.results.TransientSolution(3).Vel),...
|
---|
79 | (md.results.TransientSolution(3).Pressure),...
|
---|
80 | (md.results.TransientSolution(3).Base),...
|
---|
81 | (md.results.TransientSolution(3).Surface),...
|
---|
82 | (md.results.TransientSolution(3).Thickness),...
|
---|
83 | (md.results.TransientSolution(3).IceVolume),...
|
---|
84 | (md.results.TransientSolution(3).SmbMassBalance),...
|
---|
85 | };
|
---|