Index: /issm/trunk-jpl/src/c/Container/DataSet.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/DataSet.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/Container/DataSet.cpp	(revision 12493)
@@ -133,5 +133,5 @@
 	vector<Object*>::iterator object;
 
-	if(this==NULL)_error_(" trying to echo a NULL dataset");
+	if(this==NULL)_error2_(" trying to echo a NULL dataset");
 
 	_printf_(true,"DataSet echo: %i objects\n",objects.size());
@@ -150,5 +150,5 @@
 	vector<Object*>::iterator object;
 
-	if(this==NULL)_error_(" trying to echo a NULL dataset");
+	if(this==NULL)_error2_(" trying to echo a NULL dataset");
 
 	_printf_(true,"DataSet echo: %i objects\n",objects.size());
@@ -194,9 +194,9 @@
 
 	_assert_(this);
-	if(!sorted)_error_(" trying to binary search on a non-sorted dataset!");
+	if(!sorted)_error2_(" trying to binary search on a non-sorted dataset!");
 
 	/*Carry out a binary search on the sorted_ids: */
 	if(!binary_search(&id_offset,eid, sorted_ids,objects.size())){
-		_error_("could not find object with id %i in DataSet %s",eid,EnumToStringx(enum_type));
+		_error2_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));
 	}
 
@@ -259,6 +259,6 @@
 	/*Only sort if we are not already sorted: */
 	if(!sorted){
-		_error_(" not implemented yet!");
-	}
-}
-/*}}}*/
+		_error2_(" not implemented yet!");
+	}
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/Container/Elements.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Elements.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/Container/Elements.cpp	(revision 12493)
@@ -203,5 +203,5 @@
 		/*see what the first element of this partition has in stock (this is common to all partitions)*/
 		if(my_rank==minrank){
-			if(this->Size()==0) _error_("Cannot write results because there is no element??");
+			if(this->Size()==0) _error2_("Cannot write results because there is no element??");
 			Element* element=(Element*)this->GetObjectByOffset(0);
 			element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
@@ -232,5 +232,5 @@
 			if(resultssizes[i]==P1Enum)      vectorsize=numberofvertices;
 			else if(resultssizes[i]==P0Enum) vectorsize=numberofelements;
-			else _error_("Unkown result size: %s",EnumToStringx(resultssizes[i]));
+			else _error2_("Unkown result size: " << EnumToStringx(resultssizes[i]));
 			vector=new Vector(vectorsize);
 
Index: /issm/trunk-jpl/src/c/Container/Inputs.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Inputs.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/Container/Inputs.cpp	(revision 12493)
@@ -57,5 +57,5 @@
 		/*we could not find an input with the correct enum type. No defaults values were provided, 
 		 * error out: */
-		_error_("could not find input with enum type %i (%s)",enum_type,EnumToStringx(enum_type));
+		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
 	}
 
@@ -85,5 +85,5 @@
 		/*we could not find an input with the correct enum type. No defaults values were provided, 
 		 * error out: */
-		_error_("could not find input with enum type %i (%s)",enum_type,EnumToStringx(enum_type));
+		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
 	}
 
@@ -113,5 +113,5 @@
 		/*we could not find an input with the correct enum type. No defaults values were provided, 
 		 * error out: */
-		_error_("could not find input with enum type %i (%s)",enum_type,EnumToStringx(enum_type));
+		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
 	}
 
@@ -141,5 +141,5 @@
 		/*we could not find an input with the correct enum type. No defaults values were provided, 
 		 * error out: */
-		_error_("could not find input with enum type %i (%s)",enum_type,EnumToStringx(enum_type));
+		_error2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");
 	}
 
@@ -213,5 +213,5 @@
 
 	/*some checks: */
-	if(!constrain_input) _error_(" input %s could not be found!",EnumToStringx(constrain_enum));
+	if(!constrain_input) _error2_(" input " << EnumToStringx(constrain_enum) << " could not be found!");
 
 	/*Apply ContrainMin: */
@@ -254,5 +254,5 @@
 	}
 	else{
-		_error_("Input %s not found",EnumToStringx(enumtype));
+		_error2_("Input " << EnumToStringx(enumtype) << " not found");
 	}
 
@@ -275,5 +275,5 @@
 	}
 	else{
-		_error_("Input %s not found",EnumToStringx(enumtype));
+		_error2_("Input " << EnumToStringx(enumtype) << " not found");
 	}
 
@@ -296,5 +296,5 @@
 	}
 	else{
-		_error_("Input %s not found",EnumToStringx(enumtype));
+		_error2_("Input " << EnumToStringx(enumtype) << " not found");
 	}
 
@@ -317,5 +317,5 @@
 	}
 	else{
-		_error_("Input %s not found",EnumToStringx(enumtype));
+		_error2_("Input " << EnumToStringx(enumtype) << " not found");
 	}
 
@@ -369,5 +369,5 @@
 	/*Make a copy of the original input: */
 	original=(Input*)this->GetInput(original_enum);
-	if(!original)_error_("could not find input with enum: %s",EnumToStringx(original_enum)); 
+	if(!original)_error2_("could not find input with enum: " << EnumToStringx(original_enum)); 
 	copy=(Input*)original->copy();
 
@@ -416,6 +416,6 @@
 
 	/*some checks: */
-	if(!xinput) _error_(" input %s could not be found!",EnumToStringx(MeshXEnum));
-	if(!yinput) _error_(" input %s could not be found!",EnumToStringx(MeshYEnum));
+	if(!xinput) _error2_(" input " << EnumToStringx(MeshXEnum) << " could not be found!");
+	if(!yinput) _error2_(" input " << EnumToStringx(MeshYEnum) << " could not be found!");
 
 	/*Apply AXPY: */
Index: /issm/trunk-jpl/src/c/Container/Observations.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Observations.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/Container/Observations.cpp	(revision 12493)
@@ -59,10 +59,10 @@
 	options->Get(&maxtrimming,"maxtrimming",+1.e+21);
 	options->Get(&minspacing,"minspacing",0.01);
-	if(minspacing<=0) _error_("minspacing must > 0");
+	if(minspacing<=0) _error2_("minspacing must > 0");
 
 	/*Get Minimum box size*/
 	if(options->GetOption("boxlength")){
 		options->Get(&minlength,"boxlength");
-		if(minlength<=0)_error_("boxlength should be a positive number");
+		if(minlength<=0)_error2_("boxlength should be a positive number");
 		maxdepth=int(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));
 	}
@@ -384,5 +384,5 @@
 	SolverxGsl(&GinvZ, Gamma,obs,n_obs);    // Gamma^-1 Z
 #else
-	_error_("GSL is required");
+	_error2_("GSL is required");
 #endif
 
Index: /issm/trunk-jpl/src/c/Container/Options.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Options.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/Container/Options.cpp	(revision 12493)
@@ -47,8 +47,8 @@
 
 	/*Also, check the option name*/
-	if(!in_option->name) _error_("input option has an empty name");
-	if(strchr(in_option->name,'.')) _error_("Option \"%s\" has a protected character \".\"",in_option->name);
-	if(strchr(in_option->name,'[')) _error_("Option \"%s\" has a protected character \"[\"",in_option->name);
-	if(strchr(in_option->name,']')) _error_("Option \"%s\" has a protected character \"]\"",in_option->name);
+	if(!in_option->name) _error2_("input option has an empty name");
+	if(strchr(in_option->name,'.')) _error2_("Option \"" << in_option->name << "\" has a protected character \".\"");
+	if(strchr(in_option->name,'[')) _error2_("Option \"" << in_option->name << "\" has a protected character \"[\"");
+	if(strchr(in_option->name,']')) _error2_("Option \"" << in_option->name << "\" has a protected character \"]\"");
 
 	/*Finally, check that no option of the same name already exists in the dataset*/
@@ -57,5 +57,5 @@
 		option=(Option*)(*object); 
 		if (!strcmp(option->name,in_option->name)){
-			_error_("Options \"%s\" found multiple times",in_option->name);
+			_error2_("Options \"" << in_option->name << "\" found multiple times");
 			break;
 		}
@@ -83,5 +83,5 @@
 	/*Else, the Option does not exist, no default provided*/
 	else{
-		_error_("option of name \"%s\" not found, and no default value has been provided",name);
+		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
 	}
 }
@@ -121,5 +121,5 @@
 	/*Else, the Option does not exist, no default provided*/
 	else{
-		_error_("option of name \"%s\" not found, and no default value has been provided",name);
+		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
 	}
 }
@@ -159,5 +159,5 @@
 	/*Else, the Option does not exist, no default provided*/
 	else{
-		_error_("option of name \"%s\" not found, and no default value has been provided",name);
+		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
 	}
 }
@@ -199,5 +199,5 @@
 	/*Else, the Option does not exist, no default provided*/
 	else{
-		_error_("option of name \"%s\" not found, and no default value has been provided",name);
+		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
 	}
 
@@ -264,5 +264,5 @@
 		/*Else: not supported*/
 		else{
-			_error_("Cannot recover field \"%s\" for an option of type %s",name,EnumToStringx(option->ObjectEnum()));
+			_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
 		}
 	}
@@ -290,5 +290,5 @@
 	/*Else, the Option does not exist, no default provided*/
 	else{
-		_error_("option of name \"%s\" not found, and no default value has been provided",name);
+		_error2_("option of name \"" << name << "\" not found, and no default value has been provided");
 	}
 }
@@ -324,5 +324,5 @@
 				/*Else: not supported*/
 				else{
-					_error_("Cannot recover field \"%s\" for an option of type %s",name,EnumToStringx(option->ObjectEnum()));
+					_error2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
 				}
 			}
Index: /issm/trunk-jpl/src/c/Container/Parameters.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Parameters.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/Container/Parameters.cpp	(revision 12493)
@@ -65,5 +65,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 }
 /*}}}*/
@@ -82,5 +82,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 }
 /*}}}*/
@@ -99,5 +99,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 }
 /*}}}*/
@@ -116,5 +116,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -134,5 +134,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -152,5 +152,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -170,5 +170,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -188,5 +188,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -206,5 +206,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -224,5 +224,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 }
 /*}}}*/
@@ -241,5 +241,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -259,5 +259,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 
 }
@@ -277,5 +277,5 @@
 		}
 	}
-	_error_("could not find parameter %s",EnumToStringx(enum_type));
+	_error2_("could not find parameter " << EnumToStringx(enum_type));
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/include/macros.h
===================================================================
--- /issm/trunk-jpl/src/c/include/macros.h	(revision 12492)
+++ /issm/trunk-jpl/src/c/include/macros.h	(revision 12493)
@@ -9,5 +9,4 @@
 #include <iostream>
 #include <sstream>
-
 #include "./typedefs.h"
 
@@ -42,5 +41,5 @@
 #else
 #define _error2_(StreamArgs)\
-   {std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+	{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
    throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}
Index: /issm/trunk-jpl/src/c/io/Disk/pfclose.cpp
===================================================================
--- /issm/trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/io/Disk/pfclose.cpp	(revision 12493)
@@ -18,4 +18,4 @@
 	extern int my_rank;
 	_assert_(fid);
-	if(fclose(fid)!=0)_error_("%s%s","could not close file ",filename);
+	if(fclose(fid)!=0)_error2_("" << "could not close file " << filename);
 }
Index: /issm/trunk-jpl/src/c/io/Disk/pfopen.cpp
===================================================================
--- /issm/trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 12493)
@@ -20,5 +20,5 @@
 	/*Open handle to data on disk: */
 	fid=fopen(filename,format);
-	if(fid==NULL) _error_("%s%s%s","could not open file ",filename," for binary reading or writing"); 
+	if(fid==NULL) _error2_("" << "could not open file " << filename << " for binary reading or writing"); 
 
 	return fid;
Index: /issm/trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp
===================================================================
--- /issm/trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp	(revision 12493)
@@ -22,9 +22,9 @@
 		/* special case: */
 		function();
-		_error_("usage: see above");
+		_error2_("usage: see above");
 	}
 	else if (nlhs!=NLHS || nrhs!=NRHS ) {
 		function(); 
-		_error_("usage error.");
+		_error2_("usage error.");
 	}
 	return 1;
Index: /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
===================================================================
--- /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 12493)
@@ -44,5 +44,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 			
@@ -85,5 +85,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 			
@@ -130,5 +130,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -172,5 +172,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -234,5 +234,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 			
@@ -265,5 +265,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -297,5 +297,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -329,5 +329,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -361,5 +361,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -377,5 +377,5 @@
 	/*Ok, the string should be coming directly from the matlab workspace: */
 	if (!mxIsClass(dataref,"char")){
-		_error_("input data_type is not a string!");
+		_error2_("input data_type is not a string!");
 	}
 	else{
@@ -412,5 +412,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 			
@@ -430,5 +430,5 @@
 
 	if (!mxIsClass(dataref,"double")){
-		_error_("input data_type is not a double!");
+		_error2_("input data_type is not a double!");
 	}
 	else{
@@ -447,5 +447,5 @@
 
 	if (!mxIsClass(dataref,"double")){
-		_error_("input data_type is not a scalar!");
+		_error2_("input data_type is not a scalar!");
 	}
 	else{
@@ -464,10 +464,10 @@
 
 	if (mxIsClass(dataref,"logical")){
-		if(mxGetM(dataref)!=1) _error_("input data is not of size 1x1");
-		if(mxGetN(dataref)!=1) _error_("input data is not of size 1x1");
+		if(mxGetM(dataref)!=1) _error2_("input data is not of size 1x1");
+		if(mxGetN(dataref)!=1) _error2_("input data is not of size 1x1");
 		mxbool_ptr=mxGetLogicals(dataref);
 	}
 	else{
-		_error_("input data_type is not a bool!");
+		_error2_("input data_type is not a bool!");
 	}
 
@@ -491,5 +491,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -515,5 +515,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+		_error2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
 	}
 
@@ -616,8 +616,8 @@
 	/*Fetch all options*/
 	for (int i=istart; i<nrhs; i=i+2){
-		if (!mxIsClass(pdataref[i],"char")) _error_("Argument %d must be name of option",i+1);
+		if (!mxIsClass(pdataref[i],"char")) _error2_("Argument " << i+1 << " must be name of option");
 
 		FetchData(&name,pdataref[i]);
-		if(i+1 == nrhs) _error_("Argument %d must exist and be value of option \"%s\".",i+2,name);
+		if(i+1 == nrhs) _error2_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");
 
 		option=(Option*)OptionParse(name,&pdataref[i+1]);
Index: /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
===================================================================
--- /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 12493)
@@ -108,5 +108,5 @@
 	}
 	else{
-		_error_("Matlab matrix type Not implemented yet");
+		_error2_("Matlab matrix type Not implemented yet");
 	}
 
Index: /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp
===================================================================
--- /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp	(revision 12493)
@@ -46,5 +46,5 @@
 		
 		/*Check that input is actualy a vector*/
-		if (cols!=1) _error_("input vector of size %ix%i should have only one column",rows,cols);
+		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
 
 		nz=(int)((double)nnz/(double)rows);
@@ -77,5 +77,5 @@
 
 		/*Check that input is actualy a vector*/
-		if (cols!=1) _error_("input vector of size %ix%i should have only one column",rows,cols);
+		if (cols!=1) _error2_("input vector of size " << rows << "x" << cols << " should have only one column");
 
 		/*allocate and memcpy*/
Index: /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp
===================================================================
--- /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp	(revision 12493)
@@ -27,5 +27,5 @@
 	/*check and parse the value  */
 	if (!mxIsClass(prhs[0],"double")){
-		_error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",odouble->name,"double",odouble->name,mxGetClassName(prhs[0]));
+		_error2_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
 	}
 	FetchData(&odouble->values,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
@@ -45,5 +45,5 @@
 	/*check and parse the value  */
 	if (!mxIsClass(prhs[0],"logical")){
-		_error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ological->name,"logical",ological->name,mxGetClassName(prhs[0]));
+		_error2_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
 	}
 	FetchData(&ological->values,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
@@ -63,5 +63,5 @@
 	/*check and parse the value  */
 	if (!mxIsClass(prhs[0],"char")){
-		_error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ochar->name,"char",ochar->name,mxGetClassName(prhs[0]));
+		_error2_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
 	}
 	FetchData(&ochar->values,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
@@ -87,5 +87,5 @@
 	/*check and parse the value  */
 	if (!mxIsClass(prhs[0],"struct")){
-		_error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ostruct->name,"struct",ostruct->name,mxGetClassName(prhs[0]));
+		_error2_("Value of option \"" << ostruct->name  << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
 	}
 	ostruct->numel=mxGetNumberOfElements(prhs[0]);
@@ -133,5 +133,5 @@
 	/*check and parse the value  */
 	if (!mxIsClass(prhs[0],"cell")){
-		_error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ocell->name,"cell",ocell->name,mxGetClassName(prhs[0]));
+		_error2_("Value of option \"" << ocell->name  << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
 	}
 
@@ -181,5 +181,5 @@
 			mxDestroyArray(lhs[0]);
 		}
-		else _error_("Second argument value of option \"%s\" is of unrecognized class \"%s\".",name,mxGetClassName(prhs[0]));
+		else _error2_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 12493)
@@ -86,5 +86,5 @@
 		}
 		else if (flag==NodalEnum){
-			_error_(" nodal response functions not supported yet!");
+			_error2_(" nodal response functions not supported yet!");
 
 			/*increment response_pointer :*/
@@ -104,5 +104,5 @@
 			}
 		}
-		else _error_("%s%i%s"," flag type ",flag," not supported yet for response analysis");
+		else _error2_("" << " flag type " << flag << " not supported yet for response analysis");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Dakotax/DescriptorIndex.cpp	(revision 12493)
@@ -23,10 +23,10 @@
 	/*retrieve first token, separated by underscore: */
 	pch = strtok (descriptor,"_");
-	if(!pch)_error_("%s%s%s"," descriptor ",descriptor," is not correctly formatted!");
+	if(!pch)_error2_("" << " descriptor " << descriptor << " is not correctly formatted!");
 
 	if (strncmp(pch,"scaled",6)==0){
 		/*we have a scaled variable. recover the root: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," scaled descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " scaled descriptor " << descriptor << " is not correctly formatted!");
 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
 
@@ -44,9 +44,9 @@
 		/*we have an indexed variable. recover the root: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," indexed descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " indexed descriptor " << descriptor << " is not correctly formatted!");
 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
 		/*now recover  the index: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," indexed descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " indexed descriptor " << descriptor << " is not correctly formatted!");
 		sscanf(pch,"%i",pindex);
 		return IndexedEnum;
@@ -55,9 +55,9 @@
 		/*we have an indexed variable. recover the root: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," nodal descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " nodal descriptor " << descriptor << " is not correctly formatted!");
 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
 		/*now recover  the index: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," nodal descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " nodal descriptor " << descriptor << " is not correctly formatted!");
 		sscanf(pch,"%i",pindex);
 		return NodalEnum;
Index: /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Dakotax/SpawnCoreParallel.cpp	(revision 12493)
@@ -72,5 +72,5 @@
 	if(control_analysis)solutioncore=&control_core;
 	#else
-	_error_("ISSM was not compiled with control capabilities, exiting!");
+	_error2_("ISSM was not compiled with control capabilities, exiting!");
 	#endif
 
Index: /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 12493)
@@ -39,5 +39,5 @@
 	#ifdef _HAVE_MPI_
 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
-	if(!sumfound)_error_("%s%i%s","could not find material with id",index," to compute ElementResponse");
+	if(!sumfound)_error2_("" << "could not find material with id" << index << " to compute ElementResponse");
 	#endif
 
Index: /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 12493)
@@ -55,5 +55,5 @@
 
 	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
-		_error_("Error reading exp file.");
+		_error2_("Error reading exp file.");
 	_printf_(true,"Exp2Kmlx -- Reading %d exp profiles from file \"%s\".\n",nprof,filexp);
 //	for (i=0; i<nprof; i++)
Index: /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 12493)
@@ -26,5 +26,5 @@
 	/*Get size of vector: */
 	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
-	if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: %s",EnumToStringx(configuration_type));
+	if (gsize==0) _error2_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
 	
 	/*Initialize solution: */
Index: /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 12493)
@@ -32,5 +32,5 @@
 	}
 	else{
-		_error_("%s%s%s"," vector type: ",EnumToStringx(type)," not supported yet!");
+		_error2_("" << " vector type: " << EnumToStringx(type) << " not supported yet!");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 12493)
@@ -54,6 +54,6 @@
 	/*Check that gradient is clean*/
 	norm_inf=gradient->Norm(NORM_INF);
-	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
-	if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
+	if(norm_inf<=0)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
+	if(isnan(norm_inf))_error2_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
 
 	/*Clean-up and assign output pointer*/
Index: /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 12493)
@@ -27,5 +27,5 @@
 
 	if(migration_style==NoneEnum) return;
-	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_("%s not supported yet!",EnumToStringx(migration_style));
+	if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error2_("" << EnumToStringx(migration_style) << " not supported yet!");
 
 	if(migration_style==SoftMigrationEnum){
Index: /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 12493)
@@ -95,8 +95,8 @@
 		}
 		else if (strncmp(descriptor,"indexed_",8)==0){
-			_error_(" indexed variables not supported yet!");
+			_error2_(" indexed variables not supported yet!");
 		}
 		else if (strncmp(descriptor,"nodal_",8)==0){
-			_error_(" nodal variables not supported yet!");
+			_error2_(" nodal variables not supported yet!");
 		}
 		else{
Index: /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 12493)
@@ -36,11 +36,11 @@
 	/*Some checks on arguments: */
 	if ((M<2) || (N<2) || (nods<=0)){
-		_error_("nothing to be done according to the dimensions of input matrices and vectors.");
+		_error2_("nothing to be done according to the dimensions of input matrices and vectors.");
 	}
 	if (x_in[1]-x_in[0]<0){
-		_error_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
+		_error2_("x coordinate vector should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
 	}
 	if (y_in[1]-y_in[0]<0){
-		_error_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
+		_error2_("y coordinate vector should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
 	}
 
@@ -68,5 +68,5 @@
 	}
 	else{
-		_error_("x and y vectors length should be 1 or 0 more than data number of rows.");
+		_error2_("x and y vectors length should be 1 or 0 more than data number of rows.");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 12493)
@@ -41,5 +41,5 @@
 	/*some checks*/
 	if (nels_data<1 || nods_data<3 || nods_prime==0){
-		_error_("nothing to be done according to the mesh given in input");
+		_error2_("nothing to be done according to the mesh given in input");
 	}
 
@@ -55,9 +55,9 @@
 	}
 	else{
-		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
 	}
 
 	if((numcontours) && (interpolation_type==2)){
-		_error_(" element interpolation_type with contours not supported yet!");
+		_error2_(" element interpolation_type with contours not supported yet!");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 12493)
@@ -30,5 +30,5 @@
 	/*some checks*/
 	if (nels<1 || nods<3 || nlines<1 || ncols<1 || xposting==0 || yposting==0){
-		_error_("nothing to be done according to the mesh given in input");
+		_error2_("nothing to be done according to the mesh given in input");
 	}
 
@@ -41,5 +41,5 @@
 	}
 	else{
-		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 12493)
@@ -38,11 +38,11 @@
 	/*Checks*/
 	if (data_cols<=0){
-		_error_("data provided has a negative number of columns");
+		_error2_("data provided has a negative number of columns");
 	}
 	if (data_rows!=nods_data && data_rows!=nels_data){
-		_error_("data provided should have either %i or %i lines (not %i)",nods_data,nels_data,data_rows);
+		_error2_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << data_rows << ")");
 	}
 	if((num_default_values) && (data_cols>1)){
-		_error_("data provided can only have 1 column if a default value is provided");
+		_error2_("data provided can only have 1 column if a default value is provided");
 	}
 	
@@ -125,5 +125,5 @@
 				for (j=0;j<data_cols;j++){
 					if (it<0 || it>=nels_data){
-						_error_("Triangle number %i not in [0 %i], because not correctly implemented yet... interpolate on grid first",it,nels_data);
+						_error2_("Triangle number " << it << " not in [0 " << nels_data << "], because not correctly implemented yet... interpolate on grid first");
 					}
 					data_interp[i*data_cols+j]=data[data_cols*it+j];
Index: /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp	(revision 12493)
@@ -27,5 +27,5 @@
 	/*some checks*/
 	if (nels_data<1 || nods_data<6 || nods_prime==0){
-		_error_("nothing to be done according to the mesh given in input");
+		_error2_("nothing to be done according to the mesh given in input");
 	}
 
@@ -41,5 +41,5 @@
 	}
 	else{
-		_error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
+		_error2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 12493)
@@ -38,6 +38,6 @@
 	fid=iomodel->SetFilePointerToData(&code, &vector_layout,vector_enum);
 
-	if(code!=7)_error_("%s%s"," expecting a IssmDouble vector for constraints with enum ",EnumToStringx(vector_enum));
-	if(vector_layout!=1)_error_("%s%s"," expecting a nodal vector for constraints with enum ",EnumToStringx(vector_enum));
+	if(code!=7)_error2_("" << " expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
+	if(vector_layout!=1)_error2_("" << " expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
 
 	/*Fetch vector:*/
@@ -99,5 +99,5 @@
 	}
 	else{
-		_error_("Size of field %s not supported",EnumToStringx(vector_enum));
+		_error2_("Size of field " << EnumToStringx(vector_enum) << " not supported");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp	(revision 12493)
@@ -133,5 +133,5 @@
 					}
 					else
-						_error_("Nodal connectivity table needs more than specified %d columns.\n",mxepg);
+						_error2_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");
 				}
 				jpt++;
@@ -173,5 +173,5 @@
 
 		else
-			_error_("Data matrix has incorrect number of %d rows.\n",mdata);
+			_error2_("Data matrix has incorrect number of " << mdata << " rows.\n");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 12493)
@@ -44,5 +44,5 @@
 	fidi=fopen(filkml,"r");
 	if (!(kobj=KMLFileReadx(fidi)))
-		_error_("Error reading kml file.");
+		_error2_("Error reading kml file.");
 	fclose(fidi);
 
Index: /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12493)
@@ -139,5 +139,5 @@
 	}
 	else{
-		_error_("output '%s' not supported yet",output);
+		_error2_("output '" << output << "' not supported yet");
 	}
 
@@ -306,5 +306,5 @@
 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
-		else _error_("variogram %s not supported yet (list of supported variogram: gaussian, exponential, spherical and power)",model);
+		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
 	}
 	else variogram = new GaussianVariogram(options);
Index: /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 12493)
@@ -103,5 +103,5 @@
 	}
 	else{
-		_error_("output '%s' not supported yet",output);
+		_error2_("output '" << output << "' not supported yet");
 	}
 
@@ -126,5 +126,5 @@
 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
 		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
-		else _error_("variogram %s not supported yet (list of supported variogram: gaussian, exponential, spherical and power)",model);
+		else _error2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");
 	}
 	else variogram = new GaussianVariogram(options);
Index: /issm/trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 12493)
@@ -52,5 +52,5 @@
 	double  T,rho,sl,tc,mc;
 
-	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
+	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
 
 	delta = central_meridian;
@@ -123,5 +123,5 @@
 		_printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
 	}
-	else _error_("Sign should be either +1 or -1.\n");
+	else _error2_("Sign should be either +1 or -1.\n");
 
 	return;
Index: /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 12493)
@@ -51,5 +51,5 @@
 			for (i=0;i<numberofnodes;i++)    npart[i]=0;
 		}
-		else _error_("At least one processor is required");
+		else _error2_("At least one processor is required");
 	}
 	else{
@@ -78,5 +78,5 @@
 			for (i=0;i<numberofnodes2d;i++)    npart2d[i]=0;
 		}
-		else _error_("At least one processor is required");
+		else _error2_("At least one processor is required");
 
 		/*Extrude epart2d to epart, using numlayers: */
