Index: /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/DomainOutline.exp	(revision 2056)
+++ /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/DomainOutline.exp	(revision 2056)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/Front.exp
===================================================================
--- /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/Front.exp	(revision 2056)
+++ /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/Front.exp	(revision 2056)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/Square.par
===================================================================
--- /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/Square.par	(revision 2056)
+++ /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/Square.par	(revision 2056)
@@ -0,0 +1,62 @@
+%Start defining model parameters here
+
+%dynamics
+md.debug=0;
+md.dt=1; %1 year
+md.ndt=md.dt*10; 
+md.artificial_diffusivity=0;
+
+hmin=300;
+hmax=1000;
+ymin=min(md.y);
+ymax=max(md.y);
+md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+md.bed=-md.rho_ice/md.rho_water*md.thickness+100;
+md.surface=md.bed+md.thickness;
+
+md.drag_type=2; %0 none 1 plastic 2 viscous
+md.drag=20*ones(md.numberofgrids,1); %q=1.
+%Take care of iceshelves: no basal drag
+pos=find(md.elementoniceshelf);
+md.drag(md.elements(pos,:))=0;
+md.p=ones(md.numberofelements,1);
+md.q=ones(md.numberofelements,1);
+md.viscosity_overshoot=0.3;
+
+md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+md.B=paterson(md.observed_temperature);
+md.n=3*ones(md.numberofelements,1);
+
+%Deal with boundary conditions:
+md=SetMarineIceSheetBC(md,'Front.exp');
+
+%Parallel options
+md.np=3;
+md.time=50;
+md.waitonlock=1;
+
+
+
+%Dakota options
+md.variables.nuv=normal_uncertain.empty();
+md.variables.nuv(end+1)=normal_uncertain('rho_ice',1,0.01);
+md.variables.nuv(end+1)=normal_uncertain('drag',1,0.01);
+
+md.responses=struct();
+md.responses.rf =response_function.empty();
+md.responses.rf (end+1)=response_function('max_vel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+
+md.qmu_method     =dakota_method('nond_l');
+
+md.qmu_params.direct=true;
+md.qmu_params.analysis_driver='diagnostic';
+md.qmu_params.evaluation_concurrency=1;
+md.qmu_params.interval_type='forward';
+
+md.part=0:1:md.numberofgrids-1;
+md.part=md.part';
+md.npart=md.numberofgrids;
+md.qmu_analysis=1;
+
+md.eps_rel=10^-15; %tighten for qmu analysese
Index: /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/runme.m
===================================================================
--- /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/runme.m	(revision 2056)
+++ /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/runme.m	(revision 2056)
@@ -0,0 +1,106 @@
+function varargout=runme(varargin)
+%RUNME - test deck for ISSM nightly runs
+%
+%   Usage:
+%      varargout=runme(varargin);
+%
+%   Examples:
+%      runme;
+%      runme({'ice'});
+%      runme({'ice','cielo_serial'},{'diagnostic'});
+%      md=runme({'cielo_parallel'});
+%
+%   See Also: UPDATEARCHIVE
+
+% This file can be run to check that the current version of issm is giving 
+% coherent results. This test deals with an icesheet with icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup ISSM code. 
+% The results of this test will indicate if there is a difference between current computations 
+% and archived results.
+
+% Errors  between archived results and the current version will get flagged if they are not within 
+% a certain tolerance. The current tolerance is 10^-12. If you have good reasons to believe this 
+% tolerance should be lowered (for example, if you are running single precision compilers?), feel 
+% free to tweak the tolerance variable.
+
+%check arguments
+if (nargin>2 | nargout>1)
+	help runme
+	error('runme error message: bad usage');
+end
+
+%packages and analysis_types to be tested
+if nargin==2,
+	solutions=varargin{2};
+else
+	solutions={'diagnostic'};
+end
+if nargin,
+	packages=varargin{1};
+else
+	packages={'cielo_serial','cielo_parallel'};
+end
+
+%Initialize log message for nightly runs.
+testname='IceSheetIceFrontM2d_Dakota_25';
+
+%go through the solutions requested
+for i=1:length(packages),
+	package=packages{i};
+
+	for j=1:length(solutions),
+		solution=solutions{j};
+
+		%check solution requested
+		if	(strcmpi(package,'macayeal')  | strcmpi(package,'ice')  & ~strcmpi(solution,'diagnostic')),
+			disp(sprintf(['\nsolution: ' solution  ', with package: ' package  ', in test: ' testname  ', not supported yet.\n']));
+			continue
+		end
+
+		%initialize model
+		md=model;
+		md=mesh(md,'DomainOutline.exp',100000);
+		md=geography(md,'','');
+		md=parameterize(md,'Square.par');
+		md=setelementstype(md,'macayeal','all');
+		if md.numberofgrids==340
+			load Velocities; md.vx=0.5*vx; md.vy=0.5*vy;
+		end
+
+		%compute solution
+		[md analysis_type sub_analysis_type packagefinal]=testsparameterization(md,solution,package);
+		if ~testschecksolution(md.type,solution), continue; end
+
+		md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal,'overwrite','y');
+		md=tres(md,'dakota');
+		md.results.dakota.importancefactors=importancefactors(md,'drag','max_vel');
+
+		%compute fields to be checked
+		fields=testsgetfields(md,solution);
+
+		%load archive
+		eval(['load Archive' package solution ]);
+
+		for k=1:length(fields),
+			
+			%Get field and tolerance
+			field=fields{k};
+			tolerance=testsgettolerance(md,package,solution,field);
+
+			%compare to archive
+			eval(['Archive=Archive' package solution '_field' num2str(k) ';']);
+			eval(['error_diff=full(max(abs(Archive-md.results.' field '))/(max(abs(Archive))+eps));']);
+
+			%disp test result
+			if (error_diff>tolerance);
+				disp(sprintf(['\n\nERROR   difference: %-7.2g > %7.2g test: %-25s solution: %-16s package: %-14s field: ' field  '.\n\n'],error_diff,tolerance,testname,solution,package));
+			else
+				disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s solution: %-16s package: %-14s field: ' field  '.\n\n'],error_diff,tolerance,testname,solution,package));
+			end
+
+		end
+	end
+end
+if nargout==1, 
+	varargout{1}=md; 
+end
Index: /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/updatearchive.m
===================================================================
--- /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/updatearchive.m	(revision 2056)
+++ /issm/trunk/test/Verification/IceSheetIceFrontM2dDakota_25/updatearchive.m	(revision 2056)
@@ -0,0 +1,82 @@
+function varargout=updatearchive(varargin)
+%updatearchive - test deck for ISSM nightly runs
+%
+%   Usage:
+%      varargout=updatearchive(varargin);
+%
+%   Examples:
+%      updatearchive;
+%      updatearchive({'ice'});
+%      updatearchive({'ice','cielo_serial'},{'diagnostic'});
+%      md=updatearchive({'cielo_parallel'});
+%
+%   See also: RUNME
+
+% This file can be run to update the velocity archives  of the test1.
+% This test deals with an icesheet with icefront for a 2d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+%check arguments
+if (nargin>2 | nargout>1)
+	help updatearchive
+	error('updatearchive error message: bad usage');
+end
+
+%packages and analysis_types to be tested
+if nargin==2,
+	solutions=varargin{2};
+else
+	solutions={'diagnostic'};
+end
+if nargin,
+	packages=varargin{1};
+else
+	packages={'cielo_serial','cielo_parallel'};
+end
+
+%go through the solutions requested
+testname='IceSheetIceFrontM2d_Dakota_25';
+for i=1:length(packages),
+	package=packages{i};
+
+	for j=1:length(solutions),
+		solution=solutions{j};
+
+		%check solution requested
+		if	(strcmpi(package,'macayeal')  | strcmpi(package,'ice')  & ~strcmpi(solution,'diagnostic')),
+			disp(sprintf(['\nsolution: ' solution  ', with package: ' package  ', in test: ' testname  ', not supported yet.\n']));
+			continue
+		end
+
+		%initialize model
+		md=model;
+		md=mesh(md,'DomainOutline.exp',100000);
+		md=geography(md,'','');
+		md=parameterize(md,'Square.par');
+		md=setelementstype(md,'macayeal','all');
+
+
+		%compute solution
+		[md analysis_type sub_analysis_type packagefinal]=testsparameterization(md,solution,package);
+		if ~testschecksolution(md.type,solution), continue; end
+		md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal,'overwrite','y');
+		md=tres(md,'dakota');
+		md.results.dakota.importancefactors=importancefactors(md,'drag','max_vel');
+
+		%compute fields to be checked
+		fields=testsgetfields(md,solution);
+
+		%save new archive
+		for k=1:length(fields),
+			field=fields{k};
+			eval(['Archive' package solution '_field' num2str(k) '=md.results. ' field  ';']);
+		end
+		eval(['save Archive' package solution ' Archive' package solution '_field*']);
+	end
+end
+if nargout==1, 
+	varargout{1}=md; 
+end
