Index: /issm/trunk-jpl/src/c/include/macros.h
===================================================================
--- /issm/trunk-jpl/src/c/include/macros.h	(revision 12512)
+++ /issm/trunk-jpl/src/c/include/macros.h	(revision 12513)
@@ -69,5 +69,5 @@
   do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
 	  aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
-	  PrintfFunction(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+	  PrintfFunction2(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
 /*}}}*/
 /* _assert_ {{{*/
Index: /issm/trunk-jpl/src/c/io/PrintfFunction.cpp
===================================================================
--- /issm/trunk-jpl/src/c/io/PrintfFunction.cpp	(revision 12512)
+++ /issm/trunk-jpl/src/c/io/PrintfFunction.cpp	(revision 12513)
@@ -57,2 +57,8 @@
 	}
 }
+int PrintfFunction2(const string & message){
+	extern int  my_rank;
+	if(my_rank==0){
+		printf("%s",message.c_str());
+	}
+}
Index: /issm/trunk-jpl/src/c/io/io.h
===================================================================
--- /issm/trunk-jpl/src/c/io/io.h	(revision 12512)
+++ /issm/trunk-jpl/src/c/io/io.h	(revision 12513)
@@ -16,4 +16,5 @@
 int PrintfFunction(const char* format,...);
 int PrintfFunction(const string & message);
+int PrintfFunction2(const string & message);
 
 #endif	/* _IO_H_ */
Index: /issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 12512)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 12513)
@@ -46,17 +46,12 @@
 void  KML_GroundOverlay::Echo(){
 
-	bool  flag=true;
-
-	_printf_(flag,"KML_GroundOverlay:\n");
+	_printLine_("KML_GroundOverlay:");
 	KML_Overlay::Echo();
 
-	_printf_(flag,"      altitude: %0.16g\n"      ,altitude);
-	_printf_(flag,"       altmode: \"%s\"\n"      ,altmode);
-	_printf_(flag,"         llbox: %p\n"          ,llbox);
-
-	return;
+	_printLine_("         altitude: " << altitude);
+	_printLine_("          altmode: " << altmode);
+	_printLine_("            llbox: " << llbox);
 }
 /*}}}*/
-
 /*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
 void  KML_GroundOverlay::DeepEcho(){
@@ -69,5 +64,4 @@
 }
 /*}}}*/
-
 /*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
 void  KML_GroundOverlay::DeepEcho(const char* indent){
@@ -92,5 +86,4 @@
 }
 /*}}}*/
-
 /*FUNCTION KML_GroundOverlay::Write {{{*/
 void  KML_GroundOverlay::Write(FILE* filout,const char* indent){
@@ -119,5 +112,4 @@
 }
 /*}}}*/
-
 /*FUNCTION KML_GroundOverlay::Read {{{*/
 void  KML_GroundOverlay::Read(FILE* fid,char* kstr){
@@ -174,3 +166,2 @@
 }
 /*}}}*/
-
Index: /issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 12512)
+++ /issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 12513)
@@ -67,6 +67,4 @@
 /*FUNCTION KML_LatLonBox::DeepEcho {{{*/
 void  KML_LatLonBox::DeepEcho(const char* indent){
-
-	bool  flag=true;
 
 	_printLine_(indent << "KML_LatLonBox:");
Index: /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 12512)
+++ /issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp	(revision 12513)
@@ -42,6 +42,9 @@
 	fx1= (*f)(x1,optargs);
 	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");
+	cout<<setprecision(5);
+	if(VerboseControl()) _pprintLine_("");
+	if(VerboseControl()) _pprintLine_("       Iteration         x           f(x)       Tolerance");
+	if(VerboseControl()) _pprintLine_("");
+	if(VerboseControl()) _pprintLine_("           N/A    "<<setw(12)<<x1<<"  "<<setw(12)<<fx1<<"           N/A");
 
 	//update tolerances
@@ -55,5 +58,6 @@
 		fx2 = (*f)(x2,optargs);
 		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));
+		if(VerboseControl())
+		 _pprintLine_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x2<<"  "<<setw(12)<<fx2<<"  "<<(fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1)));
 
 		//Stop the optimization?
Index: /issm/trunk-jpl/src/c/solutions/controltao_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12512)
+++ /issm/trunk-jpl/src/c/solutions/controltao_core.cpp	(revision 12513)
@@ -30,5 +30,5 @@
 	int        nsteps,maxiter;
 	AppCtx     user;
-	TaoSolver  tao;
+	TaoSolver  tao = 0;
 	IssmDouble    *dummy          = NULL;
 	int       *control_list   = NULL;
@@ -53,6 +53,6 @@
 
 	/*Initialize TAO*/
+	TaoCreate(PETSC_COMM_WORLD,&tao);
 	_printf_(VerboseControl(),"%s\n","   Initializing the Toolkit for Advanced Optimization (TAO)");
-	TaoCreate(PETSC_COMM_WORLD,&tao);
 	TaoSetFromOptions(tao);
 	TaoSetType(tao,"tao_blmvm");
@@ -165,12 +165,12 @@
 	if(its==0) _printf_(true,"Iter       Function      Residual  |  List of contributions\n");
 	if(its==0) _printf_(true,"-----------------------------------+-----------------------\n");
-	_printf_(true,"%4i   %12.7g  %12.7g  | ",its,f,gnorm);
+	_pprintString_(setw(4)<<its<<"   "<<setw(12)<<setprecision(7)<<f<<"  "<<setw(12)<<setprecision(7)<<gnorm<<"  | ");
 
 	/*Retrieve objective functions independently*/
 	for(i=0;i<num_responses;i++){
 		Responsex(&f,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,EnumToStringx(responses[i]),false,i);
-		_printf_(true," %12.7g ","",f);
+		_pprintString_(" "<<setw(12)<<setprecision(7)<<f);
 	}
-	_printf_(true,"\n");
+	_pprintLine_("");
 
 	/*Clean-up and return*/
