[912] | 1 | function varargout=updatearchive(varargin)
|
---|
[913] | 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 |
|
---|
[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 |
|
---|
[482] | 22 | %packages and analysis_types to be tested
|
---|
| 23 | if nargin==1,
|
---|
| 24 | packages=varargin{1};
|
---|
| 25 | else
|
---|
| 26 | packages={'macayeal','ice','cielo_serial','cielo_parallel'};
|
---|
| 27 | end
|
---|
[242] | 28 | solutions={'diagnostic','thermalsteady','thermaltransient','prognostic','transient'};
|
---|
| 29 |
|
---|
| 30 | %go through the solutions requested
|
---|
| 31 | testname='IceSheetNoIceFrontP3d_18';
|
---|
| 32 | for i=1:length(packages),
|
---|
| 33 | package=packages{i};
|
---|
| 34 |
|
---|
| 35 | for j=1:length(solutions),
|
---|
| 36 | solution=solutions{j};
|
---|
| 37 |
|
---|
| 38 | %check solution requested
|
---|
[720] | 39 | if ((strcmpi(package,'cielo_parallel') & strcmpi(solution,'thermaltransient'))...
|
---|
[489] | 40 | | strcmpi(package,'macayeal')...
|
---|
| 41 | | strcmpi(solution,'transient')),
|
---|
[242] | 42 | disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
|
---|
| 43 | continue
|
---|
| 44 | end
|
---|
| 45 |
|
---|
| 46 | %initialize model
|
---|
| 47 | md=model;
|
---|
| 48 | md=mesh(md,'DomainOutline.exp',100000);
|
---|
| 49 | md=geography(md,'','');
|
---|
| 50 | md=parameterize(md,'Square.par');
|
---|
| 51 | md=extrude(md,8,4);
|
---|
| 52 | md=setelementstype(md,'pattyn','all');
|
---|
| 53 | if md.numberofgrids==832
|
---|
| 54 | load Velocities; md.vx=0.8*vx; md.vy=0.8*vy; md.vz=0.8*vz; md.temperature=temperature-1; md.pressure=pressure;
|
---|
| 55 | end
|
---|
| 56 |
|
---|
| 57 | %compute solution
|
---|
[519] | 58 | [analysis_type sub_analysis_type]=testsgetanalysis(solution);
|
---|
| 59 | [md packagefinal]=testsgetpackage(md,package);
|
---|
[520] | 60 | md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
|
---|
[242] | 61 |
|
---|
[519] | 62 | %compute fields to be checked
|
---|
| 63 | fields=testsgetfields(md.type,solution);
|
---|
[242] | 64 |
|
---|
| 65 | %save new archive
|
---|
| 66 | for k=1:length(fields),
|
---|
| 67 | field=fields{k};
|
---|
[709] | 68 | eval(['Archive' package solution '_field' num2str(k) '=md.results. ' field ';']);
|
---|
[242] | 69 | end
|
---|
| 70 | eval(['save Archive' package solution ' Archive' package solution '_field*']);
|
---|
| 71 | end
|
---|
| 72 | end
|
---|
[912] | 73 | if nargout==1,
|
---|
| 74 | varargout{1}=md;
|
---|
| 75 | end
|
---|