source: issm/trunk/test/Verification/test1_icesheet_noicefront/runme.m@ 50

Last change on this file since 50 was 50, checked in by seroussi, 16 years ago

no field acceleration

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1% This file can be run to check that the current version of macayeal and issm models are giving
2% coherent results. This test deals with an icesheet without icefront for a 2d model. The geometry
3% is square. Just run this file in Matlab, with a properly setup ISSM 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/test1_icesheet_noicefront: ';
14
15% Create model;
16
17tolerance=10^-13;
18
19
20md=model;
21md=mesh(md,'DomainOutline.exp',50000);
22md=geography(md,'','');
23md=parameterize(md,'Square.par');
24md=setelementstype(md,'macayeal','all');
25
26%Compute solution with MacAyeal's model
27md=solve(md,'diagnostic','macayeal');
28vel_macayeal=md.vel;
29
30%Compute solution with Ice model
31md=solve(md,'diagnostic','ice');
32vel_ice=md.vel;
33
34%Compute solution with Hutter elements in Ice model
35md=setelementstype(md,'hutter','all');
36md=solve(md,'diagnostic','ice');
37vel_hutter=md.vel;
38
39
40%Load old velocities and compare with the new model
41
42%Macayeal
43load archive_macayeal
44pos=find(archive_macayeal-vel_macayeal);
45error_vel=abs(norm((archive_macayeal(pos)-vel_macayeal(pos))./archive_macayeal(pos),2));
46
47disp(sprintf('numerical difference between old and new version of MacAyeal is : %d', error_vel));
48
49if (error_vel>tolerance);
50 logoutput(logstring,sprintf('%s\n',' ERROR. Results from MacAyeal model differ from the archive version'));
51else
52 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from MacAyeal model are comform with the archive version'));
53end
54
55%Ice
56load archive_ice
57pos=find(archive_ice-vel_ice);
58error_vel=abs(norm((archive_ice(pos)-vel_ice(pos))./archive_ice(pos),2));
59
60disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
61
62if (error_vel>tolerance);
63 logoutput(logstring,sprintf('%s\n',' ERROR. Results from Ice model differ from the archive version'));
64else
65 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from Ice model are comform with the archive version'));
66end
67
68%Ice with Hutter elements
69load archive_hutter
70pos=find(archive_hutter-vel_hutter);
71error_vel=abs(norm((archive_hutter(pos)-vel_hutter(pos))./archive_hutter(pos),2));
72
73disp(sprintf('numerical difference between old and new version of Ice is : %d', error_vel));
74
75if (error_vel>tolerance);
76 logoutput(logstring,sprintf('%s\n',' ERROR. Results from Ice model with Hutter elements differ from the archive version'));
77else
78 logoutput(logstring,sprintf('%s\n',' SUCCESS. Results from Ice model with Hutter elements are comform with the archive version'));
79end
80
Note: See TracBrowser for help on using the repository browser.