[482] | 1 | function updatearchive(varargin)
|
---|
[242] | 2 | % This file can be run to update the velocity archives of the test1.
|
---|
| 3 | % This test deals with an icesheet with icefront for a 3d 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 |
|
---|
[482] | 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
|
---|
[242] | 15 | solutions={'diagnostic','thermalsteady','thermaltransient','prognostic','transient'};
|
---|
| 16 |
|
---|
| 17 | %go through the solutions requested
|
---|
| 18 | testname='IceSheetNoIceFrontP3d_18';
|
---|
| 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
|
---|
[489] | 26 | if (~(strcmpi(package,'ice') | strcmpi(solution,'diagnostic'))...
|
---|
| 27 | | strcmpi(package,'macayeal')...
|
---|
| 28 | | strcmpi(solution,'transient')),
|
---|
[242] | 29 | disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
|
---|
| 30 | continue
|
---|
| 31 | end
|
---|
| 32 |
|
---|
| 33 | %initialize model
|
---|
| 34 | md=model;
|
---|
| 35 | md=mesh(md,'DomainOutline.exp',100000);
|
---|
| 36 | md=geography(md,'','');
|
---|
| 37 | md=parameterize(md,'Square.par');
|
---|
| 38 | md=extrude(md,8,4);
|
---|
| 39 | md=setelementstype(md,'pattyn','all');
|
---|
| 40 | if md.numberofgrids==832
|
---|
| 41 | load Velocities; md.vx=0.8*vx; md.vy=0.8*vy; md.vz=0.8*vz; md.temperature=temperature-1; md.pressure=pressure;
|
---|
| 42 | end
|
---|
| 43 |
|
---|
| 44 | %compute solution
|
---|
[519] | 45 | [analysis_type sub_analysis_type]=testsgetanalysis(solution);
|
---|
| 46 | [md packagefinal]=testsgetpackage(md,package);
|
---|
[520] | 47 | md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
|
---|
[242] | 48 |
|
---|
[519] | 49 | %compute fields to be checked
|
---|
| 50 | fields=testsgetfields(md.type,solution);
|
---|
[242] | 51 |
|
---|
| 52 | %save new archive
|
---|
| 53 | for k=1:length(fields),
|
---|
| 54 | field=fields{k};
|
---|
[709] | 55 | eval(['Archive' package solution '_field' num2str(k) '=md.results. ' field ';']);
|
---|
[242] | 56 | end
|
---|
| 57 | eval(['save Archive' package solution ' Archive' package solution '_field*']);
|
---|
| 58 | end
|
---|
| 59 | end
|
---|