Index: ../trunk-jpl/src/m/os/oshostname.m
===================================================================
--- ../trunk-jpl/src/m/os/oshostname.m	(revision 18737)
+++ ../trunk-jpl/src/m/os/oshostname.m	(revision 18738)
@@ -4,6 +4,8 @@
 %   usage: hostname=oshostname();
 %
 %
+hostname='sylvestre';
+return;
 
 if ispc(),
 	[status,hostname]=system('hostname');
Index: ../trunk-jpl/src/m/solve/waitonlock.m
===================================================================
--- ../trunk-jpl/src/m/solve/waitonlock.m	(revision 18737)
+++ ../trunk-jpl/src/m/solve/waitonlock.m	(revision 18738)
@@ -60,7 +60,7 @@
 		ispresent=(exist(lockfilename,'file') & exist(logfilename,'file'));
 		time=etime(clock,time0)/60;
 	else
-		pause(5);
+		pause(60);
 		time=etime(clock,time0);
 		fprintf('\rchecking for job completion (time: %i min %i sec)      ',floor(time/60),floor(rem(time,60)));
 		time=time/60; %converts time from sec to min
Index: ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m
===================================================================
--- ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 18737)
+++ ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 18738)
@@ -53,15 +53,25 @@
 %First find segments that are not completely on the front
 if strcmp(elementtype(md.mesh),'Penta'),
 	numbernodesfront=4;
+	%I added the next part. If not, there would be no segments !
+	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements2d,md.mesh.numberofvertices2d);
+	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements2d,md.mesh.vertexconnectivity);
+	segments2=contourenvelope(md);
+	md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices/md.mesh.numberoflayers,1); md.mesh.vertexonboundary(segments2(:,1:2))=1;
+	md.mesh.vertexonboundary=repmat(md.mesh.vertexonboundary,md.mesh.numberoflayers,1);
+	%Then do it for 3d as usual
+	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 elseif strcmp(elementtype(md.mesh),'Tria'),
 	numbernodesfront=2;
+	segments2=md.mesh.segments;
 else
 	error('mesh type not supported yet');
 end
-segmentsfront=md.mask.ice_levelset(md.mesh.segments(:,1:numbernodesfront))==0;
+segmentsfront=md.mask.ice_levelset(segments2(:,1:numbernodesfront))==0;
 segments=find(sum(segmentsfront,2)~=numbernodesfront);
 %Find all nodes for these segments and spc them
-pos=md.mesh.segments(segments,1:numbernodesfront);
+pos=segments2(segments,1:numbernodesfront);
 md.stressbalance.spcvx(pos(:))=0;
 md.stressbalance.spcvy(pos(:))=0;
 md.stressbalance.spcvz(pos(:))=0; % FIXME probably shouldn't spc vertical velocity here
Index: ../trunk-jpl/src/m/classes/clusters/hpc.m
===================================================================
--- ../trunk-jpl/src/m/classes/clusters/hpc.m	(revision 18737)
+++ ../trunk-jpl/src/m/classes/clusters/hpc.m	(revision 18738)
@@ -49,9 +49,9 @@
 		 %}}}
 		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'pub64','free64','free48','free*,pub64','free*'};
-			 queue_requirements_time=[Inf Inf Inf Inf Inf];
-			 queue_requirements_np=[64 64 48 48 48];
+			 available_queues={'pub64','free64','free48','free*,pub64','free*','free*,free64'};
+			 queue_requirements_time=[Inf Inf Inf Inf Inf Inf];
+			 queue_requirements_np=[64 64 48 48 48 48];
 
 			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
 
@@ -105,7 +105,7 @@
 			 fprintf(fid,'#$ -q %s \n',cluster.queue);
 			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
 			 fprintf(fid,'#$ -R y\n');
-			 fprintf(fid,'#$ -m beas\n');
+			 %fprintf(fid,'#$ -m beas\n');
 			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
 			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
 			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
Index: ../trunk-jpl/src/m/classes/model.m
===================================================================
--- ../trunk-jpl/src/m/classes/model.m	(revision 18737)
+++ ../trunk-jpl/src/m/classes/model.m	(revision 18738)
@@ -303,6 +303,9 @@
 			if ~isnan(md.mesh.vertexonboundary), mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1); end
 			if ~isnan(md.mesh.elementconnectivity), mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1); end
 			md.mesh=mesh;
