source: issm/trunk/test/Verification/IceShelfIceFrontM3d_2/runme.m@ 913

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

Added some comments

  • Property svn:executable set to *
File size: 3.2 KB
Line 
1function varargout=runme(varargin)
2%RUNME - test deck for ISSM nightly runs
3%
4% Usage:
5% varargout=runme(varargin);
6%
7% Example:
8% runme;
9% runme({'ice'});
10% runme({'ice','cielo_serial'});
11% md=runme({'cielo_parallel'});
12%
13% See Also: UPDATEARCHIVE
14
15% This file can be run to check that the current version of issm is giving
16% coherent results. This test deals with an icesheet with icefront for a 3d model. The geometry
17% is square. Just run this file in Matlab, with a properly setup ISSM code.
18% The results of this test will indicate if there is a difference between current computations
19% and archived results.
20
21% Errors between archived results and the current version will get flagged if they are not within
22% a certain tolerance. The current tolerance is 10^-12. If you have good reasons to believe this
23% tolerance should be lowered (for example, if you are running single precision compilers?), feel
24% free to tweak the tolerance variable.
25
26%packages and analysis_types to be tested
27if nargin==1,
28 packages=varargin{1};
29else
30 packages={'ice','cielo_serial','cielo_parallel'};
31end
32solutions={'diagnostic','thermalsteady','thermaltransient','prognostic','transient'};
33
34%Initialize log message for nightly runs.
35testname='IceShelfIceFrontM3d_2';
36
37%go through the solutions requested
38for i=1:length(packages),
39 package=packages{i};
40
41 for j=1:length(solutions),
42 solution=solutions{j};
43
44 %check solution requested
45 if ((strcmpi(package,'cielo_parallel') & strcmpi(solution,'thermaltransient'))...
46 | strcmpi(package,'macayeal')...
47 | strcmpi(solution,'transient')),
48 disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
49 continue
50 end
51
52 %initialize model
53 md=model;
54 md=mesh(md,'DomainOutline.exp',100000);
55 md=geography(md,'all','');
56 md=parameterize(md,'Square.par');
57 md=extrude(md,8,4);
58 md=setelementstype(md,'macayeal','all');
59 if md.numberofgrids==832
60 load Velocities; md.vx=0.8*vx; md.vy=0.8*vy; md.vz=0.8*vz; md.temperature=temperature-1; md.pressure=pressure;
61 end
62
63 %compute solution
64 [analysis_type sub_analysis_type]=testsgetanalysis(solution);
65 [md packagefinal]=testsgetpackage(md,package);
66 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
67
68 %compute fields to be checked
69 fields=testsgetfields(md.type,solution);
70
71 %load archive
72 eval(['load Archive' package solution ]);
73
74 for k=1:length(fields),
75
76 %Get field and tolerance
77 field=fields{k};
78 tolerance=testsgettolerance(md,package,solution,field);
79
80 %compare to archive
81 eval(['Archive=Archive' package solution '_field' num2str(k) ';']);
82 eval(['error_diff=full(max(abs(Archive-md.results.' field '))/(max(abs(Archive))+eps));']);
83
84 %disp test result
85 if (error_diff>tolerance);
86 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package));
87 else
88 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package));
89 end
90
91 end
92 end
93end
94if nargout==1,
95 varargout{1}=md;
96end
Note: See TracBrowser for help on using the repository browser.