1 | %This test is a test from the ISMP-HOM Intercomparison project
|
---|
2 | %Pattyn and Payne 2006
|
---|
3 | printingflag=false;
|
---|
4 |
|
---|
5 | L_list={5000,10000,20000,40000,80000,160000};
|
---|
6 | results={};
|
---|
7 | minvx=[];
|
---|
8 | maxvx=[];
|
---|
9 |
|
---|
10 | for i=1:length(L_list),
|
---|
11 | L=L_list{i};
|
---|
12 | nx=20; %numberof nodes in x direction
|
---|
13 | ny=20;
|
---|
14 | md=model;
|
---|
15 | md=squaremesh(md,L,L,nx,ny);
|
---|
16 | md=setmask(md,'',''); %ice sheet test
|
---|
17 | md=parameterize(md,'../Par/ISMIPA.par');
|
---|
18 | md=extrude(md,9,1);
|
---|
19 |
|
---|
20 | md=setflowequation(md,'pattyn','all');
|
---|
21 |
|
---|
22 | %Create dirichlet on the bed only
|
---|
23 | md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
|
---|
24 | md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
|
---|
25 | md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
|
---|
26 |
|
---|
27 | pos=find(md.mesh.vertexonbed);
|
---|
28 | md.diagnostic.spcvx(pos)=0;
|
---|
29 | md.diagnostic.spcvy(pos)=0;
|
---|
30 |
|
---|
31 | %Create MPCs to have periodic boundary conditions
|
---|
32 | posx=find(md.mesh.x==0);
|
---|
33 | posx2=find(md.mesh.x==max(md.mesh.x));
|
---|
34 |
|
---|
35 | posy=find(md.mesh.y==0 & md.mesh.x~=0 & md.mesh.x~=max(md.mesh.x)); %Don't take the same nodes two times
|
---|
36 | posy2=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=0 & md.mesh.x~=max(md.mesh.x));
|
---|
37 |
|
---|
38 | md.diagnostic.vertex_pairing=[posx,posx2;posy,posy2];
|
---|
39 |
|
---|
40 | %Compute the diagnostic
|
---|
41 | md.cluster=generic('name',oshostname(),'np',8);
|
---|
42 | md=solve(md,DiagnosticSolutionEnum);
|
---|
43 |
|
---|
44 | %Plot the results and save them
|
---|
45 | vx=(md.results.DiagnosticSolution.Vx);
|
---|
46 | vy=(md.results.DiagnosticSolution.Vy);
|
---|
47 | vz=(md.results.DiagnosticSolution.Vz);
|
---|
48 | results{i}=md.results.DiagnosticSolution;
|
---|
49 | minvx(i)=min(vx(end-md.mesh.numberofvertices2d+1:end));
|
---|
50 | maxvx(i)=max(vx(end-md.mesh.numberofvertices2d+1:end));
|
---|
51 |
|
---|
52 | %Now plot vx, vy, vz and vx on a cross section
|
---|
53 | plotmodel(md,'data',vx,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
|
---|
54 | if printingflag,
|
---|
55 | set(gcf,'Color','w')
|
---|
56 | printmodel(['ismipapattynvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
---|
57 | system(['mv ismipapattynvx' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA ']);
|
---|
58 | end
|
---|
59 | plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
|
---|
60 | if printingflag,
|
---|
61 | set(gcf,'Color','w')
|
---|
62 | printmodel(['ismipapattynvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
---|
63 | system(['mv ismipapattynvy' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA ']);
|
---|
64 | end
|
---|
65 | plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
|
---|
66 | if printingflag,
|
---|
67 | set(gcf,'Color','w')
|
---|
68 | printmodel(['ismipapattynvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
---|
69 | system(['mv ismipapattynvz' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA ']);
|
---|
70 | end
|
---|
71 |
|
---|
72 | if(L==5000),
|
---|
73 | plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP5000.exp','layer',md.mesh.numberoflayers,...
|
---|
74 | 'resolution',[10 10],'ylim',[10 18],'xlim',[0 5000],'title','','xlabel','')
|
---|
75 | elseif(L==10000),
|
---|
76 | plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP10000.exp','layer',md.mesh.numberoflayers,...
|
---|
77 | 'resolution',[10 10],'ylim',[10 30],'xlim',[0 10000],'title','','xlabel','')
|
---|
78 | elseif(L==20000),
|
---|
79 | plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP20000.exp','layer',md.mesh.numberoflayers,...
|
---|
80 | 'resolution',[10 10],'ylim',[0 50],'xlim',[0 20000],'title','','xlabel','')
|
---|
81 | elseif(L==40000),
|
---|
82 | plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP40000.exp','layer',md.mesh.numberoflayers,...
|
---|
83 | 'resolution',[10 10],'ylim',[0 80],'xlim',[0 40000],'title','','xlabel','')
|
---|
84 | elseif(L==80000),
|
---|
85 | plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP80000.exp','layer',md.mesh.numberoflayers,...
|
---|
86 | 'resolution',[10 10],'ylim',[0 100],'xlim',[0 80000],'title','','xlabel','')
|
---|
87 | elseif(L==160000),
|
---|
88 | plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP160000.exp','layer',md.mesh.numberoflayers,...
|
---|
89 | 'resolution',[10 10],'ylim',[0 120],'xlim',[0 160000],'title','','xlabel','')
|
---|
90 | end
|
---|
91 | if printingflag,
|
---|
92 | set(gcf,'Color','w')
|
---|
93 | printmodel(['ismipapattynvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
---|
94 | system(['mv ismipapattynvxsec' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA ']);
|
---|
95 | end
|
---|
96 | end
|
---|
97 |
|
---|
98 | %Now plot the min and max values of vx for each size of the square
|
---|
99 | plot([5 10 20 40 80 160],minvx);ylim([0 18]);xlim([0 160])
|
---|
100 | if printingflag,
|
---|
101 | set(gcf,'Color','w')
|
---|
102 | printmodel('ismipapattynminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
---|
103 | system(['mv ismipapattynminvx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA ']);
|
---|
104 | end
|
---|
105 | plot([5 10 20 40 80 160],maxvx);ylim([0 120]);xlim([0 160])
|
---|
106 | if printingflag,
|
---|
107 | set(gcf,'Color','w')
|
---|
108 | printmodel('ismipapattynmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
---|
109 | system(['mv ismipapattynmaxvx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA ']);
|
---|
110 | end
|
---|
111 | %Fields and tolerances to track changes
|
---|
112 | field_names ={ ...
|
---|
113 | 'Vx5km','Vy5km','Vz5km',...
|
---|
114 | 'Vx10km','Vy10km','Vz10km',...
|
---|
115 | 'Vx20km','Vy20km','Vz20km',...
|
---|
116 | 'Vx40km','Vy40km','Vz40km',...
|
---|
117 | 'Vx80km','Vy80km','Vz80km',...
|
---|
118 | 'Vx160km','Vy160km','Vz160km'
|
---|
119 | };
|
---|
120 | field_tolerances={...
|
---|
121 | 1e-09,1e-09,1e-09,...
|
---|
122 | 1e-10,1e-10,1e-09,...
|
---|
123 | 1e-09,1e-09,1e-09,...
|
---|
124 | 1e-09,1e-08,1e-09,...
|
---|
125 | 1e-08,1e-08,1e-08,...
|
---|
126 | 1e-08,1e-07,1e-08,...
|
---|
127 | };
|
---|
128 | field_values={};
|
---|
129 | for i=1:6,
|
---|
130 | result=results{i};
|
---|
131 | field_values={field_values{:},...
|
---|
132 | (result.Vx),...
|
---|
133 | (result.Vy),...
|
---|
134 | (result.Vz),...
|
---|
135 | };
|
---|
136 | end
|
---|