1 | function 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
|
---|
10 | if nargin==1,
|
---|
11 | packages=varargin{1};
|
---|
12 | else
|
---|
13 | packages={'macayeal','ice','cielo_serial','cielo_parallel'};
|
---|
14 | end
|
---|
15 | solutions={'diagnostic','prognostic'};
|
---|
16 |
|
---|
17 | %go through the solutions requested
|
---|
18 | testname='IceSheetNoIceFrontM2d_16';
|
---|
19 | for 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,'prognostic')),
|
---|
27 | disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
|
---|
28 | continue
|
---|
29 | end
|
---|
30 |
|
---|
31 | %initialize model
|
---|
32 | md=model;
|
---|
33 | md=mesh(md,'DomainOutline.exp',50000);
|
---|
34 | md=geography(md,'','');
|
---|
35 | md=parameterize(md,'Square.par');
|
---|
36 | md=setelementstype(md,'macayeal','all');
|
---|
37 | if strcmpi(package,'cielo_parallel'), md.cluster='wilkes'; end
|
---|
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 | if (strcmpi(package,'cielo_serial') | strcmpi(package,'cielo_parallel')),
|
---|
44 | md=solve(md,'analysis_type',solution,'package','cielo');
|
---|
45 | else
|
---|
46 | md=solve(md,'analysis_type',solution,'package',package);
|
---|
47 | end
|
---|
48 |
|
---|
49 | %field to be saved
|
---|
50 | if strcmpi(solution,'diagnostic'),
|
---|
51 | fields={'vel'};
|
---|
52 | elseif strcmpi(solution,'prognostic'),
|
---|
53 | fields={'new_thickness'};
|
---|
54 | end
|
---|
55 |
|
---|
56 | %save new archive
|
---|
57 | for k=1:length(fields),
|
---|
58 | field=fields{k};
|
---|
59 | eval(['Archive' package solution '_field' num2str(k) '=md.' field ';']);
|
---|
60 | end
|
---|
61 | eval(['save Archive' package solution ' Archive' package solution '_field*']);
|
---|
62 | end
|
---|
63 | end
|
---|