Index: /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp	(revision 12493)
@@ -38,5 +38,5 @@
 	if(    (edge1==IntersectEnum) && (edge2==IntersectEnum) && (edge3==IntersectEnum)   ){
 		/*This case is impossible: */
-		_error_(" error: a line cannot go through 3 different vertices!");
+		_error2_(" error: a line cannot go through 3 different vertices!");
 	}
 	else if(    ((edge1==IntersectEnum) && (edge2==IntersectEnum)) || ((edge2==IntersectEnum) && (edge3==IntersectEnum)) || ((edge3==IntersectEnum) && (edge1==IntersectEnum))   ){
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 12493)
@@ -46,5 +46,5 @@
 
 	/*Check in 3d*/
-	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
+	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
 
 	/*First fetch data: */
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 12493)
@@ -48,5 +48,5 @@
 			case FrictionCoefficientEnum: iomodel->FetchData(1,FrictionCoefficientEnum); break;
 			case MaterialsRheologyBbarEnum:    iomodel->FetchData(1,MaterialsRheologyBEnum); break;
-			default: _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]));
+			default: _error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
 		}
 	}
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 12493)
@@ -124,5 +124,5 @@
 
 		default:
-			_error_("%s%s%s"," analysis_type: ",EnumToStringx(analysis_type)," not supported yet!");
+			_error2_("" << " analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 12493)
@@ -153,5 +153,5 @@
 			/*Fetch the mass flux segments necessary to compute the mass fluxes.  Build a DoubleMatArrayParam object out of them: */ 
 			iomodel->FetchData(&array,&mdims_array,&ndims_array,&qmu_mass_flux_num_profiles,QmuMassFluxSegmentsEnum);
-			if(qmu_mass_flux_num_profiles==0)_error_(" qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
+			if(qmu_mass_flux_num_profiles==0)_error2_(" qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");
 
 			/*Go through segments, and extract those that belong to this cpu: */
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 12493)
@@ -145,5 +145,5 @@
 
 					}
-					else _error_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
+					else _error2_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");
 			}
 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
@@ -185,5 +185,5 @@
 						}
 					}
-					else _error_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
+					else _error2_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");
 			}
 			/*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/
@@ -225,5 +225,5 @@
 						}
 					}
-					else _error_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
+					else _error2_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");
 			}
 			/*Now add the regular spcs*/
@@ -318,5 +318,5 @@
 						count++;
 						break;
-					default: _error_("Vertex approximation %s not supported",EnumToStringx((int)vertices_type[i]));
+					default: _error2_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");
 				}
 			}
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 12493)
@@ -61,5 +61,5 @@
 			doftype[5]=StokesApproximationEnum;
 		}
-		else _error_("Approximationtype %i (%s) not implemented yet for DiagnosticHoriz",(int)*vertices_type,EnumToStringx((int)*vertices_type));
+		else _error2_("Approximationtype " << (int)*vertices_type << " (" << EnumToStringx((int)*vertices_type) << ") not implemented yet for DiagnosticHoriz");
 	}
 	else if (analysis_type==DiagnosticVertAnalysisEnum){
@@ -90,5 +90,5 @@
 		numdofs=1;
 	}
-	else _error_("analysis type: %i (%s) not implemented yet",analysis_type,EnumToStringx(analysis_type));
+	else _error2_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");
 
 	/*Now initialize the index*/
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 12493)
@@ -26,5 +26,5 @@
 
 	/*if 2d: Error*/
-	if (dim==2) _error_("2d meshes not supported yet");
+	if (dim==2) _error2_("2d meshes not supported yet");
 
 	/*Recover pointer: */
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 12493)
@@ -103,5 +103,5 @@
 	}
 	else{
-		_error_("not implemented yet");
+		_error2_("not implemented yet");
 	}
 
@@ -111,5 +111,5 @@
 	iomodel->FetchData(&edges,&numberofedges,&cols,MeshEdgesEnum);
 	iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum);
-	if (cols!=4) _error_("field edges should have 4 columns");
+	if (cols!=4) _error2_("field edges should have 4 columns");
 
 	/*!All elements have been partitioned above, only create elements for this CPU: */
@@ -152,5 +152,5 @@
 			}
 			else{
-				_error_("Problem in edges creation");
+				_error2_("Problem in edges creation");
 			}
 		}
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 12493)
@@ -46,5 +46,5 @@
 
 	/*Check in 3d*/
-	if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet");
+	if(stabilization==3 && dim==3) _error2_("DG 3d not implemented yet");
 
 	/*First fetch data: */
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 12493)
@@ -33,5 +33,5 @@
 
 	/*return if 2d mesh*/
-	if (dim==2) _error_("2d meshes not supported yet");
+	if (dim==2) _error2_("2d meshes not supported yet");
 
 	//create penalties for nodes: no node can have a temperature over the melting point
Index: /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 12493)
@@ -38,5 +38,5 @@
 	#ifdef _HAVE_MPI_
 	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
-	if(!sumfound)_error_("%s%i%s%s","could not find element with vertex with id",index," to compute nodal value ",EnumToStringx(natureofdataenum));
+	if(!sumfound)_error2_("" << "could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
 	#endif
 
Index: /issm/trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp	(revision 12493)
@@ -71,5 +71,5 @@
 	 * warn the user to increase the connectivity width: */
 	for(i=0;i<nods;i++){
-		if (*(connectivity+width*i+maxels)>maxels)_error_("%s%g%s"," max connectivity width reached (",*(connectivity+width*i+maxels),")! increase width of connectivity table");
+		if (*(connectivity+width*i+maxels)>maxels)_error2_("" << " max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");
 	}
 
Index: /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 12493)
@@ -106,5 +106,5 @@
 		char* string=strings[i];
 		if(my_rank==0){
-			if(string==NULL) _error_("PETSc options for analysis %s have been declared but were not found",EnumToStringx((int)analyses[i]));
+			if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx((int)analyses[i]) << " have been declared but were not found");
 		}
 		if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
Index: /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 12493)
@@ -30,5 +30,5 @@
 	 * management routine, otherwise, skip : */
 	if (RiftIsPresent(loads,analysis_type)){
-		_error_("rift constraints reset not supported yet!");
+		_error2_("rift constraints reset not supported yet!");
 	}
 	else if(ThermalIsPresent(loads,analysis_type)){
Index: /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 12493)
@@ -46,7 +46,7 @@
 		case VelEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,VelEnum,process_units); break;
 		case FrictionCoefficientEnum:NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters,process_units); break;
-		default: _error_(" response descriptor \"%s\" not supported yet!",response_descriptor); break;
+		default: _error2_(" response descriptor \"" << response_descriptor << "\" not supported yet!"); break;
 		#else
-		default: _error_(" ISSM was not compiled with responses capabilities, exiting!");
+		default: _error2_(" ISSM was not compiled with responses capabilities, exiting!");
 		#endif
 	}
Index: /issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	(revision 12493)
@@ -75,5 +75,5 @@
 
 	hSHP = SHPOpen( filshp, "rb" );
-	if (!hSHP) _error_("Error opening shp/shx files.");
+	if (!hSHP) _error2_("Error opening shp/shx files.");
 
 /*  read header and print out file bounds  */
Index: /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 12493)
@@ -55,5 +55,5 @@
 
 		#else
-			_error_("GSL support not compiled in!");
+			_error2_("GSL support not compiled in!");
 		#endif
 	#endif
Index: /issm/trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Solverx/SolverxGsl.cpp	(revision 12493)
@@ -26,6 +26,6 @@
 	pf->GetSize(&N2);
 
-	if(N!=N2)_error_("Right hand side vector of size %i, when matrix is of size %i-%i !",N2,M,N);
-	if(M!=N)_error_("Stiffness matrix should be square!");
+	if(N!=N2)_error2_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
+	if(M!=N)_error2_("Stiffness matrix should be square!");
 
 	SolverxGsl(&x,Kff->matrix,pf->vector,N);
Index: /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp	(revision 12493)
@@ -81,5 +81,5 @@
 		#if _PETSC_MAJOR_ >=3
 			#ifndef _HAVE_MUMPS_
-			_error_("requested MUMPS solver, which was not compiled into ISSM!\n");
+			_error2_("requested MUMPS solver, which was not compiled into ISSM!\n");
 			#endif
 		#endif
@@ -105,5 +105,5 @@
 	if (solver_type==StokesSolverEnum){
 		/*Make indices out of doftypes: */
-		if(!df)_error_("need doftypes for Stokes solver!\n");
+		if(!df)_error2_("need doftypes for Stokes solver!\n");
 		DofTypesToIndexSet(&isv,&isp,df,StokesSolverEnum);
 
@@ -136,5 +136,5 @@
 	/*Check convergence*/
 	KSPGetIterationNumber(ksp,&iteration_number);
-	if (iteration_number<0) _error_("%s%i"," Solver diverged at iteration number: ",-iteration_number);
+	if (iteration_number<0) _error2_("" << " Solver diverged at iteration number: " << -iteration_number);
 
 	/*Free resources:*/
Index: /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 12493)
@@ -470,4 +470,4 @@
    }
 	/*If we reach this point, the string provided has not been found*/
-   _error_("Enum %s not found",name);
+   _error2_("Enum " << name << " not found");
 }
Index: /issm/trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 12493)
@@ -53,5 +53,5 @@
 	double  sl,rho,cm,T,chi;
 
-	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
+	if((sgn!=1) && (sgn!=-1)) _error2_("Sign should be either +1 or -1.\n");
 
 	delta = central_meridian;
@@ -131,5 +131,5 @@
 		_printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
 	}
-	else _error_("Sign should be either +1 or -1.\n");
+	else _error2_("Sign should be either +1 or -1.\n");
 
 	return;
Index: /issm/trunk-jpl/src/c/objects/Bamg/BamgOpts.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/BamgOpts.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/BamgOpts.cpp	(revision 12493)
@@ -60,28 +60,28 @@
 	int i;
 
-	if (this->anisomax<1) _error_("'anisomax' option should be >=1");
-	if (this->coeff==0) _error_("'coeff' should be positive");
-	if (this->errg<0) _error_("'errg' option should be >0");
-	if (this->gradation<1) _error_("'gradation' option should be >=1");
-	if (this->Hessiantype!=0  && this->Hessiantype!=1) _error_("'Hessiantype' supported options are 0 and 1");
-	if (this->maxnbv<3) _error_("'maxnbv' option should be >3");
-	if (this->maxsubdiv<=1) _error_("'maxsubdiv' should be >1");
-	if (this->Metrictype!=0   && this->Metrictype!=1 && this->Metrictype!=2) _error_("'Metrictype' supported options are 0, 1 and 2");
-	if (this->nbjacobi<=0) _error_("'nbjacobi' option should be >0");
-	if (this->nbsmooth<=0) _error_("'nbsmooth' option should be >0");
+	if (this->anisomax<1) _error2_("'anisomax' option should be >=1");
+	if (this->coeff==0) _error2_("'coeff' should be positive");
+	if (this->errg<0) _error2_("'errg' option should be >0");
+	if (this->gradation<1) _error2_("'gradation' option should be >=1");
+	if (this->Hessiantype!=0  && this->Hessiantype!=1) _error2_("'Hessiantype' supported options are 0 and 1");
+	if (this->maxnbv<3) _error2_("'maxnbv' option should be >3");
+	if (this->maxsubdiv<=1) _error2_("'maxsubdiv' should be >1");
+	if (this->Metrictype!=0   && this->Metrictype!=1 && this->Metrictype!=2) _error2_("'Metrictype' supported options are 0, 1 and 2");
+	if (this->nbjacobi<=0) _error2_("'nbjacobi' option should be >0");
+	if (this->nbsmooth<=0) _error2_("'nbsmooth' option should be >0");
 
-	if (this->Crack!=0  && this->Crack!=1) _error_("'Crack' supported options are 0 and 1");
-	if (this->KeepVertices!=0 && this->KeepVertices!=1) _error_("'KeepVertices' supported options are 0 and 1");
-	if (this->geometricalmetric!=0  && this->geometricalmetric!=1) _error_("'geometricalmetric' supported options are 0 and 1");
+	if (this->Crack!=0  && this->Crack!=1) _error2_("'Crack' supported options are 0 and 1");
+	if (this->KeepVertices!=0 && this->KeepVertices!=1) _error2_("'KeepVertices' supported options are 0 and 1");
+	if (this->geometricalmetric!=0  && this->geometricalmetric!=1) _error2_("'geometricalmetric' supported options are 0 and 1");
 
-	if (this->hmin<=0) _error_("'hmin' option should be >0");
-	if (this->hmax<=0 || this->hmax<this->hmin) _error_("'hmax' option should be between 0 and hmin=%g",this->hmin);
-	if (this->hminVertices && this->hminVerticesSize[1]!=1) _error_("'hminVertices' should be a column");
-	if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error_("'hmaxVertices' should be a column");
-	if (this->hVertices && this->hVerticesSize[1]!=1) _error_("'hVertices' should be a column");
-	if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error_("'metric' should have either 1 (iso) or 3 (aniso) columns.");
+	if (this->hmin<=0) _error2_("'hmin' option should be >0");
+	if (this->hmax<=0 || this->hmax<this->hmin) _error2_("'hmax' option should be between 0 and hmin=" << this->hmin);
+	if (this->hminVertices && this->hminVerticesSize[1]!=1) _error2_("'hminVertices' should be a column");
+	if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error2_("'hmaxVertices' should be a column");
+	if (this->hVertices && this->hVerticesSize[1]!=1) _error2_("'hVertices' should be a column");
+	if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error2_("'metric' should have either 1 (iso) or 3 (aniso) columns.");
 	if (this->field){
-		if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error_("'err' should be of size %i x %i",1,this->fieldSize[1]);
-		for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error_("'err' option should be >0");};
+		if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error2_("'err' should be of size " << 1 << " x " << this->fieldSize[1]);
+		for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error2_("'err' option should be >0");};
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp	(revision 12493)
@@ -76,5 +76,5 @@
 		}
 		else{
-			_error_("Metrictype %i not supported yet (use 0,1 or 2(default))",Metrictype);
+			_error2_("Metrictype " << Metrictype << " not supported yet (use 0,1 or 2(default))");
 		}
 
@@ -146,5 +146,5 @@
 			j = NextEdge[jc];
 			if (k>=2000){
-				_error_("k>=2000 (Maximum number of iterations reached)");
+				_error2_("k>=2000 (Maximum number of iterations reached)");
 			}
 		} while ( tbegin != tria); 
@@ -213,5 +213,5 @@
 				j = NextEdge[jc];
 				if (k>=2000){
-					_error_("k>=2000");
+					_error2_("k>=2000");
 				}
 			}while ( tbegin != tria); 
Index: /issm/trunk-jpl/src/c/objects/Bamg/Edge.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/Edge.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/Edge.cpp	(revision 12493)
@@ -45,5 +45,5 @@
 
 		/*some shecks*/
-		if (!(adj[0]==&e || adj[1]==&e)){ _error_("Intersection bug"); }
+		if (!(adj[0]==&e || adj[1]==&e)){ _error2_("Intersection bug"); }
 		_assert_(adj[0]==&e || adj[1]==&e);
 
Index: /issm/trunk-jpl/src/c/objects/Bamg/Geometry.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/Geometry.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/Geometry.cpp	(revision 12493)
@@ -76,11 +76,11 @@
 
 		//some checks
-		if (bamggeom->Vertices==NULL) _error_("the domain provided does not contain any vertex");
-		if (bamggeom->Edges==NULL) _error_("the domain provided does not contain any edge");
+		if (bamggeom->Vertices==NULL) _error2_("the domain provided does not contain any vertex");
+		if (bamggeom->Edges==NULL) _error2_("the domain provided does not contain any edge");
 
 		//Vertices
 		if (bamggeom->Vertices){
 			if(verbose>5) printf("      processing Vertices\n");
-			if (bamggeom->VerticesSize[1]!=3) _error_("Vertices should have 3 columns");
+			if (bamggeom->VerticesSize[1]!=3) _error2_("Vertices should have 3 columns");
 			vertices = new GeomVertex[nbv];
 			for (i=0;i<nbv;i++) {
@@ -115,8 +115,8 @@
 			 */
 			coefIcoor=(MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
-			if(coefIcoor<=0) _error_("coefIcoor should be positive");
+			if(coefIcoor<=0) _error2_("coefIcoor should be positive");
 		}
 		else{
-			_error_("No BamgVertex provided");
+			_error2_("No BamgVertex provided");
 		}
 
@@ -127,5 +127,5 @@
 
 			if(verbose>5) printf("      processing Edges\n");
-			if (bamggeom->EdgesSize[1]!=3) _error_("Edges should have 3 columns");
+			if (bamggeom->EdgesSize[1]!=3) _error2_("Edges should have 3 columns");
 			edges = new GeomEdge[nbe];
 
@@ -176,5 +176,5 @@
 		}
 		else{
-			_error_("No edges provided");
+			_error2_("No edges provided");
 		}
 
@@ -206,5 +206,5 @@
 		if (bamggeom->TangentAtEdges){
 			if(verbose>5) printf("      processing TangentAtEdges");
-			if (bamggeom->TangentAtEdgesSize[1]!=4) _error_("TangentAtEdges should have 4 columns");
+			if (bamggeom->TangentAtEdgesSize[1]!=4) _error2_("TangentAtEdges should have 4 columns");
 			int n,i,j,k;
 			R2 tg;
@@ -216,6 +216,6 @@
 				tg.x=bamggeom->TangentAtEdges[k*4+2];
 				tg.y=bamggeom->TangentAtEdges[k*4+3];
-				if (i<0 || i>=nbe) _error_("TangentAtEdges first index exceeds matrix dimension");
-				if (j!=0 && j!=1)  _error_("TangentAtEdges second index should be 1 or 2 only");
+				if (i<0 || i>=nbe) _error2_("TangentAtEdges first index exceeds matrix dimension");
+				if (j!=0 && j!=1)  _error2_("TangentAtEdges second index should be 1 or 2 only");
 				edges[i].tg[j] = tg;
 			}
@@ -225,9 +225,9 @@
 		if(bamggeom->Corners){
 			if(verbose>5) printf("      processing Corners");
-			if (bamggeom->CornersSize[1]!=1) _error_("Corners should have 1 column");
+			if (bamggeom->CornersSize[1]!=1) _error2_("Corners should have 1 column");
 			n=bamggeom->CornersSize[0];
 			for (i=0;i<n;i++) {     
 				j=(int)bamggeom->Corners[i]-1; //for C indexing
-				if (j>nbv-1 || j<0) _error_("Bad corner definition: should in [0 %i]",nbv);
+				if (j>nbv-1 || j<0) _error2_("Bad corner definition: should in [0 " << nbv << "]");
 				/*Required => at the same time SetRequired and SetCorner*/
 				vertices[j].SetCorner();
@@ -239,9 +239,9 @@
 		if(bamggeom->RequiredVertices){
 			if(verbose>5) printf("      processing RequiredVertices\n");
-			if (bamggeom->RequiredVerticesSize[1]!=1) _error_("RequiredVertices should have 1 column");
+			if (bamggeom->RequiredVerticesSize[1]!=1) _error2_("RequiredVertices should have 1 column");
 			n=bamggeom->RequiredVerticesSize[0];
 			for (i=0;i<n;i++) {     
 				j=(int)bamggeom->RequiredVertices[i]-1; //for C indexing
-				if (j>nbv-1 || j<0) _error_("Bad RequiredVerticess  definition: should in [0 %i]",nbv);
+				if (j>nbv-1 || j<0) _error2_("Bad RequiredVerticess  definition: should in [0 " << nbv << "]");
 				vertices[j].SetRequired();
 			}
@@ -251,9 +251,9 @@
 		if(bamggeom->RequiredEdges){
 			if(verbose>5) printf("      processing RequiredEdges\n");
-			if (bamggeom->RequiredEdgesSize[1]!=1) _error_("RequiredEdges should have 1 column");
+			if (bamggeom->RequiredEdgesSize[1]!=1) _error2_("RequiredEdges should have 1 column");
 			n=bamggeom->RequiredEdgesSize[0];
 			for (i=0;i<n;i++) {     
 				j=(int)bamggeom->RequiredEdges[i]-1; //for C indexing
-				if (j>nbe-1 || j<0) _error_("Bad RequiredEdges definition: should in [0 %i]",nbe);
+				if (j>nbe-1 || j<0) _error2_("Bad RequiredEdges definition: should in [0 " << nbe << "]");
 				edges[j].SetRequired();  
 			}
@@ -263,5 +263,5 @@
 		if(bamggeom->SubDomains){
 			if(verbose>5) printf("      processing SubDomains\n");
-			if (bamggeom->SubDomainsSize[1]!=4) _error_("SubDomains should have 4 columns");
+			if (bamggeom->SubDomainsSize[1]!=4) _error2_("SubDomains should have 4 columns");
 			nbsubdomains=bamggeom->SubDomainsSize[0];
 			subdomains = new GeomSubDomain[nbsubdomains];
@@ -271,6 +271,6 @@
 				i2=(int)bamggeom->SubDomains[i*4+2];
 				i3=(int)bamggeom->SubDomains[i*4+3];
-				if (i0!=2) _error_("Bad Subdomain definition: first number should be 2 (for Edges)");
-				if (i1>nbe || i1<=0) _error_("Bad Subdomain definition: second number should in [1 %i] (edge number)",nbe);
+				if (i0!=2) _error2_("Bad Subdomain definition: first number should be 2 (for Edges)");
+				if (i1>nbe || i1<=0) _error2_("Bad Subdomain definition: second number should in [1 " << nbe << "] (edge number)");
 				subdomains[i].edge=edges + (i1-1);
 				subdomains[i].direction = (int) i2;
@@ -532,5 +532,5 @@
 				delete [] head_v;
 				delete [] eangle;
-				_error_("two points of the geometry are very closed to each other (see reference numbers above)");
+				_error2_("two points of the geometry are very closed to each other (see reference numbers above)");
 			}
 
@@ -610,5 +610,5 @@
 				delete [] head_v;
 				delete [] eangle;
-				_error_("Length of edge %i is 0",i);
+				_error2_("Length of edge " << i << " is 0");
 			}
 			//compute angle in [-Pi Pi]
@@ -704,5 +704,5 @@
 				long i1 = n1/2 ,j1=n1%2;
 
-				if( edges[i1].v[j1] != edges[i].v[j]) _error_("Problem while processing edges: check the edge list");
+				if( edges[i1].v[j1] != edges[i].v[j]) _error2_("Problem while processing edges: check the edge list");
 
 				edges[i1].Adj[j1] = edges + i;
@@ -831,8 +831,8 @@
 		GeomEdge* on=e.GeomEdgeHook;
 		if (!on){
-			_error_("ProjectOnCurve error message: edge provided should be on geometry");
+			_error2_("ProjectOnCurve error message: edge provided should be on geometry");
 		}
 		if (!e[0].GeomEdgeHook ||  !e[1].GeomEdgeHook){
-			_error_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");
+			_error2_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");
 		}
 
@@ -875,5 +875,5 @@
 					printf(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before\n");
 					printf("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)\n");
-					_error_("see above");
+					_error2_("see above");
 				}
 				NbTry++;
@@ -895,5 +895,5 @@
 				printf(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before\n");
 				printf("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)\n");
-				_error_("see above");
+				_error2_("see above");
 			}
 			GeomEdge* tmpge = eg1;
Index: /issm/trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp	(revision 12493)
@@ -38,5 +38,5 @@
 		// check Size
 		if (Size<=0){
-			_error_("Size<=0");
+			_error2_("Size<=0");
 		}
 
@@ -268,5 +268,5 @@
 				k=(*t)(0) ?  ((  (*t)(1) ? ( (*t)(2) ? -1 : 2) : 1  )) : 0;
 				if (k<0){
-					_error_("k<0");
+					_error2_("k<0");
 				}
 				ocut = OppositeEdge[k];
@@ -312,5 +312,5 @@
 				double dij = detj-deti;
 				if (i+j+k != 0 + 1 +2){
-					_error_("i+j+k != 0 + 1 +2");
+					_error2_("i+j+k != 0 + 1 +2");
 				}
 				ba[j] =  detj/dij;
@@ -384,5 +384,5 @@
 					}
 					else {
-						_error_("Bug Split Edge");
+						_error2_("Bug Split Edge");
 					}
 				}
Index: /issm/trunk-jpl/src/c/objects/Bamg/Mesh.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/Mesh.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/Mesh.cpp	(revision 12493)
@@ -117,5 +117,5 @@
 			  delete [] kk;
 			  delete [] refv;
-			  _error_("imaxnbv != nbv");
+			  _error2_("imaxnbv != nbv");
 		  }
 		  for (i=0;i<Tho.nbt;i++)
@@ -128,8 +128,8 @@
 				if (i0<0 || i1<0 || i2<0){
 					delete [] refv;
-					_error_("i0<0 || i1<0 || i2< 0");
+					_error2_("i0<0 || i1<0 || i2< 0");
 				}
 				if (i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
-					_error_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
+					_error2_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
 				}
 				triangles[nbt] = Triangle(this,kk[i0],kk[i1],kk[i2]);
@@ -138,8 +138,8 @@
 			  }
 		  if (kt!=nbt){
-			  _error_("kt!=nbt");
+			  _error2_("kt!=nbt");
 		  }
 		  if (nbt==0 && nbv==0) {
-			  _error_("All triangles have been removed");
+			  _error2_("All triangles have been removed");
 		  }
 		  delete [] kk;
@@ -153,8 +153,8 @@
 
 		  if (!nbsubdomains){
-			  _error_("nbsubdomains==0");
+			  _error2_("nbsubdomains==0");
 		  }
 		  if (!subdomains[0].head || !subdomains[0].head->link){
-			  _error_("!subdomains[0].head || !subdomains[0].head->link");
+			  _error2_("!subdomains[0].head || !subdomains[0].head->link");
 		  }
 
@@ -323,5 +323,5 @@
 			}
 		}
-		if(isorphan) _error_("Orphan found in mesh, see ids above");
+		if(isorphan) _error2_("Orphan found in mesh, see ids above");
 
 		/*Clean up*/
@@ -362,5 +362,5 @@
 		}
 		else{
-			if(verbose>5) _error_("no Vertices found in the initial mesh");
+			if(verbose>5) _error2_("no Vertices found in the initial mesh");
 		}
 
@@ -380,5 +380,5 @@
 		}
 		else{
-			if(verbose>5) _error_("no Triangles found in the initial mesh");
+			if(verbose>5) _error2_("no Triangles found in the initial mesh");
 		}
 
@@ -506,5 +506,5 @@
 				//Check value
 				if(!(i>=0 && j>=0 && i<nbe && j<Gh.nbe)) {
-					_error_("ReadMesh error: EdgesOnGeomEdge edge provided (line %i: [%i %i]) is incorrect (must be positive, [0<i<nbe=%i 0<j<Gh.nbe=%i]",i1+1,i+1,j+1,nbe,Gh.nbe);
+					_error2_("ReadMesh error: EdgesOnGeomEdge edge provided (line " << i1+1 << ": [" << i+1 << " " << j+1 << "]) is incorrect (must be positive, [0<i<nbe=" << nbe << " 0<j<Gh.nbe=" << Gh.nbe << "]");
 				}
 				edges[i].GeomEdgeHook=Gh.edges+j;
@@ -522,6 +522,6 @@
 				head=(int)bamgmesh->SubDomains[i*3+1]-1;//C indexing
 				direction=(int)bamgmesh->SubDomains[i*3+2];
-				if (i3!=23) _error_("Bad Subdomain definition: first number should be 3");
-				if (head<0 || head>=nbt) _error_("Bad Subdomain definition: head should in [1 %i] (triangle number)",nbt);
+				if (i3!=23) _error2_("Bad Subdomain definition: first number should be 3");
+				if (head<0 || head>=nbt) _error2_("Bad Subdomain definition: head should in [1 " << nbt << "] (triangle number)");
 				subdomains[i].head = triangles+head;
 			}
