source: issm/trunk-jpl/test/NightlyRun/test1207.m@ 15566

Last change on this file since 15566 was 15566, checked in by Mathieu Morlighem, 12 years ago

CHG: MacAyeal -> SSA

  • Property svn:executable set to *
File size: 3.3 KB
Line 
1%The aim of this program is to compare a model with an analytical solution given in SSA EISMINT : Lessons in Ice-Sheet Modeling.
2printingflag=false;
3
4numlayers=10;
5resolution=30000.;
6
7%To begin with the numerical model
8md=model();
9md=roundmesh(md,750000.,resolution);
10md=setmask(md,'',''); %We can not test iceshelves nor ice rises with this analytical solution
11md=parameterize(md,'../Par/RoundSheetStaticEISMINT.par');
12
13%Calculation of the analytical 2d velocity field
14constant=0.3;
15vx_obs=constant/2.*md.mesh.x.*(md.geometry.thickness).^-1;
16vy_obs=constant/2.*md.mesh.y.*(md.geometry.thickness).^-1;
17vel_obs=sqrt((md.inversion.vx_obs).^2+(md.inversion.vy_obs).^2);
18
19%We extrude the model to have a 3d model
20md=extrude(md,numlayers,1.);
21md=setflowequation(md,'FS','all');
22
23%Spc the nodes on the bed
24pos=find(md.mesh.vertexonbed);
25md.diagnostic.spcvx(pos)=0.;
26md.diagnostic.spcvy(pos)=0.;
27md.diagnostic.spcvz(pos)=0.;
28
29%Now we can solve the problem
30md.cluster=generic('name',oshostname(),'np',8);
31md=solve(md,DiagnosticSolutionEnum());
32
33%Calculate the depth averaged velocity field (2d):
34vx=(md.results.DiagnosticSolution.Vx);
35vy=(md.results.DiagnosticSolution.Vy);
36vel=zeros(md.mesh.numberofvertices2d,1);
37
38for i=1:md.mesh.numberofvertices2d
39 node_vel=0.;
40 for j=1:md.mesh.numberoflayers-1
41 node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*...
42 (sqrt(vx(i+j*md.mesh.numberofvertices2d,1).^2+vy(i+j*md.mesh.numberofvertices2d,1).^2)+...
43 sqrt(vx(i+(j-1)*md.mesh.numberofvertices2d,1).^2+vy(i+(j-1)*md.mesh.numberofvertices2d,1).^2));
44 end
45 vel(i,1)=node_vel;
46end
47
48%Plot of the velocity from the exact and calculated solutions
49figure(1)
50subplot(2,2,1)
51p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
52vel,'FaceColor','interp','EdgeColor','none');
53title('Modelled velocity','FontSize',14,'FontWeight','bold')
54colorbar;
55caxis([0 200]);
56
57subplot(2,2,2)
58p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
59vel_obs,'FaceColor','interp','EdgeColor','none');
60title('Analytical velocity','FontSize',14,'FontWeight','bold')
61colorbar;
62caxis([0 200]);
63
64subplot(2,2,3)
65hold on;
66plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.');
67plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.');
68title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold');
69xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold');
70ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold');
71legend('calculated velocity','exact velocity');
72axis([0 750000 0 200]);
73hold off;
74
75subplot(2,2,4)
76p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
77abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
78title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
79colorbar;
80caxis([0 100]);
81
82if printingflag,
83 set(gcf,'Color','w')
84 printmodel('FSstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
85 system(['mv FSstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet']);
86end
87
88%Fields and tolerances to track changes
89field_names ={ ...
90 'Vx','Vy','Vel', ...
91};
92field_tolerances={ ...
93 1e-12,1e-12,1e-12, ...
94};
95field_values={ ...
96 vx,vy,vel, ...
97};
Note: See TracBrowser for help on using the repository browser.