source: issm/trunk/test/Verification/test1_icesheet_noicefront/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: 3.5 KB
Line 
1
2% This file can be run to check that the current version of macayeal and ice models are giving
3% coherent results. This test deals with an icesheet without icefront for a 2d model. The geometry
4% is square. Just run this file in Matlab, with a properly setup Ice code.
5% The results of this test will indicate if there is a difference between current computations
6% and archived results.
7
8% Errors between archived results and the current version will get flagged if they are not within
9% a certain tolerance. The current tolerance is 10^-14. If you have good reasons to believe this
10% tolerance should be lowered (for example, if you are running single precision compilers?), feel
11% free to tweak the tolerance variable.
12
13%Initialize log message for nightly runs.
14logstring='Verification/test1_icesheet_noicefront: ';
15
16% Create model;
17
18tolerance=10^-13;
19
20
21md=model;
22md=mesh(md,'DomainOutline.exp',50000);
23md=geography(md,'','');
24md=parameterize(md,'Square.par');
25md=setelementstype(md,'macayeal','all');
26
27%Compute solution with MacAyeal's model
28md=solve(md,'diagnostic','macayeal');
29vel_macayeal=md.vel;
30
31%Compute solution with Ice model
32md.acceleration=0;
33md=solve(md,'diagnostic','ice');
34vel_ice=md.vel;
35
36%Compute solution with accelerated Ice model
37md.acceleration=1;
38md=solve(md,'diagnostic','ice');
39vel_acc=md.vel;
40
41%Compute solution with Hutter elements in Ice model
42md=setelementstype(md,'hutter','all');
43md=solve(md,'diagnostic','ice');
44vel_hutter=md.vel;
45
46
47%Load old velocities and compare with the new model
48
49%Macayeal
50load archive_macayeal
51pos=find(archive_macayeal-vel_macayeal);
52error_vel=abs(norm((archive_macayeal(pos)-vel_macayeal(pos))./archive_macayeal(pos),2));
53
54disp(sprintf('numerical difference between old and new version of MacAyeal is : %d', error_vel));
55
56if (error_vel>tolerance);
57 logoutput(logstring,sprintf('%s\n',' ERROR. Results from MacAyeal model differ from the archive version'));
58else
59 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from MacAyeal model are comform with the archive version'));
60end
61
62%Ice
63load archive_ice
64pos=find(archive_ice-vel_ice);
65error_vel=abs(norm((archive_ice(pos)-vel_ice(pos))./archive_ice(pos),2));
66
67disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
68
69if (error_vel>tolerance);
70 logoutput(logstring,sprintf('%s\n',' ERROR. Results from Ice model differ from the archive version'));
71else
72 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from Ice model are comform with the archive version'));
73end
74
75%Accelerated Ice
76load archive_acc
77pos=find(archive_acc-vel_acc);
78error_vel=abs(norm((archive_acc(pos)-vel_acc(pos))./archive_acc(pos),2));
79
80disp(sprintf('numerical difference between old and new version of Accelerated Ice is : %d', error_vel));
81
82if (error_vel>tolerance);
83 logoutput(logstring,sprintf('%s\n',' ERROR. Results from Accelerated Ice model differ from the archive version'));
84else
85 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from Accelerated Ice model are comform with the archive version'));
86end
87
88%Ice with Hutter elements
89load archive_hutter
90pos=find(archive_hutter-vel_hutter);
91error_vel=abs(norm((archive_hutter(pos)-vel_hutter(pos))./archive_hutter(pos),2));
92
93disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
94
95if (error_vel>tolerance);
96 logoutput(logstring,sprintf('%s\n',' ERROR. Results from Ice model with Hutter elements differ from the archive version'));
97else
98 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from Ice model with Hutter elements are comform with the archive version'));
99end
100
Note: See TracBrowser for help on using the repository browser.