@@ -567,7 +567,7 @@
 				for (j=0;j<3;j++){
 					int v=GetId(triangles[i][j]); //jth vertex of the ith triangle
-					if (k>3*nbt-1 || k<0) _error_("k = %i, nbt = %i",k,nbt);
+					if (k>3*nbt-1 || k<0) _error2_("k = " << k << ", nbt = " << nbt);
 					next_1[k]=head_1[v];
-					if (v>nbv-1 || v<0)   _error_("v = %i, nbv = %i",v,nbv);
+					if (v>nbv-1 || v<0)   _error2_("v = " << v << ", nbv = " << nbv);
 					head_1[v]=k++;
 					connectivitysize_1[v]+=1;
@@ -707,5 +707,5 @@
 				}
 				if (!stop){
-					_error_("Element holding segment [%i %i] not found...",i1+1,i2+1);
+					_error2_("Element holding segment [" << i1+1 << " " << i2+1 << "] not found...");
 				}
 			}
@@ -805,5 +805,5 @@
 				const VertexOnGeom &v=VerticesOnGeomEdge[i];
 				if (!v.OnGeomEdge()){
-					_error_("A vertices supposed to be OnGeomEdge is actually not");
+					_error2_("A vertices supposed to be OnGeomEdge is actually not");
 				}
 				bamgmesh->VerticesOnGeomEdge[i*3+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
@@ -888,7 +888,7 @@
 			for (j=0;j<2;j++){
 				int v=(int)bamgmesh->IssmEdges[i*i2+j]-1; //back to C indexing
-				if (k>2*i1-1 || k<0) _error_("Index exceed matrix dimensions (k=%i not in [0 %i]",k,2*i1-1);
+				if (k>2*i1-1 || k<0) _error2_("Index exceed matrix dimensions (k=" << k << " not in [0 " << 2*i1-1 << "]");
 				next_2[k]=head_2[v];
-				if (v>nbv-1 || v<0)   _error_("Index exceed matrix dimensions (v=%i not in [0 %i])",v,nbv-1);
+				if (v>nbv-1 || v<0)   _error2_("Index exceed matrix dimensions (v=" << v << " not in [0 " << nbv-1 << "])");
 				head_2[v]=k++;
 				connectivitysize_2[v]+=1;
@@ -1061,5 +1061,5 @@
 		//check that hmax is positive
 		if (hmax<=0){
-			_error_("hmax<=0");
+			_error2_("hmax<=0");
 		}
 
@@ -1090,5 +1090,5 @@
 
 				if (ht<=0 || hn<=0){
-					_error_("ht<=0 || hn<=0");
+					_error2_("ht<=0 || hn<=0");
 				}
 				EigenMetric Vp(1/(ht*ht),1/(hn*hn),tg);
@@ -1115,5 +1115,5 @@
 		}
 		else{
-			_error_("Hessiantype %i not supported yet (1->use Green formula, 0-> double P2 projection)",Hessiantype);
+			_error2_("Hessiantype " << Hessiantype << " not supported yet (1->use Green formula, 0-> double P2 projection)");
 		}
 	}
@@ -1159,5 +1159,5 @@
 		//some checks
 		if (( infvertexindex <0 ) && (detOld <0) ||  ( infvertexindex >=0  ) && (detOld >0) ){
-			_error_("inconsistent configuration (Contact ISSM developers)");
+			_error2_("inconsistent configuration (Contact ISSM developers)");
 		}
 
@@ -1201,5 +1201,5 @@
 			}
 			else{
-				_error_("Cannot add a vertex more than once. Check duplicates");
+				_error2_("Cannot add a vertex more than once. Check duplicates");
 			}
 		}
@@ -1214,5 +1214,5 @@
 		tt[2]= &triangles[nbt++];
 
-		if (nbt>maxnbt) _error_("Not enough triangles");
+		if (nbt>maxnbt) _error2_("Not enough triangles");
 
 		*tt[1]=*tt[2]=*t;
@@ -1251,5 +1251,5 @@
 
 			if (!rswap) {
-				_error_("swap the point s is on a edge");
+				_error2_("swap the point s is on a edge");
 			}
 		}
@@ -1318,5 +1318,5 @@
 		//check that the mesh is not empty
 		if (nbt<=0 || nbv <=0 ) {
-			_error_("nbt or nbv is negative (Mesh empty?)");
+			_error2_("nbt or nbv is negative (Mesh empty?)");
 		}
 
@@ -1340,5 +1340,5 @@
 		if (nbe !=  edge4->nb()){ 
 			delete [] st;
-			_error_("Some Double edge in the mesh, the number is %i, nbe4=%i",nbe,edge4->nb()); 
+			_error2_("Some Double edge in the mesh, the number is " << nbe << ", nbe4=" << edge4->nb()); 
 		}
 		//keep nbe in nbeold
@@ -1360,5 +1360,5 @@
 					//check that it is not an edge on boundary (should not already exist)
 					if (triangles[i].TriangleAdj(j) || triangles[st[k]/3].TriangleAdj((int) (st[k]%3))){
-						_error_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");
+						_error2_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");
 					}
 					//OK, the element is not on boundary, is belongs to 2 triangles -> build Adjacent triangles list
@@ -1378,5 +1378,5 @@
 					printf("Edge %i of triangle %i\n",(-st[k]+2)%3,(-st[k]+2)/3);
 					printf("Edge %i of triangle %i\n",triangles[(-st[k]+2)/3].NuEdgeTriangleAdj((int)((-st[k]+2)%3)),GetId(triangles[(-st[k]+2)/3].TriangleAdj((int)((-st[k]+2)%3))));
-					_error_("An edge belongs to more than 2 triangles");
+					_error2_("An edge belongs to more than 2 triangles");
 				}	
 			}
@@ -1460,5 +1460,5 @@
 			//check that we have been through all edges
 			if (k!=nbe){
-				_error_("problem in edge construction process: k!=nbe (should not happen)");
+				_error2_("problem in edge construction process: k!=nbe (should not happen)");
 			}
 			//delete edgessave
@@ -1505,5 +1505,5 @@
 					//check that we have the correct vertex
 					if (v!=edges[i0 ].v[j0]){
-						_error_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge");
+						_error2_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge");
 					}
 
@@ -1522,5 +1522,5 @@
 		//check that nbsubdomains is empty
 		if (nbsubdomains){
-			_error_("nbsubdomains should be 0");
+			_error2_("nbsubdomains should be 0");
 		}
 		nbsubdomains=0;
@@ -1591,5 +1591,5 @@
 		if (k!= nbsubdomains){
 			delete [] colorT;
-			_error_("k!= nbsubdomains");
+			_error2_("k!= nbsubdomains");
 		}
 		//delete colorT and st
@@ -1652,5 +1652,5 @@
 		if (Gh.coefIcoor<=0){
 			delete [] colorV;
-			_error_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)");
+			_error2_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)");
 		}
 
@@ -1705,5 +1705,5 @@
 				delete [] len;
 				delete [] colorV;
-				_error_("problem in Edge4 construction: k != i");
+				_error2_("problem in Edge4 construction: k != i");
 			}
 		}
@@ -1734,5 +1734,5 @@
 			}
 			else
-			 _error_("%i should be >=0");
+			 _error2_("%i should be >=0");
 		  }
 
@@ -1768,5 +1768,5 @@
 
 		/*Check size*/
-		if (bamgopts->fieldSize[0] != nbv) _error_("'field' should have %i rows",nbv);
+		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
 
 		//initialization of some variables
@@ -1973,5 +1973,5 @@
 
 		/*Check size*/
-		if (bamgopts->fieldSize[0] != nbv) _error_("'field' should have %i rows",nbv);
+		if (bamgopts->fieldSize[0] != nbv) _error2_("'field' should have " << nbv << " rows");
 
 		//initialization of some variables
@@ -2298,5 +2298,5 @@
 				if (splitvertex[i1]==3 || splitvertex[i2]==3){
 					delete [] splitvertex;
-					_error_("Crossing rifts not supported yet");
+					_error2_("Crossing rifts not supported yet");
 				}
 			}
@@ -2376,5 +2376,5 @@
 				//printf("%i -> %i %i %i, edge [%i->%i %i->%i]\n",element_renu[GetId(ta.t)],GetId((*ta.t)[0])+1,GetId((*ta.t)[1])+1,GetId((*ta.t)[2])+1,i1,j1,i2,j2);
 				ta = Next(ta).Adj(); 
-				if (count++>50) _error_("Maximum number of iteration exceeded");
+				if (count++>50) _error2_("Maximum number of iteration exceeded");
 			}while ((tbegin != ta)); 
 		}
@@ -2383,5 +2383,5 @@
 		for(i=0;i<NbCrackedEdges;i++){
 			if (Edgeflags[i]!=2){
-				_error_("A problem occured: at least one crack edge (number %i) does not belong to 2 elements",i+1);
+				_error2_("A problem occured: at least one crack edge (number " << i+1 << ") does not belong to 2 elements");
 			}
 		}
@@ -2433,5 +2433,5 @@
 			}
 			if (k!=0) {
-				_error_("there is %i triangles of mes = 0",k);
+				_error2_("there is " << k << " triangles of mes = 0");
 			}
 
@@ -2447,10 +2447,10 @@
 				if (nbswp) nbfe++;
 				if ( nbswp < 0 && k < 5){
-					_error_("Missing Edge %i, v0=%i,v1=%i",i,GetId(edges[i][0]),GetId(edges[i][1]));
+					_error2_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));
 				}
 			}
 
 			if (k!=0) {
-				_error_("There are %i lost edges, the boundary might be crossing",k);
+				_error2_("There are " << k << " lost edges, the boundary might be crossing");
 			}
 			for (int j=0;j<nbv;j++){
@@ -2534,5 +2534,5 @@
 			if (nbt == nbtout ||  !NbSubDomTot) {
 				delete [] HeapArete;
-				_error_("The boundary is not close: all triangles are outside");
+				_error2_("The boundary is not close: all triangles are outside");
 			}
 
@@ -2572,5 +2572,5 @@
 						if (k!=nbsubdomains){
 							delete [] mark;
-							_error_("k!=nbsubdomains");
+							_error2_("k!=nbsubdomains");
 						}
 						if(OutSide) 
@@ -2662,5 +2662,5 @@
 							 subdomains[i].head=t=ta;
 							if(t<triangles || t >= triangles+nbt || t->det < 0 || t->link == 0) {
-								_error_("bad definition of SubSomain %i",i);
+								_error2_("bad definition of SubSomain " << i);
 							}
 							long it = GetId(t);
@@ -2677,5 +2677,5 @@
 								kkk++;
 								if (mark[GetId(tt)]>=0){
-									_error_("mark[GetId(tt)]>=0");
+									_error2_("mark[GetId(tt)]>=0");
 								}
 								mark[GetId(tt)]=i;
@@ -2686,5 +2686,5 @@
 						ta = Previous(Adj(ta));         
 						if(t == (Triangle *) ta) {
-							_error_("bad definition of SubSomain %i",i);
+							_error2_("bad definition of SubSomain " << i);
 						}
 					}
@@ -2848,5 +2848,5 @@
 			//if i is higher than nbv, it means that all the determinants are 0,
 			//all vertices are aligned!
-			if  (++i>=nbv) _error_("all the vertices are aligned");
+			if  (++i>=nbv) _error2_("all the vertices are aligned");
 		}
 		// exchange i et 2 in "orderedvertices" so that
@@ -2984,5 +2984,5 @@
 				long  j=vj.ReferenceNumber; 
 				if (&vj!=orderedvertices[j]){
-					_error_("&vj!= orderedvertices[j]");
+					_error2_("&vj!= orderedvertices[j]");
 				}
 				if(i!=j){ 
@@ -2994,5 +2994,5 @@
 				if (tcvj && !tcvj->link){
 					tcvj->Echo();
-					_error_("problem inserting point in InsertNewPoints (tcvj=%p and tcvj->link=%i)",tcvj,tcvj->link);
+					_error2_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")");
 				}
 				quadtree->Add(vj);
@@ -3026,5 +3026,5 @@
 
 		if (!Gh.nbe){
-			_error_("!Gh.nbe");
+			_error2_("!Gh.nbe");
 		}
 		Edge **e= new (Edge* [Gh.nbe]);
@@ -3059,5 +3059,5 @@
 			}
 		}
-		if(kk) _error_("See above");
+		if(kk) _error2_("See above");
 
 		return e;
@@ -3258,5 +3258,5 @@
 				//check i
 				if (i<0 || i>=nbt ){
-					_error_("Index problem in NewPoints (i=%i not in [0 %i])",i,nbt-1);
+					_error2_("Index problem in NewPoints (i=" << i << " not in [0 " << nbt-1 << "])");
 				}
 				//change first_np_or_next_t[i]
@@ -3309,5 +3309,5 @@
 					}
 					if (ta.EdgeVertex(0)!=s){
-						_error_("ta.EdgeVertex(0)!=s");
+						_error2_("ta.EdgeVertex(0)!=s");
 					}
 					ta = Next(Adj(ta));
@@ -3344,5 +3344,5 @@
 		}
 		else {
-			_error_("ProjectOnCurve On BamgVertex %i forget call to SetVertexFieldOnBTh",BTh.GetId(vA));
+			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vA) << " forget call to SetVertexFieldOnBTh");
 		} 
 
@@ -3355,9 +3355,9 @@
 		}
 		else {
-			_error_("ProjectOnCurve On BamgVertex %i forget call to SetVertexFieldOnBTh",BTh.GetId(vB));
+			_error2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vB) << " forget call to SetVertexFieldOnBTh");
 		} 
 		Edge * e = &BhAB;
 		if (!pA || !pB || !e){
-			_error_("!pA || !pB || !e");
+			_error2_("!pA || !pB || !e");
 		}
 		// be carefull the back ground edge e is on same geom edge 
@@ -3365,5 +3365,5 @@
 		//check Is a background Mesh;   
 		if (e<BTh.edges || e>=BTh.edges+BTh.nbe){
-			_error_("e<BTh.edges || e>=BTh.edges+BTh.nbe");
+			_error2_("e<BTh.edges || e>=BTh.edges+BTh.nbe");
 		}
 		// walk on BTh edge 
@@ -3388,5 +3388,5 @@
 		  } 
 		else{ // do the search by walking 
-			_error_("case not supported yet");
+			_error2_("case not supported yet");
 		  }
 
@@ -3452,5 +3452,5 @@
 
 		  }
-		_error_("Big bug...");
+		_error2_("Big bug...");
 		return 0; // just for the compiler 
 	}                  
@@ -3493,5 +3493,5 @@
 	}
 	if (kk != nbe){ 
-		_error_("There are %i double edges in the mesh",kk-nbe);
+		_error2_("There are " << kk-nbe << " double edges in the mesh");
 	}
 
@@ -3525,5 +3525,5 @@
 			//An edge belongs to 2 triangles
 			else {
-				_error_("The edge (%i , %i) belongs to more than 2 triangles",GetId(triangles[i][VerticesOfTriangularEdge[j][0]]),GetId(triangles[i][VerticesOfTriangularEdge[j][1]]));
+				_error2_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << " , " << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles");
 			}
 		}
@@ -3563,5 +3563,5 @@
 	}
 	if(k) {
-		_error_("%i boundary edges (from the geometry) are not defined as mesh edges",k);
+		_error2_("" << k << " boundary edges (from the geometry) are not defined as mesh edges");
 	}
 
@@ -3590,5 +3590,5 @@
 	for (i=2;det(orderedvertices[0]->i,orderedvertices[1]->i,orderedvertices[i]->i)==0;) 
 	 if  (++i>=nbvb) {
-		 _error_("ReconstructExistingMesh: All the vertices are aligned");
+		 _error2_("ReconstructExistingMesh: All the vertices are aligned");
 	 }
 	//Move this vertex (i) to the 2d position in orderedvertices
@@ -3650,5 +3650,5 @@
 	}
 	if(nbloss) {
-		_error_("we lost %i existing edges other %i",nbloss,knbe);
+		_error2_("we lost " << nbloss << " existing edges other " << knbe);
 	}
 
@@ -3725,5 +3725,5 @@
 	subdomains = savesubdomains;
 	if (k) {
-		_error_("number of triangles edges alone = %i",k);
+		_error2_("number of triangles edges alone = " << k);
 	}
 	FindSubDomain();
@@ -3755,5 +3755,5 @@
 
 						printf("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required\n");
-						_error_("See above (might be cryptic...)");
+						_error2_("See above (might be cryptic...)");
 					}
 				}
@@ -3778,13 +3778,13 @@
 			t=t0=subdomains[i].head;
 			if (!t0){ // not empty sub domain
-				_error_("!t0");
+				_error2_("!t0");
 			}
 			do { 
 				long kt = GetId(t);
 				if (kt<0 || kt >= nbt ){
-					_error_("kt<0 || kt >= nbt");
+					_error2_("kt<0 || kt >= nbt");
 				}
 				if (renu[kt]!=-1){
-					_error_("renu[kt]!=-1");
+					_error2_("renu[kt]!=-1");
 				}
 				renu[kt]=k++;
@@ -3803,5 +3803,5 @@
 		}
 		if (k != nbt){
-			_error_("k != nbt");
+			_error2_("k != nbt");
 		}
 		// do the change on all the pointeur 
@@ -3929,5 +3929,5 @@
 	coefIcoor= (MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
 	if (coefIcoor<=0){
-		_error_("coefIcoor should be positive, a problem in the geometry is likely");
+		_error2_("coefIcoor should be positive, a problem in the geometry is likely");
 	}
 
@@ -3965,5 +3965,5 @@
 	}
 
-	if (number_of_errors) _error_("Fatal error: some triangles have negative areas, see above");
+	if (number_of_errors) _error2_("Fatal error: some triangles have negative areas, see above");
 }
 /*}}}*/
@@ -4146,5 +4146,5 @@
 			register Triangle* t= vertices[i].t;
 			if (!t){
-				_error_("!t");
+				_error2_("!t");
 			}
 			BamgVertex & vi = vertices[i];
@@ -4154,5 +4154,5 @@
 				ta=Previous(Adj(ta));
 				if (vertices+i != ta.EdgeVertex(1)){
-					_error_("vertices+i != ta.EdgeVertex(1)");
+					_error2_("vertices+i != ta.EdgeVertex(1)");
 				}
 				BamgVertex & vj = *(ta.EdgeVertex(0));
@@ -4160,5 +4160,5 @@
 					j= &vj-vertices;
 					if (j<0 || j >= nbv){
-						_error_("j<0 || j >= nbv");
+						_error2_("j<0 || j >= nbv");
 					}
 					R2 Aij = (R2) vj - (R2) vi;
@@ -4284,5 +4284,5 @@
 					// the first PB is to now a background edge between the 2 vertices
 					if (!edgesGtoB){
-						_error_("!edgesGtoB");
+						_error2_("!edgesGtoB");
 					}
 					ong= ProjectOnCurve(*edgesGtoB[Gh.GetId(edges[i].GeomEdgeHook)],
@@ -4356,5 +4356,5 @@
 			Triangle & t = triangles[i];
 			if (!t.link){
-				_error_("!t.link");
+				_error2_("!t.link");
 			}
 			for(int j=0;j<3;j++)
@@ -4383,5 +4383,5 @@
 										||   (cc=Area2( t[0].r , t[1].r , A.r    )) < 0.0)){
 							printf("%i not in triangle %i In= %i %g %g %g %g\n",ke + nbvold,i,!!t.link,aa,bb,cc,dd);
-							_error_("Number of triangles with P2 interpolation Problem");
+							_error2_("Number of triangles with P2 interpolation Problem");
 						}
 					}
@@ -4391,5 +4391,5 @@
 										||   (cc=Area2( tt[0].r , tt[1].r , A.r     )) < 0)){
 							printf("%i not in triangle %i In= %i %g %g %g %g\n",ke + nbvold,ii,!!tt.link,aa,bb,cc,dd);
-							_error_("Number of triangles with P2 interpolation Problem");
+							_error2_("Number of triangles with P2 interpolation Problem");
 						}
 					} 
@@ -4439,5 +4439,5 @@
 						  } // tt 
 						else
-						 _error_("Bug...");
+						 _error2_("Bug...");
 					  } // ke<0	       
 					else
@@ -4452,5 +4452,5 @@
 			  } 
 			if (nbinvisible>=2){
-				_error_("nbinvisible>=2");
+				_error2_("nbinvisible>=2");
 			}
 			switch (nbsplitedge) {
@@ -4464,5 +4464,5 @@
 			} 
 			if (ksplit[i]<40){
-				_error_("ksplit[i]<40");
+				_error2_("ksplit[i]<40");
 			}
 		  }
@@ -4481,5 +4481,5 @@
 			int  ke=(int) (ksplit[i]%10);
 			if (kk>=7 || kk<=0){
-				_error_("kk>=7 || kk<=0");
+				_error2_("kk>=7 || kk<=0");
 			}
 
@@ -4498,5 +4498,5 @@
 
 			if (nbmkadj>=10){
-				_error_("nbmkadj>=10");
+				_error2_("nbmkadj>=10");
 			}
 			// --------------------------
@@ -4516,5 +4516,5 @@
 							t1=t0;
 							if (kedge[3*i+i0]<0){
-								_error_("kedge[3*i+i0]<0");
+								_error2_("kedge[3*i+i0]<0");
 							}
 							BamgVertex * v3 = vertices + kedge[3*i+k0];
@@ -4532,8 +4532,8 @@
 							t2=t1=t0;
 							if (kedge[3*i+k1]<0){
-								_error_("kedge[3*i+k1]<0");
+								_error2_("kedge[3*i+k1]<0");
 							}
 							if (kedge[3*i+k2]<0){
-								_error_("kedge[3*i+k2]<0");
+								_error2_("kedge[3*i+k2]<0");
 							}
 
@@ -4559,5 +4559,5 @@
 							t3=t2=t1=t0;
 							if (kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0){
-								_error_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0");
+								_error2_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0");
 							}
 							BamgVertex * v12 = vertices + kedge[3*i+k0];
@@ -4633,5 +4633,5 @@
 				}
 			if (nbmkadj>13){// 13 = 6 + 4 +
-				_error_("nbmkadj>13");
+				_error2_("nbmkadj>13");
 			}
 
@@ -4759,5 +4759,5 @@
 			quadtree->Add(vi);
 			if (!tcvi || tcvi->det<0){// internal
-				_error_("!tcvi || tcvi->det < 0");
+				_error2_("!tcvi || tcvi->det < 0");
 			}
 			AddVertex(vi,tcvi,det3);
@@ -4803,5 +4803,5 @@
 
 		/*Check that the quadtree does exist*/
-		if (!quadtree) _error_("no starting triangle provided and no quadtree available");
+		if (!quadtree) _error2_("no starting triangle provided and no quadtree available");
 
 		/*Call NearestVertex*/
@@ -4809,6 +4809,6 @@
 
 		/*Check output (Vertex a)*/
-		if (!a)    _error_("problem while trying to find nearest vertex from a given point. No output found");
-		if (!a->t) _error_("no triangle is associated to vertex number %i (orphan?)",GetId(a)+1);
+		if (!a)    _error2_("problem while trying to find nearest vertex from a given point. No output found");
+		if (!a->t) _error2_("no triangle is associated to vertex number " << GetId(a)+1 << " (orphan?)");
 		_assert_(a>=vertices && a<vertices+nbv);
 
@@ -4845,5 +4845,5 @@
 
 		/*Increase counter*/
-		if (++counter>=10000) _error_("Maximum number of iteration reached (threshold = %i).",counter);
+		if (++counter>=10000) _error2_("Maximum number of iteration reached (threshold = " << counter << ").");
 
 		j= OppositeVertex[jj];
@@ -4909,5 +4909,5 @@
 
 		//check that the subdomain is not empty
-		if (!t0){ _error_("At least one subdomain is empty");}
+		if (!t0){ _error2_("At least one subdomain is empty");}
 
 		//loop
@@ -4992,5 +4992,5 @@
 		//allocate
 		VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];  
-		if(NbVerticesOnGeomVertex >= maxnbv) _error_("too many vertices on geometry: %i >= %i",NbVerticesOnGeomVertex,maxnbv);
+		if(NbVerticesOnGeomVertex >= maxnbv) _error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
 		_assert_(nbv==0);
 		//Build VerticesOnGeomVertex
@@ -5081,5 +5081,5 @@
 								NbNewPoints=0;
 								NbEdgeCurve=0;
-								if (nbvend>=maxnbv) _error_("maximum number of vertices too low! Check the domain outline or increase maxnbv");
+								if (nbvend>=maxnbv) _error2_("maximum number of vertices too low! Check the domain outline or increase maxnbv");
 								lcurve =0;
 								s = lstep; //-1 initially, then length of each sub edge
@@ -5323,5 +5323,5 @@
 		if(NbVerticesOnGeomVertex >= maxnbv){
 			delete [] bcurve;
-			_error_("too many vertices on geometry: %i >= %i",NbVerticesOnGeomVertex,maxnbv);
+			_error2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);
 		}
 
@@ -5394,5 +5394,5 @@
 		if (bfind!=Gh.nbcurves){
 			delete [] bcurve;
-			_error_("problem generating number of curves (%i found in the geometry but %i curve found in the mesh)",Gh.nbcurves,bfind);
+			_error2_("problem generating number of curves (" << Gh.nbcurves << " found in the geometry but " << bfind << " curve found in the mesh)");
 		}
 
@@ -5493,9 +5493,9 @@
 									double se= (sNew-L0)/LAB;
 									if (se<0 || se>=1.000000001){
-										_error_("Problem creating point on a boundary: se=%g should be in [0 1]",se);
+										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
 									}
 									se = abscisseInterpole(v0.m,v1.m,AB,se,1);
 									if (se<0 || se>1){
-										_error_("Problem creating point on a boundary: se=%g should be in [0 1]",se);
+										_error2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");
 									}
 									se = k1         ? se : 1. - se;
@@ -5529,5 +5529,5 @@
 							}
 							if (!ee.adj[k1]) {
-								_error_(" adj edge %i, nbe=%i, Gh.vertices=%i",BTh.GetId(ee),nbe,Gh.vertices);
+								_error2_(" adj edge " << BTh.GetId(ee) << ", nbe=" << nbe << ", Gh.vertices=" << Gh.vertices);
 							}
 							pe = ee.adj[k1]; // next edge
@@ -5567,5 +5567,5 @@
 			if(step==0){
 				if(nbv+NbOfNewPoints > maxnbv) {
-					_error_("too many vertices on geometry: %i >= %i",nbv+NbOfNewPoints,maxnbv);
+					_error2_("too many vertices on geometry: " << nbv+NbOfNewPoints << " >= " << maxnbv);
 				}
 				edges = new Edge[NbOfNewEdge];
@@ -5612,5 +5612,5 @@
 		int dir=0;
 		if (k<0){
-			_error_("k<0");
+			_error2_("k<0");
 		}
 		int kkk=0;  
@@ -5620,5 +5620,5 @@
 			kkk++;
 			if (kkk>=1000){
-				_error_("kkk>=1000");
+				_error2_("kkk>=1000");
 			}
 			BamgVertex  &vI =  *edge.EdgeVertex(0);
@@ -5637,5 +5637,5 @@
 							double IJ2 = IJ_IA + IJ_AJ;
 							if (IJ2==0){
-								_error_("IJ2==0");
+								_error2_("IJ2==0");
 							}
 							a= IJ_AJ/IJ2;
@@ -5655,5 +5655,5 @@
 		//   int dir=0;
 		if (t->link != 0){
-			_error_("t->link != 0");
+			_error2_("t->link != 0");
 		}
 		// to have a starting edges 
@@ -5727,5 +5727,5 @@
 		  }
 		if (cas ==-2){
-			_error_("cas==-2");
+			_error2_("cas==-2");
 		}
 		// l1 = ||C s1||  , l0 = ||C s0||
