Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1301.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1301.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1301.py	(revision 13492)
@@ -0,0 +1,87 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1301.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+#  This file can be run to check that the melting in simple conduction is correctly modeled.
+
+#  There is no velocity (no advection) the only thermal boundary conditions are an imposed temperature
+
+#  at upper surface and an impose flux at its base. The result must be a linear temperature from the upper to the lower
+
+#  surface with an imposed slope (Geothermal flux). if it is not the case, something is thermal modeling has been changed...
+
+printingflag=false
+
+
+md=model()
+md=triangle(md,'../Exp/Square.exp',100000)
+md=setmask(md,'','')
+md=parameterize(md,'../Par/SquareThermal.py')
+md.extrude(3,2)
+md=setflowequation(md,'Pattyn','all')
+
+
+# Some conditions specific to melting test
+
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1)
+md.initialization.temperature=273.15*ones(md.mesh.numberofvertices,1)
+pos=numpy.nonzero(md.mesh.vertexonsurface)
+md.thermal.spctemperature(pos)=md.initialization.temperature(pos)
+md.materials.rheology_B=paterson(md.initialization.temperature)
+
+
+# analytical results
+
+# melting heat = geothermal flux
+
+# Mb*L*rho=G   => Mb=G/L*rho
+
+melting=md.basalforcings.geothermalflux/(md.materials.rho_ice*md.materials.latentheat)*md.constants.yts
+
+
+# modeled  results
+
+md.cluster=generic('name',oshostname(),'np',2)
+md=solve(md,ThermalSolutionEnum())
+
+
+# plot results
+
+comp_melting=md.results.ThermalSolution.BasalforcingsMeltingRate
+relative=abs((comp_melting-melting)./melting)*100
+relative(find(comp_melting==melting))=0
+plotmodel()(md,'data',comp_melting,'title','Modeled melting','data',melting,'title','Analytical melting',\
+	'data',comp_melting-melting,'title','Absolute error','data',relative,'title','Relative error [%]',\
+	'layer#all',1,'caxis#2',[1.02964 1.02966]*10^-4,'FontSize#all',20,'figposition','mathieu')
+if printingflag, 
+	set(gcf,'Color','w')
+	printmodel()('thermalmelting','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
+	system(['mv thermalmelting.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
+end
+
+
+
+
+# Fields and tolerances to track changes
+
+field_names     =['BasalMelting']
+field_tolerances=[1e-08]
+field_values    =[comp_melting]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1302.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1302.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1302.py	(revision 13492)
@@ -0,0 +1,86 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1302.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+#  This file can be run to check that the advection-diffusion  is correctly modeled.
+
+#  There is u=v=0 and w=cst everywhere the only thermal boundary conditions are an imposed temperature
+
+#  at upper surface and an impose flux at its base.
+
+printingflag=false
+
+
+md=model()
+md=triangle(md,'../Exp/Square.exp',100000)
+md=setmask(md,'','')
+md=parameterize(md,'../Par/SquareThermal.py')
+md.extrude(30,1)   %NB: the more one extrudes, the better (10-> relative~0.35%, 20->0.1%, 30->0.05%)
+md=setflowequation(md,'Pattyn','all') 
+
+
+# Thermal boundary conditions
+
+pos1=numpy.nonzero(md.mesh.elementonbed)     md.thermal.spctemperature(md.mesh.elements(pos1,1:3))=10
+pos2=numpy.nonzero(md.mesh.elementonsurface) md.thermal.spctemperature(md.mesh.elements(pos2,4:6))=0
+md.initialization.vz=0.1*ones(md.mesh.numberofvertices,1)
+md.initialization.vel=sqrt( md.initialization.vx.^2+ md.initialization.vy.^2+ md.initialization.vz.^2)
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1)
+
+
+md.thermal.stabilization=2
+# analytical results
+
+# d2T/dz2-w*rho_ice*c/k*dT/dz=0   T(surface)=0  T(bed)=10   => T=A exp(alpha z)+B
+
+alpha=0.1/md.constants.yts*md.materials.rho_ice*md.materials.heatcapacity/md.materials.thermalconductivity   %alpha=w rho_ice c /k  and w=0.1m/an
+A=10/(exp(alpha*(-1000))-1)    %A=T(bed)/(exp(alpha*bed)-1)  with bed=-1000 T(bed)=10
+B=-A
+md.initialization.temperature=A*exp(alpha*md.mesh.z)+B
+
+
+# modeled  results
+
+md.cluster=generic('name',oshostname(),'np',2)
+md=solve(md,ThermalSolutionEnum())
+
+
+# plot results
+
+comp_temp=md.results.ThermalSolution.Temperature
+relative=abs((comp_temp-md.initialization.temperature)./md.initialization.temperature)*100
+relative(find(comp_temp==md.initialization.temperature))=0
+plotmodel()(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,\
+	'title','Analytical temperature [K]','view',3,'data',comp_temp-md.initialization.temperature,\
+	'title','Absolute error [K]','view',3,'data',relative,'title','Relative error [%]','view',3,\
+	'figposition','mathieu','FontSize#all',20)
+if printingflag, 
+	set(gcf,'Color','w')
+	printmodel()('thermaladvection','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
+	system(['mv thermaladvection.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT '])
+end
+
+
+# Fields and tolerances to track changes
+
+field_names     =['AdvectionTemperature']
+field_tolerances=[1e-13]
+field_values    =[comp_temp]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1303.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1303.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1303.py	(revision 13492)
@@ -0,0 +1,80 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1303.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+#  This file can be run to check that the conduction is correctly modeled.
+
+#  There is no velocity (no advection) the only thermal boundary conditions are an imposed temperature
+
+#  at the lower and upper surface. The result must be a linear temperature from the upper to the lower
+
+#  surface. if it is not the case, something is thermal modeling has been changed...
+
+printingflag=false
+
+
+md=model()
+md=triangle(md,'../Exp/Square.exp',100000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareThermal.py')
+md.extrude(11,2)
+md=setflowequation(md,'Pattyn','all')
+pos1=numpy.nonzero(md.mesh.elementonbed)     md.thermal.spctemperature(md.mesh.elements(pos1,1:3))=10
+pos2=numpy.nonzero(md.mesh.elementonsurface) md.thermal.spctemperature(md.mesh.elements(pos2,4:6))=0
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1)
+
+
+# analytical results
+
+# d2T/dz2=0 T(bed)=10 T(surface)=0  => T=0*(z-bed)/thickness+10*(surface-z)/thickness
+
+# each layer of the 3d mesh must have a constant value
+
+md.initialization.temperature=10*(md.geometry.surface-md.mesh.z)./md.geometry.thickness
+
+
+# modeled  results
+
+md.cluster=generic('name',oshostname(),'np',2)
+md=solve(md,ThermalSolutionEnum())
+
+
+# plot results
+
+comp_temp=md.results.ThermalSolution.Temperature
+relative=abs((comp_temp-md.initialization.temperature)./md.initialization.temperature)*100
+relative(find(comp_temp==md.initialization.temperature))=0
+plotmodel()(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,\
+	'title','Analytical temperature [K]','view',3,'data',comp_temp-md.initialization.temperature,\
+	'title','Absolute error [K]','view',3,'data',relative,'title','Relative error [%]','view',3,\
+	'figposition','mathieu','FontSize#all',20)
+if printingflag, 
+	set(gcf,'Color','w')
+	printmodel()('thermalconduction','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
+	system(['mv thermalconduction.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
+end
+
+
+# Fields and tolerances to track changes
+
+field_names     =['ConductionTemperature']
+field_tolerances=[1e-13]
+field_values    =[comp_temp]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1304.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1304.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1304.py	(revision 13492)
@@ -0,0 +1,82 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1304.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+#  This file can be run to check that the geothermal flux in simple conduction is correctly modeled.
+
+#  There is no velocity (no advection) the only thermal boundary conditions are an imposed temperature
+
+#  at upper surface and an impose flux at its base. The result must be a linear temperature from the upper to the lower
+
+#  surface with an imposed slope (Geothermal flux). if it is not the case, something is thermal modeling has been changed...
+
+printingflag=false
+
+
+md=model()
+md=triangle(md,'../Exp/Square.exp',100000)
+md=setmask(md,'','')
+md=parameterize(md,'../Par/SquareThermal.py')
+md.extrude(11,1)
+md=setflowequation(md,'Pattyn','all')
+
+
+pos2=numpy.nonzero(md.mesh.elementonsurface) md.thermal.spctemperature(md.mesh.elements(pos2,4:6))=0
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1)
+md.basalforcings.geothermalflux(:)=0.1 %100mW/m^2
+
+
+# analytical results
+
+# the result is linear with depth and is equal to 0 on the upper surface (See BC)
+
+# d2T/dz2=0  -k*dT/dz(bed)=G  T(surface)=0  => T=-G/k*(z-surface)
+
+md.initialization.temperature=-0.1/md.materials.thermalconductivity*(md.mesh.z-md.geometry.surface) %G=0.1 W/m2
+
+
+# modeled  results
+
+md.cluster=generic('name',oshostname(),'np',2)
+md=solve(md,ThermalSolutionEnum())
+
+
+# plot results
+
+comp_temp=md.results.ThermalSolution.Temperature
+relative=abs((comp_temp-md.initialization.temperature)./md.initialization.temperature)*100
+relative(find(comp_temp==md.initialization.temperature))=0
+plotmodel()(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,\
+	'title','Analytical temperature','view',3,'data',comp_temp-md.initialization.temperature,\
+	'title','Absolute error [K]','view',3,'data',relative,'title','Relative error [%]','view',3,\
+	'figposition','mathieu','FontSize#all',20)
+if printingflag, 
+	set(gcf,'Color','w')
+	printmodel()('thermalgeothermalflux','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
+	system(['mv thermalgeothermalflux.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
+end
+
+
+# Fields and tolerances to track changes
+
+field_names     =['GeothermalFluxTemperature']
+field_tolerances=[1e-13]
+field_values    =[comp_temp]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1501.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1501.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1501.py	(revision 13492)
@@ -0,0 +1,267 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1501.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+printingflag = false
+
+
+md=triangle(model(),'../Exp/Square.exp',350000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.transient.isthermal=0
+
+
+md.timestepping.time_step=1
+md.settings.output_frequency=1
+md.timestepping.final_time=2000
+
+
+# Solve for thinning rate -> -1 * surface mass balance
+
+smb= 2*ones(md.mesh.numberofvertices,1)   
+md.surfaceforcings.mass_balance= smb
+md.basalforcings.melting_rate= smb
+
+
+md=solve(md,PrognosticSolutionEnum())
+
+
+for i=1:10
+	 md=solve(md,PrognosticSolutionEnum())
+	 md.surfaceforcings.mass_balance= md.surfaceforcings.mass_balance - (md.results['PrognosticSolution'][1]['Thickness']-md.geometry.thickness)
+end
+
+
+# Set up transient
+
+smb = md.surfaceforcings.mass_balance
+
+
+tooth= [ [ones(400,1)*(smb') - 10]' [ones(400,1)*(smb')]' ]
+smb=[ [ones(399,1)*(smb')]' smb  tooth tooth]
+
+
+md.surfaceforcings.mass_balance= smb
+md.surfaceforcings.mass_balance(end+1,:)=[1:2000]
+
+
+md=solve(md,TransientSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
+	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4', \
+	'Vx5','Vy5','Vel5','Pressure5','Bed5','Surface5','Thickness5','SurfaceforcingsMassBalance5']
+field_tolerances=[1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
+	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
+	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
+	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
+	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
+field_values=[\
+	md.results['TransientSolution'][400]['Vx'],\
+	md.results['TransientSolution'][400]['Vy'],\
+	md.results['TransientSolution'][400]['Vel'],\
+	md.results['TransientSolution'][400]['Pressure'],\
+	md.results['TransientSolution'][400]['Bed'],\
+	md.results['TransientSolution'][400]['Surface'],\
+	md.results['TransientSolution'][400]['Thickness'],\
+	md.results['TransientSolution'][400]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][800]['Vx'],\
+	md.results['TransientSolution'][800]['Vy'],\
+	md.results['TransientSolution'][800]['Vel'],\
+	md.results['TransientSolution'][800]['Pressure'],\
+	md.results['TransientSolution'][800]['Bed'],\
+	md.results['TransientSolution'][800]['Surface'],\
+	md.results['TransientSolution'][800]['Thickness'],\
+	md.results['TransientSolution'][800]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][1200]['Vx'],\
+	md.results['TransientSolution'][1200]['Vy'],\
+	md.results['TransientSolution'][1200]['Vel'],\
+	md.results['TransientSolution'][1200]['Pressure'],\
+	md.results['TransientSolution'][1200]['Bed'],\
+	md.results['TransientSolution'][1200]['Surface'],\
+	md.results['TransientSolution'][1200]['Thickness'],\
+	md.results['TransientSolution'][1200]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][1600]['Vx'],\
+	md.results['TransientSolution'][1600]['Vy'],\
+	md.results['TransientSolution'][1600]['Vel'],\
+	md.results['TransientSolution'][1600]['Pressure'],\
+	md.results['TransientSolution'][1600]['Bed'],\
+	md.results['TransientSolution'][1600]['Surface'],\
+	md.results['TransientSolution'][1600]['Thickness'],\
+	md.results['TransientSolution'][1600]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][2000]['Vx'],\
+	md.results['TransientSolution'][2000]['Vy'],\
+	md.results['TransientSolution'][2000]['Vel'],\
+	md.results['TransientSolution'][2000]['Pressure'],\
+	md.results['TransientSolution'][2000]['Bed'],\
+	md.results['TransientSolution'][2000]['Surface'],\
+	md.results['TransientSolution'][2000]['Thickness'],\
+	md.results['TransientSolution'][2000]['SurfaceforcingsMassBalance'],\
+	]
+
+
+if printingflag,
+
+
+	starttime = 360
+	endtime = 2000
+	res = 40
+	ts = [starttime:res:endtime]
+
+
+	index = md.mesh.elements
+	x1=md.mesh.x(index(:,1)) x2=md.mesh.x(index(:,2)) x3=md.mesh.x(index(:,3))
+	y1=md.mesh.y(index(:,1)) y2=md.mesh.y(index(:,2)) y3=md.mesh.y(index(:,3))
+	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
+
+
+	thickness = []
+	volume = []
+	massbal = []
+	velocity = []
+	for t=starttime:endtime
+		thickness = [thickness md.results['TransientSolution'][t]['Thickness']]
+		volume = [volume meanmd.results['TransientSolution'][t]['Thicknessvalue,2'].*areas]
+		massbal = [massbal md.results['TransientSolution'][t]['SurfaceforcingsMassBalance']]
+		velocity = [velocity md.results['TransientSolution'][t]['Vel']]
+	end
+
+
+	figure('Position', [0 0 860 932])
+
+
+	options = plotoptions('data','transient_movie','unit','km')
+	options = options.list[1]
+	options = checkplotoptions(md,options)
+
+
+# 	loop over the time steps
+
+	results=md.results.TransientSolution
+	count = 1
+	for i=ts
+
+
+		subplot(5,9,[28:31 37:40])
+		set(gca,'pos',get(gca,'pos')+[-0.08 -0.08 0.07 0.08])
+		field = 'Thickness'
+
+
+# 		process data
+
+		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
+		[data datatype]=processdata(md,results(i).(field),options)
+
+
+		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
+		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+		options=changefieldvalue(options,'title',titlestring)
+		options=addfielddefault(options,'colorbar',1)
+		options=changefieldvalue(options,'caxis',[0 max(max(thickness))])
+		applyoptions(md,[],options)
+
+
+		subplot(5,9,[33:36 42:45])
+		set(gca,'pos',get(gca,'pos')+[-0.00 -0.08 0.07 0.08])
+		field = 'Vel'
+
+
+# 		process data
+
+		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
+		[data datatype]=processdata(md,results(i).(field),options)
+
+
+		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
+		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+		options=changefieldvalue(options,'title',titlestring)
+		options=addfielddefault(options,'colorbar',1)
+		options=changefieldvalue(options,'caxis',[0 max(max(velocity))])
+		applyoptions(md,[],options)
+
+
+		subplot(5,4,1:4)
+		cla
+		set(gca,'pos',get(gca,'pos')+[-0.07 0.03 0.12 0.015])
+		plot(starttime:endtime,mean(massbal),'k','LineWidth', 4)
+		hold on
+		ya = ylim
+		plot([i i], ya, 'r', 'LineWidth',6)
+		ylim(ya) xlim([starttime endtime])
+		title('Surface Mass Balance','FontSize',14)
+		ylabel('m/year','FontSize',14)
+
+
+		subplot(5,4,5:8)
+		cla
+		set(gca,'pos',get(gca,'pos')+[-0.07 0.015 0.12 0.015])
+		plot(starttime:endtime,sum(volume)/1000/1000/1000,'LineWidth',4)
+		hold on
+		ya = ylim
+		plot([i i], ya, 'r', 'LineWidth',6)
+		ylim(ya) xlim([starttime endtime])
+		title('Ice Volume','FontSize',14)
+		ylabel('km^3','FontSize',14)
+
+
+		subplot(5,4,9:12)
+		cla
+		set(gca,'pos',get(gca,'pos')+[-0.07 0 0.12 0.015])
+		plot(starttime:endtime,mean(velocity)/1000, 'LineWidth', 4)
+		hold on
+		ya = ylim
+		plot([i i], ya, 'r', 'LineWidth',6)
+		ylim(ya) xlim([starttime endtime])
+		title('Mean Velocity','FontSize', 14)
+		ylabel('km/year','FontSize', 14)
+		xlabel('year','FontSize', 14)
+
+
+		set(gcf,'Renderer','zbuffer','color','white') %fixes a bug on Mac OS X (not needed in future Matlab version)
+		if i==starttime,
+# 			initialize images and frame
+
+			frame=getframe(gcf)
+			[images,map]=rgb2ind(frame.cdata,256,'nodither')
+			images(1,1,1,length(ts))=0
+		else
+			frame=getframe(gcf)
+			images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither')
+		end
+
+
+		count = count+1
+
+
+	end
+
+
+	filename='transawtooth2d.gif'
+	imwrite(images,map,filename,'DelayTime',1.0,'LoopCount',inf)
+
+
+end %printingflag
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1502.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1502.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1502.py	(revision 13492)
@@ -0,0 +1,273 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1502.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+printingflag = false
+
+
+md=triangle(model(),'../Exp/Square.exp',450000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md=setflowequation(md,'macayeal','all')
+md.extrude(3,1)
+md.cluster=generic('name',oshostname(),'np',2)
+md.transient.isthermal=0
+
+
+md.timestepping.time_step=1
+md.settings.output_frequency=1
+md.timestepping.final_time=2000
+
+
+# Solve for thinning rate -> -1 * surface mass balance
+
+smb= 2*ones(md.mesh.numberofvertices,1)   
+md.surfaceforcings.mass_balance= smb
+md.basalforcings.melting_rate= smb
+
+
+md=solve(md,PrognosticSolutionEnum())
+
+
+for i=1:10
+	 md=solve(md,PrognosticSolutionEnum())
+	 md.surfaceforcings.mass_balance= md.surfaceforcings.mass_balance - (md.results['PrognosticSolution'][1]['Thickness']-md.geometry.thickness)
+end
+
+
+# Set up transient
+
+smb = md.surfaceforcings.mass_balance
+
+
+tooth= [ [ones(400,1)*(smb') - 10]' [ones(400,1)*(smb')]' ]
+smb=[ [ones(399,1)*(smb')]' smb  tooth tooth]
+
+
+md.surfaceforcings.mass_balance= smb
+md.surfaceforcings.mass_balance(end+1,:)=[1:2000]
+
+
+md=solve(md,TransientSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names=['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
+	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
+	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
+	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4', \
+	'Vx5','Vy5','Vz5','Vel5','Pressure5','Bed5','Surface5','Thickness5','SurfaceforcingsMassBalance5']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
+field_values=[\
+	md.results['TransientSolution'][400]['Vx'],\
+	md.results['TransientSolution'][400]['Vy'],\
+	md.results['TransientSolution'][400]['Vz'],\
+	md.results['TransientSolution'][400]['Vel'],\
+	md.results['TransientSolution'][400]['Pressure'],\
+	md.results['TransientSolution'][400]['Bed'],\
+	md.results['TransientSolution'][400]['Surface'],\
+	md.results['TransientSolution'][400]['Thickness'],\
+	md.results['TransientSolution'][400]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][800]['Vx'],\
+	md.results['TransientSolution'][800]['Vy'],\
+	md.results['TransientSolution'][800]['Vz'],\
+	md.results['TransientSolution'][800]['Vel'],\
+	md.results['TransientSolution'][800]['Pressure'],\
+	md.results['TransientSolution'][800]['Bed'],\
+	md.results['TransientSolution'][800]['Surface'],\
+	md.results['TransientSolution'][800]['Thickness'],\
+	md.results['TransientSolution'][800]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][1200]['Vx'],\
+	md.results['TransientSolution'][1200]['Vy'],\
+	md.results['TransientSolution'][1200]['Vz'],\
+	md.results['TransientSolution'][1200]['Vel'],\
+	md.results['TransientSolution'][1200]['Pressure'],\
+	md.results['TransientSolution'][1200]['Bed'],\
+	md.results['TransientSolution'][1200]['Surface'],\
+	md.results['TransientSolution'][1200]['Thickness'],\
+	md.results['TransientSolution'][1200]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][1600]['Vx'],\
+	md.results['TransientSolution'][1600]['Vy'],\
+	md.results['TransientSolution'][1600]['Vz'],\
+	md.results['TransientSolution'][1600]['Vel'],\
+	md.results['TransientSolution'][1600]['Pressure'],\
+	md.results['TransientSolution'][1600]['Bed'],\
+	md.results['TransientSolution'][1600]['Surface'],\
+	md.results['TransientSolution'][1600]['Thickness'],\
+	md.results['TransientSolution'][1600]['SurfaceforcingsMassBalance'],\
+	md.results['TransientSolution'][2000]['Vx'],\
+	md.results['TransientSolution'][2000]['Vy'],\
+	md.results['TransientSolution'][2000]['Vz'],\
+	md.results['TransientSolution'][2000]['Vel'],\
+	md.results['TransientSolution'][2000]['Pressure'],\
+	md.results['TransientSolution'][2000]['Bed'],\
+	md.results['TransientSolution'][2000]['Surface'],\
+	md.results['TransientSolution'][2000]['Thickness'],\
+	md.results['TransientSolution'][2000]['SurfaceforcingsMassBalance'],\
+	]
+
+
+if printingflag,
+
+
+	starttime = 360
+	endtime = 2000
+	res = 40
+	ts = [starttime:res:endtime]
+
+
+	index = md.mesh.elements
+	x1=md.mesh.x(index(:,1)) x2=md.mesh.x(index(:,2)) x3=md.mesh.x(index(:,3))
+	y1=md.mesh.y(index(:,1)) y2=md.mesh.y(index(:,2)) y3=md.mesh.y(index(:,3))
+	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
+
+
+	thickness = []
+	volume = []
+	massbal = []
+	velocity = []
+	for t=starttime:endtime
+		thickness = [thickness md.results['TransientSolution'][t]['Thickness']]
+		volume = [volume meanmd.results['TransientSolution'][t]['Thicknessvalue,2'].*areas]
+		massbal = [massbal md.results['TransientSolution'][t]['SurfaceforcingsMassBalance']]
+		velocity = [velocity md.results['TransientSolution'][t]['Vel']]
+	end
+
+
+	figure('Position', [0 0 1060 1060])
+
+
+	options = plotoptions('data','transient_movie','unit','km')
+	options = options.list[1]
+	options = checkplotoptions(md,options)
+
+
+# 	loop over the time steps
+
+	results=md.results.TransientSolution
+	count = 1
+	for i=ts
+
+
+		subplot(5,9,[28:31 37:40])
+		set(gca,'pos',get(gca,'pos')+[-0.08 -0.08 0.07 0.08])
+		field = 'Thickness'
+
+
+# 		process data
+
+		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
+		[data datatype]=processdata(md,results(i).(field),options)
+
+
+		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
+		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+		options=changefieldvalue(options,'title',titlestring)
+		options=addfielddefault(options,'colorbar',1)
+		options=changefieldvalue(options,'caxis',[0 max(max(thickness))])
+		applyoptions(md,[],options)
+
+
+		subplot(5,9,[33:36 42:45])
+		set(gca,'pos',get(gca,'pos')+[-0.01 -0.08 0.07 0.08])
+		field = 'Vel'
+
+
+# 		process data
+
+		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
+		[data datatype]=processdata(md,results(i).(field),options)
+
+
+		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
+		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+		options=changefieldvalue(options,'title',titlestring)
+		options=addfielddefault(options,'colorbar',1)
+		options=changefieldvalue(options,'caxis',[0 max(max(velocity))])
+		applyoptions(md,[],options)
+
+
+		subplot(5,4,1:4)
+		cla
+		set(gca,'pos',get(gca,'pos')+[-0.07 0.03 0.12 0.015])
+		plot(starttime:endtime,mean(massbal),'k','LineWidth', 4)
+		hold on
+		ya = ylim
+		plot([i i], ya, 'r', 'LineWidth',6)
+		ylim(ya) xlim([starttime endtime])
+		title('Surface Mass Balance','FontSize',14)
+		ylabel('m/year','FontSize',14)
+
+
+		subplot(5,4,5:8)
+		cla
+		set(gca,'pos',get(gca,'pos')+[-0.07 0.015 0.12 0.015])
+		plot(starttime:endtime,sum(volume)/1000/1000/1000,'LineWidth',4)
+		hold on
+		ya = ylim
+		plot([i i], ya, 'r', 'LineWidth',6)
+		ylim(ya) xlim([starttime endtime])
+		title('Ice Volume','FontSize',14)
+		ylabel('km^3','FontSize',14)
+
+
+		subplot(5,4,9:12)
+		cla
+		set(gca,'pos',get(gca,'pos')+[-0.07 0 0.12 0.015])
+		plot(starttime:endtime,mean(velocity)/1000, 'LineWidth', 4)
+		hold on
+		ya = ylim
+		plot([i i], ya, 'r', 'LineWidth',6)
+		ylim(ya) xlim([starttime endtime])
+		title('Mean Velocity','FontSize', 14)
+		ylabel('km/year','FontSize', 14)
+		xlabel('year','FontSize', 14)
+
+
+		set(gcf,'Renderer','zbuffer','color','white') %fixes a bug on Mac OS X (not needed in future Matlab version)
+		if i==starttime,
+# 			initialize images and frame
+
+			frame=getframe(gcf)
+			[images,map]=rgb2ind(frame.cdata,256,'nodither')
+			images(1,1,1,length(ts))=0
+		else
+			frame=getframe(gcf)
+			images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither')
+		end
+
+
+		count = count+1
+
+
+	end
+
+
+	filename='transawtooth3d.gif'
+	imwrite(images,map,filename,'DelayTime',1.0,'LoopCount',inf)
+
+
+end %printingflag
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1601.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1601.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1601.py	(revision 13492)
@@ -0,0 +1,76 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1601.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md=setflowequation(md,'macayeal','all')
+md.diagnostic.spcvx(numpy.nonzero(md.mesh.y>0))=NaN
+md.initialization.vx(:)=0
+md.initialization.vy(:)=0
+md.initialization.vel(:)=0
+
+
+md.cluster=generic('name',oshostname,'np',2)
+md=solve(md,DiagnosticSolutionEnum())
+vel0=md.results.DiagnosticSolution.Vel
+
+
+theta=30*pi/180
+x=md.mesh.x
+y=md.mesh.y
+md.mesh.x=cos(theta)*x-sin(theta)*y
+md.mesh.y=sin(theta)*x+cos(theta)*y
+
+
+md.diagnostic.referential(:,1:3)=repmat([cos(theta),sin(theta),0],md.mesh.numberofvertices,1)
+md.diagnostic.referential(:,4:6)=repmat([0,0,1],md.mesh.numberofvertices,1)
+md=solve(md,DiagnosticSolutionEnum())
+vel1=md.results.DiagnosticSolution.Vel
+
+
+plotmodel()(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference')
+disp(['Error between Cartesian and rotated CS: ' num2str(max(abs(vel0-vel1))/(max(abs(vel0))+eps)) ])
+
+
+# Now, put CS back to normal except on the side where the spc are applied
+
+pos=find(x==0 | x==1000000)
+md.diagnostic.referential(:)=NaN
+md.diagnostic.referential(pos,1:3)=repmat([cos(theta),sin(theta),0],size(pos,1),1)
+md.diagnostic.referential(pos,4:6)=repmat([0,0,1],size(pos,1),1)
+md=solve(md,DiagnosticSolutionEnum())
+vel2=md.results.DiagnosticSolution.Vel
+
+
+plotmodel()(md,'data',vel0,'data',vel2,'data',vel2-vel0,'title','Cartesian CS','title','Rotated CS','title','difference')
+disp(['Error between Cartesian and rotated CS: ' num2str(max(abs(vel0-vel2))/(max(abs(vel0))+eps)) ])
+
+
+# Fields and tolerances to track changes
+
+field_names     =['vel1','vel2']
+field_tolerances=[1e-11,1e-11]
+field_values=[\
+	vel1, \
+	vel2, \
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1602.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1602.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test1602.py	(revision 13492)
@@ -0,0 +1,62 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test1602.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'../Exp/SquareShelf.exp','')
+md=parameterize(md,'../Par/SquareSheetShelf.py')
+md.extrude(5,1)
+md=setflowequation(md,'pattyn','all')
+md.diagnostic.spcvx(numpy.nonzero(md.mesh.y>0))=NaN
+md.initialization.vx(:)=0
+md.initialization.vy(:)=0
+md.initialization.vel(:)=0
+
+
+md.cluster=generic('name',oshostname,'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+vel0=md.results.DiagnosticSolution.Vel
+
+
+theta=30*pi/180
+x=md.mesh.x
+y=md.mesh.y
+md.mesh.x=cos(theta)*x-sin(theta)*y
+md.mesh.y=sin(theta)*x+cos(theta)*y
+
+
+md.diagnostic.referential(:,1:3)=repmat([cos(theta),sin(theta),0],md.mesh.numberofvertices,1)
+md.diagnostic.referential(:,4:6)=repmat([0,0,1],md.mesh.numberofvertices,1)
+md=solve(md,DiagnosticSolutionEnum())
+vel1=md.results.DiagnosticSolution.Vel
+
+
+plotmodel()(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference','view#all',2)
+disp(['Error between Cartesian and rotated CS: ' num2str(max(abs(vel0-vel1))/(max(abs(vel0))+eps)) ])
+
+
+# Fields and tolerances to track changes
+
+field_names     =['vel1']
+field_tolerances=[1e-9]
+field_values=[\
+	vel1, \
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test205.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test205.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test205.py	(revision 13492)
@@ -0,0 +1,42 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test205.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md.extrude(3,2)
+md=setflowequation(md,'pattyn','../Exp/SquareHalfRight.exp','fill','macayeal','coupling','penalties')
+md.cluster=generic('name',oshostname(),'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vz','Vel','Pressure']
+field_tolerances=[1e-05,1e-05,1e-05,1e-05,1e-05]
+field_values=[\
+md.results['DiagnosticSolution'][1]['Vx'],\
+md.results['DiagnosticSolution'][1]['Vy'],\
+md.results['DiagnosticSolution'][1]['Vz'],\
+md.results['DiagnosticSolution'][1]['Vel'],\
+md.results['DiagnosticSolution'][1]['Pressure'],\
+]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test212.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test212.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test212.py	(revision 13492)
@@ -0,0 +1,61 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test212.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',200000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md=setflowequation(md,'macayeal','all')
+
+
+# control parameters
+
+md.inversion.iscontrol=1
+md.inversion.control_parameters=['MaterialsRheologyBbar']
+md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1)
+md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1)
+md.inversion.nsteps=2
+md.inversion.cost_functions=101*ones(md.inversion.nsteps,1)
+md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1)
+md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1)
+md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1)
+md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1)
+md.inversion.vx_obs=md.initialization.vx
+md.inversion.vy_obs=md.initialization.vy
+
+
+md.cluster=generic('name',oshostname(),'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
+field_values=[\
+md.results['DiagnosticSolution'][1]['Gradient1'],\
+md.results['DiagnosticSolution.J'],\
+md.results['DiagnosticSolution'][1]['MaterialsRheologyBbar'],\
+md.results['DiagnosticSolution'][1]['Pressure'],\
+md.results['DiagnosticSolution'][1]['Vel'],\
+md.results['DiagnosticSolution'][1]['Vx'],\
+md.results['DiagnosticSolution'][1]['Vy'],\
+]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test213.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test213.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test213.py	(revision 13492)
@@ -0,0 +1,63 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test213.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',200000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md.extrude(3,1)
+md=setflowequation(md,'macayeal','all')
+
+
+# control parameters
+
+md.inversion.iscontrol=1
+md.inversion.control_parameters=['MaterialsRheologyBbar']
+md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1)
+md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1)
+md.inversion.nsteps=2
+md.inversion.cost_functions=101*ones(md.inversion.nsteps,1)
+md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1)
+md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1)
+md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1)
+md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1)
+md.inversion.vx_obs=md.initialization.vx
+md.inversion.vy_obs=md.initialization.vy
+
+
+md.cluster=generic('name',oshostname(),'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
+#field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Gradient1'],\
+	md.results['DiagnosticSolution'][1]['J'],\
+	md.results['DiagnosticSolution'][1]['MaterialsRheologyB'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test214.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test214.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test214.py	(revision 13492)
@@ -0,0 +1,61 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test214.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',200000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md.extrude(3,1)
+md=setflowequation(md,'pattyn','all')
+
+
+# control parameters
+
+md.inversion.iscontrol=1
+md.inversion.control_parameters=['MaterialsRheologyBbar']
+md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1)
+md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1)
+md.inversion.nsteps=2
+md.inversion.cost_functions=101*ones(md.inversion.nsteps,1)
+md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1)
+md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1)
+md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1)
+md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1)
+md.inversion.vx_obs=md.initialization.vx md.inversion.vy_obs=md.initialization.vy
+
+
+md.cluster=generic('name',oshostname(),'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy']
+field_tolerances=[1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08]
+field_values=[\
+	md.results['DiagnosticSolution.Gradient1),\
+	md.results.DiagnosticSolution.J,\
+	md.results['DiagnosticSolution.MaterialsRheologyB),\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy']
+]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test215.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test215.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test215.py	(revision 13492)
@@ -0,0 +1,61 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test215.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',200000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md.extrude(3,1)
+md=setflowequation(md,'stokes','all')
+
+
+# control parameters
+
+md.inversion.iscontrol=1
+md.inversion.control_parameters=['MaterialsRheologyBbar']
+md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1)
+md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1)
+md.inversion.nsteps=2
+md.inversion.cost_functions=101*ones(md.inversion.nsteps,1)
+md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1)
+md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1)
+md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1)
+md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1)
+md.inversion.vx_obs=md.initialization.vx md.inversion.vy_obs=md.initialization.vy
+
+
+md.cluster=generic('name',oshostname(),'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Gradient' 'Misfits' 'MaterialsRheologyBbar' 'Pressure' 'Vel' 'Vx' 'Vy']
+field_tolerances=[1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09]
+field_values=[\
+	md.results['DiagnosticSolution.Gradient1),\
+	md.results.DiagnosticSolution.J,\
+	md.results['DiagnosticSolution.MaterialsRheologyB),\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy']
+]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test216.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test216.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test216.py	(revision 13492)
@@ -0,0 +1,50 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test216.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/SquareHole.exp','../Exp/Rifts.exp',50000)
+md=meshprocessrifts(md,'../Exp/Square.exp')
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+
+
+# rift settings
+
+md.rifts.riftstruct.fill=MelangeEnum()
+md.rifts.riftstruct.fraction=0
+md.diagnostic.rift_penalty_lock=2
+md.diagnostic.rift_penalty_threshold=0
+md.rifts.riftstruct.fractionincrement=.1
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vel','Pressure']
+field_tolerances=[1e-11,1e-11,1e-11,1e-11]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test217.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test217.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test217.py	(revision 13492)
@@ -0,0 +1,121 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test217.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+
+
+# redo the parameter file for this special shelf. 
+
+# constant thickness, constrained (vy=0) flow into an icefront, 
+
+# from 0 m/yr at the grounding line.
+
+
+
+# tighten
+
+md.diagnostic.restol=10^-4
+
+
+# needed later
+
+ymin=min(md.mesh.y)
+ymax=max(md.mesh.y)
+xmin=min(md.mesh.x)
+xmax=max(md.mesh.x)
+
+
+di=md.materials.rho_ice/md.materials.rho_water
+
+
+h=1000
+md.geometry.thickness=h*ones(md.mesh.numberofvertices,1)
+md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+md.geometry.surface=md.geometry.bed+md.geometry.thickness
+
+
+# Initial velocity and pressure
+
+md.initialization.vx=zeros(md.mesh.numberofvertices,1)
+md.initialization.vy=zeros(md.mesh.numberofvertices,1)
+md.initialization.vz=zeros(md.mesh.numberofvertices,1)
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1)
+
+
+# Materials
+
+md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1)
+md.materials.rheology_B=paterson(md.initialization.temperature)
+md.materials.rheology_n=3*ones(md.mesh.numberofelements,1)
+
+
+# Boundary conditions:
+
+md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1)
+md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1)
+md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1)
+
+
+# constrain flanks to 0 normal velocity
+
+pos=numpy.nonzero(md.mesh.x==xmin | md.mesh.x==xmax)
+md.diagnostic.spcvx(pos)=0
+md.diagnostic.spcvz(pos)=NaN
+
+
+# constrain grounding line to 0 velocity
+
+pos=numpy.nonzero(md.mesh.y==ymin)
+md.diagnostic.spcvx(pos)=0
+md.diagnostic.spcvy(pos)=0
+
+
+# icefront
+
+nodeonicefront=zeros(md.mesh.numberofvertices,1)
+pos=numpy.nonzero(md.mesh.y==ymax)
+nodeonicefront(pos)=1
+pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))) diagnostic.icefront=md.mesh.segments(pos,:)
+diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))]
+md.diagnostic.icefront=diagnostic.icefront
+
+
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
+
+# ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3;
+
+# vy_c=ey_c.*md.mesh.y*md.constants.yts;
+
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vy']
+field_tolerances=[1e-13]
+field_values=[md.results['DiagnosticSolution'][1]['Vy']]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test218.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test218.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test218.py	(revision 13492)
@@ -0,0 +1,152 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test218.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=squaremesh(model(),1000000,1000000,5,5)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+
+
+# redo the parameter file for this special shelf. 
+
+# constant thickness, constrained (vy=0) flow into an icefront, 
+
+# from 0 m/yr at the grounding line.
+
+
+
+# needed later
+
+ymin=min(md.mesh.y)
+ymax=max(md.mesh.y)
+xmin=min(md.mesh.x)
+xmax=max(md.mesh.x)
+
+
+di=md.materials.rho_ice/md.materials.rho_water
+
+
+h=1000
+md.geometry.thickness=h*ones(md.mesh.numberofvertices,1)
+md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+md.geometry.surface=md.geometry.bed+md.geometry.thickness
+
+
+# Initial velocity and pressure
+
+md.initialization.vx=zeros(md.mesh.numberofvertices,1)
+md.initialization.vy=zeros(md.mesh.numberofvertices,1)
+md.initialization.vz=zeros(md.mesh.numberofvertices,1)
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1)
+
+
+# Materials
+
+md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1)
+md.materials.rheology_B=paterson(md.initialization.temperature)
+md.materials.rheology_n=3*ones(md.mesh.numberofelements,1)
+
+
+# Boundary conditions:
+
+md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1)
+md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1)
+md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1)
+
+
+# constrain flanks to 0 normal velocity
+
+pos=numpy.nonzero(md.mesh.x==xmin | md.mesh.x==xmax)
+md.diagnostic.spcvx(pos)=0
+md.diagnostic.spcvz(pos)=NaN
+
+
+# constrain grounding line to 0 velocity
+
+pos=numpy.nonzero(md.mesh.y==ymin)
+md.diagnostic.spcvx(pos)=0
+md.diagnostic.spcvy(pos)=0
+
+
+# icefront
+
+nodeonicefront=zeros(md.mesh.numberofvertices,1)
+pos=numpy.nonzero(md.mesh.y==ymax)
+nodeonicefront(pos)=1
+pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)))
+diagnostic.icefront=md.mesh.segments(pos,:)
+diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))]
+md.diagnostic.icefront=diagnostic.icefront
+
+
+# partitioning
+
+md.qmu.numberofpartitions=md.mesh.numberofvertices
+md=partitioner(md,'package','linear','npart',md.qmu.numberofpartitions)
+md.qmu.pytition=md.qmu.pytition-1
+
+
+# Dakota options
+
+# variables
+
+md.qmu.variables.rheology_B=normal_uncertain('scaled_MaterialsRheologyB',1,.05)
+
+
+# responses
+
+md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999])
+
+
+# method
+
+md.qmu.method     =dakota_method('nond_l')
+
+
+# parameters
+
+md.qmu.pyams.direct=true
+md.qmu.pyams.analysis_driver='diagnostic'
+md.qmu.pyams.evaluation_concurrency=1
+md.qmu.pyams.interval_type='forward'
+
+
+# imperative! 
+
+md.diagnostic.reltol=10^-10#tighten for qmu analysese
+md.qmu.isdakota=1
+
+
+# solve
+
+md=solve(md,DiagnosticSolutionEnum(),'overwrite','y')
+
+
+# Fields and tolerances to track changes
+
+md.qmu.results=md.results.dakota
+md.results.dakota.importancefactors=importancefactors(md,'scaled_MaterialsRheologyB','MaxVel')
+field_names     =['importancefactors']
+field_tolerances=[1e-10]
+field_values=[\
+md.results.dakota.importancefactors,\
+]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test219.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test219.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test219.py	(revision 13492)
@@ -0,0 +1,42 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test219.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md.extrude(3,2)
+md=setflowequation(md,'pattyn','../Exp/SquareHalfRight.exp','fill','macayeal')
+md.cluster=generic('name',oshostname(),'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vz','Vel','Pressure']
+field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-13]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+	md.results['DiagnosticSolution'][1]['Vz'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test220.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test220.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test220.py	(revision 13492)
@@ -0,0 +1,42 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test220.m
+Created on 2012-09-27 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+from numpy import *
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',120000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelf.py')
+md.extrude(2,1)
+md=setflowequation(md,'stokes','../Exp/SquareHalfRight.exp','fill','pattyn')
+md.cluster=generic('name',oshostname(),'np',3)
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vz','Vel','Pressure']
+field_tolerances=[1e-09,1e-09,1e-06,1e-09,1e-09]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+	md.results['DiagnosticSolution'][1]['Vz'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3001.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3001.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3001.py	(revision 13492)
@@ -0,0 +1,47 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3001.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',50000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.diagnostic.requested_outputs=StressTensorEnum()
+md.autodiff.isautodiff=true
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vel','Pressure',\
+	'StressTensorxx','StressTensoryy','StressTensorxy']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
+	1e-13,1e-13,1e-13]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	md.results['DiagnosticSolution'][1]['StressTensorxx'],\
+	md.results['DiagnosticSolution'][1]['StressTensoryy'],\
+	md.results['DiagnosticSolution'][1]['StressTensorxy'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3002.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3002.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3002.py	(revision 13492)
@@ -0,0 +1,43 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3002.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',180000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md.extrude(3,2)
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.autodiff.isautodiff=true
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vz','Vel','Pressure']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+	md.results['DiagnosticSolution'][1]['Vz'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3003.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3003.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3003.py	(revision 13492)
@@ -0,0 +1,52 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3003.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',180000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md.extrude(3,2)
+md=setflowequation(md,'pattyn','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.diagnostic.requested_outputs=StressTensorEnum()
+md.autodiff.isautodiff=true
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vz','Vel','Pressure',\
+	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
+field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,\
+	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+	md.results['DiagnosticSolution'][1]['Vz'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	md.results['DiagnosticSolution'][1]['StressTensorxx'],\
+	md.results['DiagnosticSolution'][1]['StressTensoryy'],\
+	md.results['DiagnosticSolution'][1]['StressTensorzz'],\
+	md.results['DiagnosticSolution'][1]['StressTensorxy'],\
+	md.results['DiagnosticSolution'][1]['StressTensorxz'],\
+	md.results['DiagnosticSolution'][1]['StressTensoryz'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3004.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3004.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3004.py	(revision 13492)
@@ -0,0 +1,43 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3004.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',180000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md.extrude(3,2)
+md=setflowequation(md,'stokes','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.autodiff.isautodiff=true
+md=solve(md,DiagnosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx','Vy','Vz','Vel','Pressure']
+field_tolerances=[1e-08,1e-08,1e-07,1e-08,1e-08]
+field_values=[\
+	md.results['DiagnosticSolution'][1]['Vx'],\
+	md.results['DiagnosticSolution'][1]['Vy'],\
+	md.results['DiagnosticSolution'][1]['Vz'],\
+	md.results['DiagnosticSolution'][1]['Vel'],\
+	md.results['DiagnosticSolution'][1]['Pressure'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3005.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3005.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3005.py	(revision 13492)
@@ -0,0 +1,38 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3005.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.autodiff.isautodiff=true
+md=solve(md,PrognosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Thickness']
+field_tolerances=[1e-13]
+field_values=[\
+	md.results['PrognosticSolution'][1]['Thickness'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3006.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3006.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3006.py	(revision 13492)
@@ -0,0 +1,42 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3006.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from meshconvert import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=meshconvert(md)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.prognostic.stabilization=3
+md.prognostic.spcthickness=md.geometry.thickness
+md.autodiff.isautodiff=true
+md=solve(md,PrognosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Thickness']
+field_tolerances=[1e-13]
+field_values=[\
+	md.results['PrognosticSolution'][1]['Thickness'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3007.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3007.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3007.py	(revision 13492)
@@ -0,0 +1,39 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3007.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md=setflowequation(md,'macayeal','all')
+md.extrude(5,3)
+md.cluster=generic('name',oshostname(),'np',3)
+md.autodiff.isautodiff=true
+md=solve(md,PrognosticSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Thickness']
+field_tolerances=[1e-13]
+field_values=[\
+	md.results['PrognosticSolution'][1]['Thickness'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3008.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3008.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3008.py	(revision 13492)
@@ -0,0 +1,41 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3008.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',180000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md.extrude(3,1)
+md=setflowequation(md,'macayeal','all')
+md.timestepping.time_step=0
+md.cluster=generic('name',oshostname(),'np',3)
+md.autodiff.isautodiff=true
+md=solve(md,ThermalSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Temperature','BasalforcingsMeltingRate']
+field_tolerances=[1e-13,1e-13]
+field_values=[\
+	md.results['ThermalSolution'][1]['Temperature'],\
+	md.results['ThermalSolution'][1]['BasalforcingsMeltingRate'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3009.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3009.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3009.py	(revision 13492)
@@ -0,0 +1,44 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3009.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',180000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md.extrude(3,1)
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.transient.isdiagnostic=0
+md.transient.isprognostic=0
+md.transient.isthermal=1
+md.transient.isgroundingline=0
+md.autodiff.isautodiff=true
+md=solve(md,TransientSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Temperature','BasalforcingsMeltingRate']
+field_tolerances=[1e-13,1e-13]
+field_values=[\
+	md.results['TransientSolution'][1]['Temperature'],\
+	md.results['TransientSolution'][1]['BasalforcingsMeltingRate'],\
+	]
Index: /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3010.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3010.py	(revision 13492)
+++ /issm/trunk-jpl/test/NightlyRun/InNeedOfDebugging/test3010.py	(revision 13492)
@@ -0,0 +1,66 @@
+"""
+== == == == == == == == == == == == == == == == == == ==
+Auto generated python script for ISSM:   test3010.m
+Created on 2012-09-25 via translateToPy.py Ver 1.0 by mikep
+== == == == == == == == == == == == == == == == == == ==
+
+Matlab script conversion into python
+translateToPy.py Author: Michael Pellegrin
+translateToPy.py Date: 09/24/12
+== == == == == == == == == == == == == == == == == == ==
+"""
+
+from MatlabFuncs import *
+from model import *
+from EnumDefinitions import *
+import numpy
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md=triangle(model(),'../Exp/Square.exp',150000)
+md=setmask(md,'all','')
+md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md=setflowequation(md,'macayeal','all')
+md.cluster=generic('name',oshostname(),'np',3)
+md.transient.requested_outputs=IceVolumeEnum()
+
+
+md.autodiff.isautodiff=true
+md=solve(md,TransientSolutionEnum())
+
+
+# Fields and tolerances to track changes
+
+field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
+field_values=[\
+	md.results['TransientSolution'][1]['Vx'],\
+	md.results['TransientSolution'][1]['Vy'],\
+	md.results['TransientSolution'][1]['Vel'],\
+	md.results['TransientSolution'][1]['Pressure'],\
+	md.results['TransientSolution'][1]['Bed'],\
+	md.results['TransientSolution'][1]['Surface'],\
+	md.results['TransientSolution'][1]['Thickness'],\
+	md.results['TransientSolution'][1]['IceVolume'],\
+	md.results['TransientSolution'][2]['Vx'],\
+	md.results['TransientSolution'][2]['Vy'],\
+	md.results['TransientSolution'][2]['Vel'],\
+	md.results['TransientSolution'][2]['Pressure'],\
+	md.results['TransientSolution'][2]['Bed'],\
+	md.results['TransientSolution'][2]['Surface'],\
+	md.results['TransientSolution'][2]['Thickness'],\
+	md.results['TransientSolution'][2]['IceVolume'],\
+	md.results['TransientSolution'][3]['Vx'],\
+	md.results['TransientSolution'][3]['Vy'],\
+	md.results['TransientSolution'][3]['Vel'],\
+	md.results['TransientSolution'][3]['Pressure'],\
+	md.results['TransientSolution'][3]['Bed'],\
+	md.results['TransientSolution'][3]['Surface'],\
+	md.results['TransientSolution'][3]['Thickness'],\
+	md.results['TransientSolution'][3]['IceVolume'],\
+	]
