source: issm/trunk/test/Verification/IceSheetNoIceFrontM2d_16/updatearchive.m@ 147

Last change on this file since 147 was 147, checked in by Mathieu Morlighem, 16 years ago

changed runme and archive: allow to test several fields at the same time

  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[16]1% This file can be run to update the velocity archives of the test1.
2% This test deals with an icesheet without icefront for a 2d model. The geometry
3% is square. Just run this file in Matlab, with a properly setup Ice code.
4
5% The archive files will be saved in this directory but will not commited to ice1.
6% Just commit the result if you want to.
7
[115]8%packages and solutions to be tested
9packages={'macayeal','ice','cielo_serial','cielo_parallel'};
[123]10solutions={'diagnostic','prognostic'};
[16]11
[115]12%go through the solutions requested
[136]13testname='IceSheetNoIceFrontM2d_16';
[115]14for i=1:length(packages),
15 package=packages{i};
[16]16
[123]17 for j=1:length(solutions),
18 solution=solutions{j};
[16]19
[123]20 %check package
21 if ~(strcmpi(package,'macayeal') | strcmpi(package,'ice') | strcmpi(package,'cielo_serial') | strcmpi(package,'cielo_parallel'));
22 error(['package: ' package ' in test: ' testname ' not supported yet']);
23 %check solution
24 elseif ~(strcmpi(solution,'diagnostic') | strcmpi(solution,'prognostic'));
25 error(['solution: ' solution ' in test: ' testname ' not supported yet']);
26 end
27 %check solution requested
28 if (~strcmpi(package,'ice') & strcmpi(solution,'prognostic')),
29 disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
30 continue
31 end
[16]32
[123]33 %initialize model
34 md=model;
35 md=mesh(md,'DomainOutline.exp',50000);
36 md=geography(md,'','');
37 md=parameterize(md,'Square.par');
38 md=setelementstype(md,'macayeal','all');
39 if strcmpi(package,'cielo_parallel'), md.cluster='wilkes'; end
40 if md.numberofgrids==388
41 load Velocities; md.vx=0.5*vx; md.vy=0.5*vy;
42 end
[16]43
[123]44 %compute solution
45 if strcmpi(package,'cielo_parallel') & strcmpi(solution,'diagnostic'),
46 md=solve(md,'diagnostic_horiz','cielo');
47 elseif strcmpi(package,'cielo_serial'),
48 eval(['md=solve(md,''' solution ''',''cielo'');']);
49 else
50 eval(['md=solve(md,''' solution ''',''' package ''');']);
51 end
[16]52
[147]53 %field to be saved
[123]54 if strcmpi(solution,'diagnostic'),
[147]55 fields={'vel'};
[123]56 elseif strcmpi(solution,'prognostic'),
[147]57 fields={'new_thickness'};
[123]58 end
[147]59
60 %save new archive
61 for k=1:length(fields),
62 field=fields{k};
63 eval(['Archive' package solution '_field' num2str(k) '=md.' field ';']);
64 end
65 eval(['save Archive' package solution ' Archive' package solution '_field*']);
[115]66 end
67end
Note: See TracBrowser for help on using the repository browser.