@@ -5744,5 +5744,5 @@
 				kkk++;
 				if (edge.EdgeVertex(0)!=s && kkk>=10000){
-					_error_("edge.EdgeVertex(0)!=s && kkk>=10000");
+					_error2_("edge.EdgeVertex(0)!=s && kkk>=10000");
 				}
 
@@ -5776,5 +5776,5 @@
 
 			if (!(Triangle *) er){
-				_error_("!(Triangle *) er");
+				_error2_("!(Triangle *) er");
 			}
 			I2 A((I2)*er.EdgeVertex(0));
@@ -5800,5 +5800,5 @@
 	int NbSwap =0;
 	if (!a.t || !b.t){ // the 2 vertex is in a mesh
-		_error_("!a.t || !b.t");
+		_error2_("!a.t || !b.t");
 	}
 	int k=0;
@@ -5817,5 +5817,5 @@
 		vbegin =v2;
 		if (!v2){
-			_error_("!v2");
+			_error2_("!v2");
 		}
 		det2 = det(*v2,a,b);
@@ -5834,10 +5834,10 @@
 			tc = Previous(tc);
 			if (!v1 || !v2){
-				_error_("!v1 || !v2");
+				_error2_("!v1 || !v2");
 			}
 			Icoor2 detss = 0,l=0,ks;
 			while ((ks=SwapForForcingEdge(  va,  vb, tc, detss, det1,det2,NbSwap)))
 			 if(l++ > 10000000) {
-				 _error_("Loop in forcing Egde, nb de swap=%i, nb of try swap (%i) too big",NbSwap,l);
+				 _error2_("Loop in forcing Egde, nb de swap=" << NbSwap << ", nb of try swap (" << l << ") too big");
 			 }
 			BamgVertex *aa = tc.EdgeVertex(0), *bb = tc.EdgeVertex(1);
@@ -5858,5 +5858,5 @@
 		k++;
 		if (k>=2000){
-			_error_("k>=2000");
+			_error2_("k>=2000");
 		}
 		if ( vbegin == v2 ) return -1;// error 
@@ -5930,5 +5930,5 @@
 		short a1=tt1,a2=tt2;// les 2 numero de l arete dans les 2 triangles
 		if ( a1<0 || a1>=3 ){
-			_error_("a1<0 || a1>=3");
+			_error2_("a1<0 || a1>=3");
 		}
 
@@ -5942,8 +5942,8 @@
 		Icoor2 detT = det1+det2;
 		if ((det1<=0 ) || (det2<=0)){
-			_error_("(det1<=0 ) || (det2<=0)");
+			_error2_("(det1<=0 ) || (det2<=0)");
 		}
 		if ( (detsa>=0) || (detsb<=0) ){ // [a,b] cut infinite line va,bb
-			_error_("(detsa>=0) || (detsb<=0)");
+			_error2_("(detsa>=0) || (detsb<=0)");
 		}
 		Icoor2 ndet1 = bamg::det(s1,sa,s2);
Index: /issm/trunk-jpl/src/c/objects/Bamg/Metric.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/Metric.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/Metric.cpp	(revision 12493)
@@ -197,5 +197,5 @@
 		// warning for optimisation S is in [0:0.5] not in [0:1]
 		if (i>=512){
-			_error_("i>=512");
+			_error2_("i>=512");
 		}
 		LastMetricInterpole.lab=l;
@@ -345,5 +345,5 @@
 		}
 		if (r>1 || r<0){
-			_error_("r>1 || r<0");
+			_error2_("r>1 || r<0");
 		}
 		return r ;
Index: /issm/trunk-jpl/src/c/objects/Bamg/SetOfE4.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/SetOfE4.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/SetOfE4.cpp	(revision 12493)
@@ -50,5 +50,5 @@
 		//check that nbax <=NbOfEdges
 		if (nbax <=NbOfEdges ) {
-			_error_("SetOfEdges4::add overflow: NbOfEdges=%i > nbax=%i",NbOfEdges,nbax);
+			_error2_("SetOfEdges4::add overflow: NbOfEdges=" << NbOfEdges << " > nbax=" << nbax);
 		}
 
Index: /issm/trunk-jpl/src/c/objects/Bamg/SubDomain.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/SubDomain.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/SubDomain.cpp	(revision 12493)
@@ -16,9 +16,9 @@
 		*this = Th.subdomains[i];
 		if ( head-Th.triangles<0 || head-Th.triangles>=Th.nbt){
-			_error_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");
+			_error2_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");
 		}
 		head = ThNew.triangles + Th.GetId(head) ; 
 		if (edge-Th.edges<0 || edge-Th.edges>=Th.nbe);{
-			_error_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe");
+			_error2_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe");
 		}
 		edge = ThNew.edges+ Th.GetId(edge);
Index: /issm/trunk-jpl/src/c/objects/Bamg/Triangle.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Bamg/Triangle.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Bamg/Triangle.cpp	(revision 12493)
@@ -19,8 +19,8 @@
 		long nbv = Th->nbv;
 		if (i<0 || j<0 || k<0){
-			_error_("i<0 || j<0 || k<0");
+			_error2_("i<0 || j<0 || k<0");
 		}
 		if (i>=nbv || j>=nbv || k>=nbv){
-			_error_("i>=nbv || j>=nbv || k>=nbv");
+			_error2_("i>=nbv || j>=nbv || k>=nbv");
 		}
 		vertices[0]=v+i;
@@ -173,5 +173,5 @@
 			//check number of iterations
 			if (k>=2000){
-				_error_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)");
+				_error2_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)");
 			}
 		} while (this!= t);
@@ -213,5 +213,5 @@
 		do {
 			while (t->swap(j,koption)){
-				if (k>=20000) _error_("k>=20000");
+				if (k>=20000) _error2_("k>=20000");
 				NbSwap++;
 				k++;
Index: /issm/trunk-jpl/src/c/objects/Constraints/SpcTransient.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Constraints/SpcTransient.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Constraints/SpcTransient.cpp	(revision 12493)
@@ -146,5 +146,5 @@
 		}
 
-		if(!found)_error_("could not find time segment for constraint");
+		if(!found)_error2_("could not find time segment for constraint");
 
 		/*Apply or relax constraint: */
Index: /issm/trunk-jpl/src/c/objects/DofIndexing.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/DofIndexing.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/DofIndexing.cpp	(revision 12493)
@@ -143,5 +143,5 @@
 		else this->sdoflist=NULL;
 	}
-	else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+	else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp	(revision 12493)
@@ -130,5 +130,5 @@
 void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
 
-	_error_("cannot return vector on vertices");
+	_error2_("cannot return vector on vertices");
 } /*}}}*/
 /*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/
Index: /issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp	(revision 12493)
@@ -142,5 +142,5 @@
 	IssmDouble data[6];
 
-	if(numdofs!=6)_error_("Result %s is a PentaP1ElementResult and cannot write vector of %i dofs",EnumToStringx(this->enum_type),numdofs);
+	if(numdofs!=6)_error2_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs");
 	for(int i=0;i<6;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
 	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
@@ -150,4 +150,4 @@
 void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
 
-	_error_("Result %s is a PentaP1ElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
+	_error2_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");
 } /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp	(revision 12493)
@@ -130,5 +130,5 @@
 	IssmDouble data[3];
 
-	if(numdofs!=3)_error_("Result %s is a TriaP1ElementResult and cannot write vector of %i dofs",numdofs);
+	if(numdofs!=3)_error2_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs");
 	for(int i=0;i<3;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
 	vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
@@ -137,4 +137,4 @@
 /*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/
 void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
-	_error_("Result %s is a TriaP1ElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
+	_error2_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");
 } /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12493)
@@ -146,5 +146,5 @@
 /*FUNCTION Penta::AverageOntoPartition {{{*/
 void  Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
-	_error_("Not supported yet!");
+	_error2_("Not supported yet!");
 }
 /*}}}*/
@@ -252,6 +252,6 @@
 
 	/*Check analysis_types*/
-	if (analysis_type!=DiagnosticHorizAnalysisEnum) _error_("Not supported yet!");
-	if (approximation!=StokesApproximationEnum) _error_("Not supported yet!");
+	if (analysis_type!=DiagnosticHorizAnalysisEnum) _error2_("Not supported yet!");
+	if (approximation!=StokesApproximationEnum) _error2_("Not supported yet!");
 
 	/*retrieve some parameters: */
@@ -318,5 +318,5 @@
 void  Penta::ComputeStrainRate(Vector* eps){
 
-	_error_("Not implemented yet");
+	_error2_("Not implemented yet");
 
 }
@@ -464,5 +464,5 @@
 		#endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -569,5 +569,5 @@
 		#endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -638,5 +638,5 @@
 #endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -816,5 +816,5 @@
 		 return i;
 	}
-	_error_("Node provided not found among element nodes");
+	_error2_("Node provided not found among element nodes");
 
 }
@@ -829,5 +829,5 @@
 	/*Recover input*/
 	Input* input=inputs->GetInput(enumtype);
-	if (!input) _error_("Input %s not found in element",EnumToStringx(enumtype));
+	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
 
 	/*Checks in debugging mode*/
@@ -878,5 +878,5 @@
 
 	Input* input=inputs->GetInput(enumtype);
-	if(!input) _error_("No input of type %s found in tria",EnumToStringx(enumtype));
+	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
 
 	GaussPenta* gauss=new GaussPenta();
@@ -973,5 +973,5 @@
 	#endif
 	default:
-		_error_("analysis: %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+		_error2_("analysis: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 }
@@ -1013,5 +1013,5 @@
 	/*Check that both inputs have been found*/
 	if (!vx_input || !vy_input){
-		_error_("Input missing. Here are the input pointers we have for vx: %p, vy: %p\n",vx_input,vy_input);
+		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
 	}
 
@@ -1038,5 +1038,5 @@
 	/*Check that both inputs have been found*/
 	if (!vx_input || !vy_input || !vz_input){
-		_error_("Input missing. Here are the input pointers we have for vx: %p, vy: %p, vz: %p\n",vx_input,vy_input,vz_input);
+		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vz: " << vz_input << "\n");
 	}
 
@@ -1073,5 +1073,5 @@
 	/*Get input (either in element or material)*/
 	Input* input=inputs->GetInput(input_enum);
-	if(!input) _error_("Input %s not found in element",EnumToStringx(input_enum));
+	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
 
 	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
@@ -1133,5 +1133,5 @@
 	/*Make a copy of the original input: */
 	input=(Input*)this->inputs->GetInput(enum_type);
-	if(!input)_error_(" could not find old input with enum: %s",EnumToStringx(enum_type));
+	if(!input)_error2_(" could not find old input with enum: " << EnumToStringx(enum_type));
 
 	/*ArtificialNoise: */
@@ -1153,6 +1153,6 @@
 		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
 		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
-		if(!new_inputs[i])_error_("%s%s"," could not find input with enum ",EnumToStringx(enums[2*i+0]));
-		if(!old_inputs[i])_error_("%s%s"," could not find input with enum ",EnumToStringx(enums[2*i+0]));
+		if(!new_inputs[i])_error2_("" << " could not find input with enum " << EnumToStringx(enums[2*i+0]));
+		if(!old_inputs[i])_error2_("" << " could not find input with enum " << EnumToStringx(enums[2*i+0]));
 	}
 
@@ -1186,5 +1186,5 @@
 		this->inputs->AddInput(new DoubleInput(name,(IssmDouble)scalar));
 	}
-	else _error_("%s%i"," could not recognize nature of vector from code ",code);
+	else _error2_("" << " could not recognize nature of vector from code " << code);
 
 }
@@ -1251,5 +1251,5 @@
 			this->inputs->AddInput(transientinput);
 		}
-		else _error_("nodal vector is either numberofnodes (%i), or numberofnodes+1 long. Field provided is %i long. Enum %s",numberofvertices,M,EnumToStringx(vector_enum));
+		else _error2_("nodal vector is either numberofnodes (" << numberofvertices << "), or numberofnodes+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum));
 	}
 	else if(vector_type==2){ //element vector
@@ -1268,12 +1268,12 @@
 				this->inputs->AddInput(new DoubleInput(vector_enum,(IssmDouble)vector[index]));
 			}
-			else _error_("%s%i"," could not recognize nature of vector from code ",code);
+			else _error2_("" << " could not recognize nature of vector from code " << code);
 		}
 		else {
-			_error_("transient elementary inputs not supported yet!");
+			_error2_("transient elementary inputs not supported yet!");
 		}
 	}
 	else{
-		_error_("Cannot add input for vector type %i (not supported)",vector_type);
+		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
 	}
 
@@ -1314,6 +1314,6 @@
 		 original_input=(Input*)penta->matice->inputs->GetInput(enum_type);
 		else
-		 _error_("object %s not supported yet",EnumToStringx(object_enum));
-		if(!original_input) _error_("could not find input with enum %s",EnumToStringx(enum_type));
+		 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+		if(!original_input) _error2_("could not find input with enum " << EnumToStringx(enum_type));
 
 		/*If first time, initialize total_integrated_input*/
@@ -1326,5 +1326,5 @@
 			 total_integrated_input=new DoubleInput(average_enum_type,0.0);
 			else
-			 _error_("object %s not supported yet",EnumToStringx(original_input->ObjectEnum()));
+			 _error2_("object " << EnumToStringx(original_input->ObjectEnum()) << " not supported yet");
 		}
 
@@ -1374,5 +1374,5 @@
 	 this->matice->inputs->AddInput((Input*)depth_averaged_input);
 	else
-	 _error_("object %s not supported yet",EnumToStringx(object_enum));
+	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
 }
 /*}}}*/
@@ -1415,8 +1415,8 @@
 	}
 	else{
-		_error_("object of type %s not supported yet",EnumToStringx(object_type));
+		_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
 	}
 	for(i=0;i<num_inputs;i++){
-		if(!base_inputs[i]) _error_("could not find input with enum %s in object %s",EnumToStringx(enum_type),EnumToStringx(object_type));
+		if(!base_inputs[i]) _error2_("could not find input with enum " << EnumToStringx(enum_type) << " in object " << EnumToStringx(object_type));
 		base_inputs[i]->Extrude();
 	}
@@ -1445,5 +1445,5 @@
 			}
 			else{
-				_error_("object of type %s not supported yet",EnumToStringx(object_type));
+				_error2_("object of type " << EnumToStringx(object_type) << " not supported yet");
 			}
 		}
@@ -1464,5 +1464,5 @@
 	/*Make a copy of the original input: */
 	input=(Input*)this->inputs->GetInput(enum_type);
-	if(!input)_error_(" could not find old input with enum: %s",EnumToStringx(enum_type));
+	if(!input)_error2_(" could not find old input with enum: " << EnumToStringx(enum_type));
 
 	/*Scale: */
@@ -1480,5 +1480,5 @@
 	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
 	else input=this->inputs->GetInput(enum_type);
-	//if (!input) _error_("Input %s not found in penta->inputs",EnumToStringx(enum_type)); why error out? if the requested input does not exist, we should still 
+	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still 
 	//try and output whatever we can instead of just failing.
 	if(!input)return;
@@ -1594,5 +1594,5 @@
 					/*Matice will take care of it*/ break;
 				default:
-					_error_("Control %s not implemented yet",EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]));
+					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
 			}
 		}
@@ -1627,5 +1627,5 @@
 		}
 		else{
-			_error_("Approximation type %s not supported yet",EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)));
+			_error2_("Approximation type " << EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)) << " not supported yet");
 		}
 	}
@@ -1711,5 +1711,5 @@
 	#endif
 	default: 
-		_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+		_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 }
@@ -1742,5 +1742,5 @@
 	for(i=0;i<numdof2d;i++){
 		newthickness[i]=solution[doflist[i]];
-		if(isnan(newthickness[i])) _error_("NaN found in solution vector");
+		if(isnan(newthickness[i])) _error2_("NaN found in solution vector");
 		/*Constrain thickness to be at least 1m*/
 		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
@@ -1775,5 +1775,5 @@
 				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
 			}
-			else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToStringx(hydroadjustment));
+			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
 		}
 	}
@@ -1812,5 +1812,5 @@
 	for(int i=0;i<numdof;i++){
 		values[i]=solution[doflist[i]];
-		if(isnan(values[i])) _error_("NaN found in solution vector");
+		if(isnan(values[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -1842,5 +1842,5 @@
 		values[i]         =solution[doflist[i]];
 		values[i+numdof2d]=values[i];
-		if(isnan(values[i])) _error_("NaN found in solution vector");
+		if(isnan(values[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -1888,5 +1888,5 @@
 		default:
 
-			_error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 }
@@ -1894,10 +1894,10 @@
 /*FUNCTION Penta::InputUpdateFromVector(int* vector, int name, int type);{{{*/
 void  Penta::InputUpdateFromVector(int* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
 /*FUNCTION Penta::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
 void  Penta::InputUpdateFromVector(bool* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
@@ -2676,5 +2676,5 @@
 void  Penta::SetClone(int* minranks){
 
-	_error_("not implemented yet");
+	_error2_("not implemented yet");
 }
 /*}}}*/
@@ -2988,5 +2988,5 @@
 				this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,nodeinputs));
 			}
-			else _error_("temperature and waterfraction required for the enthalpy solution");
+			else _error2_("temperature and waterfraction required for the enthalpy solution");
 			break;
 
@@ -3067,5 +3067,5 @@
 /*FUNCTION Penta::SmearFunction {{{*/
 void  Penta::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
-	_error_("not implemented yet");
+	_error2_("not implemented yet");
 }
 /*}}}*/
@@ -3285,5 +3285,5 @@
 			*presponse=vel;
 		default:  
-			_error_("Response type %s not supported yet!",EnumToStringx(response_enum));
+			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
 	}
 
@@ -4328,5 +4328,5 @@
 
 		/*Check solution*/
-		if(isnan(values[i])) _error_("NaN found in solution vector");
+		if(isnan(values[i])) _error2_("NaN found in solution vector");
 		//if(values[i]<0)      printf("temperature < 0°K found in solution vector\n");
 		//if(values[i]>275)    printf("temperature > 275°K found in solution vector (Paterson's rheology associated is negative)\n");
@@ -4362,5 +4362,5 @@
 				break;
 			default:
-				_error_("Rheology law %s not supported yet",EnumToStringx(rheology_law));
+				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
 
 		}
@@ -4398,5 +4398,5 @@
 
 		/*Check solution*/
-		if(isnan(values[i])) _error_("NaN found in solution vector");
+		if(isnan(values[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -4411,6 +4411,6 @@
 		for(i=0;i<numdof;i++){
 			matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]);
-			if(waterfraction[i]<0) _error_("Negative water fraction found in solution vector");
-			//if(waterfraction[i]>1) _error_("Water fraction >1 found in solution vector");
+			if(waterfraction[i]<0) _error2_("Negative water fraction found in solution vector");
+			//if(waterfraction[i]>1) _error2_("Water fraction >1 found in solution vector");
 		}
 			
@@ -4440,5 +4440,5 @@
 				break;
 			default:
-				_error_("Rheology law %s not supported yet",EnumToStringx(rheology_law));
+				_error2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
 
 		}
@@ -4468,6 +4468,6 @@
 		input=inputs->GetInput(enum_type);
 	}
-	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
+	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
 
 	GradientIndexing(&doflist1[0],control_index);
@@ -4486,6 +4486,6 @@
 		input=inputs->GetInput(enum_type);
 	}
-	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
+	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
 
 	((ControlInput*)input)->ScaleGradient(scale);
@@ -4505,6 +4505,6 @@
 		input=inputs->GetInput(enum_type);
 	}
-	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
+	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
 
 	GradientIndexing(&doflist1[0],control_index);
@@ -4530,5 +4530,5 @@
 			return NULL;
 		default:
-			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
+			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
 	}
 }
@@ -4720,5 +4720,5 @@
 			return CreatePVectorAdjointStokes();
 		default:
-			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
+			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
 	}
 }
@@ -4809,5 +4809,5 @@
 					break;
 				default:
-					_error_("approximation %s not supported yet",EnumToStringx(approximation));
+					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
 			}
 			break;
@@ -4829,10 +4829,10 @@
 					break;
 				default:
-					_error_("approximation %s not supported yet",EnumToStringx(approximation));
+					_error2_("approximation " << EnumToStringx(approximation) << " not supported yet");
 			}
 			break;
 
 		default:
-			_error_("control type %s not supported yet: ",EnumToStringx(control_type));
+			_error2_("control type " << EnumToStringx(control_type) << " not supported yet: ");
 	}
 
@@ -4866,5 +4866,5 @@
 			break;
 		default:
-			_error_("response %s not supported yet",EnumToStringx(responses[resp]));
+			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
 	}
 	xDelete<int>(responses);
@@ -5120,5 +5120,5 @@
 		}
 
-		if (input->ObjectEnum()!=ControlInputEnum) _error_("input %s is not a ControlInput",EnumToStringx(control_type[i]));
+		if (input->ObjectEnum()!=ControlInputEnum) _error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
 
 		((ControlInput*)input)->UpdateValue(scalar);
@@ -5163,8 +5163,8 @@
 
 		/*Check solution*/
