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

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

updated test 16

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1function varargout=updatearchive(varargin)
2%updatearchive - test deck for ISSM nightly runs
3%
4% Usage:
5% varargout=updatearchive(varargin);
6%
7% Examples:
8% updatearchive;
9% updatearchive({'ice'});
10% updatearchive({'ice','cielo_serial'},{'diagnostic'});
11% md=updatearchive({'cielo_parallel'});
12%
13% See also: RUNME
14
15% This file can be run to update the velocity archives of the test1.
16% This test deals with an icesheet without icefront for a 2d model. The geometry
17% is square. Just run this file in Matlab, with a properly setup Ice code.
18
19% The archive files will be saved in this directory but will not commited to ice1.
20% Just commit the result if you want to.
21
22%check arguments
23if (nargin>2 | nargout>1)
24 help updatearchive
25 error('updatearchive error message: bad usage');
26end
27
28%packages and analysis_types to be tested
29if nargin==2,
30 solutions=varargin{2};
31else
32 solutions={'diagnostic','prognostic','transient'};
33end
34if nargin,
35 packages=varargin{1};
36else
37 packages={'macayeal','ice','cielo_serial','cielo_parallel'};
38end
39
40%go through the solutions requested
41testname='IceSheetNoIceFrontM2d_16';
42for i=1:length(packages),
43 package=packages{i};
44
45 for j=1:length(solutions),
46 solution=solutions{j};
47
48 %check solution requested
49 if (strcmpi(package,'macayeal') & ~strcmpi(solution,'diagnostic')),
50 disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
51 continue
52 end
53
54 %initialize model
55 md=model;
56 md=mesh(md,'DomainOutline.exp',50000);
57 md=geography(md,'','');
58 md=parameterize(md,'Square.par');
59 md=setelementstype(md,'macayeal','all');
60 if md.numberofgrids==340
61 load Velocities; md.vx=0.5*vx; md.vy=0.5*vy;
62 end
63
64 %compute solution
65 [analysis_type sub_analysis_type]=testsgetanalysis(solution);
66 [md packagefinal]=testsgetpackage(md,package);
67 if ~testschecksolution(md.type,solution), continue; end
68 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
69
70 %compute fields to be checked
71 fields=testsgetfields(md.type,solution);
72
73 %save new archive
74 for k=1:length(fields),
75 field=fields{k};
76 eval(['Archive' package solution '_field' num2str(k) '=md.results. ' field ';']);
77 end
78 eval(['save Archive' package solution ' Archive' package solution '_field*']);
79 end
80end
81if nargout==1,
82 varargout{1}=md;
83end
Note: See TracBrowser for help on using the repository browser.