[912] | 1 | function varargout=updatearchive(varargin)
|
---|
[913] | 2 | %updatearchive - test deck for ISSM nightly runs
|
---|
| 3 | %
|
---|
| 4 | % Usage:
|
---|
| 5 | % varargout=updatearchive(varargin);
|
---|
| 6 | %
|
---|
[996] | 7 | % Examples:
|
---|
[913] | 8 | % updatearchive;
|
---|
| 9 | % updatearchive({'ice'});
|
---|
[996] | 10 | % updatearchive({'ice','cielo_serial'},{'diagnostic'});
|
---|
[913] | 11 | % md=updatearchive({'cielo_parallel'});
|
---|
| 12 | %
|
---|
| 13 | % See also: RUNME
|
---|
| 14 |
|
---|
[242] | 15 | % This file can be run to update the velocity archives of the test1.
|
---|
| 16 | % This test deals with an icesheet with icefront for a 3d 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 |
|
---|
[996] | 22 | %check arguments
|
---|
| 23 | if (nargin>2 | nargout>1)
|
---|
| 24 | help updatearchive
|
---|
| 25 | error('updatearchive error message: bad usage');
|
---|
| 26 | end
|
---|
| 27 |
|
---|
[482] | 28 | %packages and analysis_types to be tested
|
---|
[996] | 29 | if nargin==2,
|
---|
| 30 | solutions=varargin{2};
|
---|
| 31 | else
|
---|
[1906] | 32 | solutions={'diagnostic','thermal_steady','thermal_transient','prognostic','transient'};
|
---|
[996] | 33 | end
|
---|
| 34 | if nargin,
|
---|
[482] | 35 | packages=varargin{1};
|
---|
| 36 | else
|
---|
| 37 | packages={'macayeal','ice','cielo_serial','cielo_parallel'};
|
---|
| 38 | end
|
---|
[242] | 39 |
|
---|
| 40 | %go through the solutions requested
|
---|
| 41 | testname='IceSheetNoIceFrontP3d_18';
|
---|
| 42 | for i=1:length(packages),
|
---|
| 43 | package=packages{i};
|
---|
| 44 |
|
---|
| 45 | for j=1:length(solutions),
|
---|
| 46 | solution=solutions{j};
|
---|
| 47 |
|
---|
| 48 | %check solution requested
|
---|
[1057] | 49 | if strcmpi(package,'macayeal');
|
---|
[242] | 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',100000);
|
---|
| 57 | md=geography(md,'','');
|
---|
| 58 | md=parameterize(md,'Square.par');
|
---|
| 59 | md=extrude(md,8,4);
|
---|
| 60 | md=setelementstype(md,'pattyn','all');
|
---|
[1154] | 61 | if md.numberofgrids==728
|
---|
[242] | 62 | load Velocities; md.vx=0.8*vx; md.vy=0.8*vy; md.vz=0.8*vz; md.temperature=temperature-1; md.pressure=pressure;
|
---|
| 63 | end
|
---|
| 64 |
|
---|
| 65 | %compute solution
|
---|
[519] | 66 | [analysis_type sub_analysis_type]=testsgetanalysis(solution);
|
---|
| 67 | [md packagefinal]=testsgetpackage(md,package);
|
---|
[1022] | 68 | if ~testschecksolution(md.type,solution), continue; end
|
---|
[520] | 69 | md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
|
---|
[242] | 70 |
|
---|
[519] | 71 | %compute fields to be checked
|
---|
| 72 | fields=testsgetfields(md.type,solution);
|
---|
[242] | 73 |
|
---|
| 74 | %save new archive
|
---|
| 75 | for k=1:length(fields),
|
---|
| 76 | field=fields{k};
|
---|
[709] | 77 | eval(['Archive' package solution '_field' num2str(k) '=md.results. ' field ';']);
|
---|
[242] | 78 | end
|
---|
| 79 | eval(['save Archive' package solution ' Archive' package solution '_field*']);
|
---|
| 80 | end
|
---|
| 81 | end
|
---|
[912] | 82 | if nargout==1,
|
---|
| 83 | varargout{1}=md;
|
---|
| 84 | end
|
---|