Index: ../trunk-jpl/src/m/classes/calving.py
===================================================================
--- ../trunk-jpl/src/m/classes/calving.py	(revision 0)
+++ ../trunk-jpl/src/m/classes/calving.py	(revision 18757)
@@ -0,0 +1,52 @@
+from fielddisplay import fielddisplay
+from EnumDefinitions import *
+from StringToEnum import StringToEnum
+from checkfield import checkfield
+from WriteData import WriteData
+
+class calving(object):
+	"""
+	CALVING class definition
+
+	   Usage:
+	      calving=calving();
+	"""
+
+	def __init__(self): # {{{
+		self.calvingrate            = float('NaN')
+
+		#set defaults
+		self.setdefaultparameters()
+
+		#}}}
+	def __repr__(self): # {{{
+		string='   Calving parameters:'
+		string="%s\n%s"%(string,fielddisplay(self,'calvingrate','calving rate at given location [m/a]'))
+
+		return string
+		#}}}
+	def defaultoutputs(self,md): # {{{
+
+		return []
+
+	#}}}
+	def setdefaultparameters(self): # {{{
+
+		return self
+	#}}}
+	def checkconsistency(self,md,solution,analyses):    # {{{
+
+		#Early return
+		if (solution!=TransientSolutionEnum()) or (not md.transient.iscalving):
+			return md
+
+		md = checkfield(md,'fieldname','calving.calvingrate','NaN',1,'size',[md.mesh.numberofvertices],'>=',0)
+		return md
+	# }}}
+	def marshall(self,md,fid):    # {{{
+
+		yts=365.*24.*3600.
+
+		WriteData(fid,'enum',CalvingLawEnum(),'data',DefaultCalvingEnum(),'format','Integer');
+		WriteData(fid,'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1,'scale',1./yts)
+	# }}}
Index: ../trunk-jpl/src/m/classes/transient.m
===================================================================
--- ../trunk-jpl/src/m/classes/transient.m	(revision 18756)
+++ ../trunk-jpl/src/m/classes/transient.m	(revision 18757)
@@ -12,6 +12,7 @@
 		isgia             = 0;
 		isdamageevolution = 0;
 		islevelset        = 0;
+		iscalving         = 0;
 		ishydrology       = 0;
 		requested_outputs = {};
 	end
@@ -28,6 +29,7 @@
                 fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="isgia" type="',class(obj.isgia),'" default="',convert2str(obj.isgia),'">','     <section name="transient" />','     <help> indicates whether a postglacial rebound model is used in the transient </help>','  </parameter>');
                 fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="isdamageevolution" type="',class(obj.isdamageevolution),'" default="',convert2str(obj.isdamageevolution),'">','     <section name="transient" />','     <help> indicates whether damage evolution is used in the transient </help>','  </parameter>');
                 fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="islevelset" type="',class(obj.islevelset),'" default="',convert2str(obj.islevelset),'">','     <section name="transient" />','     <help> LEVEL SET DESCRIPTION...  </help>','  </parameter>');
+                fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="iscalving" type="',class(obj.iscalving),'" default="',convert2str(obj.iscalving),'">','     <section name="transient" />','     <help> indicates whether calving is used in the transient </help>','  </parameter>');
                 fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="requested_outputs" type="',class(obj.requested_outputs),'" default="',convert2str(obj.requested_outputs),'">','     <section name="transient" />','     <help> list of additional outputs requested </help>','  </parameter>');
             fprintf(fid,'%s\n%s\n','</frame>');    
         
@@ -50,6 +52,7 @@
 			obj.isgia           = 0;
 			obj.isdamageevolution = 0;
 			obj.islevelset      = 0;
+			obj.iscalving       =0;
 			obj.ishydrology     = 0;
 
 			%default output
@@ -65,6 +68,7 @@
 			obj.isgia           = 0;
 			obj.isdamageevolution = 0;
 			obj.islevelset      = 0;
+			obj.iscalving       = 0;
 			obj.ishydrology     = 0;
 
 			%default output
@@ -89,6 +93,7 @@
 			md = checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.islevelset','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','transient.iscalving','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
 
@@ -103,6 +108,7 @@
 			fielddisplay(obj,'isgia','indicates whether a postglacial rebound model is used in the transient');
 			fielddisplay(obj,'isdamageevolution','indicates whether damage evolution is used in the transient');
 			fielddisplay(obj,'islevelset','LEVEL SET DESCRIPTION...');
+			fielddisplay(obj,'iscalving','indicates whether calving is used in the transient');
 			fielddisplay(obj,'ishydrology','indicates whether an hydrology model is used');
 			fielddisplay(obj,'requested_outputs','list of additional outputs requested');
 
@@ -116,6 +122,7 @@
 			WriteData(fid,'object',obj,'fieldname','isdamageevolution','format','Boolean');
 			WriteData(fid,'object',obj,'fieldname','ishydrology','format','Boolean');
 			WriteData(fid,'object',obj,'fieldname','islevelset','format','Boolean');
+			WriteData(fid,'object',obj,'fieldname','iscalving','format','Boolean');
 
 			%process requested outputs
 			outputs = obj.requested_outputs;
Index: ../trunk-jpl/src/m/classes/calving.m
===================================================================
--- ../trunk-jpl/src/m/classes/calving.m	(revision 0)
+++ ../trunk-jpl/src/m/classes/calving.m	(revision 18757)
@@ -0,0 +1,73 @@
+%CALVING class definition
+%
+%   Usage:
+%      calving=calving();
+
+classdef calving
+	properties (SetAccess=public) 
+		 calvingrate            = NaN;
+	end
+	methods (Static)
+		function obj = loadobj(obj) % {{{
+			% This function is directly called by matlab when a model object is
+			% loaded. If the input is a struct it is an old version of this class and
+			% old fields must be recovered (make sure they are in the deprecated
+			% model properties)
+
+			if verLessThan('matlab','7.9'),
+				disp('Warning: your matlab version is old and there is a risk that load does not work correctly');
+				disp('         if the model is not loaded correctly, rename temporarily loadobj so that matlab does not use it');
+
+				% This is a Matlab bug: all the fields of md have their default value
+				% Example of error message:
+				% Warning: Error loading an object of class 'model':
+				% Undefined function or method 'exist' for input arguments of type 'cell'
+				%
+				% This has been fixed in MATLAB 7.9 (R2009b) and later versions
+			end
+
+			if isstruct(obj)
+				disp('Recovering calving from older version');
+				objstruct = obj;
+				obj = structtoobj(calving(),objstruct);
+			end
+		end% }}}
+	end
+	methods
+		function obj = calving(varargin) % {{{
+			switch nargin
+				case 0
+					obj=setdefaultparameters(obj);
+				case 1
+					inputstruct=varargin{1};
+					list1 = properties('calving');
+					list2 = fieldnames(inputstruct);
+					for i=1:length(list1)
+						fieldname = list1{i};
+						if ismember(fieldname,list2),
+							obj.(fieldname) = inputstruct.(fieldname);
+						end
+					end
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function obj = setdefaultparameters(obj) % {{{
+
+		end % }}}
+		function md = checkconsistency(obj,md,solution,analyses) % {{{
+			%Early return
+			if (solution~=TransientSolutionEnum() | md.transient.iscalving==0), return; end
+			md = checkfield(md,'fieldname','calving.calvingrate','NaN',1,'size',[md.mesh.numberofvertices 1],'>=',0);
+		end % }}}
+		function disp(obj) % {{{
+			disp(sprintf('   Calving parameters:'));
+			fielddisplay(obj,'calvingrate','calving rate at given location [m/a]');
+		end % }}}
+		function marshall(obj,md,fid) % {{{
+			yts=365.0*24.0*3600.0;
+			WriteData(fid,'enum',CalvingLawEnum(),'data',DefaultCalvingEnum(),'format','Integer');
+			WriteData(fid,'object',obj,'fieldname','calvingrate','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1,'scale',1./yts);
+		end % }}}
+	end
+end
Index: ../trunk-jpl/src/m/classes/model.m
===================================================================
--- ../trunk-jpl/src/m/classes/model.m	(revision 18756)
+++ ../trunk-jpl/src/m/classes/model.m	(revision 18757)
@@ -36,6 +36,7 @@
 		thermal          = 0;
 		steadystate      = 0;
 		transient        = 0;
+		calving          = 0;
 		gia              = 0;
 
 		seaice           = 0;
@@ -795,12 +796,15 @@
 				end
 			end
 			md.masstransport.spcthickness=project3d(md,'vector',md.masstransport.spcthickness,'type','node');
-			md.masstransport.calvingrate=project3d(md,'vector',md.masstransport.calvingrate,'type','node');
 			md.balancethickness.spcthickness=project3d(md,'vector',md.balancethickness.spcthickness,'type','node');
 			md.damage.spcdamage=project3d(md,'vector',md.damage.spcdamage,'type','node');
 			md.stressbalance.referential=project3d(md,'vector',md.stressbalance.referential,'type','node');
 			md.stressbalance.loadingforce=project3d(md,'vector',md.stressbalance.loadingforce,'type','node');
 
+			% Calving variables
+			if isa(md.calving,'calving'),md.calving.calvingrate=project3d(md,'vector',md.calving.calvingrate,'type','node');end;
+			if isa(md.calving,'calvinglevermann'),md.calving.coeff=project3d(md,'vector',md.calving.coeff,'type','node');end;
+
 			% Hydrologydc variables
 			if isa(md.hydrology,'hydrologydc');
 				md.hydrology.spcsediment_head=project3d(md,'vector',md.hydrology.spcsediment_head,'type','node','layer',1);
@@ -1159,6 +1163,7 @@
 			md.thermal          = thermal();
 			md.steadystate      = steadystate();
 			md.transient        = transient();
+			md.calving          = calving();
 			md.gia              = gia();
 			md.seaice           = seaice();
 			md.autodiff         = autodiff();
@@ -1319,17 +1324,18 @@
 			disp(sprintf('%19s: %-22s -- %s','debug'           ,['[1x1 ' class(obj.debug) ']'],'debugging tools (valgrind, gprof)'));
 			disp(sprintf('%19s: %-22s -- %s','verbose'         ,['[1x1 ' class(obj.verbose) ']'],'verbosity level in solve'));
 			disp(sprintf('%19s: %-22s -- %s','settings'        ,['[1x1 ' class(obj.settings) ']'],'settings properties'));
-			disp(sprintf('%19s: %-22s -- %s','toolkits'          ,['[1x1 ' class(obj.toolkits) ']'],'PETSc options for each solution'));
+			disp(sprintf('%19s: %-22s -- %s','toolkits'        ,['[1x1 ' class(obj.toolkits) ']'],'PETSc options for each solution'));
 			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(obj.cluster) ']'],'cluster parameters (number of cpus...)'));
 			disp(sprintf('%19s: %-22s -- %s','balancethickness',['[1x1 ' class(obj.balancethickness) ']'],'parameters for balancethickness solution'));
-			disp(sprintf('%19s: %-22s -- %s','stressbalance'      ,['[1x1 ' class(obj.stressbalance) ']'],'parameters for stressbalance solution'));
+			disp(sprintf('%19s: %-22s -- %s','stressbalance'   ,['[1x1 ' class(obj.stressbalance) ']'],'parameters for stressbalance solution'));
 			disp(sprintf('%19s: %-22s -- %s','groundingline'   ,['[1x1 ' class(obj.groundingline) ']'],'parameters for groundingline solution'));
 			disp(sprintf('%19s: %-22s -- %s','hydrology'       ,['[1x1 ' class(obj.hydrology) ']'],'parameters for hydrology solution'));
-			disp(sprintf('%19s: %-22s -- %s','masstransport'      ,['[1x1 ' class(obj.masstransport) ']'],'parameters for masstransport solution'));
+			disp(sprintf('%19s: %-22s -- %s','masstransport'   ,['[1x1 ' class(obj.masstransport) ']'],'parameters for masstransport solution'));
 			disp(sprintf('%19s: %-22s -- %s','thermal'         ,['[1x1 ' class(obj.thermal) ']'],'parameters for thermal solution'));
 			disp(sprintf('%19s: %-22s -- %s','steadystate'     ,['[1x1 ' class(obj.steadystate) ']'],'parameters for steadystate solution'));
 			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(obj.transient) ']'],'parameters for transient solution'));
