Index: issm/trunk/test/Validation/ISMIP/TestA/runme.m
===================================================================
--- issm/trunk/test/Validation/ISMIP/TestA/runme.m	(revision 4896)
+++ issm/trunk/test/Validation/ISMIP/TestA/runme.m	(revision 4897)
@@ -10,6 +10,10 @@
 md=geography(md,'',''); %ice sheet test
 md=parameterize(md,'Square.par');
-md=extrude(md,10,1);
+md=extrude(md,9,1);
+md.verbose=10;
+md.np=5;
+md.cluster='wilkes';
 
+%md=setelementstype(md,'macayeal','all');
 md=setelementstype(md,'pattyn','all');
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
@@ -21,11 +25,11 @@
 
 %Create MPCs to have periodic boundary conditions
-%posx=find(md.x==0);
-%posx2=find(md.x==max(md.x));
-%
-%posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
-%posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
-%
-%md.penalties=[posx,posx2;posy,posy2];
+posx=find(md.x==0);
+posx2=find(md.x==max(md.x));
+
+posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
+posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
+
+md.penalties=[posx,posx2;posy,posy2];
 
 %Compute the diagnostic
Index: issm/trunk/test/Validation/ISMIP/TestB/runme.m
===================================================================
--- issm/trunk/test/Validation/ISMIP/TestB/runme.m	(revision 4896)
+++ issm/trunk/test/Validation/ISMIP/TestB/runme.m	(revision 4897)
@@ -11,4 +11,6 @@
 md=parameterize(md,'Square.par');
 md=extrude(md,10,1);
+md.cluster='wilkes';
+md.np=3;
 
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
@@ -20,12 +22,12 @@
 md.spcvelocity(pos,1:2)=1;
 
-%%Create MPCs to have periodic boundary conditions
-%posx=find(md.x==0);
-%posx2=find(md.x==max(md.x));
-%
-%posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
-%posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
-%
-%md.penalties=[posx,posx2;posy,posy2];
+%Create MPCs to have periodic boundary conditions
+posx=find(md.x==0);
+posx2=find(md.x==max(md.x));
+
+posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
+posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
+
+md.penalties=[posx,posx2;posy,posy2];
 
 %Compute the diagnostic
Index: issm/trunk/test/Validation/ISMIP/TestC/Square.par
===================================================================
--- issm/trunk/test/Validation/ISMIP/TestC/Square.par	(revision 4896)
+++ issm/trunk/test/Validation/ISMIP/TestC/Square.par	(revision 4897)
@@ -9,5 +9,6 @@
 disp('      creating drag');
 md.drag_type=2; %0 none 1 plastic 2 viscous
-md.drag_coefficient=sqrt(md.yts.*(1000+1000*sin(md.x*2*pi/max(md.x)).*sin(md.y*2*pi/max(md.x)))./(md.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)));
+md.drag_coefficient=sqrt(md.yts.*(1000+1000*sin(md.x*2*pi/max(md.x/3)).*sin(md.y*2*pi/max(md.x/3)))./(md.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)));
+%md.drag_coefficient=sqrt(md.yts.*(1000+1000*sin(md.x*2*pi/max(md.x)).*sin(md.y*2*pi/max(md.x)))./(md.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)));
 %Take care of iceshelves: no basal drag
 pos=find(md.elementoniceshelf);
Index: issm/trunk/test/Validation/ISMIP/TestC/runme.m
===================================================================
--- issm/trunk/test/Validation/ISMIP/TestC/runme.m	(revision 4896)
+++ issm/trunk/test/Validation/ISMIP/TestC/runme.m	(revision 4897)
@@ -3,7 +3,7 @@
 
 %TestC 
-L=80000; %in m
-nx=20; %number of nodes in x direction
-ny=20;
+L=3*80000; %in m (3 times the desired lenght for BC problems)
+nx=60; %number of nodes in x direction
+ny=60;
 md=model;
 md=squaremesh(md,L,L,nx,ny);
@@ -15,12 +15,14 @@
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
 
-%%Create MPCs to have periodic boundary conditions
-%posx=find(md.x==0);
-%posx2=find(md.x==L);
-%
-%posy=find(md.y==0 & md.x~=0 & md.x~=L); %Don't take the same grids two times
-%posy2=find(md.y==L & md.x~=0 & md.x~=L);
-%
-%md.penalties=[posx,posx2;posy,posy2];
+%Create MPCs to have periodic boundary conditions
+%md.spcvelocity=zeros(md.numberofgrids,6);
+
+posx=find(md.x==0);
+posx2=find(md.x==L);
+
+posy=find(md.y==0 & md.x~=0 & md.x~=L); %Don't take the same grids two times
+posy2=find(md.y==L & md.x~=0 & md.x~=L);
+
+md.penalties=[posx,posx2;posy,posy2];
 
 %Compute the diagnostic
Index: issm/trunk/test/Validation/ISMIP/TestD/runme.m
===================================================================
--- issm/trunk/test/Validation/ISMIP/TestD/runme.m	(revision 4896)
+++ issm/trunk/test/Validation/ISMIP/TestD/runme.m	(revision 4897)
@@ -12,20 +12,23 @@
 md=parameterize(md,'Square.par');
 md=extrude(md,10,1);
+md.np=8;
+md.cluster='wilkes';
 
 md=setelementstype(md,'pattyn','all');
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
 
-%We need one grd on dirichlet (in the middle)
-%md.gridondirichlet_diag(33)=1;
-%md.dirichletvalues_diag(1,:)=[18/md.yts -3/md.yts];
+%We need one grd on dirichlet: the 4 corners are set to zero
+md.spcvelocity=zeros(md.numberofgrids,6);
+pos=find((md.x==0 | md.x==max(md.x)) & (md.y==0 | md.y==max(md.y)));
+md.spcvelocity(pos,1:3)=1;
 
-%%Create MPCs to have periodic boundary conditions
-%posx=find(md.x==0);
-%posx2=find(md.x==max(md.x));
-%
-%posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
-%posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
-%
-%md.penalties=[posx,posx2;posy,posy2];
+%Create MPCs to have periodic boundary conditions
+posx=find(md.x==0);
+posx2=find(md.x==max(md.x));
+
+posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
+posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
+
+md.penalties=[posx,posx2;posy,posy2];
 
 %Compute the diagnostic