-		if(isnan(lambdax[i])) _error_("NaN found in solution vector");
-		if(isnan(lambday[i])) _error_("NaN found in solution vector");
-		if(isnan(lambdaz[i])) _error_("NaN found in solution vector");
-		if(isnan(lambdap[i])) _error_("NaN found in solution vector");
+		if(isnan(lambdax[i])) _error2_("NaN found in solution vector");
+		if(isnan(lambday[i])) _error2_("NaN found in solution vector");
+		if(isnan(lambdaz[i])) _error2_("NaN found in solution vector");
+		if(isnan(lambdap[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -5202,6 +5202,6 @@
 
 		/*Check solution*/
-		if(isnan(lambdax[i]))       _error_("NaN found in solution vector");
-		if(isnan(lambday[i]))       _error_("NaN found in solution vector");
+		if(isnan(lambdax[i]))       _error2_("NaN found in solution vector");
+		if(isnan(lambday[i]))       _error2_("NaN found in solution vector");
 	}
 
@@ -5404,5 +5404,5 @@
 IssmDouble Penta::ThicknessAbsGradient(bool process_units,int weight_index){
 
-	_error_("Not implemented yet");
+	_error2_("Not implemented yet");
 }
 /*}}}*/
@@ -5419,5 +5419,5 @@
 	/*If on water, return 0: */
 	if(IsOnWater())return 0;
-	_error_("Not implemented yet");
+	_error2_("Not implemented yet");
 
 	tria=(Tria*)SpawnTria(0,1,2);
@@ -5470,9 +5470,9 @@
 	/*Get input (either in element or material)*/
 	Input* input=inputs->GetInput(control_enum);
-	if(!input) _error_("Input %s not found in element",EnumToStringx(control_enum));
+	if(!input) _error2_("Input " << EnumToStringx(control_enum) << " not found in element");
 
 	/*Check that it is a ControlInput*/
 	if (input->ObjectEnum()!=ControlInputEnum){
-		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
 	}
 
@@ -5509,5 +5509,5 @@
 
 	if (input->ObjectEnum()!=ControlInputEnum){
-		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
 	}
 
@@ -5615,5 +5615,5 @@
 
 		default:
-			_error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 
@@ -5622,10 +5622,10 @@
 /*FUNCTION Penta::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
 void  Penta::InputUpdateFromVectorDakota(int* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
 /*FUNCTION Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
 void  Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
@@ -5670,5 +5670,5 @@
 
 		default:
-			_error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 
@@ -6229,5 +6229,5 @@
 			return CreateKMatrixDiagnosticPattynStokes();
 		default:
-			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
+			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
 	}
 }
@@ -6397,5 +6397,5 @@
 			matice->GetViscosity3dStokes(&newviscosity,&epsilons[0]);
 		}
-		else _error_("approximation %i (%s) not supported yet",approximation,EnumToStringx(approximation));
+		else _error2_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet");
 
 		D_scalar=2*newviscosity*gauss->weight*Jdet;
@@ -7220,5 +7220,5 @@
 			return CreatePVectorDiagnosticPattynStokes();
 		default:
-			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
+			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
 	}
 }
@@ -7733,5 +7733,5 @@
 			return NULL;
 		default:
-			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
+			_error2_("Approximation " << EnumToStringx(approximation) << " not supported yet");
 	}
 }
@@ -8128,6 +8128,6 @@
 
 		/*Check solution*/
-		if(isnan(vx[i])) _error_("NaN found in solution vector");
-		if(isnan(vy[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i])) _error2_("NaN found in solution vector");
+		if(isnan(vy[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -8226,6 +8226,6 @@
 
 		/*Check solution*/
-		if(isnan(vx[i])) _error_("NaN found in solution vector");
-		if(isnan(vy[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i])) _error2_("NaN found in solution vector");
+		if(isnan(vy[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -8314,8 +8314,8 @@
 
 		/*Check solution*/
-		if(isnan(vx[i]))       _error_("NaN found in solution vector");
-		if(isnan(vy[i]))       _error_("NaN found in solution vector");
-		if(isnan(vzstokes[i])) _error_("NaN found in solution vector");
-		if(isnan(pressure[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i]))       _error2_("NaN found in solution vector");
+		if(isnan(vy[i]))       _error2_("NaN found in solution vector");
+		if(isnan(vzstokes[i])) _error2_("NaN found in solution vector");
+		if(isnan(pressure[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -8324,10 +8324,10 @@
 	if (vzmacayeal_input){
 		if (vzmacayeal_input->ObjectEnum()!=PentaP1InputEnum){
-			_error_("Cannot compute Vel as VzMacAyeal is of type %s",EnumToStringx(vzmacayeal_input->ObjectEnum()));
+			_error2_("Cannot compute Vel as VzMacAyeal is of type " << EnumToStringx(vzmacayeal_input->ObjectEnum()));
 		}
 		GetInputListOnVertices(&vzmacayeal[0],VzMacAyealEnum);
 	}
 	else{
-		_error_("Cannot update solution as VzMacAyeal is not present");
+		_error2_("Cannot update solution as VzMacAyeal is not present");
 	}
 
@@ -8393,6 +8393,6 @@
 
 		/*Check solution*/
-		if(isnan(vx[i])) _error_("NaN found in solution vector");
-		if(isnan(vy[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i])) _error2_("NaN found in solution vector");
+		if(isnan(vy[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -8482,8 +8482,8 @@
 
 		/*Check solution*/
-		if(isnan(vx[i]))       _error_("NaN found in solution vector");
-		if(isnan(vy[i]))       _error_("NaN found in solution vector");
-		if(isnan(vzstokes[i])) _error_("NaN found in solution vector");
-		if(isnan(pressure[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i]))       _error2_("NaN found in solution vector");
+		if(isnan(vy[i]))       _error2_("NaN found in solution vector");
+		if(isnan(vzstokes[i])) _error2_("NaN found in solution vector");
+		if(isnan(pressure[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -8492,10 +8492,10 @@
 	if (vzpattyn_input){
 		if (vzpattyn_input->ObjectEnum()!=PentaP1InputEnum){
-			_error_("Cannot compute Vel as VzPattyn is of type %s",EnumToStringx(vzpattyn_input->ObjectEnum()));
+			_error2_("Cannot compute Vel as VzPattyn is of type " << EnumToStringx(vzpattyn_input->ObjectEnum()));
 		}
 		GetInputListOnVertices(&vzpattyn[0],VzPattynEnum);
 	}
 	else{
-		_error_("Cannot update solution as VzPattyn is not present");
+		_error2_("Cannot update solution as VzPattyn is not present");
 	}
 
@@ -8558,6 +8558,6 @@
 
 		/*Check solution*/
-		if(isnan(vx[i])) _error_("NaN found in solution vector");
-		if(isnan(vy[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i])) _error2_("NaN found in solution vector");
+		if(isnan(vy[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -8627,5 +8627,5 @@
 
 		/*Check solution*/
-		if(isnan(vz[i])) _error_("NaN found in solution vector");
+		if(isnan(vz[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -8638,8 +8638,8 @@
 		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
 		if (vzstokes_input){
-			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type %s",EnumToStringx(vzstokes_input->ObjectEnum()));
+			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
 			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
 		}
-		else _error_("Cannot compute Vz as VzStokes in not present in PattynStokes element");
+		else _error2_("Cannot compute Vz as VzStokes in not present in PattynStokes element");
 		for(i=0;i<NUMVERTICES;i++){
 			vzpattyn[i]=vz[i];
@@ -8650,8 +8650,8 @@
 		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
 		if (vzstokes_input){
-			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type %s",EnumToStringx(vzstokes_input->ObjectEnum()));
+			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));
 			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
 		}
-		else _error_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");
+		else _error2_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");
 		for(i=0;i<NUMVERTICES;i++){
 			vzmacayeal[i]=vz[i];
@@ -8725,8 +8725,8 @@
 
 		/*Check solution*/
-		if(isnan(vx[i]))       _error_("NaN found in solution vector");
-		if(isnan(vy[i]))       _error_("NaN found in solution vector");
-		if(isnan(vz[i]))       _error_("NaN found in solution vector");
-		if(isnan(pressure[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i]))       _error2_("NaN found in solution vector");
+		if(isnan(vy[i]))       _error2_("NaN found in solution vector");
+		if(isnan(vz[i]))       _error2_("NaN found in solution vector");
+		if(isnan(pressure[i])) _error2_("NaN found in solution vector");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Elements/PentaRef.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/PentaRef.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Elements/PentaRef.cpp	(revision 12493)
@@ -949,5 +949,5 @@
 	/*Get Determinant*/
 	Matrix3x3Determinant(Jdet,&J[0][0]);
-	if(*Jdet<0) _error_("negative jacobian determinant!");
+	if(*Jdet<0) _error2_("negative jacobian determinant!");
 
 }
@@ -972,5 +972,5 @@
 	/*Jdet = norm( AB ^ AC ) / (2 * area of the reference triangle), with areaRef=sqrt(3) */
 	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
-	if(*Jdet<0) _error_("negative jacobian determinant!");
+	if(*Jdet<0) _error2_("negative jacobian determinant!");
 }
 /*}}}*/
@@ -990,5 +990,5 @@
 
 	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.) + pow(z2-z1,2.));
-	if(*Jdet<0) _error_("negative jacobian determinant!");
+	if(*Jdet<0) _error2_("negative jacobian determinant!");
 
 }
@@ -1226,5 +1226,5 @@
 	/*Area of a trabezoid = altitude * (base1 + base2)/2 */
 	*Jdet= pow(pow(x2-x1,2.) + pow(y2-y1,2.),0.5) * (z4-z1 + z3-z2)/8;
-	if(*Jdet<0) _error_("negative jacobian determinant!");
+	if(*Jdet<0) _error2_("negative jacobian determinant!");
 
 }
Index: /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12493)
@@ -214,5 +214,5 @@
 		#endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -277,5 +277,5 @@
 			return CreateKMatrixPrognostic_DG();
 		default:
-			_error_("Element type %s not supported yet",EnumToStringx(GetElementType()));
+			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
 	}
 
@@ -568,5 +568,5 @@
 		#endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -587,5 +587,5 @@
 			return CreatePVectorPrognostic_DG();
 		default:
-			_error_("Element type %s not supported yet",EnumToStringx(GetElementType()));
+			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
 	}
 }
@@ -763,5 +763,5 @@
 #endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -775,10 +775,10 @@
 /*FUNCTION Tria::ComputeBasalStress {{{*/
 void  Tria::ComputeBasalStress(Vector* eps){
-	_error_("Not Implemented yet");
+	_error2_("Not Implemented yet");
 }
 /*}}}*/
 /*FUNCTION Tria::ComputeStrainRate {{{*/
 void  Tria::ComputeStrainRate(Vector* eps){
-	_error_("Not Implemented yet");
+	_error2_("Not Implemented yet");
 }
 /*}}}*/
@@ -1019,5 +1019,5 @@
 		 return i;
 	}
-	_error_("Node provided not found among element nodes");
+	_error2_("Node provided not found among element nodes");
 }
 /*}}}*/
@@ -1031,5 +1031,5 @@
 	/*Recover input*/
 	Input* input=inputs->GetInput(enumtype);
-	if (!input) _error_("Input %s not found in element",EnumToStringx(enumtype));
+	if (!input) _error2_("Input " << EnumToStringx(enumtype) << " not found in element");
 
 	/*Checks in debugging mode*/
@@ -1103,5 +1103,5 @@
 
 	Input* input=inputs->GetInput(enumtype);
-	if(!input) _error_("No input of type %s found in tria",EnumToStringx(enumtype));
+	if(!input) _error2_("No input of type " << EnumToStringx(enumtype) << " found in tria");
 
 	GaussTria* gauss=new GaussTria();
@@ -1145,5 +1145,5 @@
 	#endif
 	default:
-		_error_("analysis: %s not supported yet",EnumToStringx(analysis_type));
+		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
 	}
 
@@ -1161,5 +1161,5 @@
 	/*Check that both inputs have been found*/
 	if (!vx_input || !vy_input){
-		_error_("Input missing. Here are the input pointers we have for vx: %p, vy: %p\n",vx_input,vy_input);
+		_error2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");
 	}
 
@@ -1185,5 +1185,5 @@
 	/*Get input (either in element or material)*/
 	Input* input=inputs->GetInput(input_enum);
-	if(!input) _error_("Input %s not found in element",EnumToStringx(input_enum));
+	if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in element");
 
 	/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
@@ -1232,5 +1232,5 @@
 	/*Make a copy of the original input: */
 	input=(Input*)this->inputs->GetInput(enum_type);
-	if(!input)_error_(" could not find old input with enum: %s",EnumToStringx(enum_type));
+	if(!input)_error2_(" could not find old input with enum: " << EnumToStringx(enum_type));
 
 	/*ArtificialNoise: */
@@ -1252,6 +1252,6 @@
 		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
 		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
-		if(!new_inputs[i])_error_("%s%s"," could not find input with enum ",EnumToStringx(enums[2*i+0]));
-		if(!old_inputs[i])_error_("%s%s"," could not find input with enum ",EnumToStringx(enums[2*i+0]));
+		if(!new_inputs[i])_error2_("" << " could not find input with enum " << EnumToStringx(enums[2*i+0]));
+		if(!old_inputs[i])_error2_("" << " could not find input with enum " << EnumToStringx(enums[2*i+0]));
 	}
 
@@ -1281,6 +1281,6 @@
 	 oldinput=(Input*)this->matice->inputs->GetInput(enum_type);
 	else
-	 _error_("object %s not supported yet",EnumToStringx(object_enum));
-	if(!oldinput)_error_("%s%s"," could not find old input with enum: ",EnumToStringx(enum_type));
+	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
+	if(!oldinput)_error2_("" << " could not find old input with enum: " << EnumToStringx(enum_type));
 	newinput=(Input*)oldinput->copy();
 
@@ -1294,5 +1294,5 @@
 	 this->matice->inputs->AddInput((Input*)newinput);
 	else
-	 _error_("object %s not supported yet",EnumToStringx(object_enum));
+	 _error2_("object " << EnumToStringx(object_enum) << " not supported yet");
 }
 /*}}}*/
@@ -1312,5 +1312,5 @@
 	/*Make a copy of the original input: */
 	input=(Input*)this->inputs->GetInput(enum_type);
-	if(!input)_error_(" could not find old input with enum: %s",EnumToStringx(enum_type));
+	if(!input)_error2_(" could not find old input with enum: " << EnumToStringx(enum_type));
 
 	/*Scale: */
@@ -1327,5 +1327,5 @@
 	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(enum_type);
 	else input=this->inputs->GetInput(enum_type);
-	//if (!input) _error_("Input %s not found in tria->inputs",EnumToStringx(enum_type));
+	//if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs");
 	if(!input)return;
 
@@ -1433,5 +1433,5 @@
 					/*Matice will take care of it*/ break;
 				default:
-					_error_("Control %s not implemented yet",EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]));
+					_error2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");
 			}
 		}
@@ -1505,5 +1505,5 @@
 			break;
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 }
@@ -1523,5 +1523,5 @@
 	for(int i=0;i<numdof;i++){
 		values[i]=solution[doflist[i]];
-		if(isnan(values[i])) _error_("NaN found in solution vector");
+		if(isnan(values[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -1556,5 +1556,5 @@
 	for(i=0;i<numdof;i++){
 		newthickness[i]=solution[doflist[i]];
-		if(isnan(newthickness[i])) _error_("NaN found in solution vector");
+		if(isnan(newthickness[i])) _error2_("NaN found in solution vector");
 		/*Constrain thickness to be at least 1m*/
 		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
@@ -1587,5 +1587,5 @@
 				newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH
 			}
-			else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToStringx(hydroadjustment));
+			else _error2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
 		}
 	}
@@ -1628,5 +1628,5 @@
 
 		default:
-			_error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 }
@@ -1634,10 +1634,10 @@
 /*FUNCTION Tria::InputUpdateFromVector(int* vector, int name, int type);{{{*/
 void  Tria::InputUpdateFromVector(int* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
 /*FUNCTION Tria::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
 void  Tria::InputUpdateFromVector(bool* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
@@ -1657,5 +1657,5 @@
 		this->inputs->AddInput(new DoubleInput(name,(int)scalar));
 	}
-	else _error_("%s%i"," could not recognize nature of vector from code ",code);
+	else _error2_("" << " could not recognize nature of vector from code " << code);
 
 }
@@ -1722,5 +1722,5 @@
 			this->inputs->AddInput(transientinput);
 		}
-		else _error_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (%s) is %i long",EnumToStringx(vector_enum),M);
+		else _error2_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
 	}
 	else if(vector_type==2){ //element vector
@@ -1739,12 +1739,12 @@
 				this->inputs->AddInput(new DoubleInput(vector_enum,(IssmDouble)vector[index]));
 			}
-			else _error_("%s%i"," could not recognize nature of vector from code ",code);
+			else _error2_("" << " could not recognize nature of vector from code " << code);
 		}
 		else {
-			_error_("transient elementary inputs not supported yet!");
+			_error2_("transient elementary inputs not supported yet!");
 		}
 	}
 	else{
-		_error_("Cannot add input for vector type %i (not supported)",vector_type);
+		_error2_("Cannot add input for vector type " << vector_type << " (not supported)");
 	}
 
@@ -2360,10 +2360,10 @@
 void  Tria::SetClone(int* minranks){
 
-	_error_("not implemented yet");
+	_error2_("not implemented yet");
 }
 /*}}}*/
 /*FUNCTION Tria::SmearFunction {{{*/
 void  Tria::SmearFunction(Vector*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
-	_error_("not implemented yet");
+	_error2_("not implemented yet");
 
 }
@@ -2458,5 +2458,5 @@
 	this->MaxAbsVy(&maxabsvy,false);
 	#else
-		_error_("ISSM was not compiled with responses compiled in, exiting!");
+		_error2_("ISSM was not compiled with responses compiled in, exiting!");
 	#endif
 
@@ -2651,5 +2651,5 @@
 
 	/*First off, check that this segment belongs to this element: */
-	if ((int)*(segment+4)!=this->id)_error_("%s%i%s%i","error message: segment with id ",(int)*(segment+4)," does not belong to element with id:",this->id);
+	if ((int)*(segment+4)!=this->id)_error2_("" << "error message: segment with id " << (int)*(segment+4) << " does not belong to element with id:" << this->id);
 
 	/*Recover segment node locations: */
@@ -2870,5 +2870,5 @@
 			*presponse=vel;
 		default:  
-			_error_("Response type %s not supported yet!",EnumToStringx(response_enum));
+			_error2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
 	}
 
@@ -3325,6 +3325,6 @@
 
 		/*Check solution*/
-		if(isnan(vx[i])) _error_("NaN found in solution vector");
-		if(isnan(vy[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i])) _error2_("NaN found in solution vector");
+		if(isnan(vy[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -3385,6 +3385,6 @@
 
 		/*Check solution*/
-		if(isnan(vx[i])) _error_("NaN found in solution vector");
-		if(isnan(vy[i])) _error_("NaN found in solution vector");
+		if(isnan(vx[i])) _error2_("NaN found in solution vector");
+		if(isnan(vy[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -3441,5 +3441,5 @@
 
 		if (input->ObjectEnum()!=ControlInputEnum){
-			_error_("input %s is not a ControlInput",EnumToStringx(control_type[i]));
+			_error2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");
 		}
 
@@ -3466,6 +3466,6 @@
 		input=inputs->GetInput(enum_type);
 	}
-	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
+	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
 
 	GradientIndexing(&doflist1[0],control_index);
@@ -3484,6 +3484,6 @@
 		input=inputs->GetInput(enum_type);
 	}
-	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
+	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
 
 	((ControlInput*)input)->ScaleGradient(scale);
@@ -3503,6 +3503,6 @@
 		input=inputs->GetInput(enum_type);
 	}
-	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
+	if (!input) _error2_("Input " << EnumToStringx(enum_type) << " not found");
+	if (input->ObjectEnum()!=ControlInputEnum) _error2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
 
 	GradientIndexing(&doflist1[0],control_index);
@@ -3538,5 +3538,5 @@
 			break;
 		default:
-			_error_("%s%i","control type not supported yet: ",control_type);
+			_error2_("" << "control type not supported yet: " << control_type);
 	}
 
@@ -3566,5 +3566,5 @@
 			break;
 		default:
-			_error_("response %s not supported yet",EnumToStringx(responses[resp]));
+			_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
 	}
 
@@ -4422,5 +4422,5 @@
 				break;
 			default:
-				_error_("response %s not supported yet",EnumToStringx(responses[resp]));
+				_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
 		}
 	}
@@ -4600,5 +4600,5 @@
 					break;
 				default:
-					_error_("response %s not supported yet",EnumToStringx(responses[resp]));
+					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
 			}
 		}
@@ -4777,5 +4777,5 @@
 					break;
 				default:
-					_error_("response %s not supported yet",EnumToStringx(responses[resp]));
+					_error2_("response " << EnumToStringx(responses[resp]) << " not supported yet");
 			}
 		}
@@ -4846,5 +4846,5 @@
 			break;
 		default:
-			_error_("Element type %s not supported yet",EnumToStringx(GetElementType()));
+			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
 	}
 
@@ -4947,6 +4947,6 @@
 
 		/*Check solution*/
-		if(isnan(lambdax[i])) _error_("NaN found in solution vector");
-		if(isnan(lambday[i])) _error_("NaN found in solution vector");
+		if(isnan(lambdax[i])) _error2_("NaN found in solution vector");
+		if(isnan(lambday[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -4978,5 +4978,5 @@
 	for(i=0;i<numdof;i++){
 		lambda[i]=values[i];
-		if(isnan(lambda[i])) _error_("NaN found in solution vector");
+		if(isnan(lambda[i])) _error2_("NaN found in solution vector");
 	}
 
@@ -5010,5 +5010,5 @@
 	/*Check that it is a ControlInput*/
 	if (input->ObjectEnum()!=ControlInputEnum){
-		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
 	}
 
@@ -5044,5 +5044,5 @@
 
 	if (input->ObjectEnum()!=ControlInputEnum){
-		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+		_error2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
 	}
 
@@ -5314,5 +5314,5 @@
 	for(i=0;i<numdof;i++){
 		values[i]=solution[doflist[i]];
-		if(isnan(values[i])) _error_("NaN found in solution vector");
+		if(isnan(values[i])) _error2_("NaN found in solution vector");
 		if (values[i]<pow((IssmDouble)10,(IssmDouble)-10))values[i]=pow((IssmDouble)10,(IssmDouble)-10); //correcting the water column to positive values
  
@@ -5426,5 +5426,5 @@
 
 		default:
-			_error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 
@@ -5433,10 +5433,10 @@
 /*FUNCTION Tria::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
 void  Tria::InputUpdateFromVectorDakota(int* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
 /*FUNCTION Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
 void  Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type){
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 }
 /*}}}*/
@@ -5480,5 +5480,5 @@
 
 		default:
-			_error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+			_error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 
@@ -5497,5 +5497,5 @@
 			return CreateKMatrixBalancethickness_DG();
 		default:
-			_error_("Element type %s not supported yet",EnumToStringx(GetElementType()));
+			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
 	}
 
@@ -5676,5 +5676,5 @@
 			return CreatePVectorBalancethickness_DG();
 		default:
-			_error_("Element type %s not supported yet",EnumToStringx(GetElementType()));
+			_error2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");
 	}
 }
Index: /issm/trunk-jpl/src/c/objects/Elements/TriaRef.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/TriaRef.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Elements/TriaRef.cpp	(revision 12493)
@@ -338,5 +338,5 @@
 
 	*Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.));
-	if(*Jdet<0) _error_("negative jacobian determinant!");
+	if(*Jdet<0) _error2_("negative jacobian determinant!");
 
 }
@@ -353,5 +353,5 @@
 	/*Get Determinant*/
 	Matrix2x2Determinant(Jdet,&J[0][0]);
-	if(*Jdet<0) _error_("negative jacobian determinant!");
+	if(*Jdet<0) _error2_("negative jacobian determinant!");
 
 }
@@ -375,5 +375,5 @@
 
 	*Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5);
-	if(*Jdet<0) _error_("negative jacobian determinant!");
+	if(*Jdet<0) _error2_("negative jacobian determinant!");
 
 }
Index: /issm/trunk-jpl/src/c/objects/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/FemModel.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/FemModel.cpp	(revision 12493)
@@ -129,5 +129,5 @@
 	}
 	if(found!=-1) analysis_counter=found;
-	else _error_("Could not find alias for analysis_type %s in list of FemModel analyses",EnumToStringx(configuration_type));
+	else _error2_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");
 
 	/*Now, plug analysis_counter and analysis_type inside the parameters: */
Index: /issm/trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Gauss/GaussPenta.cpp	(revision 12493)
@@ -121,5 +121,5 @@
 	}
 	else{
-		_error_("Penta not supported yet");
+		_error2_("Penta not supported yet");
 	}
 
@@ -161,5 +161,5 @@
 	}
 	else{
-		_error_("Tria not supported yet");
+		_error2_("Tria not supported yet");
 	}
 
@@ -223,5 +223,5 @@
 	}
 	else{
-		_error_("Tria not supported yet (user provided indices %i %i %i %i)",index1,index2,index3,index4);
+		_error2_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");
 	}
 
@@ -342,5 +342,5 @@
 			break;
 		default:
-			_error_("vertex index should be in [0 5]");
+			_error2_("vertex index should be in [0 5]");
 
 	}
@@ -361,5 +361,5 @@
 	}
 	else{
-		_error_("Tria not supported yet");
+		_error2_("Tria not supported yet");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Gauss/GaussTria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Gauss/GaussTria.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Gauss/GaussTria.cpp	(revision 12493)
@@ -82,5 +82,5 @@
 	}
 	else
-	 _error_("The 2 indices provided are not supported yet (user provided %i and %i)",index1,index2);
+	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
 
 	/*Initialize static fields as undefined*/
@@ -180,5 +180,5 @@
 	}
 	else
-	 _error_("The 2 indices provided are not supported yet (user provided %i and %i)",index1,index2);
+	 _error2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");
 
 }
@@ -243,5 +243,5 @@
 			break;
 		default:
-			_error_("vertex index should be in [0 2]");
+			_error2_("vertex index should be in [0 2]");
 
 	}
Index: /issm/trunk-jpl/src/c/objects/Hook.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Hook.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Hook.cpp	(revision 12493)
@@ -185,5 +185,5 @@
 			this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on.
 			/*check the id is correct!: */
-			if (this->objects[i]->Id()!=this->ids[i]) _error_("%s%i%s%i%s"," wrong id: ",this->objects[i]->Id()," vs ",this->ids[i],"  in resolved pointer!");
+			if (this->objects[i]->Id()!=this->ids[i]) _error2_("" << " wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << "  in resolved pointer!");
 		}
 	}
@@ -194,8 +194,8 @@
 	
 	/*first, check that we only have one T object in our object list: */
