source: issm/trunk/test/Verification/IceSheetNoIceFrontM2d_16/updatearchive.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: 2.2 KB
Line 
1function varargout=updatearchive(varargin)
2%updatearchive - test deck for ISSM nightly runs
3%
4% Usage:
5% varargout=updatearchive(varargin);
6%
7% Example:
8% updatearchive;
9% updatearchive({'ice'});
10% updatearchive({'ice','cielo_serial'});
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%packages and analysis_types to be tested
23if nargin==1,
24 packages=varargin{1};
25else
26 packages={'macayeal','ice','cielo_serial','cielo_parallel'};
27end
28solutions={'diagnostic','prognostic','transient'};
29
30%go through the solutions requested
31testname='IceSheetNoIceFrontM2d_16';
32for i=1:length(packages),
33 package=packages{i};
34
35 for j=1:length(solutions),
36 solution=solutions{j};
37
38 %check solution requested
39 if ((~strcmpi(package,'ice') & strcmpi(solution,'transient'))...
40 | (strcmpi(package,'macayeal') & ~strcmpi(solution,'diagnostic'))),
41 disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
42 continue
43 end
44
45 %initialize model
46 md=model;
47 md=mesh(md,'DomainOutline.exp',50000);
48 md=geography(md,'','');
49 md=parameterize(md,'Square.par');
50 md=setelementstype(md,'macayeal','all');
51 if md.numberofgrids==388
52 load Velocities; md.vx=0.5*vx; md.vy=0.5*vy;
53 end
54
55 %compute solution
56 [analysis_type sub_analysis_type]=testsgetanalysis(solution);
57 [md packagefinal]=testsgetpackage(md,package);
58 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
59
60 %compute fields to be checked
61 fields=testsgetfields(md.type,solution);
62
63 %save new archive
64 for k=1:length(fields),
65 field=fields{k};
66 eval(['Archive' package solution '_field' num2str(k) '=md.results. ' field ';']);
67 end
68 eval(['save Archive' package solution ' Archive' package solution '_field*']);
69 end
70end
71if nargout==1,
72 varargout{1}=md;
73end
Note: See TracBrowser for help on using the repository browser.