-			disp(sprintf('%19s: %-22s -- %s','gia'       ,['[1x1 ' class(obj.gia) ']'],'parameters for gia solution'));
+			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(obj.calving) ']'],'parameters for calving'));
+			disp(sprintf('%19s: %-22s -- %s','gia'             ,['[1x1 ' class(obj.gia) ']'],'parameters for gia solution'));
 			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(obj.autodiff) ']'],'automatic differentiation parameters'));
 			disp(sprintf('%19s: %-22s -- %s','flaim'           ,['[1x1 ' class(obj.flaim) ']'],'flaim parameters'));
 			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(obj.inversion) ']'],'parameters for inverse methods'));
Index: ../trunk-jpl/src/m/classes/calvinglevermann.m
===================================================================
--- ../trunk-jpl/src/m/classes/calvinglevermann.m	(revision 0)
+++ ../trunk-jpl/src/m/classes/calvinglevermann.m	(revision 18757)
@@ -0,0 +1,48 @@
+%CALVINGLEVERMANN class definition
+%
+%   Usage:
+%      calvinglevermann=calvinglevermann();
+
+classdef calvinglevermann
+	properties (SetAccess=public) 
+		 coeff                  = 0;
+	end
+	methods
+		function obj = calvinglevermann(varargin) % {{{
+			switch nargin
+				case 0
+					obj=setdefaultparameters(obj);
+				case 1
+					inputstruct=varargin{1};
+					list1 = properties('calvinglevermann');
+					list2 = fieldnames(inputstruct);
+					for i=1:length(list1)
+						fieldname = list1{i};
+						if ismember(fieldname,list2),
+							obj.(fieldname) = inputstruct.(fieldname);
+						end
+					end
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function obj = setdefaultparameters(obj) % {{{
+			%Proportionality coefficient in Levermann model
+			obj.coeff=2e13;
+		end % }}}
+		function md = checkconsistency(obj,md,solution,analyses) % {{{
+			%Early return
+			if (solution~=TransientSolutionEnum() | md.transient.iscalving==0), return; end
+			md = checkfield(md,'fieldname','calving.coeff','>',0,'size',[md.mesh.numberofvertices 1]);
+		end % }}}
+		function disp(obj) % {{{
+			disp(sprintf('   Calving parameters:'));
+			fielddisplay(obj,'coeff','proportionality coefficient in Levermann model');
+
+		end % }}}
+		function marshall(obj,md,fid) % {{{
+			WriteData(fid,'enum',CalvingLawEnum(),'data',CalvingLevermannEnum(),'format','Integer');
+			WriteData(fid,'enum',CalvinglevermannCoeffEnum(),'data',obj.coeff,'format','DoubleMat','mattype',1);
+		end % }}}
+	end
+end
Index: ../trunk-jpl/src/m/classes/model.py
===================================================================
--- ../trunk-jpl/src/m/classes/model.py	(revision 18756)
+++ ../trunk-jpl/src/m/classes/model.py	(revision 18757)
@@ -14,6 +14,7 @@
 from SMBmeltcomponents import SMBmeltcomponents
 from basalforcings import basalforcings
 from matice import matice
+from calving import calving
 from damage import damage
 from friction import friction
 from flowequation import flowequation
@@ -87,6 +88,7 @@
 		self.thermal          = thermal()
 		self.steadystate      = steadystate()
 		self.transient        = transient()
+		self.calving          = calving()
 		self.gia              = gia()
 
 		self.autodiff         = autodiff()
@@ -128,6 +130,7 @@
 		        'thermal',\
 		        'steadystate',\
 		        'transient',\
+		        'calving',\
                         'gia',\
 		        'autodiff',\
 		        'flaim',\
@@ -167,6 +170,7 @@
 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("thermal","[%s,%s]" % ("1x1",obj.thermal.__class__.__name__),"parameters for thermal solution"))
 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("steadystate","[%s,%s]" % ("1x1",obj.steadystate.__class__.__name__),"parameters for steadystate solution"))
 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("transient","[%s,%s]" % ("1x1",obj.transient.__class__.__name__),"parameters for transient solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("calving","[%s,%s]" % ("1x1",obj.calving.__class__.__name__),"parameters for calving"))
 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("autodiff","[%s,%s]" % ("1x1",obj.autodiff.__class__.__name__),"automatic differentiation parameters"))
 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flaim","[%s,%s]" % ("1x1",obj.flaim.__class__.__name__),"flaim parameters"))
 		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods"))
@@ -657,8 +661,13 @@
 		md.damage.spcdamage=project3d(md,'vector',md.damage.spcdamage,'type','node')
 		md.stressbalance.referential=project3d(md,'vector',md.stressbalance.referential,'type','node')
 		md.stressbalance.loadingforce=project3d(md,'vector',md.stressbalance.loadingforce,'type','node')
-		md.masstransport.calvingrate=project3d(md,'vector',md.masstransport.calvingrate,'type','node')
 
+		# Calving variables
+		if hasattr(md.calving,'calving'):
+			md.calving.calvingrate=project3d(md,'vector',md.calving.calvingrate,'type','node')
+		if hasattr(md.calving,'calvinglevermann'):
+			md.calving.coeff=project3d(md,'vector',md.calving.coeff,'type','node')
+
 		# Hydrologydc variables
 		if hasattr(md.hydrology,'hydrologydc'):
 			md.hydrology.spcsediment_head=project3d(md,'vector',md.hydrology.spcsediment_head,'type','node','layer',1)
Index: ../trunk-jpl/src/m/classes/masstransport.m
===================================================================
--- ../trunk-jpl/src/m/classes/masstransport.m	(revision 18756)
+++ ../trunk-jpl/src/m/classes/masstransport.m	(revision 18757)
@@ -6,9 +6,6 @@
 classdef masstransport
 	properties (SetAccess=public) 
 		 spcthickness           = NaN;
-		 iscalvingrate          = 0;
-		 calvingrate            = NaN;
-		 levermann_calving_coeff= 0;
 		 isfreesurface          = 0;
 		 min_thickness          = 0;
 		 hydrostatic_adjustment = 0;
@@ -44,40 +41,6 @@
 		end% }}}
 	end
 	methods