-	if (this->num!=1) _error_("%s%i%s\n"," trying to delivery a single hook object when hook holds ",this->num," objects");
+	if (this->num!=1) _error2_("" << " trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
 
 	/*check NULL: */
-	if (this->objects==NULL) _error_("hook is not pointing to any object, objects pointer is NULL");
+	if (this->objects==NULL) _error2_("hook is not pointing to any object, objects pointer is NULL");
 
 	return *objects;
@@ -246,9 +246,9 @@
 
 	/*Else, check that we are requesting a half of num*/
-	if (numindices>this->num) _error_("Cannot spawn hook with %i objects from a Hook of %i objects",numindices,this->num);
+	if (numindices>this->num) _error2_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");
 
 	/*go pickup the correct objects, ids and offsets :*/
 	output->num=numindices;
-	if(output->num<1) _error_("Trying to spawn an empty ElementProperties!");
+	if(output->num<1) _error2_("Trying to spawn an empty ElementProperties!");
 
 	output->objects=xNew<Object*>(output->num);
Index: /issm/trunk-jpl/src/c/objects/Inputs/BoolInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/BoolInput.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/BoolInput.cpp	(revision 12493)
@@ -112,20 +112,20 @@
 /*}}}*/
 /*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/
-void BoolInput::GetInputValue(int* pvalue){_error_(" not supported yet!");}
+void BoolInput::GetInputValue(int* pvalue){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION BoolInput::GetInputValue(IssmPDouble* pvalue){{{*/
-void BoolInput::GetInputValue(IssmPDouble* pvalue){_error_(" not supported yet!");}
+void BoolInput::GetInputValue(IssmPDouble* pvalue){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION BoolInput::GetInputValue(IssmPDouble* pvalue,GaussTria* gauss){{{*/
-void BoolInput::GetInputValue(IssmPDouble* pvalue,GaussTria* gauss){_error_(" not supported yet!");}
+void BoolInput::GetInputValue(IssmPDouble* pvalue,GaussTria* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION BoolInput::GetInputValue(IssmPDouble* pvalue,GaussPenta* gauss){{{*/
-void BoolInput::GetInputValue(IssmPDouble* pvalue,GaussPenta* gauss){_error_(" not supported yet!");}
+void BoolInput::GetInputValue(IssmPDouble* pvalue,GaussPenta* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION BoolInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){{{*/
-void BoolInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){_error_(" not supported yet!");}
+void BoolInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION BoolInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){{{*/
-void BoolInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){_error_(" not supported yet!");}
+void BoolInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION BoolInput::ChangeEnum{{{*/
@@ -161,5 +161,5 @@
 
 		default:
-			_error_("not implemented yet");
+			_error2_("not implemented yet");
 	}
 
@@ -184,5 +184,5 @@
 void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
 
-	_error_(" not supporte yet!");
+	_error2_(" not supporte yet!");
 
 }
@@ -191,5 +191,5 @@
 void BoolInput::GetValuesPtr(IssmPDouble** pvalues,int* pnum_values){
 
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 
 }
Index: /issm/trunk-jpl/src/c/objects/Inputs/ControlInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/ControlInput.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/ControlInput.cpp	(revision 12493)
@@ -48,5 +48,5 @@
 			break;
 		default:
-			_error_("Input of Enum %s not supported yet by ControlInput",EnumToStringx(enum_input));
+			_error2_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");
 	}
 	gradient   =NULL;
@@ -152,5 +152,5 @@
 /*FUNCTION ControlInput::ScaleGradient{{{*/
 void ControlInput::ScaleGradient(IssmPDouble scaling_factor){
-	if(!gradient) _error_("Gradient of ControlInput %s not found",EnumToStringx(enum_type));
+	if(!gradient) _error2_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
 	gradient->Scale(scaling_factor);
 }/*}}}*/
@@ -170,5 +170,5 @@
 			break;
 		default:
-			_error_("more than 3 controls not implemented yet (Gradient %i was requested). EnumDefinitions.h needs to be updated.",this->control_id);
+			_error2_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");
 	}
 
@@ -221,5 +221,5 @@
 	 }
 	 else{
-		 _error_("Data %s not supported yet",data);
+		 _error2_("Data " << data << " not supported yet");
 	 }
 }/*}}}*/
@@ -258,5 +258,5 @@
 /*FUNCTION ControlInput::SaveValue{{{*/
 void ControlInput::SaveValue(void){
-	if(!values) _error_("Values of %s not found",EnumToStringx(this->enum_type));
+	if(!values) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
 
 	if(savedvalues) delete this->savedvalues;
@@ -265,6 +265,6 @@
 /*FUNCTION ControlInput::UpdateValue{{{*/
 void ControlInput::UpdateValue(IssmPDouble scalar){
-	if(!gradient)    _error_("Gradient of %s not found",EnumToStringx(this->enum_type));
-	if(!savedvalues) _error_("Values of %s not found",EnumToStringx(this->enum_type));
+	if(!gradient)    _error2_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
+	if(!savedvalues) _error2_("Values of " << EnumToStringx(this->enum_type) << " not found");
 
 	if(values) delete this->values;
Index: /issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.cpp	(revision 12493)
@@ -115,5 +115,5 @@
 
 	/*Get requested input within dataset*/
-	if(index<0 || index > inputs->Size()-1) _error_("index requested (%i) exceeds dataset size (%i)",index,inputs->Size());
+	if(index<0 || index > inputs->Size()-1) _error2_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
 	Input* input=(Input*)this->inputs->GetObjectByOffset(index);
 	
Index: /issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp	(revision 12493)
@@ -108,5 +108,5 @@
 /*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/
 void DoubleInput::GetInputValue(bool* pvalue){
-	_error_("Double input of enum %s cannot return a boolean",EnumToStringx(enum_type));
+	_error2_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
 
 }
@@ -114,5 +114,5 @@
 /*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/
 void DoubleInput::GetInputValue(int* pvalue){
-	_error_("Double input of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));
+	_error2_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
 
 }
@@ -132,8 +132,8 @@
 /*}}}*/
 /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){{{*/
-void DoubleInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){_error_(" not supported yet!");}
+void DoubleInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){{{*/
-void DoubleInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){_error_(" not supported yet!");}
+void DoubleInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION DoubleInput::GetVxStrainRate2d(IssmPDouble* epsilonvx,IssmPDouble* xyz_list, GaussTria* gauss){{{*/
@@ -217,5 +217,5 @@
 
 		default:
-			_error_("not implemented yet");
+			_error2_("not implemented yet");
 	}
 
@@ -253,5 +253,5 @@
 void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
 
-	_error_(" not supporte yet!");
+	_error2_(" not supporte yet!");
 
 }
@@ -260,5 +260,5 @@
 void DoubleInput::GetValuesPtr(IssmPDouble** pvalues,int* pnum_values){
 
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 
 }
@@ -276,5 +276,5 @@
 
 	/*Check that input provided is a thickness*/
-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is %s)",EnumToStringx(thickness_input->InstanceEnum()));
+	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
 
 	/*vertically integrate depending on type:*/
@@ -287,5 +287,5 @@
 
 		default:
-			_error_("not implemented yet");
+			_error2_("not implemented yet");
 	}
 }
Index: /issm/trunk-jpl/src/c/objects/Inputs/IntInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/IntInput.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/IntInput.cpp	(revision 12493)
@@ -99,5 +99,5 @@
 ElementResult* IntInput::SpawnResult(int step, IssmPDouble time){
 	
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 
 }
@@ -106,5 +106,5 @@
 /*Object functions*/
 /*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/
-void IntInput::GetInputValue(bool* pvalue){_error_(" not supported yet!");}
+void IntInput::GetInputValue(bool* pvalue){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/
@@ -115,18 +115,18 @@
 /*FUNCTION IntInput::GetInputValue(IssmPDouble* pvalue){{{*/
 void IntInput::GetInputValue(IssmPDouble* pvalue){
-	_error_("IntInput cannot return a IssmPDouble in parallel");
+	_error2_("IntInput cannot return a IssmPDouble in parallel");
 }
 /*}}}*/
 /*FUNCTION IntInput::GetInputValue(IssmPDouble* pvalue,GaussTria* gauss){{{*/
-void IntInput::GetInputValue(IssmPDouble* pvalue,GaussTria* gauss){_error_(" not supported yet!");}
+void IntInput::GetInputValue(IssmPDouble* pvalue,GaussTria* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION IntInput::GetInputValue(IssmPDouble* pvalue,GaussPenta* gauss){{{*/
-void IntInput::GetInputValue(IssmPDouble* pvalue,GaussPenta* gauss){_error_(" not supported yet!");}
+void IntInput::GetInputValue(IssmPDouble* pvalue,GaussPenta* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION IntInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){{{*/
-void IntInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){_error_(" not supported yet!");}
+void IntInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussTria* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION IntInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){{{*/
-void IntInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){_error_(" not supported yet!");}
+void IntInput::GetInputDerivativeValue(IssmPDouble* derivativevalues, IssmPDouble* xyz_list, GaussPenta* gauss){_error2_(" not supported yet!");}
 /*}}}*/
 /*FUNCTION IntInput::ChangeEnum{{{*/
@@ -166,5 +166,5 @@
 
 		default:
-			_error_("not implemented yet");
+			_error2_("not implemented yet");
 	}
 
@@ -182,5 +182,5 @@
 void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){
 
-	_error_(" not supporte yet!");
+	_error2_(" not supporte yet!");
 
 }
@@ -189,5 +189,5 @@
 void IntInput::GetValuesPtr(IssmPDouble** pvalues,int* pnum_values){
 
-	_error_(" not supported yet!");
+	_error2_(" not supported yet!");
 
 }
Index: /issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp	(revision 12493)
@@ -455,10 +455,10 @@
 		case ControlInputEnum:{
 			ControlInput* cont_input=(ControlInput*)xinput;
-			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error_("not supported yet");
+			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error2_("not supported yet");
 			PentaP1Input* cast_input=(PentaP1Input*)cont_input->values;
 			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
 			return;
 		default:
-			_error_("not implemented yet");
+			_error2_("not implemented yet");
 	}
 
@@ -495,5 +495,5 @@
 
 	/*Check that input provided is a thickness*/
-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is %s)",EnumToStringx(thickness_input->InstanceEnum()));
+	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
 
 	/*Get Thickness value pointer*/
@@ -511,5 +511,5 @@
 
 		default:
-			_error_("not implemented yet");
+			_error2_("not implemented yet");
 	}
 }
@@ -529,5 +529,5 @@
 
 	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
 	xinputB=(PentaP1Input*)inputB;
 
@@ -560,5 +560,5 @@
 
 	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
 	xinputB=(PentaP1Input*)inputB;
 
@@ -591,5 +591,5 @@
 
 	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
 	xinputB=(PentaP1Input*)inputB;
 
Index: /issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp	(revision 12493)
@@ -446,5 +446,5 @@
 		}
 	}
-	if(!found)_error_("did not find time interval on which to interpolate forcing values!");
+	if(!found)_error2_("did not find time interval on which to interpolate forcing values!");
 
 	/*Assign output pointer*/
Index: /issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp	(revision 12493)
@@ -323,5 +323,5 @@
 
 		default :
-			_error_("not implemented yet");
+			_error2_("not implemented yet");
 	}
 
@@ -368,5 +368,5 @@
 
 	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
 	xinputB=(TriaP1Input*)inputB;
 
@@ -399,5 +399,5 @@
 
 	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
 	xinputB=(TriaP1Input*)inputB;
 
Index: /issm/trunk-jpl/src/c/objects/IoModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/IoModel.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/IoModel.cpp	(revision 12493)
@@ -110,5 +110,5 @@
 		/*Get first Enum*/
 		if(fread(&record_enum,sizeof(int),1,this->fid)==0){
-			_error_("Marshalled file is empty");
+			_error2_("Marshalled file is empty");
 		}
 		else{
@@ -128,5 +128,5 @@
 				printf("=========================================================================\n");
 				printf("\n");
-				_error_("Enums not consistent (See error message above)");
+				_error2_("Enums not consistent (See error message above)");
 			}
 		}
@@ -177,5 +177,5 @@
 	/*Find constant*/
 	Param* param=(Param*)this->constants->FindParamObject(constant_enum);
-	if(!param) _error_("Constant %s not found in iomodel",EnumToStringx(constant_enum));
+	if(!param) _error2_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel");
 
 	return (Param*)param->copy();
@@ -266,5 +266,5 @@
 					case 1: 
 						/*Read the boolean and broadcast it to other cpus:*/
-						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_(" could not read boolean ");
+						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error2_(" could not read boolean ");
 						#ifdef _HAVE_MPI_
 						MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
@@ -277,5 +277,5 @@
 					case 2:
 						/*Read the integer and broadcast it to other cpus:*/
-						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_(" could not read integer ");
+						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error2_(" could not read integer ");
 						#ifdef _HAVE_MPI_
 						MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
@@ -288,5 +288,5 @@
 					case 3:
 						/*Read the scalar and broadcast it to other cpus:*/
-						if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_(" could not read scalar ");
+						if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error2_(" could not read scalar ");
 						#ifdef _HAVE_MPI_
 						MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
@@ -299,5 +299,5 @@
 					case 4: 
 						/*We have to read a string from disk. First read the dimensions of the string, then the string: */
-						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_(" could not read length of string ");
+						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error2_(" could not read length of string ");
 						#ifdef _HAVE_MPI_
 						MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
@@ -309,5 +309,5 @@
 
 							/*Read string, then broadcast: */
-							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_("  could not read string ");
+							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error2_("  could not read string ");
 							#ifdef _HAVE_MPI_
 							MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
@@ -360,5 +360,5 @@
 
 					default: 
-						_error_("%s%i","unknown record type:",record_code); 
+						_error2_("" << "unknown record type:" << record_code); 
 						break;;
 				}
@@ -428,5 +428,5 @@
 
 				default: 
-					_error_("%s%i","unknown record type:",record_code); 
+					_error2_("" << "unknown record type:" << record_code); 
 					break;;
 				}
@@ -453,9 +453,9 @@
 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
 
-	if(code!=1)_error_("expecting a boolean for enum %s",EnumToStringx(data_enum));
+	if(code!=1)_error2_("expecting a boolean for enum " << EnumToStringx(data_enum));
 	
 	/*We have to read a boolean from disk. */
 	if(my_rank==0){  
-		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_(" could not read boolean ");
+		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error2_(" could not read boolean ");
 	}
 	#ifdef _HAVE_MPI_
@@ -483,9 +483,9 @@
 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
 	
-	if(code!=2)_error_("expecting an integer for enum %s",EnumToStringx(data_enum));
+	if(code!=2)_error2_("expecting an integer for enum " << EnumToStringx(data_enum));
 	
 	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
 	if(my_rank==0){  
-		if(fread(&integer,sizeof(int),1,fid)!=1) _error_(" could not read integer ");
+		if(fread(&integer,sizeof(int),1,fid)!=1) _error2_(" could not read integer ");
 	}
 
@@ -514,9 +514,9 @@
 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
 	
-	if(code!=3)_error_("expecting a IssmPDouble for enum %s",EnumToStringx(data_enum));
+	if(code!=3)_error2_("expecting a IssmPDouble for enum " << EnumToStringx(data_enum));
 	
 	/*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
 	if(my_rank==0){
-		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error_(" could not read scalar ");
+		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error2_(" could not read scalar ");
 	}
 	#ifdef _HAVE_MPI_
@@ -544,5 +544,5 @@
 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
 	
-	if(code!=4)_error_("expecting a string for enum %s",EnumToStringx(data_enum));
+	if(code!=4)_error2_("expecting a string for enum " << EnumToStringx(data_enum));
 	
 	/*Now fetch: */
@@ -550,5 +550,5 @@
 	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
 	if(my_rank==0){  
-		if(fread(&string_size,sizeof(int),1,fid)!=1) _error_(" could not read length of string ");
+		if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_(" could not read length of string ");
 	}
 
@@ -564,5 +564,5 @@
 		/*Read string on node 0, then broadcast: */
 		if(my_rank==0){  
-			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_("  could not read string ");
+			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_("  could not read string ");
 		}
 		#ifdef _HAVE_MPI_
@@ -598,5 +598,5 @@
 	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
 
-	if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmPDouble, integer or boolean matrix for enum %s",EnumToStringx(data_enum));
+	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmPDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
 	
 	/*Now fetch: */
@@ -605,5 +605,5 @@
 	/*numberofelements: */
 	if(my_rank==0){  
-		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
+		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
 	}
 
@@ -613,5 +613,5 @@
 
 	if(my_rank==0){  
-		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
+		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
 	}
 	#ifdef _HAVE_MPI_
@@ -625,5 +625,5 @@
 		/*Read matrix on node 0, then broadcast: */
 		if(my_rank==0){  
-			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
+			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
 		}
 		
@@ -669,5 +669,5 @@
 	/*Set file pointer to beginning of the data: */
 	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
-	if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmPDouble, integer or boolean matrix for enum %s",EnumToStringx(data_enum));
+	if((code!=5) && (code!=6) && (code!=7))_error2_("expecting a IssmPDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
 	
 	/*Now fetch: */
@@ -676,5 +676,5 @@
 	/*numberofelements: */
 	if(my_rank==0){  
-		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
+		if(fread(&M,sizeof(int),1,fid)!=1) _error2_("could not read number of rows for matrix ");
 	}
 	#ifdef _HAVE_MPI_
@@ -683,5 +683,5 @@
 
 	if(my_rank==0){  
-		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
+		if(fread(&N,sizeof(int),1,fid)!=1) _error2_("could not read number of columns for matrix ");
 	}
 	#ifdef _HAVE_MPI_
@@ -695,5 +695,5 @@
 		/*Read matrix on node 0, then broadcast: */
 		if(my_rank==0){  
-			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
+			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
 		}
 		#ifdef _HAVE_MPI_
@@ -728,9 +728,9 @@
 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
 	
-	if(code!=9)_error_("expecting a string array for enum %s",EnumToStringx(data_enum));
+	if(code!=9)_error2_("expecting a string array for enum " << EnumToStringx(data_enum));
 	
 	/*We have to read a bunch of strings from disk. First read the number of strings, and allocate: */
 	if(my_rank==0){  
-		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_(" could not read length of string array");
+		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error2_(" could not read length of string array");
 	}
 	#ifdef _HAVE_MPI_
@@ -747,5 +747,5 @@
 			
 			if(my_rank==0){  
-				if(fread(&string_size,sizeof(int),1,fid)!=1) _error_(" could not read length of string ");
+				if(fread(&string_size,sizeof(int),1,fid)!=1) _error2_(" could not read length of string ");
 			}
 			#ifdef _HAVE_MPI_
@@ -758,5 +758,5 @@
 				/*Read string on node 0, then broadcast: */
 				if(my_rank==0){  
-					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_("  could not read string ");
+					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error2_("  could not read string ");
 				}
 				#ifdef _HAVE_MPI_
@@ -799,9 +799,9 @@
 	/*Set file pointer to beginning of the data: */
 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
-	if(code!=8)_error_("expecting a IssmPDouble mat array for enum %s",EnumToStringx(data_enum));
+	if(code!=8)_error2_("expecting a IssmPDouble mat array for enum " << EnumToStringx(data_enum));
 	
 	/*Now fetch: */
 	if(my_rank==0){  
-		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error_("could not read number of records in matrix array ");
+		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error2_("could not read number of records in matrix array ");
 	}
 	#ifdef _HAVE_MPI_
@@ -826,5 +826,5 @@
 
 			if(my_rank==0){  
-				if(fread(&M,sizeof(int),1,fid)!=1) _error_("%s%i%s","could not read number of rows in ",i,"th matrix of matrix array");
+				if(fread(&M,sizeof(int),1,fid)!=1) _error2_("" << "could not read number of rows in " << i << "th matrix of matrix array");
 			}
 			#ifdef _HAVE_MPI_
@@ -833,5 +833,5 @@
 
 			if(my_rank==0){  
-				if(fread(&N,sizeof(int),1,fid)!=1) _error_("%s%i%s","could not read number of columns in ",i,"th matrix of matrix array");
+				if(fread(&N,sizeof(int),1,fid)!=1) _error2_("" << "could not read number of columns in " << i << "th matrix of matrix array");
 			}
 			#ifdef _HAVE_MPI_
@@ -845,5 +845,5 @@
 				/*Read matrix on node 0, then broadcast: */
 				if(my_rank==0){  
-					if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
+					if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error2_("could not read matrix ");
 				}
 
@@ -908,5 +908,5 @@
 			  }
 		default:
-			  _error_("Option of format %i not supported yet",code);
+			  _error2_("Option of format " << code << " not supported yet");
 	}
 
@@ -937,5 +937,5 @@
 		_assert_(dataenum<MaximumNumberOfEnums);
 		if(this->data[dataenum]){
-			_error_("Info: trying to fetch %s but previous pointer has not been freed (DeleteData has not been called)",EnumToStringx(dataenum));
+			_error2_("Info: trying to fetch " << EnumToStringx(dataenum) << " but previous pointer has not been freed (DeleteData has not been called)");
 		}
 		#endif
@@ -1137,5 +1137,5 @@
 			break; /*}}}*/
 		default: /*{{{*/
-			_error_("%s%i%s","data code ",code," not supported yet!");
+			_error2_("" << "data code " << code << " not supported yet!");
 			break;
 			/*}}}*/
@@ -1228,5 +1228,5 @@
 #ifdef _HAVE_MPI_
 	MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 
-	if(!found)_error_("%s %s ","could not find data with name",EnumToStringx(data_enum));
+	if(!found)_error2_("" << "could not find data with name" << " " << EnumToStringx(data_enum) << " ");
 #endif
 
Index: /issm/trunk-jpl/src/c/objects/KML/KMLFileReadUtils.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KMLFileReadUtils.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KMLFileReadUtils.cpp	(revision 12493)
@@ -138,5 +138,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenComment(FILE* fid) {{{*/
 char* KMLFileTokenComment(FILE* fid){
@@ -203,5 +202,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenBuffer {{{*/
 void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,
@@ -228,5 +226,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTagName {{{*/
 char* KMLFileTagName(char* pname,
@@ -237,5 +234,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTagName {{{*/
 char* KMLFileTagName(char* pname,int *m,int maxlen,
@@ -248,5 +244,5 @@
 
 	if (strncmp(&ktag[0],"<"        ,1) || strncmp(&ktag[strlen(ktag)-1],">",1))
-		_error_("KMLFileTagName -- Missing tag delimiters in %s.\n",ktag);
+		_error2_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");
 
 /*  strtok modifies ktag, so work on copy  */
@@ -283,5 +279,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTagAttrib {{{*/
 int KMLFileTagAttrib(KML_Object* kobj,
@@ -333,5 +328,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
 int KMLFileTokenParse(int* pival,
@@ -346,5 +340,5 @@
 							NULL,NULL)) ||
 		(kstr[0] == '<'))
-		_error_("KMLFileTokenParse -- Missing integer field for %s.\n",ktag);
+		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
 
 	sscanf(kstr,"%d",pival);
@@ -359,5 +353,5 @@
 			(kstr[1] != '/') ||
 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
-			_error_("KMLFileTokenParse -- Missing closing tag for %s.\n",ktag);
+		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
 		else
 			xfree((void**)&kstr);
@@ -368,9 +362,6 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
-int KMLFileTokenParse(bool* pbval,
-					  char* ktag,
-					  FILE* fid){
+int KMLFileTokenParse(bool* pbval, char* ktag, FILE* fid){
 
 	int     ival;
@@ -382,5 +373,5 @@
 							NULL,NULL)) ||
 		(kstr[0] == '<'))
-		_error_("KMLFileTokenParse -- Missing bool field for %s.\n",ktag);
+	  {_error2_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}
 
 	sscanf(kstr,"%d",&ival);
@@ -396,5 +387,5 @@
 			(kstr[1] != '/') ||
 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
-			_error_("KMLFileTokenParse -- Missing closing tag for %s.\n",ktag);
+		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
 		else
 			xfree((void**)&kstr);
@@ -405,5 +396,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
 char* KMLFileTokenParse(char* pstr,
@@ -416,5 +406,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
 char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
@@ -429,5 +418,5 @@
 							NULL,NULL)) ||
 		(kstr[0] == '<'))
-		_error_("KMLFileTokenParse -- Missing string field for %s.\n",ktag);
+		_error2_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");
 
 	if (!pstr) {
@@ -459,5 +448,5 @@
 			(kstr[1] != '/') ||
 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
-			_error_("KMLFileTokenParse -- Missing closing tag for %s.\n",ktag);
+		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
 		else
 			xfree((void**)&kstr);
@@ -468,5 +457,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
 int KMLFileTokenParse(float* pfval,
@@ -481,5 +469,5 @@
 							NULL,NULL)) ||
 		(kstr[0] == '<'))
-		_error_("KMLFileTokenParse -- Missing integer field for %s.\n",ktag);
+	  {_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}
 
 	sscanf(kstr,"%g",pfval);
@@ -494,5 +482,5 @@
 			(kstr[1] != '/') ||
 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
-			_error_("KMLFileTokenParse -- Missing closing tag for %s.\n",ktag);
+		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
 		else
 			xfree((void**)&kstr);
@@ -503,5 +491,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
 int KMLFileTokenParse(double* pdval,
@@ -516,5 +503,5 @@
 							NULL,NULL)) ||
 		(kstr[0] == '<'))
-		_error_("KMLFileTokenParse -- Missing integer field for %s.\n",ktag);
+		_error2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");
 
 	sscanf(kstr,"%lg",pdval);
@@ -529,5 +516,5 @@
 			(kstr[1] != '/') ||
 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
-			_error_("KMLFileTokenParse -- Missing closing tag for %s.\n",ktag);
+		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
 		else
 			xfree((void**)&kstr);
@@ -538,5 +525,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
 int KMLFileTokenParse(double **pdval,int* m,int maxlen,
@@ -554,5 +540,5 @@
 							NULL,NULL)) ||
 		(kstr[0] == '<'))
-		_error_("KMLFileTokenParse -- Missing double [m] field for %s.\n",ktag);
+		_error2_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
 
 	if (!*pdval)
@@ -568,5 +554,5 @@
 		i++;
 		if (maxlen && (maxlen < i+1))
-			_error_("KMLFileTokenParse -- Double [m] field too short for %s.\n",ktag);
+			_error2_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");
 		sscanf(ktok,"%lg",&((*pdval)[i]));
 		ktok=strtok(NULL,delim);
@@ -588,5 +574,5 @@
 			(kstr[1] != '/') ||
 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
-			_error_("KMLFileTokenParse -- Missing closing tag for %s.\n",ktag);
+		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
 		else
 			xfree((void**)&kstr);
@@ -599,5 +585,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTokenParse {{{*/
 int KMLFileTokenParse(double (**pdval3)[3],int* m,int maxlen,
@@ -615,5 +600,5 @@
 							NULL,NULL)) ||
 		(kstr[0] == '<'))
-		_error_("KMLFileTokenParse -- Missing double [m x 3] field for %s.\n",ktag);
+		_error2_("KMLFileTokenParse -- Missing double [m x 3] field for " << ktag << ".\n");
 
 	if (!*pdval3)
@@ -632,5 +617,5 @@
 			j=0;
 			if (maxlen && (maxlen < i+1))
-				_error_("KMLFileTokenParse -- Double [m x 3] field too short for %s.\n",ktag);
+				_error2_("KMLFileTokenParse -- Double [m x 3] field too short for " << ktag << ".\n");
 		}
 		sscanf(ktok,"%lg",&((*pdval3)[i][j]));
@@ -656,5 +641,5 @@
 			(kstr[1] != '/') ||
 			(strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
-			_error_("KMLFileTokenParse -- Missing closing tag for %s.\n",ktag);
+		  {_error2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
 		else
 			xfree((void**)&kstr);
@@ -667,5 +652,4 @@
 }
 /*}}}*/
-
 /*FUNCTION  KMLFileTagSkip {{{*/
 int KMLFileTagSkip(char* ktag,
@@ -704,5 +688,5 @@
 		else if ((kstr[0] == '<') &&
 				 (kstr[1] == '/')) {
-			_error_("KMLFileTagSkip -- Unexpected closing tag %s.\n",kstr);
+			_error2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");
 		}
 
@@ -710,8 +694,7 @@
 	}
 
-	_error_("KMLFileTokenParse -- Corresponding closing tag for %s not found.\n",ktag);
+	_error2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");
 
 	return(0);
 }
 /*}}}*/
-
Index: /issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp	(revision 12493)
@@ -95,16 +95,12 @@
 		return;
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_ColorStyle::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_ColorStyle::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}
 
 	else if (!strcmp(kstr,"<color>"))
-		KMLFileTokenParse( color     ,NULL,KML_COLORSTYLE_COLOR_LENGTH,
-						  kstr,
-						  fid);
+		KMLFileTokenParse( color     ,NULL,KML_COLORSTYLE_COLOR_LENGTH, kstr, fid);
 	else if (!strcmp(kstr,"<colorMode>"))
-		KMLFileTokenParse( colormode ,NULL,KML_COLORSTYLE_COLORMODE_LENGTH,
-						  kstr,
-						  fid);
+		KMLFileTokenParse( colormode ,NULL,KML_COLORSTYLE_COLORMODE_LENGTH, kstr, fid);
 
 	else if (!strncmp(kstr,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Container.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Container.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Container.cpp	(revision 12493)
@@ -120,7 +120,7 @@
 	}
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_Container::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_Container::Read -- Unexpected closing tag " << kstr );}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_Container::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_Container::Read -- Unexpected field \"" << kstr << "\"");}
 
 	else if (!strncmp(kstr,"<Placemark",10)) {
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Document.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Document.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Document.cpp	(revision 12493)
@@ -110,7 +110,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Document::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_Document::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strncmp(kstri,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Feature.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Feature.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Feature.cpp	(revision 12493)
@@ -153,7 +153,7 @@
 		return;
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_Feature::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_Feature::Read -- Unexpected closing tag " << kstr);}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_Feature::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}
 
 	else if (!strncmp(kstr,"<Style", 6)) {
@@ -164,27 +164,15 @@
 
 	else if (!strcmp(kstr,"<name>"))
-		KMLFileTokenParse( name      ,NULL,KML_FEATURE_NAME_LENGTH,
-						  kstr,
-						  fid);
+		KMLFileTokenParse( name      ,NULL,KML_FEATURE_NAME_LENGTH, kstr, fid);
 	else if (!strcmp(kstr,"<visibility>"))
-		KMLFileTokenParse(&visibility,
-						  kstr,
-						  fid);
+		KMLFileTokenParse(&visibility, kstr, fid);
 	else if (!strcmp(kstr,"<open>"))
-		KMLFileTokenParse(&open      ,
-						  kstr,
-						  fid);
+		KMLFileTokenParse(&open      , kstr, fid);
 	else if (!strncmp(kstr,"<snippet", 8))
-		KMLFileTokenParse( snippet   ,NULL,KML_FEATURE_SNIPPET_LENGTH,
-						  kstr,
-						  fid);
+		KMLFileTokenParse( snippet   ,NULL,KML_FEATURE_SNIPPET_LENGTH, kstr, fid);
 	else if (!strcmp(kstr,"<description>"))
-		KMLFileTokenParse( descript  ,NULL,KML_FEATURE_DESCRIPT_LENGTH,
-						  kstr,
-						  fid);
+		KMLFileTokenParse( descript  ,NULL,KML_FEATURE_DESCRIPT_LENGTH, kstr, fid);
 	else if (!strcmp(kstr,"<styleUrl>"))
-		KMLFileTokenParse( styleurl  ,NULL,KML_FEATURE_STYLEURL_LENGTH,
-						  kstr,
-						  fid);
+		KMLFileTokenParse( styleurl  ,NULL,KML_FEATURE_STYLEURL_LENGTH, kstr, fid);
 
 	else if (!strncmp(kstr,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_File.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_File.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_File.cpp	(revision 12493)
@@ -107,7 +107,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_File::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_File::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}
 
 		else if (!strncmp(kstri,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Folder.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Folder.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Folder.cpp	(revision 12493)
@@ -110,7 +110,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Folder::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_Folder::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strncmp(kstri,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Geometry.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Geometry.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Geometry.cpp	(revision 12493)
@@ -82,7 +82,7 @@
 		return;
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_Geometry::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_Geometry::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}
 
 	else if (!strncmp(kstr,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 12493)
@@ -142,7 +142,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_GroundOverlay::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_GroundOverlay::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<altitude>"))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Icon.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Icon.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Icon.cpp	(revision 12493)
@@ -149,40 +149,24 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Icon::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_Icon::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<href>"))
-			KMLFileTokenParse( href      ,NULL,KML_ICON_HREF_LENGTH,
-							  kstri,
-							  fid);
+			KMLFileTokenParse( href      ,NULL,KML_ICON_HREF_LENGTH, kstri, fid);
 		else if (!strcmp(kstri,"<refreshMode>"))
-			KMLFileTokenParse( refmode   ,NULL,KML_ICON_REFMODE_LENGTH,
-							  kstri,
-							  fid);
+			KMLFileTokenParse( refmode   ,NULL,KML_ICON_REFMODE_LENGTH, kstri, fid);
 		else if (!strcmp(kstri,"<refreshInterval>"))
-			KMLFileTokenParse(&refint    ,
-							  kstri,
-							  fid);
+			KMLFileTokenParse(&refint    , kstri, fid);
 		else if (!strcmp(kstri,"<viewRefreshMode>"))
-			KMLFileTokenParse( vrefmode  ,NULL,KML_ICON_VREFMODE_LENGTH,
-							  kstri,
-							  fid);
+			KMLFileTokenParse( vrefmode  ,NULL,KML_ICON_VREFMODE_LENGTH, kstri, fid);
 		else if (!strcmp(kstri,"<viewRefreshTime>"))
-			KMLFileTokenParse(&vreftime  ,
-							  kstri,
-							  fid);
+			KMLFileTokenParse(&vreftime  , kstri, fid);
 		else if (!strcmp(kstri,"<viewBoundScale>"))
-			KMLFileTokenParse(&vboundsc  ,
-							  kstri,
-							  fid);
+			KMLFileTokenParse(&vboundsc  , kstri, fid);
 		else if (!strcmp(kstri,"<viewFormat>"))
-			KMLFileTokenParse( vformat   ,NULL,KML_ICON_VFORMAT_LENGTH,
-							  kstri,
-							  fid);
+			KMLFileTokenParse( vformat   ,NULL,KML_ICON_VFORMAT_LENGTH, kstri, fid);
 		else if (!strcmp(kstri,"<httpQuery>"))
-			KMLFileTokenParse( hquery    ,NULL,KML_ICON_HQUERY_LENGTH,
-							  kstri,
-							  fid);
+			KMLFileTokenParse( hquery    ,NULL,KML_ICON_HQUERY_LENGTH, kstri, fid);
 
 		else if (!strncmp(kstri,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 12493)
@@ -132,7 +132,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_LatLonBox::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_LatLonBox::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<north>"))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_LineString.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_LineString.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_LineString.cpp	(revision 12493)
@@ -141,7 +141,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_LineString::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_LineString::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_LineString::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_LineString::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<extrude>"))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp	(revision 12493)
@@ -50,5 +50,4 @@
 }
 /*}}}*/
-
 /*FUNCTION KML_LineStyle::DeepEcho {{{*/
 void  KML_LineStyle::DeepEcho(){
@@ -61,5 +60,4 @@
 }
 /*}}}*/
-
 /*FUNCTION KML_LineStyle::DeepEcho {{{*/
 void  KML_LineStyle::DeepEcho(const char* indent){
@@ -76,5 +74,4 @@
 }
 /*}}}*/
-
 /*FUNCTION KML_LineStyle::Write {{{*/
 void  KML_LineStyle::Write(FILE* filout,const char* indent){
@@ -94,5 +91,4 @@
 }
 /*}}}*/
-
 /*FUNCTION KML_LineStyle::Read {{{*/
 void  KML_LineStyle::Read(FILE* fid,char* kstr){
@@ -117,7 +113,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_LineStyle::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_LineStyle::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<width>"))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp	(revision 12493)
@@ -139,7 +139,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_LinearRing::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_LinearRing::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<extrude>"))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp	(revision 12493)
@@ -144,7 +144,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_MultiGeometry::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_MultiGeometry::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strncmp(kstri,"<Point", 6)) {
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Object.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Object.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Object.cpp	(revision 12493)
@@ -146,7 +146,7 @@
 		return;
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_Object::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_Object::Read -- Unexpected closing tag " << kstr << ".\n");}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_Object::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_Object::Read -- Unexpected field \"" << kstr << "\".\n");}
 
 	else if (!strncmp(kstr,"<Placemark",10)) {
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Overlay.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Overlay.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Overlay.cpp	(revision 12493)
@@ -123,7 +123,7 @@
 	}
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_Overlay::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_Overlay::Read -- Unexpected closing tag " << kstr << ".\n");}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_Overlay::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_Overlay::Read -- Unexpected field \"" << kstr << "\".\n");}
 
 	else if (!strcmp(kstr,"<color>"))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Placemark.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Placemark.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Placemark.cpp	(revision 12493)
@@ -140,7 +140,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Placemark::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_Placemark::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strncmp(kstri,"<Point", 6)) {
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Point.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Point.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Point.cpp	(revision 12493)
@@ -126,20 +126,14 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Point::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_Point::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<extrude>"))
-			KMLFileTokenParse(&extrude   ,
-							  kstri,
-							  fid);
+			KMLFileTokenParse(&extrude   , kstri, fid);
 		else if (!strcmp(kstri,"<altitudeMode>"))
-			KMLFileTokenParse( altmode   ,NULL,KML_POINT_ALTMODE_LENGTH,
-							  kstri,
-							  fid);
+			KMLFileTokenParse( altmode   ,NULL,KML_POINT_ALTMODE_LENGTH, kstri, fid);
 		else if (!strcmp(kstri,"<coordinates>"))
-			KMLFileTokenParse(&pcoords   ,NULL,3,
-							  kstri,
-							  fid);
+			KMLFileTokenParse(&pcoords   ,NULL,3, kstri, fid);
 
 		else if (!strncmp(kstri,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp	(revision 12493)
@@ -121,7 +121,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_PolyStyle::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_PolyStyle::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<fill>"))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Polygon.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Polygon.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Polygon.cpp	(revision 12493)
@@ -179,7 +179,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Polygon::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_Polygon::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 		else if (!strcmp(kstri,"<extrude>"))
@@ -207,7 +207,7 @@
 				}
 				else if (!strncmp(kstrj,"</",2))
-					_error_("KML_Polygon::Read -- Unexpected closing tag %s.\n",kstrj);
+				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
 				else if (strncmp(kstrj,"<",1))
-					_error_("KML_Polygon::Read -- Unexpected field \"%s\".\n",kstrj);
+				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
 
 				else if (!strncmp(kstrj,"<LinearRing",11)) {
@@ -234,7 +234,7 @@
 				}
 				else if (!strncmp(kstrj,"</",2))
-					_error_("KML_Polygon::Read -- Unexpected closing tag %s.\n",kstrj);
+				  {_error2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}
 				else if (strncmp(kstrj,"<",1))
-					_error_("KML_Polygon::Read -- Unexpected field \"%s\".\n",kstrj);
+				  {_error2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}
 
 				else if (!strncmp(kstrj,"<LinearRing",11)) {
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Style.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Style.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Style.cpp	(revision 12493)
@@ -197,7 +197,7 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Style::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}
 		else if (strncmp(kstri,"<",1))
-			_error_("KML_Style::Read -- Unexpected field \"%s\".\n",kstri);
+		  {_error2_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}
 
 //		else if (!strncmp(kstri,"<IconStyle",10)) {
Index: /issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp	(revision 12493)
@@ -82,7 +82,7 @@
 		return;
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_StyleSelector::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_StyleSelector::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}
 
 	else if (!strncmp(kstr,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp	(revision 12493)
@@ -82,7 +82,7 @@
 		return;
 	else if (!strncmp(kstr,"</",2))
-		_error_("KML_SubStyle::Read -- Unexpected closing tag %s.\n",kstr);
+	  {_error2_("KML_SubStyle::Read -- Unexpected closing tag " << kstr << ".\n");}
 	else if (strncmp(kstr,"<",1))
-		_error_("KML_SubStyle::Read -- Unexpected field \"%s\".\n",kstr);
+	  {_error2_("KML_SubStyle::Read -- Unexpected field \"" << kstr << "\".\n");}
 
 	else if (!strncmp(kstr,"<",1))
Index: /issm/trunk-jpl/src/c/objects/KML/KML_Unknown.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_Unknown.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_Unknown.cpp	(revision 12493)
@@ -159,5 +159,5 @@
 		}
 		else if (!strncmp(kstri,"</",2))
-			_error_("KML_Unknown::Read -- Unexpected closing tag %s.\n",kstri);
+		  {_error2_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}
 
 		else if (strncmp(kstri,"<",1)) {
Index: /issm/trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Kriging/ExponentialVariogram.cpp	(revision 12493)
@@ -39,5 +39,5 @@
 
 	/*Checks*/
-	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp	(revision 12493)
@@ -39,5 +39,5 @@
 
 	/*Checks*/
-	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp	(revision 12493)
@@ -39,6 +39,6 @@
 
 	/*Checks*/
-	if(power<=0 || power>=2) _error_("power must be betwwen 0 and 2 (0 < power < 2)");
-	if(slope<=0) _error_("slope must be positive");
+	if(power<=0 || power>=2) _error2_("power must be betwwen 0 and 2 (0 < power < 2)");
+	if(slope<=0) _error2_("slope must be positive");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.cpp	(revision 12493)
@@ -1,3 +1,4 @@
 #include "../objects.h"
+
 /*DOCUMENTATION What is a Quadtree? {{{
  * A Quadtree is a very simple way to group vertices according
@@ -82,5 +83,5 @@
 /*FUNCTION Quadtree::Quadtree(){{{*/
 Quadtree::Quadtree(){
-	_error_("Constructor not supported");
+	_error2_("Constructor not supported");
 
 }
@@ -247,5 +248,5 @@
 	}
 	else{
-		_error_("Box is not full");
+		_error2_("Box is not full");
 	}
 }/*}}}*/
@@ -396,5 +397,5 @@
 			break;
 		default:
-			_error_("Case %i not supported",index);
+			_error2_("Case " << index << " not supported");
 	}
 	newbox->length=master->length/2;
@@ -573,5 +574,5 @@
 			break;
 		default:
-			_error_("Case %i not supported",this->IsWithinRange(x,y,range));
+			_error2_("Case " << this->IsWithinRange(x,y,range) << " not supported");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Kriging/SphericalVariogram.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/SphericalVariogram.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Kriging/SphericalVariogram.cpp	(revision 12493)
@@ -39,5 +39,5 @@
 
 	/*Checks*/
-	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+	if(nugget==sill) _error2_("nugget and sill cannot be equal (constant semivariogram not allowed)");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Loads/Icefront.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Loads/Icefront.cpp	(revision 12493)
@@ -81,5 +81,5 @@
 		icefront_node_ids[3]=iomodel->nodecounter+(int)*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3);
 	}
-	else _error_("in_icefront_type %s not supported yet!",EnumToStringx(in_icefront_type));
+	else _error2_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");
 
 	if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum)
@@ -263,5 +263,5 @@
 		#endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -379,5 +379,5 @@
 	    #endif
 		default:
-			_error_("Icefront type %s not supported yet",EnumToStringx(type));
+			_error2_("Icefront type " << EnumToStringx(type) << " not supported yet");
 	}
 }
@@ -441,5 +441,5 @@
 				break;
 			default:
-				_error_("fill type %s not supported yet",EnumToStringx(fill));
+				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
 		}
 		ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
@@ -564,5 +564,5 @@
 				break;
 			default:
-				_error_("fill type %s not supported yet",EnumToStringx(fill));
+				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
 		}
 		ice_pressure=rho_ice*gravity*(surface-z_g);
@@ -638,5 +638,5 @@
 				break;
 			default:
-				_error_("fill type %s not supported yet",EnumToStringx(fill));
+				_error2_("fill type " << EnumToStringx(fill) << " not supported yet");
 		}
 		air_pressure=0;
Index: /issm/trunk-jpl/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Loads/Numericalflux.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Loads/Numericalflux.cpp	(revision 12493)
@@ -270,5 +270,5 @@
 			break;
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -300,5 +300,5 @@
 			break;
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -347,5 +347,5 @@
 			return CreateKMatrixPrognosticBoundary();
 		default:
-			_error_("type not supported yet");
+			_error2_("type not supported yet");
 	}
 }
@@ -500,5 +500,5 @@
 			return CreateKMatrixBalancethicknessBoundary();
 		default:
-			_error_("type not supported yet");
+			_error2_("type not supported yet");
 	}
 }
@@ -651,5 +651,5 @@
 			return CreateKMatrixAdjointBalancethicknessBoundary();
 		default:
-			_error_("type not supported yet");
+			_error2_("type not supported yet");
 	}
 }
@@ -683,5 +683,5 @@
 			return CreatePVectorPrognosticBoundary();
 		default:
-			_error_("type not supported yet");
+			_error2_("type not supported yet");
 	}
 }
