source: issm/trunk/test/Verification/IceSheetNoIceFrontM2d_16/updatearchive.m@ 661

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

fixed tests for MacAyeal package

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1function updatearchive(varargin)
2% This file can be run to update the velocity archives of the test1.
3% 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
6% The archive files will be saved in this directory but will not commited to ice1.
7% Just commit the result if you want to.
8
9%packages and analysis_types to be tested
10if nargin==1,
11 packages=varargin{1};
12else
13 packages={'macayeal','ice','cielo_serial','cielo_parallel'};
14end
15solutions={'diagnostic','prognostic'};
16
17%go through the solutions requested
18testname='IceSheetNoIceFrontM2d_16';
19for i=1:length(packages),
20 package=packages{i};
21
22 for j=1:length(solutions),
23 solution=solutions{j};
24
25 %check solution requested
26 if ((~strcmpi(package,'ice') & strcmpi(solution,'transient'))...
27 | (strcmpi(package,'macayeal') & ~strcmpi(solution,'diagnostic'))),
28 disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
29 continue
30 end
31
32 %initialize model
33 md=model;
34 md=mesh(md,'DomainOutline.exp',50000);
35 md=geography(md,'','');
36 md=parameterize(md,'Square.par');
37 md=setelementstype(md,'macayeal','all');
38 if md.numberofgrids==388
39 load Velocities; md.vx=0.5*vx; md.vy=0.5*vy;
40 end
41
42 %compute solution
43 [analysis_type sub_analysis_type]=testsgetanalysis(solution);
44 [md packagefinal]=testsgetpackage(md,package);
45 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
46
47 %compute fields to be checked
48 fields=testsgetfields(md.type,solution);
49
50 %save new archive
51 for k=1:length(fields),
52 field=fields{k};
53 eval(['Archive' package solution '_field' num2str(k) '=md.' field ';']);
54 end
55 eval(['save Archive' package solution ' Archive' package solution '_field*']);
56 end
57end
Note: See TracBrowser for help on using the repository browser.