Index: issm/trunk-jpl/src/m/Makefile.am
===================================================================
--- issm/trunk-jpl/src/m/Makefile.am	(revision 21259)
+++ issm/trunk-jpl/src/m/Makefile.am	(revision 21260)
@@ -96,4 +96,5 @@
 				${ISSM_DIR}/src/m/classes/geometry.js \
 				${ISSM_DIR}/src/m/classes/gia.js \
+				${ISSM_DIR}/src/m/classes/esa.js \
 				${ISSM_DIR}/src/m/classes/groundingline.js \
 				${ISSM_DIR}/src/m/classes/hydrologyshreve.js \
Index: issm/trunk-jpl/src/m/classes/esa.js
===================================================================
--- issm/trunk-jpl/src/m/classes/esa.js	(revision 21260)
+++ issm/trunk-jpl/src/m/classes/esa.js	(revision 21260)
@@ -0,0 +1,89 @@
+//ESA class definition
+//
+//   Usage:
+//      esa=esa();
+
+function esa(){
+	//methods
+		this.setdefaultparameters = function (){ //{{{
+		
+		//numerical discretization accuracy
+		this.degacc=.01;
+		
+		//output default:
+		this.requested_outputs=['default'];
+
+		//transitions should be a cell array of vectors: 
+		this.transitions=[];
+		
+		}// }}}
+		this.checkconsistency = function(md,solution,analyses) { //{{{
+
+			//Early return
+			if(ArrayAnyEqual(ArrayIsMember('EsaAnalysis',analyses),0))return;
+			
+			md = checkfield(md,'fieldname','esa.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements, 1]);
+			md = checkfield(md,'fieldname','esa.love_h','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','esa.love_l','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','esa.degacc','size',[1, 1],'>=',1e-10);
+			md = checkfield(md,'fieldname','esa.requested_outputs','stringrow',1);
+			
+			//check that love numbers are provided at the same level of accuracy: 
+			if (this.love_h.length != this.love_l.length){
+				throw Error('esa error message: love numbers should be provided at the same level of accuracy');
+			}
+
+		} // }}}
+		this.defaultoutputs = function(md){ // {{{
+			return ['EsaUmotion'];
+		}//}}}
+		this.classname= function(){// {{{
+			return "esa";
+		}// }}}
+		this.disp= function(){// {{{
+			
+		console.log(sprintf('   esa solution parameters:'));
+
+		fielddisplay(this,'deltathickness','thickness change: ice height equivalent [m]');
+		fielddisplay(this,'love_h','load Love number for radial displacement');
+		fielddisplay(this,'love_l','load Love number for horizontal displacements'); 
+		fielddisplay(this,'degacc',"accuracy (default .01 deg) for numerical discretization of the Green's functions");
+		fielddisplay(this,'transitions','indices into parts of the mesh that will be icecaps');
+		fielddisplay(this,'requested_outputs','additional outputs requested (default: EsaUmotion)');
+		} //}}}
+		this.marshall=function(md,prefix,fid) { //{{{
+
+			WriteData(fid,prefix,'object',this,'fieldname','deltathickness','format','DoubleMat','mattype',2);
+			WriteData(fid,prefix,'object',this,'fieldname','love_h','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','love_l','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','degacc','format','Double');
+			WriteData(fid,prefix,'object',this,'fieldname','transitions','format','MatArray');
+
+			//process requested outputs
+			var outputs = this.requested_outputs;
+			for (var i=0;i<outputs.length;i++){
+				if (outputs[i] == 'default') {
+					outputs.splice(i,1);
+					var newoutputs=this.defaultoutputs(md);
+					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
+				}
+			}
+			WriteData(fid,prefix,'data',outputs,'name','md.esa.requested_outputs','format','StringArray');
+		}//}}}
+		this.fix=function() { //{{{
+			this.deltathickness=NullFix(this.deltathickness,NaN);
+			this.love_h=NullFix(this.love_h,NaN);
+			this.love_l=NullFix(this.love_l,NaN);
+			this.degacc=NullFix(this.degacc,NaN);
+		}//}}}
+	//properties
+	//{{{
+	this.deltathickness = NaN;
+	this.love_h         = 0; //provided by PREM model
+	this.love_l         = 0; //idam
+	this.degacc         = 0;
+	this.requested_outputs = [];
+	this.transitions    = [];
+	this.setdefaultparameters();
+	//}}}
+}
Index: issm/trunk-jpl/src/m/classes/esa.m
===================================================================
--- issm/trunk-jpl/src/m/classes/esa.m	(revision 21260)
+++ issm/trunk-jpl/src/m/classes/esa.m	(revision 21260)
@@ -0,0 +1,100 @@
+%ESA class definition
+%
+%   Usage:
+%      esa=esa();
+
+classdef esa
+	properties (SetAccess=public) 
+		deltathickness = NaN;
+		love_h         = 0; %provided by PREM model
+		love_l         = 0; %ideam
+		degacc         = 0;
+		requested_outputs      = {};
+		transitions    = {};
+	end
+	methods
+		function self = esa(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+		
+		%numerical discretization accuracy
+		self.degacc=.01;
+		
+		%output default:
+		self.requested_outputs={'default'};
+
+		%transitions should be a cell array of vectors: 
+		self.transitions={};
+		
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ismember('EsaAnalysis',analyses), return; end
+			md = checkfield(md,'fieldname','esa.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
+			md = checkfield(md,'fieldname','esa.love_h','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','esa.love_l','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','esa.degacc','size',[1 1],'>=',1e-10);
+			md = checkfield(md,'fieldname','esa.requested_outputs','stringrow',1);
+
+			%check that love numbers are provided at the same level of accuracy: 
+			if (size(self.love_h,1)~=size(self.love_l,1)),
+				error('esa error message: love numbers should be provided at the same level of accuracy');
+			end
+
+			%cross check that whereever we have an ice load, the mask is <0 on each vertex: 
+			pos=find(self.deltathickness);
+			maskpos=md.mask.ice_levelset(md.mesh.elements(pos,:)); 
+			[els,vertices]=find(maskpos>0);
+			if length(els),
+				error('esa checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!');
+			end
+
+		end % }}}
+		function list=defaultoutputs(self,md) % {{{
+			list = {'EsaUmotion'};
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   esa parameters:'));
+
+			fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]');
+			fielddisplay(self,'love_h','load Love number for radial displacement');
+			fielddisplay(self,'love_l','load Love number for horizontal displacements');
+			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
+			fielddisplay(self,'requested_outputs','additional outputs requested (default: EsaUmotion)');
+
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2);
+			WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','love_l','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
+			
+			%process requested outputs
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = [];                         %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.esa.requested_outputs','format','StringArray');
+
+		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+		
+			writejs1Darray(fid,[modelname '.esa.deltathickness'],self.deltathickness);
+			writejs1Darray(fid,[modelname '.esa.love_h'],self.love_h);
+			writejs1Darray(fid,[modelname '.esa.love_l'],self.love_l);
+			writejsdouble(fid,[modelname '.esa.degacc'],self.degacc);
+			writejscellstring(fid,[modelname '.esa.requested_outputs'],self.requested_outputs);
+			writejscellarray(fid,[modelname '.esa.transitions'],self.transitions);
+		end % }}}
+	end
+end
Index: issm/trunk-jpl/src/m/classes/esa.py
===================================================================
--- issm/trunk-jpl/src/m/classes/esa.py	(revision 21260)
+++ issm/trunk-jpl/src/m/classes/esa.py	(revision 21260)
@@ -0,0 +1,87 @@
+from fielddisplay import fielddisplay
+from MatlabFuncs import *
+from model import *
+from numpy import *
+from checkfield import checkfield
+from WriteData import WriteData
+
+class esa(object):
+	"""
+	ESA class definition
+	
+		Usage:
+		  esa=esa();
+	"""
+	
+	def __init__(self): # {{{
+		self.deltathickness    = NaN
+		self.love_h            = 0 #provided by PREM model()
+		self.love_l            = 0 #ideam
+		self.degacc            = 0
+		self.requested_outputs = []
+		self.transitions       = []
+		
+		#set defaults
+		self.setdefaultparameters()
+		#}}}
+	def __repr__(self): # {{{
+			string='   esa parameters:'
+			string="%s\n%s"%(string,fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]'))
+			string="%s\n%s"%(string,fielddisplay(self,'love_h','load Love number for radial displacement'))
+			string="%s\n%s"%(string,fielddisplay(self,'love_l','load Love number for horizontal displaements'))
+			string="%s\n%s"%(string,fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
+			string="%s\n%s"%(string,fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps'))
+			string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested (default: EsaUmotion)'))
+
+			return string
+		# }}}
+	def setdefaultparameters(self): # {{{
+		
+		#numerical discretization accuracy
+		self.degacc=.01
+		
+		#output default:
+		self.requested_outputs=['default']
+
+		#transitions should be a cell array of vectors: 
+		self.transitions=[]
+
+		#default output
+		self.requested_outputs=['default']
+		return self
+		#}}}
+	def checkconsistency(self,md,solution,analyses):    # {{{
+
+		#Early return
+		if (solution!='EsaAnalysis'):
+			return md
+
+		md = checkfield(md,'fieldname','esa.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
+		md = checkfield(md,'fieldname','esa.love_h','NaN',1,'Inf',1)
+		md = checkfield(md,'fieldname','esa.love_l','NaN',1,'Inf',1)
+		md = checkfield(md,'fieldname','esa.degacc','size',[1,1],'>=',1e-10)
+		md = checkfield(md,'fieldname','esa.requested_outputs','stringrow',1)
+
+		#check that love numbers are provided at the same level of accuracy: 
+		if (size(self.love_h,0) != size(self.love_l,0)):
+			error('esa error message: love numbers should be provided at the same level of accuracy')
+		return md
+	# }}}
+	def defaultoutputs(self,md): # {{{
+		return ['EsaUmotion']
+	# }}}
+	def marshall(self,prefix,md,fid): # {{{
+		WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2)
+		WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1)
+		WriteData(fid,prefix,'object',self,'fieldname','love_l','format','DoubleMat','mattype',1)
+		WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double')
+		WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray')
+	
+		#process requested outputs
+		outputs = self.requested_outputs
+		indices = [i for i, x in enumerate(outputs) if x == 'default']
+		if len(indices) > 0:
+			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
+			outputs    =outputscopy
+		WriteData(fid,prefix,'data',outputs,'name','md.esa.requested_outputs','format','StringArray')
+	# }}}
Index: issm/trunk-jpl/src/m/classes/model.m
===================================================================
--- issm/trunk-jpl/src/m/classes/model.m	(revision 21259)
+++ issm/trunk-jpl/src/m/classes/model.m	(revision 21260)
@@ -41,4 +41,5 @@
 		calving          = 0;
 		gia              = 0;
+		esa              = 0;
 
 		autodiff         = 0;
@@ -126,4 +127,8 @@
 			if isa(md.slr,'double');
 				md.slr=slr();
+			end
+			%2016 October 11
+			if isa(md.esa,'double');
+				md.esa=esa();
 			end
 
@@ -1094,4 +1099,5 @@
 			md.calving          = calving();
 			md.gia              = gia();
+			md.esa              = esa();
 			md.autodiff         = autodiff();
 			md.inversion        = inversion();
@@ -1265,4 +1271,5 @@
 			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
 			disp(sprintf('%19s: %-22s -- %s','gia'             ,['[1x1 ' class(self.gia) ']'],'parameters for gia solution'));
+			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
 			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
 			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
Index: issm/trunk-jpl/src/m/classes/transient.m
===================================================================
--- issm/trunk-jpl/src/m/classes/transient.m	(revision 21259)
+++ issm/trunk-jpl/src/m/classes/transient.m	(revision 21260)
@@ -12,4 +12,5 @@
 		isgroundingline   = 0;
 		isgia             = 0;
+		isesa             = 0;
 		isdamageevolution = 0;
 		ismovingfront     = 0;
@@ -37,4 +38,5 @@
 			self.isgroundingline = 0;
 			self.isgia           = 0;
+			self.isesa           = 0;
 			self.isdamageevolution = 0;
 			self.ismovingfront   =0;
@@ -55,4 +57,5 @@
 			self.isgroundingline = 0;
 			self.isgia           = 0;
+			self.isesa           = 0;
 			self.isdamageevolution = 0;
 			self.ismovingfront   = 0;
@@ -82,4 +85,5 @@
 			md = checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0 1]);
