source: issm/trunk/test/Verification/IceSheetNoIceFrontM2d_16/runme.m@ 467

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

updated runmes and updatearchive to fit new solve.m

  • Property svn:executable set to *
File size: 3.1 KB
Line 
1% This file can be run to check that the current version of issm is 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^-12. 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%packages and solutions to be tested
13packages={'macayeal','ice','cielo_serial'};
14solutions={'diagnostic','prognostic'};
15
16%Initialize log message for nightly runs.
17testname='IceSheetNoIceFrontM2d_16';
18tolerance=10^-12;
19
20%go through the solutions requested
21for i=1:length(packages),
22 package=packages{i};
23
24 for j=1:length(solutions),
25 solution=solutions{j};
26
27 %check package
28 if ~(strcmpi(package,'macayeal') | strcmpi(package,'ice') | strcmpi(package,'cielo_serial') | strcmpi(package,'cielo_parallel'));
29 error(['package: ' package ' in test: ' testname ' not supported yet']);
30 %check solution
31 elseif ~(strcmpi(solution,'diagnostic') | strcmpi(solution,'prognostic'));
32 error(['solution: ' solution ' in test: ' testname ' not supported yet']);
33 end
34 %check solution requested
35 if (~strcmpi(package,'ice') & strcmpi(solution,'prognostic')),
36 disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
37 continue
38 end
39
40 %initialize model
41 md=model;
42 md=mesh(md,'DomainOutline.exp',50000);
43 md=geography(md,'','');
44 md=parameterize(md,'Square.par');
45 md=setelementstype(md,'macayeal','all');
46 if strcmpi(package,'cielo_parallel'), md.cluster='wilkes'; end
47 if md.numberofgrids==388
48 load Velocities; md.vx=0.5*vx; md.vy=0.5*vy;
49 end
50
51 %compute solution
52 if (strcmpi(package,'cielo_serial') | strcmpi(package,'cielo_parallel')),
53 md=solve(md,'analysis_type',solution,'package','cielo');
54 else
55 md=solve(md,'analysis_type',solution,'package',package);
56 end
57
58 %compute field to be checked
59 if strcmpi(solution,'diagnostic'),
60 fields={'vel'};
61 elseif strcmpi(solution,'prognostic'),
62 fields={'new_thickness'};
63 end
64
65 %load archive
66 eval(['load Archive' package solution ]);
67
68 for k=1:length(fields),
69 field=fields{k};
70
71 %compare to archive
72 eval(['Archive=Archive' package solution '_field' num2str(k) ';']);
73 eval(['error_diff=abs(norm((Archive(find(Archive))-md.' field '(find(Archive)))./Archive(find(Archive)),2));']);
74
75 %disp test result
76 if (error_diff>tolerance);
77 disp(sprintf(['\n\nERROR (difference=%-7.2g > %g) --> test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package));
78 else
79 disp(sprintf(['\n\nSUCCESS (difference=%-7.2g < %g) --> test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package));
80 end
81
82 end
83 end
84end
Note: See TracBrowser for help on using the repository browser.