-         function createxml(obj,fid) % {{{
-            fprintf(fid, '<!-- masstransport -->\n');            
-                    
-            % 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>');
-            
-            % hydrostatic_adjustment drop-down (incremental or absolute )
-            fprintf(fid,'%s\n%s\n%s\n%s\n','  <parameter key ="hydrostatic_adjustment" type="alternative" optional ="false">','     <section name="masstransport" />','     <help> adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute''  </help>');
-            fprintf(fid,'%s\n','       <option value="Incremental" type="string" default="true"> </option>');
-            fprintf(fid,'%s\n%s\n','       <option value="Absolute" type="string" default="false"> </option>','</parameter>');
-            
-            %stabilization drop-down (0, 1, 2, or 3)
-            fprintf(fid,'%s\n%s\n%s\n%s\n','  <parameter key ="stabilization" type="alternative" optional="false">','     <section name="masstransport" />','     <help> 0: no, 1:  artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin </help>');
-            fprintf(fid,'%s\n','       <option value="0" type="string" default="true"> </option>');
-            fprintf(fid,'%s\n','       <option value="1" type="string" default="false"> </option>');
-            fprintf(fid,'%s\n','       <option value="2" type="string" default="false"> </option>');
-            fprintf(fid,'%s\n%s\n','       <option value="3" type="string" default="false"> </option>','</parameter>');
-
-            fprintf(fid,'%s\n%s\n','</frame>');    
-            
-            %Penalty options
-            fprintf(fid,'%s\n%s\n%s\n','<frame key="2" label="Penalty options">','<section name="masstransport" />'); 
-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="vertex_pairing" type="',class(obj.vertex_pairing),'" default="',convert2str(obj.vertex_pairing),'">','     <section name="masstransport" />','     <help> offset used by penalties: penalty = Kmax*10^offset </help>','  </parameter>');
-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="penalty_factor" type="',class(obj.penalty_factor),'" default="',convert2str(obj.penalty_factor),'">','     <section name="masstransport" />','     <help> pairs of vertices that are penalized </help>','  </parameter>');
-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="requested_outputs" type="',class(obj.requested_outputs),'" default="',convert2str(obj.requested_outputs),'">','     <section name="masstransport" />','     <help> additional outputs requested </help>','  </parameter>');
-            fprintf(fid,'%s\n%s\n','</frame>');
-        
-        end % }}}
 		function obj = masstransport(varargin) % {{{
 			switch nargin
 				case 0
@@ -103,9 +66,6 @@
 		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;
 
@@ -127,12 +87,6 @@
 			if ~ismember(MasstransportAnalysisEnum(),analyses) |  (solution==TransientSolutionEnum() & md.transient.ismasstransport==0), return; end
 
 			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]);
 			md = checkfield(md,'fieldname','masstransport.hydrostatic_adjustment','values',{'Absolute' 'Incremental'});
 			md = checkfield(md,'fieldname','masstransport.stabilization','values',[0 1 2 3 4]);
@@ -143,9 +97,6 @@
 		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'' ');
@@ -162,10 +113,7 @@
 			yts=365.*24.*3600.;
 
 			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');