@@ -99,4 +103,5 @@
 			fielddisplay(self,'isgroundingline','indicates whether a groundingline migration is used in the transient');
 			fielddisplay(self,'isgia','indicates whether a postglacial rebound model is used in the transient');
+			fielddisplay(self,'isesa','indicates whether an elastic adjustment model is used in the transient');
 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
@@ -114,4 +119,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','isgroundingline','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isgia','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','isesa','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean');
@@ -137,4 +143,5 @@
 			writejsdouble(fid,[modelname '.trans.isgroundingline'],self.isgroundingline);
 			writejsdouble(fid,[modelname '.trans.isgia'],self.isgia);
+			writejsdouble(fid,[modelname '.trans.isesa'],self.isesa);
 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
Index: issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m
===================================================================
--- issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 21259)
+++ issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 21260)
@@ -66,4 +66,6 @@
 	elseif strcmp(solutiontype,'GiaSolution')
 		analyses={'GiaAnalysis'};
+	elseif strcmp(solutiontype,'EsaSolution')
+		analyses={'EsaAnalysis'};
 	elseif strcmp(solutiontype,'TransientSolution')
 		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologySommersAnalysis'};
Index: issm/trunk-jpl/src/m/solve/solve.m
===================================================================
--- issm/trunk-jpl/src/m/solve/solve.m	(revision 21259)
+++ issm/trunk-jpl/src/m/solve/solve.m	(revision 21260)
@@ -19,4 +19,5 @@
 %      - 'DamageEvolution'    or 'da'
 %		 - 'Gia'                or 'gia'
+%		 - 'Esa'                or 'esa'
 %		 - 'Sealevelrise'       or 'slr'
 %
@@ -61,4 +62,6 @@
 elseif strcmpi(solutionstring,'gia') || strcmpi(solutionstring,'Gia')
 	solutionstring = 'GiaSolution';
+elseif strcmpi(solutionstring,'esa') || strcmpi(solutionstring,'Esa')
+	solutionstring = 'EsaSolution';
 elseif strcmpi(solutionstring,'slr') || strcmpi(solutionstring,'Sealevelrise')
 	solutionstring = 'SealevelriseSolution';
