source: issm/trunk-jpl/test/NightlyRun/test1102.m@ 17848

Last change on this file since 17848 was 17848, checked in by seroussi, 11 years ago

CHG: trying to reduce weekly runs

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