+			md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+			md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+			md.mesh.segments=contourenvelope(md);
 
 		end % }}}
 		function md2 = extract(md,area) % {{{
Index: ../trunk-jpl/src/m/classes/masstransport.m
===================================================================
--- ../trunk-jpl/src/m/classes/masstransport.m	(revision 18737)
+++ ../trunk-jpl/src/m/classes/masstransport.m	(revision 18738)
@@ -6,7 +6,9 @@
 classdef masstransport
 	properties (SetAccess=public) 
 		 spcthickness           = NaN;
+		 iscalvingrate          = 0;
 		 calvingrate            = NaN;
+		 levermann_calving_coeff= 0;
 		 isfreesurface          = 0;
 		 min_thickness          = 0;
 		 hydrostatic_adjustment = 0;
@@ -48,7 +50,9 @@
             % Masstransport solution parameters
             fprintf(fid,'%s\n%s\n%s\n','<frame key="1" label="Masstransport solution parameters">','<section name="masstransport" />');                    
             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="spcthickness" type="',class(obj.spcthickness),'" default="',convert2str(obj.spcthickness),'">','     <section name="masstransport" />','     <help> thickness constraints (NaN means no constraint) [m] </help>','  </parameter>');
+				fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="iscalvingrate" type="',class(obj.iscalvingrate),'" default="',convert2str(obj.iscalvingrate),'">','     <section name="masstransport" />','     <help> do we use calving (loss of ice) </help>','  </parameter>');
             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="calvingrate" type="',class(obj.calvingrate),'" default="',convert2str(obj.calvingrate),'">','     <section name="masstransport" />','     <help> calving rate at given location [m/a] </help>','  </parameter>');
+				fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="levermann_calving_coeff" type="',class(obj.levermann_calving_coeff),'" default="',convert2str(obj.levermann_calving_coeff),'">','     <section name="masstransport" />','     <help> Proportionality coefficient in Levermann model  </help>','  </parameter>');
             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="isfreesurface" type="',class(obj.isfreesurface),'" default="',convert2str(obj.isfreesurface),'">','     <section name="masstransport" />','     <help> do we use free surfaces (FS only) are mass conservation </help>','  </parameter>');
             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="min_thickness" type="',class(obj.min_thickness),'" default="',convert2str(obj.min_thickness),'">','     <section name="masstransport" />','     <help> minimum ice thickness allowed [m] </help>','  </parameter>');
             
@@ -99,6 +103,9 @@
 		end % }}}
 		function obj = setdefaultparameters(obj) % {{{
 
+			%Proportionality coefficient in Levermann model
+			obj.levermann_calving_coeff=8e21;
+			
 			%Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
 			obj.stabilization=1;
 
@@ -121,7 +128,9 @@
 
 			md = checkfield(md,'fieldname','masstransport.spcthickness','forcing',1);
 			if(ismember(LevelsetAnalysisEnum(), analyses) & md.transient.islevelset)
+				md = checkfield(md,'fieldname','masstransport.iscalvingrate','values',[0 1]);
 				md = checkfield(md,'fieldname','masstransport.calvingrate','NaN',1,'size',[md.mesh.numberofvertices 1],'>=',0);
+				md = checkfield(md,'fieldname','masstransport.levermann_calving_coeff','>',0);
 			end
 
 			md = checkfield(md,'fieldname','masstransport.isfreesurface','values',[0 1]);
@@ -134,7 +143,9 @@
 		function disp(obj) % {{{
 			disp(sprintf('   Masstransport solution parameters:'));
 			fielddisplay(obj,'spcthickness','thickness constraints (NaN means no constraint) [m]');
+			fielddisplay(obj,'iscalvingrate','do we use calving (loss of ice)');
 			fielddisplay(obj,'calvingrate','calving rate at given location [m/a]');
+			fielddisplay(obj,'levermann_calving_coeff','proportionality coefficient in Levermann model');
 			fielddisplay(obj,'isfreesurface','do we use free surfaces (FS only) are mass conservation');
 			fielddisplay(obj,'min_thickness','minimum ice thickness allowed [m]');
 			fielddisplay(obj,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' ');
@@ -152,7 +163,9 @@
 
 			WriteData(fid,'object',obj,'fieldname','spcthickness','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'object',obj,'fieldname','calvingrate','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1,'scale',1./yts);
+			WriteData(fid,'object',obj,'fieldname','iscalvingrate','format','Boolean');
 			WriteData(fid,'object',obj,'fieldname','isfreesurface','format','Boolean');
+			WriteData(fid,'object',obj,'fieldname','levermann_calving_coeff','format','Double');
 			WriteData(fid,'object',obj,'fieldname','min_thickness','format','Double');
 			WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',MasstransportHydrostaticAdjustmentEnum());
 			WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer');