@@ -751,5 +751,5 @@
 		vyaverage_input->GetInputValue(&vy,gauss);
 		spcthickness_input->GetInputValue(&thickness,gauss);
-		if(isnan(thickness)) _error_("Cannot weakly apply constraint because NaN was provided");
+		if(isnan(thickness)) _error2_("Cannot weakly apply constraint because NaN was provided");
 
 		UdotN=vx*normal[0]+vy*normal[1];
@@ -777,5 +777,5 @@
 			return CreatePVectorBalancethicknessBoundary();
 		default:
-			_error_("type not supported yet");
+			_error2_("type not supported yet");
 	}
 }
Index: /issm/trunk-jpl/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Loads/Pengrid.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Loads/Pengrid.cpp	(revision 12493)
@@ -239,5 +239,5 @@
 		#endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -271,5 +271,5 @@
 		#endif
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -379,5 +379,5 @@
 	}
 	else{
-		_error_("analysis: %s not supported yet",EnumToStringx(analysis_type));
+		_error2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");
 	}
 
@@ -616,5 +616,5 @@
 /*FUNCTION Pengrid::UpdateInputs {{{*/
 void  Pengrid::UpdateInputs(IssmDouble* solution){
-	_error_("not supported yet!");
-}
-/*}}}*/
+	_error2_("not supported yet!");
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Loads/Penpair.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Loads/Penpair.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Loads/Penpair.cpp	(revision 12493)
@@ -172,5 +172,5 @@
 			break;
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -244,5 +244,5 @@
 				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
 				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
-				default: _error_("not supported yet");
+				default: _error2_("not supported yet");
 			}
 		case PattynApproximationEnum:
@@ -250,5 +250,5 @@
 				case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
 				case PattynApproximationEnum:   return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 
-				default: _error_("not supported yet");
+				default: _error2_("not supported yet");
 			}
 		case StokesApproximationEnum:
@@ -256,5 +256,5 @@
 				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
 				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
-				default: _error_("not supported yet");
+				default: _error2_("not supported yet");
 			}
 		case NoneApproximationEnum:
@@ -262,7 +262,7 @@
 				case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 
 				case NoneApproximationEnum: return   PenaltyCreateKMatrixDiagnosticStokes(kmax); 
-				default: _error_("not supported yet");
+				default: _error2_("not supported yet");
 			}
-		default: _error_("not supported yet");
+		default: _error2_("not supported yet");
 	}
 }
Index: /issm/trunk-jpl/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Loads/Riftfront.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Loads/Riftfront.cpp	(revision 12493)
@@ -276,5 +276,5 @@
 
 	/*update input*/
-	_error_("not implemented yet");
+	_error2_("not implemented yet");
 	//this->inputs->AddInput(new DoubleInput(name,constant));
 
@@ -324,5 +324,5 @@
 			break;
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -350,5 +350,5 @@
 			break;
 		default:
-			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+			_error2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
 	}
 
@@ -397,5 +397,5 @@
 
 	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_(" only Tria element allowed for Riftfront load!");
+	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_(" only Tria element allowed for Riftfront load!");
 	tria1=(Tria*)elements[0];
 	tria2=(Tria*)elements[1];
@@ -410,5 +410,5 @@
 	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
 	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
-	if (h[0]!=h[1])_error_(" different thicknesses not supported for rift fronts");
+	if (h[0]!=h[1])_error2_(" different thicknesses not supported for rift fronts");
 	thickness=h[0];
 
@@ -488,5 +488,5 @@
 
 	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_(" only Tria element allowed for Riftfront load!");
+	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_(" only Tria element allowed for Riftfront load!");
 	tria1=(Tria*)elements[0];
 	tria2=(Tria*)elements[1];
@@ -504,9 +504,9 @@
 	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
 	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
-	if (h[0]!=h[1])_error_(" different thicknesses not supported for rift fronts");
+	if (h[0]!=h[1])_error2_(" different thicknesses not supported for rift fronts");
 	thickness=h[0];
 	tria1->GetInputValue(&b[0],nodes[0],BedEnum);
 	tria2->GetInputValue(&b[1],nodes[1],BedEnum);
-	if (b[0]!=b[1])_error_(" different beds not supported for rift fronts");
+	if (b[0]!=b[1])_error2_(" different beds not supported for rift fronts");
 	bed=b[0];
 
@@ -536,5 +536,5 @@
 	else if(fill==MelangeEnum){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
 
-		if(!shelf) _error_("%s%i%s","fill type ",fill," not supported on ice sheets yet.");
+		if(!shelf) _error2_("" << "fill type " << fill << " not supported on ice sheets yet.");
 
 		pressure_litho=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2;
@@ -546,5 +546,5 @@
 	}
 	else{
-		_error_("%s%i%s","fill type ",fill," not supported yet.");
+		_error2_("" << "fill type " << fill << " not supported yet.");
 	}
 
@@ -585,5 +585,5 @@
 
 	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_(" only Tria element allowed for Riftfront load!");
+	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_(" only Tria element allowed for Riftfront load!");
 
 	/*recover elements on both side of rift: */
@@ -706,5 +706,5 @@
 
 	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_(" only Tria element allowed for Riftfront load!");
+	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_(" only Tria element allowed for Riftfront load!");
 
 	/*recover elements on both side of rift: */
@@ -751,5 +751,5 @@
 
 	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_(" only Tria element allowed for Riftfront load!");
+	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_(" only Tria element allowed for Riftfront load!");
 
 	/*recover elements on both side of rift: */
@@ -794,5 +794,5 @@
 
 	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_(" only Tria element allowed for Riftfront load!");
+	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_(" only Tria element allowed for Riftfront load!");
 
 	/*recover elements on both side of rift: */
@@ -844,5 +844,5 @@
 
 	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_(" only Tria element allowed for Riftfront load!");
+	if(elements[0]->ObjectEnum()!=TriaEnum)_error2_(" only Tria element allowed for Riftfront load!");
 
 	/*recover elements on both side of rift: */
Index: /issm/trunk-jpl/src/c/objects/Materials/Matice.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Materials/Matice.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Materials/Matice.cpp	(revision 12493)
@@ -180,5 +180,5 @@
 			/*Get input (either in element or material)*/
 			Input* input=inputs->GetInput(input_enum);
-			if(!input) _error_("Input %s not found in material",EnumToStringx(input_enum));
+			if(!input) _error2_("Input " << EnumToStringx(input_enum) << " not found in material");
 
 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
@@ -186,5 +186,5 @@
 			break;
 
-		default: _error_("element %s not implemented yet",EnumToStringx(element->ObjectEnum()));
+		default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
 	}
 }
@@ -246,5 +246,5 @@
 
 	/*Checks in debugging mode*/
-	if(viscosity<=0) _error_("Negative viscosity");
+	if(viscosity<=0) _error2_("Negative viscosity");
 	_assert_(B>0);
 	_assert_(n>0);
@@ -317,5 +317,5 @@
 
 	/*Checks in debugging mode*/
-	if(viscosity3d<=0) _error_("Negative viscosity");
+	if(viscosity3d<=0) _error2_("Negative viscosity");
 	_assert_(B>0);
 	_assert_(n>0);
@@ -389,5 +389,5 @@
 
 	/*Checks in debugging mode*/
-	if(viscosity3d<=0) _error_("Negative viscosity");
+	if(viscosity3d<=0) _error2_("Negative viscosity");
 	_assert_(B>0);
 	_assert_(n>0);
@@ -550,7 +550,7 @@
 					return;
 
-				default: _error_("element %s not implemented yet",EnumToStringx(element->ObjectEnum()));
-			}
-		default: _error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+			}
+		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 }
@@ -608,7 +608,7 @@
 					return;
 
-				default: _error_("element %s not implemented yet",EnumToStringx(element->ObjectEnum()));
-			}
-		default: _error_("type %i (%s) not implemented yet",type,EnumToStringx(type));
+				default: _error2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
+			}
+		default: _error2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 
@@ -750,5 +750,5 @@
 	#endif
 	else{
-		_error_(" Mesh type not supported yet!");
+		_error2_(" Mesh type not supported yet!");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Node.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Node.cpp	(revision 12493)
@@ -71,5 +71,5 @@
 
 	/*spc all nodes on water*/
-	if (!iomodel->Data(MaskVertexonwaterEnum)) _error_("iomodel->nodeonwater is NULL");
+	if (!iomodel->Data(MaskVertexonwaterEnum)) _error2_("iomodel->nodeonwater is NULL");
 	if (iomodel->Data(MaskVertexonwaterEnum)[io_index]){
 		for(k=1;k<=gsize;k++){
@@ -115,5 +115,5 @@
 	/*Diagnostic Hutter*/
 	if (analysis_type==DiagnosticHutterAnalysisEnum){
-		if (!iomodel->Data(FlowequationVertexEquationEnum)) _error_("iomodel->vertices_type is NULL");
+		if (!iomodel->Data(FlowequationVertexEquationEnum)) _error2_("iomodel->vertices_type is NULL");
 		/*Constrain all nodes that are not Hutter*/
 		if (!iomodel->Data(FlowequationVertexEquationEnum)[io_index]==HutterApproximationEnum){
@@ -231,5 +231,5 @@
 		return indexing.sdoflist[dofindex];
 	}
-	else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+	else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 
 }
@@ -303,5 +303,5 @@
 			else for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
 		}
-		else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+		else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
 }
@@ -343,5 +343,5 @@
 			}
 		}
-		else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+		else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
 	else{
@@ -412,5 +412,5 @@
 			}
 		}
-		else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+		else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
 }
@@ -598,5 +598,5 @@
 		else if (setenum==FsetEnum) numdofs=this->indexing.fsize;
 		else if (setenum==SsetEnum) numdofs=this->indexing.ssize;
-		else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+		else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
 	else{
@@ -628,5 +628,5 @@
 			else numdofs=this->indexing.ssize;
 		}
-		else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+		else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
 	return numdofs;
@@ -835,5 +835,5 @@
 		}
 	}
-	else _error_("VecMerge can only merge from the s or f-set onto the g-set!");
+	else _error2_("VecMerge can only merge from the s or f-set onto the g-set!");
 
 	/*Free ressources:*/
@@ -881,5 +881,5 @@
 		}
 	}
-	else _error_("VecReduce can only merge from the s or f-set onto the g-set!");
+	else _error2_("VecReduce can only merge from the s or f-set onto the g-set!");
 
 	/*Free ressources:*/
@@ -928,5 +928,5 @@
 		dofcount+=this->indexing.ssize;
 	}
-	else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+	else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 
 
@@ -957,5 +957,5 @@
 		for(i=0;i<this->indexing.ssize;i++) indexing.sdoflist[i]+=dofcount;
 	}
-	else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+	else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 }
 /*}}}*/
@@ -973,5 +973,5 @@
 	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++)  *(truedofs+ncols*sid+j)=indexing.fdoflist[j];
 	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++)  *(truedofs+ncols*sid+j)=indexing.sdoflist[j];
-	else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+	else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 
 }
@@ -992,5 +992,5 @@
 	else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=*(alltruedofs+ncols*sid+j);
 	else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=*(alltruedofs+ncols*sid+j);
-	else _error_("%s%s%s"," set of enum type ",EnumToStringx(setenum)," not supported yet!");
+	else _error2_("" << " set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 
 }
Index: /issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp	(revision 12493)
@@ -47,5 +47,5 @@
 ElementMatrix::ElementMatrix(ElementMatrix* Ke){
 
-	if(!Ke) _error_("Input Element Matrix is a NULL pointer");
+	if(!Ke) _error2_("Input Element Matrix is a NULL pointer");
 	this->Init(Ke);
 	return;
@@ -63,5 +63,5 @@
 	/*If one of the two matrix is NULL, we copy the other one*/
 	if(!Ke1 && !Ke2){
-		_error_("Two input element matrices are NULL");
+		_error2_("Two input element matrices are NULL");
 	}
 	else if(!Ke1){
@@ -75,5 +75,5 @@
 
 	/*General Case: Ke1 and Ke2 are not empty*/
-	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error_("merging 2 non dofsymmetrical matrices not implemented yet");
+	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error2_("merging 2 non dofsymmetrical matrices not implemented yet");
 
 	/*Initialize itransformation matrix Ke[P[i]] = Ke2[i]*/
@@ -295,5 +295,5 @@
 	}
 	else{
-		_error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!");
+		_error2_(" non dofsymmetrical matrix AddToGlobal routine not support yet!");
 	}
 
@@ -332,5 +332,5 @@
 	}
 	else{
-		_error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!");
+		_error2_(" non dofsymmetrical matrix AddToGlobal routine not support yet!");
 	}
 
@@ -343,6 +343,6 @@
 	for (int i=0;i<this->nrows;i++){
 		for(int j=0;j<this->ncols;j++){
-			if (isnan(this->values[i*this->ncols+j])) _error_("NaN found in Element Matrix");
-			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error_("Element Matrix values exceeds 1.e+50");
+			if (isnan(this->values[i*this->ncols+j])) _error2_("NaN found in Element Matrix");
+			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error2_("Element Matrix values exceeds 1.e+50");
 		}
 	}
@@ -365,5 +365,5 @@
 	/*Transpose indices*/
 	if(!dofsymmetrical){
-		_error_("not supported yet");
+		_error2_("not supported yet");
 	}
 
@@ -488,5 +488,5 @@
 	int i;
 
