[242] | 1 | % This file can be run to update the velocity archives of the test1.
|
---|
| 2 | % This test deals with an icesheet with icefront for a 3d 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 |
|
---|
| 8 | %packages and solutions to be tested
|
---|
| 9 | packages={'macayeal','ice','cielo_serial','cielo_parallel'};
|
---|
| 10 | solutions={'diagnostic','thermalsteady','thermaltransient','prognostic','transient'};
|
---|
| 11 |
|
---|
| 12 | %go through the solutions requested
|
---|
| 13 | testname='IceSheetNoIceFrontP3d_18';
|
---|
| 14 | for i=1:length(packages),
|
---|
| 15 | package=packages{i};
|
---|
| 16 |
|
---|
| 17 | for j=1:length(solutions),
|
---|
| 18 | solution=solutions{j};
|
---|
| 19 |
|
---|
| 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,'thermalsteady') | strcmpi(solution,'thermaltransient') |...
|
---|
| 25 | strcmpi(solution,'prognostic') | strcmpi(solution,'transient'));
|
---|
| 26 | error(['solution: ' solution ' in test: ' testname ' not supported yet']);
|
---|
| 27 | end
|
---|
| 28 | %check solution requested
|
---|
[297] | 29 | if (~(strcmpi(package,'ice') | (strcmpi(package,'cielo_serial') & strcmpi(solution,'diagnostic'))) | strcmpi(solution,'transient')),
|
---|
[242] | 30 | disp(sprintf(['\nsolution: ' solution ', with package: ' package ', in test: ' testname ', not supported yet.\n']));
|
---|
| 31 | continue
|
---|
| 32 | end
|
---|
| 33 |
|
---|
| 34 | %initialize model
|
---|
| 35 | md=model;
|
---|
| 36 | md=mesh(md,'DomainOutline.exp',100000);
|
---|
| 37 | md=geography(md,'','');
|
---|
| 38 | md=parameterize(md,'Square.par');
|
---|
| 39 | md=extrude(md,8,4);
|
---|
| 40 | md=setelementstype(md,'pattyn','all');
|
---|
| 41 | if strcmpi(package,'cielo_parallel'), md.cluster='wilkes'; end
|
---|
| 42 | if md.numberofgrids==832
|
---|
| 43 | load Velocities; md.vx=0.8*vx; md.vy=0.8*vy; md.vz=0.8*vz; md.temperature=temperature-1; md.pressure=pressure;
|
---|
| 44 | end
|
---|
| 45 |
|
---|
| 46 | %compute solution
|
---|
[451] | 47 | if (strcmpi(package,'cielo_serial') | strcmpi(package,'cielo_parallel')),
|
---|
| 48 | md=solve(md,solution,'cielo');
|
---|
[242] | 49 | else
|
---|
[451] | 50 | md=solve(md,solution,package);
|
---|
[242] | 51 | end
|
---|
| 52 |
|
---|
| 53 | %compute field to be checked
|
---|
| 54 | if strcmpi(solution,'diagnostic'),
|
---|
| 55 | fields={'vy','vz'};
|
---|
| 56 | elseif strcmpi(solution,'thermalsteady'),
|
---|
| 57 | fields={'temperature','melting'};
|
---|
| 58 | elseif strcmpi(solution,'thermaltransient'),
|
---|
| 59 | fields={'thermaltransient_results(end).temperature','thermaltransient_results(end).melting'};
|
---|
| 60 | elseif strcmpi(solution,'prognostic'),
|
---|
| 61 | fields={'new_thickness'};
|
---|
| 62 | elseif strcmpi(solution,'transient'),
|
---|
| 63 | fields={'transient_results(end).vy','transient_results(end).vz','transient_results(end).temperature','transient_results(end).melting','transient_results(end).thickness'};
|
---|
| 64 | end
|
---|
| 65 |
|
---|
| 66 | %save new archive
|
---|
| 67 | for k=1:length(fields),
|
---|
| 68 | field=fields{k};
|
---|
| 69 | eval(['Archive' package solution '_field' num2str(k) '=md.' field ';']);
|
---|
| 70 | end
|
---|
| 71 | eval(['save Archive' package solution ' Archive' package solution '_field*']);
|
---|
| 72 | end
|
---|
| 73 | end
|
---|