source: issm/trunk/test/Verification/test10_iceshelf_icefront_stokes/runme.m@ 16

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

Added new tests form ice1

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1% This file can be run to check that the current version of Pattyn model is giving
2% coherent results. This test deals with an iceshelf with icefront for a 3d model. The geometry
3% is square. Just run this file in Matlab, with a properly setup Ice code.
4% The results of this test will indicate if there is a difference between current computations
5% and archived results.
6
7% Errors between archived results and the current version will get flagged if they are not within
8% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this
9% tolerance should be lowered (for example, if you are running single precision compilers?), feel
10% free to tweak the tolerance variable.
11
12%Initialize log message for nightly runs.
13logstring='Verification/test10_iceshelf_icefront_stokes: ';
14
15% Create model;
16
17tolerance=10^-13;
18
19
20md=model;
21md=mesh(md,'DomainOutline.exp',100000);
22md=geography(md,'all','');
23md=parameterize(md,'Square.par');
24md=extrude(md,10,3);
25md=setelementstype(md,'pattyn','all','stokes','all');
26
27%Compute solution with Ice model
28md=solve(md,'diagnostic','ice');
29vel_stokes=md.vel;
30
31%Load old velocities and compare with the new model
32load archive_stokes
33pos=find(archive_stokes-vel_stokes);
34error_vel=abs(norm((archive_stokes(pos)-vel_stokes(pos))./archive_stokes(pos),2));
35
36disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
37
38if (error_vel>tolerance);
39 logoutput(logstring,sprintf('%s\n',' ERROR. Results from Stokes model differ from the archive version'));
40else
41 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from Stokes model are comform with the archive version'));
42end
43
44
45
46%Compute solution with Ice model
47md=solve(md,'thermalsteady','ice');
48temp_stokes=md.temperature;
49melting_stokes=md.melting;
50
51%Load old velocities and compare with the new model
52load archive_temperature
53post=find(archive_temperature-temp_stokes);
54error_temp=abs(norm((archive_temperature(post)-temp_stokes(post))./archive_temperature(post),2));
55
56disp(sprintf('numerical difference between old and new version of Ice is : %d', error_temp));
57
58if (error_temp>tolerance);
59 logoutput(logstring,sprintf('%s\n',' ERROR. Results from thermal model differ from the archive version'));
60else
61 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from thermal model are comform with the archive version'));
62end
63
64%Load old velocities and compare with the new model
65load archive_melting
66post=find(archive_melting-melting_stokes);
67error_melting=abs(norm((archive_melting(post)-melting_stokes(post))./archive_melting(post),2));
68
69disp(sprintf('numerical difference between old and new version of Ice is : %d', error_melting));
70
71if (error_melting>tolerance);
72 logoutput(logstring,sprintf('%s\n',' ERROR. Results from melting model differ from the archive version'));
73else
74 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from melting model are comform with the archive version'));
75end
Note: See TracBrowser for help on using the repository browser.