-	if(this->nrows!=this->ncols)_error_("need square matrix in input!");
+	if(this->nrows!=this->ncols)_error2_("need square matrix in input!");
 
 	for(i=0;i<this->nrows;i++){
Index: /issm/trunk-jpl/src/c/objects/Numerics/ElementVector.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Numerics/ElementVector.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Numerics/ElementVector.cpp	(revision 12493)
@@ -42,5 +42,5 @@
 	/*If one of the two matrix is NULL, we copy the other one*/
 	if(!pe1 && !pe2){
-		_error_("Two input element matrices are NULL");
+		_error2_("Two input element matrices are NULL");
 	}
 	else if(!pe1){
@@ -210,6 +210,6 @@
 #ifdef _ISSM_DEBUG_ 
 	for (int i=0;i<this->nrows;i++){
-		if (isnan(this->values[i])) _error_("NaN found in Element Vector");
-		if (fabs( this->values[i])>1.e+50) _error_("Element Vector values exceeds 1.e+50");
+		if (isnan(this->values[i])) _error2_("NaN found in Element Vector");
+		if (fabs( this->values[i])>1.e+50) _error2_("Element Vector values exceeds 1.e+50");
 	}
 #endif
Index: /issm/trunk-jpl/src/c/objects/Options/OptionChar.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Options/OptionChar.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Options/OptionChar.cpp	(revision 12493)
@@ -153,5 +153,5 @@
 	/*We should first check that the size is at least one*/
 	if(this->NumEl()<=0){
-		_error_("option \"%s\" is empty and cannot return a string vector",this->name);
+		_error2_("option \"" << this->name << "\" is empty and cannot return a string vector");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp	(revision 12493)
@@ -125,5 +125,5 @@
 	/*We should first check that the size is one*/
 	if(this->NumEl()!=1){
-		_error_("option \"%s\" has %i elements and cannot return a single int",this->name,this->NumEl());
+		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int");
 	}
 
@@ -137,5 +137,5 @@
 	/*We should first check that the size is one*/
 	if(this->NumEl()!=1){
-		_error_("option \"%s\" has %i elements and cannot return a single IssmPDouble",this->name,this->NumEl());
+		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmPDouble");
 	}
 
@@ -149,5 +149,5 @@
 	/*We should first check that the size is at least one*/
 	if(this->NumEl()<=0){
-		_error_("option \"%s\" is empty and cannot return a IssmPDouble vector",this->name);
+		_error2_("option \"" << this->name << "\" is empty and cannot return a IssmPDouble vector");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Options/OptionLogical.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Options/OptionLogical.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Options/OptionLogical.cpp	(revision 12493)
@@ -125,5 +125,5 @@
 	/*We should first check that the size is one*/
 	if(this->NumEl()!=1){
-		_error_("option \"%s\" has %i elements and cannot return a single bool",this->name,this->NumEl());
+		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Options/OptionStruct.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Options/OptionStruct.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Options/OptionStruct.cpp	(revision 12493)
@@ -132,5 +132,5 @@
 	/*We should first check that the size is one*/
 	if(this->NumEl()!=1){
-		_error_("option \"%s\" has %i elements and cannot return a single options dataset",this->name,this->NumEl());
+		_error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset");
 	}
 
@@ -144,5 +144,5 @@
 	/*We should first check that the size is at least one*/
 	if(this->NumEl()<=0){
-		_error_("option \"%s\" is empty and cannot return an options dataset vector",this->name);
+		_error2_("option \"" << this->name << "\" is empty and cannot return an options dataset vector");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp	(revision 12493)
@@ -27,5 +27,5 @@
 	/*check for index too large  */
 	for (i=0;i<ndims;i++) aprod*=size[i];
-	if (index >= aprod) _error_("Index %d exceeds number of elements %d.",index,aprod);
+	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
 
 	/*calculate the dimensions (being careful of integer division)  */
@@ -46,5 +46,5 @@
 	/*check for any dimension too large  */
 	for (i=0;i<ndims;i++){
-		if (dims[i] >= size[i]) _error_("Dimension %d of %d exceeds size of %d.",i,dims[i],size[i]);
+		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
 	}
 
@@ -65,5 +65,5 @@
 	/*check for index too large  */
 	for (i=0; i<ndims; i++) aprod*=size[i];
-	if (index >= aprod) _error_("Index %d exceeds number of elements %d.",index,aprod);
+	if (index >= aprod) _error2_("Index " << index << " exceeds number of elements " << aprod << ".");
 
 	/*calculate the dimensions (being careful of integer division)  */
@@ -84,5 +84,5 @@
 	/*check for any dimension too large  */
 	for (i=0; i<ndims; i++){
-		if (dims[i] >= size[i]) _error_("Dimension %d of %d exceeds size of %d.",i,dims[i],size[i]);
+		if (dims[i] >= size[i]) _error2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");
 	}
 
Index: /issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 12493)
@@ -109,5 +109,5 @@
 /*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/
 void  DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
-	_error_("DoubleMat of enum %i (%s) cannot return an array of int",enum_type,EnumToStringx(enum_type));
+	_error2_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp	(revision 12493)
@@ -82,30 +82,30 @@
 /*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{*/
 void DoubleParam::GetParameterValue(int* pinteger){
-	_error_("Double param of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));
+	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
 }
 /*}}}*/
 /*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{*/
 void DoubleParam::GetParameterValue(bool* pbool){
-	_error_("Double param of enum %i (%s) cannot return an bool",enum_type,EnumToStringx(enum_type));
+	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an bool");
 }
 /*}}}*/
 /*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM){{{*/
 void DoubleParam::GetParameterValue(int** pintarray,int* pM){
-	_error_("Double param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));
+	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");
 }
 /*}}}*/
 /*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/
 void DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){
-	_error_("Double param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));
+	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");
 }
 /*}}}*/
 /*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
 void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){
-	_error_("Double param of enum %i (%s) cannot return an array of IssmDouble",enum_type,EnumToStringx(enum_type));
+	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
 }
 /*}}}*/
 /*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){{{*/
 void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){
-	_error_("Double param of enum %i (%s) cannot return an array of IssmDouble",enum_type,EnumToStringx(enum_type));
+	_error2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp	(revision 12493)
@@ -124,5 +124,5 @@
 /*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{*/
 void  DoubleVecParam::GetParameterValue(int** pintarray,int* pM){
-	_error_("DoubleVec param of enum %i (%s) cannot return an array of int",enum_type,EnumToStringx(enum_type));
+	_error2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp
===================================================================
--- /issm/trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp	(revision 12493)
@@ -27,9 +27,9 @@
 	if (size==0){
 		function();
-		_error_("usage: see above");
+		_error2_("usage: see above");
 	}
 	else if (size!=NRHS ) {
 		function(); 
-		_error_("usage error.");
+		_error2_("usage error.");
 	}
 	return 1;
Index: /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp
===================================================================
--- /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 12493)
@@ -47,5 +47,5 @@
 	
 	/*check this is indeed a subtype of long type: */
-	if(!PyBool_Check(py_boolean))_error_("expecting a boolean in input!");
+	if(!PyBool_Check(py_boolean))_error2_("expecting a boolean in input!");
 
 	/*extract boolean: */
@@ -68,5 +68,5 @@
 	/*retrive dimensions: */
 	ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
-	if(ndim!=2)_error_("expecting an MxN matrix in input!");
+	if(ndim!=2)_error2_("expecting an MxN matrix in input!");
 	dims=PyArray_DIMS((PyArrayObject*)py_matrix);
 	M=dims[0]; N=dims[1];
@@ -92,5 +92,5 @@
 	/*retrive dimensions: */
 	ndim=PyArray_NDIM((const PyArrayObject*)py_vector);
-	if(ndim!=1)_error_("expecting an Mx1 vector in input!");
+	if(ndim!=1)_error2_("expecting an Mx1 vector in input!");
 	dims=PyArray_DIMS((PyArrayObject*)py_vector);
 	M=dims[0]; 
Index: /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 12493)
@@ -31,9 +31,9 @@
 	void* memptr=NULL;
 
-	if(!size)_error_(" attempting to 0 size allocation!");
+	if(!size)_error2_(" attempting to 0 size allocation!");
 
 	/* Use the c library to do the allocation: */
 	memptr=malloc(size);
-	if(!memptr) _error_("memory allocation failed!");
+	if(!memptr) _error2_("memory allocation failed!");
 
 	return memptr;
@@ -44,9 +44,9 @@
 	void* memptr=NULL;
 	
-	if(!size)_error_("attempting to 0 size allocation!");
+	if(!size)_error2_("attempting to 0 size allocation!");
 
 	/* Use the c library to do the allocation: */
 	memptr=calloc(n,size);
-	if(!memptr) _error_("memory allocation failed!");
+	if(!memptr) _error2_("memory allocation failed!");
 
 	return memptr;
@@ -88,9 +88,9 @@
 	register void* value=NULL;
 	
-	if(!size)_error_("attempting to realloc to zero");
+	if(!size)_error2_("attempting to realloc to zero");
 	value = (void*)realloc(pv,size);
 
 	if (value == NULL) {
-		_error_("virtual memory exhausted");
+		_error2_("virtual memory exhausted");
 	}
 	return value;
Index: /issm/trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp	(revision 12493)
@@ -22,5 +22,5 @@
 			case XYEnum:   numdofs+=2; break;
 			case XYZPEnum: numdofs+=4; break;
-			default: _error_("Coordinate system %s not supported yet",EnumToStringx(cs_array[i]));
+			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
 		}
 	}
@@ -67,5 +67,5 @@
 				break;
 			default:
-				_error_("Coordinate system %s not supported yet",EnumToStringx(cs_array[i]));
+				_error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
 		}
 	}
Index: /issm/trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp	(revision 12493)
@@ -31,5 +31,5 @@
 			case XYEnum:   numdofs+=2; break;
 			case XYZPEnum: numdofs+=4; break;
-			default: _error_("Coordinate system %s not supported yet",EnumToStringx(cs_array[i]));
+			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
 		}
 	}
Index: /issm/trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp	(revision 12493)
@@ -30,5 +30,5 @@
 			case XYEnum:   numdofs+=2; break;
 			case XYZPEnum: numdofs+=4; break;
-			default: _error_("Coordinate system %s not supported yet",EnumToStringx(cs_array[i]));
+			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
 		}
 	}
Index: /issm/trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp	(revision 12493)
@@ -31,5 +31,5 @@
 			case XYEnum:   numdofs+=2; break;
 			case XYZPEnum: numdofs+=4; break;
-			default: _error_("Coordinate system %s not supported yet",EnumToStringx(cs_array[i]));
+			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
 		}
 	}
Index: /issm/trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp	(revision 12493)
@@ -31,5 +31,5 @@
 			case XYEnum:   numdofs+=2; break;
 			case XYZPEnum: numdofs+=4; break;
-			default: _error_("Coordinate system %s not supported yet",EnumToStringx(cs_array[i]));
+			default: _error2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
 		}
 	}
Index: /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12493)
@@ -38,5 +38,5 @@
 	/*open domain outline file for reading: */
 	if ((fid=fopen(domainname,"r"))==NULL){
-		_error_("%s%s","could not find domain file ",domainname); 
+		_error2_("" << "could not find domain file " << domainname); 
 	}
 
Index: /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 12493)
@@ -23,5 +23,5 @@
 	/*open domain outline file for writing: */
 	if ((fid=fopen(domainname,"w"))==NULL){
-		_error_("%s%s","could not open domain file ",domainname); 
+		_error2_("" << "could not open domain file " << domainname); 
 		noerr=0; goto cleanupandreturn;
 	}
Index: /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 12493)
@@ -36,5 +36,5 @@
 	if (!itrnb) {
 		if (nrowb != idimb) {
-			_error_("Matrix A and B inner vectors not equal size.");
+			_error2_("Matrix A and B inner vectors not equal size.");
 		}
 		idimc=ncolb;
@@ -42,5 +42,5 @@
 	else {
 		if (ncolb != idimb) {
-			_error_("Matrix A and B inner vectors not equal size.");
+			_error2_("Matrix A and B inner vectors not equal size.");
 		}
 		idimc=nrowb;
@@ -49,5 +49,5 @@
 	if (!itrnc) {
 		if (nrowc != idimc) {
-			_error_("Matrix B and C inner vectors not equal size.");
+			_error2_("Matrix B and C inner vectors not equal size.");
 		}
 		idimd=ncolc;
@@ -55,5 +55,5 @@
 	else {
 		if (ncolc != idimc) {
-			_error_("Matrix B and C inner vectors not equal size.");
+			_error2_("Matrix B and C inner vectors not equal size.");
 		}
 		idimd=nrowc;
@@ -124,5 +124,5 @@
 
 	if (ntrma != ntrmb) {
-		_error_("Matrix A and B inner vectors not equal size");
+		_error2_("Matrix A and B inner vectors not equal size");
 	    noerr=0;	
 		return noerr;
@@ -175,5 +175,5 @@
 
 	if (!b && nvec) {
-		_error_("No right-hand side for nvec=%d.",nvec);
+		_error2_("No right-hand side for nvec=" << nvec << ".");
 		noerr=0;
 		return noerr;
@@ -214,5 +214,5 @@
 			xDelete<int>(pivrc2);
 			xDelete<int>(pindx);
-			_error_("Pivot %f less than machine epsilon",pivot);
+			_error2_("Pivot " << pivot << " less than machine epsilon");
 			noerr=0;
 			return noerr;
@@ -349,5 +349,5 @@
 	/*Compute determinant*/
 	Matrix2x2Determinant(&det,A);
-	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
+	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
 
 	/*Compute invert*/
@@ -374,5 +374,5 @@
 	/*Compute determinant*/
 	Matrix3x3Determinant(&det,A);
-	if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon");
+	if (fabs(det) < DBL_EPSILON) _error2_("Determinant smaller that machine epsilon");
 
 	/*Compute invert*/
Index: /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 12493)
@@ -43,9 +43,9 @@
 	iter=0;
 	fxmin = (*f)(xmin,optargs);
-	if (isnan(fxmin)) _error_("Function evaluation returned NaN");
+	if (isnan(fxmin)) _error2_("Function evaluation returned NaN");
 	_printf_(VerboseControl(),"\n        Iteration         x           f(x)       Tolerance         Procedure\n\n");
 	_printf_(VerboseControl(),"        %s    %12.6g  %12.6g  %s","   N/A",xmin,fxmin,"         N/A         boundary\n");
 	fxmax = (*f)(xmax,optargs);
-	if (isnan(fxmax)) _error_("Function evaluation returned NaN");
+	if (isnan(fxmax)) _error2_("Function evaluation returned NaN");
 	_printf_(VerboseControl(),"        %s    %12.6g  %12.6g  %s","   N/A",xmax,fxmax,"         N/A         boundary\n");
 
@@ -71,5 +71,5 @@
 	/*2: call the function to be evaluated*/
 	fxbest = (*f)(x,optargs);
-	if(isnan(fxbest)) _error_("Function evaluation returned NaN");
+	if(isnan(fxbest)) _error2_("Function evaluation returned NaN");
 	iter=iter+1;
 
@@ -154,5 +154,5 @@
 		//evaluate function on x
 		fx = (*f)(x,optargs);
-		if(isnan(fx)) _error_("Function evaluation returned NaN");
+		if(isnan(fx)) _error2_("Function evaluation returned NaN");
 		iter=iter+1;
 
Index: /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 12493)
@@ -1670,5 +1670,5 @@
 		if (iter >= MAX_GAUS_ITER) {
 			xDelete<IssmPDouble>(work);
-			_error_("%s%i"," Max iterations exceeded for l=",MAX_GAUS_ITER);
+			_error2_("" << " Max iterations exceeded for l=" << MAX_GAUS_ITER);
 		}
 	}
Index: /issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp	(revision 12493)
@@ -53,5 +53,5 @@
 		else eps=0;
 	}
-	else _error_("%s%s%s"," convergence criterion ",EnumToStringx(criterion_enum)," not supported yet!");
+	else _error2_("" << " convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");
 
 	/*Assign output pointers:*/
Index: /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 12493)
@@ -41,5 +41,5 @@
 	//get the value of the function at the first boundary
 	fx1= (*f)(x1,optargs);
-	if (isnan(fx1)) _error_("Function evaluation returned NaN");
+	if (isnan(fx1)) _error2_("Function evaluation returned NaN");
 	_printf_(VerboseControl(),"\n        Iteration         x           f(x)       Tolerance\n\n");
 	_printf_(VerboseControl(),"        %s    %12.6g  %12.6g  %s","   N/A",x1,fx1,"         N/A\n");
@@ -54,5 +54,5 @@
 		iter++;
 		fx2 = (*f)(x2,optargs);
-		if (isnan(fx2)) _error_("Function evaluation returned NaN");
+		if (isnan(fx2)) _error2_("Function evaluation returned NaN");
 		_printf_(VerboseControl(),"         %5i    %12.6g  %12.6g  %12.6g\n",iter,x2,fx2,fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1));
 
Index: /issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp	(revision 12493)
@@ -57,5 +57,5 @@
 	if (found==-1){
 		/*ok, we did not find anything, this is not good! error out: */
-		_error_("%s%s","could find neither a default analysis  nor analysis ",EnumToStringx(analysis_type));
+		_error2_("" << "could find neither a default analysis  nor analysis " << EnumToStringx(analysis_type));
 	}
 
Index: /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp	(revision 12493)
@@ -29,5 +29,5 @@
 	if(direction_enum==IuToExtEnum) for(i=0;i<numvalues;i++)values[i]=values[i]*scale; 
 	else if(direction_enum==ExtToIuEnum) for(i=0;i<numvalues;i++)values[i]=values[i]/scale; 
-	else _error_(" wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
+	else _error2_(" wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");
 
 }
Index: /issm/trunk-jpl/src/c/shared/Numerics/Verbosity.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 12493)
@@ -34,5 +34,5 @@
 void SetVerbosityLevel(int level){
 
-	if(level<0) _error_("vebosity level should be a positive integer (user provided %i)",level);
+	if(level<0) _error2_("vebosity level should be a positive integer (user provided " << level << ")");
 
 	verbositylevel = level;
Index: /issm/trunk-jpl/src/c/shared/String/DescriptorIndex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/String/DescriptorIndex.cpp	(revision 12493)
@@ -23,10 +23,10 @@
 	/*retrieve first token, separated by underscore: */
 	pch = strtok (descriptor,"_");
-	if(!pch)_error_("%s%s%s"," descriptor ",descriptor," is not correctly formatted!");
+	if(!pch)_error2_("" << " descriptor " << descriptor << " is not correctly formatted!");
 
 	if (strncmp(pch,"scaled",6)==0){
 		/*we have a scaled variable. recover the root: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," scaled descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " scaled descriptor " << descriptor << " is not correctly formatted!");
 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
 
@@ -44,9 +44,9 @@
 		/*we have an indexed variable. recover the root: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," indexed descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " indexed descriptor " << descriptor << " is not correctly formatted!");
 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
 		/*now recover  the index: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," indexed descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " indexed descriptor " << descriptor << " is not correctly formatted!");
 		sscanf(pch,"%i",pindex);
 		return IndexedEnum;
@@ -55,9 +55,9 @@
 		/*we have an indexed variable. recover the root: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," nodal descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " nodal descriptor " << descriptor << " is not correctly formatted!");
 		memcpy(root,pch,(strlen(pch)+1)*sizeof(char));
 		/*now recover  the index: */
 		pch = strtok (NULL, "_");
-		if(!pch)_error_("%s%s%s"," nodal descriptor ",descriptor," is not correctly formatted!");
+		if(!pch)_error2_("" << " nodal descriptor " << descriptor << " is not correctly formatted!");
 		sscanf(pch,"%i",pindex);
 		return NodalEnum;
Index: /issm/trunk-jpl/src/c/shared/Threads/LaunchThread.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/shared/Threads/LaunchThread.cpp	(revision 12493)
@@ -44,10 +44,10 @@
 
 		if(pthread_create(threads+i,NULL,function,(void*)(handles+i))){
-			_error_(" pthread_create error");
+			_error2_(" pthread_create error");
 		}
 	}
 	for(i=0;i<num_threads;i++){
 		if(pthread_join(threads[i],(void**)&status)){
-			_error_(" pthread_join error");
+			_error2_(" pthread_join error");
 		}
 	}
Index: /issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 12493)
@@ -35,5 +35,5 @@
 			break;
 		default:
-			_error_("No adjoint has been implemented for solution %s yet",EnumToStringx(solutiontype));
+			_error2_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 12493)
@@ -110,5 +110,5 @@
 		
 		default:
-			_error_("%s%s%s"," solution type: ",EnumToStringx(solutiontype)," not supported yet!");
+			_error2_("" << " solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 12493)
@@ -29,5 +29,5 @@
 			solutioncore=&diagnostic_core;
 			#else
-			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
+			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
 			#endif
 			break;
@@ -36,5 +36,5 @@
 			solutioncore=&steadystate_core;
 			#else
-			_error_("ISSM was not compiled with steady state capabilities. Exiting");
+			_error2_("ISSM was not compiled with steady state capabilities. Exiting");
 			#endif
 			break;
@@ -43,5 +43,5 @@
 			solutioncore=&thermal_core;
 			#else
-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
 			#endif
 			break;
@@ -50,5 +50,5 @@
 			solutioncore=&enthalpy_core;
 			#else
-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
 			#endif
 			break;
@@ -57,5 +57,5 @@
 			solutioncore=&balancethickness_core;
 			#else
-			_error_("ISSM was not compiled with balanced capabilities. Exiting");
+			_error2_("ISSM was not compiled with balanced capabilities. Exiting");
 			#endif
 			break;
@@ -64,5 +64,5 @@
 			solutioncore=&hydrology_core;
 			#else
-			_error_("ISSM was not compiled with hydrology capabilities. Exiting");
+			_error2_("ISSM was not compiled with hydrology capabilities. Exiting");
 			#endif
 			break;
@@ -71,5 +71,5 @@
 			solutioncore=&surfaceslope_core;
 			#else
-			_error_("ISSM was not compiled with slope capabilities. Exiting");
+			_error2_("ISSM was not compiled with slope capabilities. Exiting");
 			#endif
 			break;
@@ -78,5 +78,5 @@
 			solutioncore=&bedslope_core;
 			#else
-			_error_("ISSM was not compiled with slope capabilities. Exiting");
+			_error2_("ISSM was not compiled with slope capabilities. Exiting");
 			#endif
 			break;
@@ -85,5 +85,5 @@
 			solutioncore=&transient_core;
 			#else
-			_error_("ISSM was not compiled with transient capabilities. Exiting");
+			_error2_("ISSM was not compiled with transient capabilities. Exiting");
 			#endif
 			break;
@@ -92,9 +92,9 @@
 			solutioncore=&prognostic_core;
 			#else
-			_error_("ISSM was not compiled with prognostic capabilities. Exiting");
+			_error2_("ISSM was not compiled with prognostic capabilities. Exiting");
 			#endif
 			break;
 		default:
-			_error_("%s%s%s"," solution type: ",EnumToStringx(solutiontype)," not supported yet!");
+			_error2_("" << " solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/ProcessArguments.cpp	(revision 12493)
@@ -17,7 +17,7 @@
 	char *lockfilename   = NULL;
 
-	if(argc<2)_error_("Usage error: no solution requested");
+	if(argc<2)_error2_("Usage error: no solution requested");
 	*solution_type=StringToEnumx(argv[1]);
-	if(argc<3)_error_("Usage error: missing model name");
+	if(argc<3)_error2_("Usage error: missing model name");
 	modelname=argv[3];
 	binfilename    = xNew<char>(strlen(modelname)+strlen(".bin")   +1); sprintf(binfilename,   "%s%s",modelname,".bin");
Index: /issm/trunk-jpl/src/c/solutions/WriteLockFile.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/WriteLockFile.cpp	(revision 12493)
@@ -17,8 +17,8 @@
 	if(my_rank==0){
 		fid=fopen(filename,"w");
-		if(fid==NULL) _error_("%s%s","error message: could not open lock file ",filename);
+		if(fid==NULL) _error2_("" << "error message: could not open lock file " << filename);
 
 		/*Close file: */
-		if(fclose(fid)!=0) _error_("%s%s","could not close lock file ",filename);
+		if(fclose(fid)!=0) _error2_("" << "could not close lock file " << filename);
 	}
 
Index: /issm/trunk-jpl/src/c/solutions/controltao_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12493)
@@ -41,5 +41,5 @@
 	PetscGetArgs(&argc,&args);
 	ierr = TaoInitialize(&argc,&args,(char*)0,"");
-	if(ierr) _error_("Could not initialize Tao");
+	if(ierr) _error2_("Could not initialize Tao");
 
 	/*Recover some parameters*/
@@ -181,5 +181,5 @@
 #else
 void controltao_core(FemModel* femmodel){
-	_error_("TAO not installed or PETSc version not supported");
+	_error2_("TAO not installed or PETSc version not supported");
 }
 #endif //_HAVE_TAO_ 
Index: /issm/trunk-jpl/src/c/solutions/convergence.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/convergence.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/convergence.cpp	(revision 12493)
@@ -72,5 +72,5 @@
 	if (isnan(res)){
 		_printf_(true,"norm nf = %lf and norm kuold = %lf\n",nF,nKUoldF);
-		_error_("mechanical equilibrium convergence criterion is NaN!");
+		_error2_("mechanical equilibrium convergence criterion is NaN!");
 	}
 
@@ -96,5 +96,5 @@
 		ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO);
 
-		if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!");
+		if (isnan(ndu) || isnan(nu)) _error2_("convergence criterion is NaN!");
 
 		//clean up
@@ -121,5 +121,5 @@
 		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
 		ndu=duf->Norm(NORM_TWO); nduinf=duf->Norm(NORM_INF);
-		if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!");
+		if (isnan(ndu) || isnan(nu)) _error2_("convergence criterion is NaN!");
 
 		//clean up
Index: /issm/trunk-jpl/src/c/solutions/gradient_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/gradient_core.cpp	(revision 12493)
@@ -37,6 +37,6 @@
 	/*Check that gradient is clean*/
 	norm_inf=new_gradient->Norm(NORM_INF);
-	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
-	if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
+	if(norm_inf<=0)    _error2_("||∂J/∂α||∞ = 0    gradient norm is zero");
+	if(isnan(norm_inf))_error2_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
 
 	/*plug back into inputs: */
Index: /issm/trunk-jpl/src/c/solutions/issm.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/issm.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/issm.cpp	(revision 12493)
@@ -40,5 +40,5 @@
 	#ifdef _HAVE_PETSC_
 	ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
-	if(ierr) _error_("Could not initialize Petsc");
+	if(ierr) _error2_("Could not initialize Petsc");
 	#else
 	#ifdef _HAVE_MPI_
@@ -111,5 +111,5 @@
 		Dakotax(femmodel);
 		#else
-		_error_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
+		_error2_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");
 		#endif
 	}
@@ -121,5 +121,5 @@
 		 control_core(femmodel);
 		#else
-		_error_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
+		_error2_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
 		#endif
 	}
Index: /issm/trunk-jpl/src/c/solutions/kriging.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/kriging.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/kriging.cpp	(revision 12493)
@@ -40,5 +40,5 @@
 #ifdef _HAVE_PETSC_
 	int ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
-	if(ierr) _error_("Could not initialize Petsc");
+	if(ierr) _error2_("Could not initialize Petsc");
 #else
 #ifdef _HAVE_MPI_
@@ -122,5 +122,5 @@
 	char *lockfilename   = NULL;
 
-	if(argc<2)_error_("Usage error: missing model name");
+	if(argc<2)_error2_("Usage error: missing model name");
 	modelname=argv[2];
 	binfilename    = xNew<char>((strlen(modelname)+strlen(".bin")   +1)); sprintf(binfilename,   "%s%s",modelname,".bin");
Index: /issm/trunk-jpl/src/c/solutions/objectivefunction.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 12493)
@@ -49,5 +49,5 @@
 	}
 	else{
-		_error_("Solution %s not implemented yet",EnumToStringx(solution_type));
+		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
 	}
 
@@ -66,5 +66,5 @@
 	}
 	else{
-		_error_("Solution %s not implemented yet",EnumToStringx(solution_type));
+		_error2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
 	}
 
Index: /issm/trunk-jpl/src/c/solutions/steadystate_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/steadystate_core.cpp	(revision 12493)
@@ -52,5 +52,5 @@
 		}
 		#else
-		_error_("ISSM was not compiled with thermal capabilities. Exiting");
+		_error2_("ISSM was not compiled with thermal capabilities. Exiting");
 		#endif
 
Index: /issm/trunk-jpl/src/c/solutions/transient_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/solutions/transient_core.cpp	(revision 12493)
@@ -103,5 +103,5 @@
 			}
 			#else
-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
+			_error2_("ISSM was not compiled with thermal capabilities. Exiting");
 			#endif
 		}
@@ -112,5 +112,5 @@
 			diagnostic_core(femmodel);
 			#else
-			_error_("ISSM was not compiled with diagnostic capabilities. Exiting");
+			_error2_("ISSM was not compiled with diagnostic capabilities. Exiting");
 			#endif
 		}
@@ -128,5 +128,5 @@
 			GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
 			#else
-			_error_("ISSM was not compiled with grounding line migration capabilities. Exiting");
+			_error2_("ISSM was not compiled with grounding line migration capabilities. Exiting");
 			#endif
 		}
Index: /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 12493)
@@ -119,5 +119,5 @@
 			break;
 		default:
-			_error_("unknown norm !");
+			_error2_("unknown norm !");
 			break;
 	}
@@ -150,6 +150,6 @@
 	AX->GetSize(&AXM);
 
-	if(M!=AXM)_error_("A and AX should have the same number of rows!");
-	if(N!=XM)_error_("A and X should have the same number of columns!");
+	if(M!=AXM)_error2_("A and AX should have the same number of rows!");
+	if(N!=XM)_error2_("A and X should have the same number of columns!");
 
 	for(i=0;i<M;i++){
@@ -197,5 +197,5 @@
 			break;
 		default:
-			_error_("unknown insert mode!");
+			_error2_("unknown insert mode!");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp	(revision 12493)
@@ -85,5 +85,5 @@
 			break;
 		default:
-			_error_("unknown insert mode!");
+			_error2_("unknown insert mode!");
 			break;
 	}
@@ -102,5 +102,5 @@
 			break;
 		default:
-			_error_("unknown insert mode!");
+			_error2_("unknown insert mode!");
 			break;
 	}
@@ -204,5 +204,5 @@
 			break;
 		default:
-			_error_("unknown norm !");
+			_error2_("unknown norm !");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 12493)
@@ -56,5 +56,5 @@
 
 	#else
-	_error_("METIS version not supported yet");
+	_error2_("METIS version not supported yet");
 	#endif
 }
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp	(revision 12493)
@@ -30,5 +30,5 @@
 			break;
 		default: 
-			_error_("unknown insert mode!");
+			_error2_("unknown insert mode!");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp	(revision 12493)
@@ -30,5 +30,5 @@
 			break;
 		default: 
-			_error_("unknown matrix type !");
+			_error2_("unknown matrix type !");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp	(revision 12493)
@@ -30,5 +30,5 @@
 			break;
 		default: 
-			_error_("unknown norm !");
+			_error2_("unknown norm !");
 			break;
 	}
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatInvert.cpp	(revision 12493)
@@ -29,5 +29,5 @@
 	/*Some checks: */
 	MatGetSize(matrix,&M,&N);
-	if(M!=N) _error_("trying to invert a non square matrix!");
+	if(M!=N) _error2_("trying to invert a non square matrix!");
 
 	/*Create identitiy matrix: */
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp	(revision 12493)
@@ -62,5 +62,5 @@
 		}
 		else{
-			_error_("MatType %s not supported yet",type);
+			_error2_("MatType " << type << " not supported yet");
 		}
 		/*Assemble*/
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp	(revision 12493)
@@ -55,5 +55,5 @@
 			if(first[0]!='-'){
 				/*This is not good, the option does not have '-'! Get out*/
-				_error_("%s%s%s","Option ",first," should be preceded by '-'!");
+				_error2_("" << "Option " << first << " should be preceded by '-'!");
 			}
 			/*Reduce first to bare option value*/
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 12493)
@@ -35,5 +35,5 @@
 	/*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */
 	if ( (row_partition_size !=MB) ){
-		_error_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
+		_error2_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
 	}
 
Index: /issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 12492)
+++ /issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp	(revision 12493)
@@ -51,5 +51,5 @@
 
 	/*Some dimensions checks: */
-	if (mA!=nA) _error_(" trying to take the invert of a non-square matrix!");
+	if (mA!=nA) _error2_(" trying to take the invert of a non-square matrix!");
 
 	/* Set default Plapack parameters */
