Index: /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 26975)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 26976)
@@ -15,7 +15,4 @@
 #include <iomanip>
 #include "./exceptions.h"
-#include "../io/Print/Print.h"
-#include "../io/Comm/IssmComm.h"
-#include "../MemOps/MemOps.h"
 
 ErrorException::ErrorException(const string & what_arg){/*{{{*/
@@ -31,24 +28,26 @@
 
 }/*}}}*/
-ErrorException::ErrorException(const string& what_file, const string& what_function,int what_line, const string& what_arg){/*{{{*/
+ErrorException::ErrorException(int what_rank,const string& what_file, const string& what_function,int what_line, const string& what_arg){/*{{{*/
 
+	/*Intermediaries*/
 	int len;
 
-	len      = strlen(what_arg.c_str())+1;
-	what_str = new char[len];
-	memcpy(what_str,what_arg.c_str(),len);
+	this->rank     = what_rank;
+	this->file_line= what_line;
 
-	len       = strlen(what_file.c_str())+1;
-	file_name = new char[len];
-	memcpy(file_name,what_file.c_str(),len);
+	len = strlen(what_arg.c_str())+1;
+	this->what_str = new char[len];
+	memcpy(this->what_str,what_arg.c_str(),len);
 
-	len           = strlen(what_function.c_str())+1;
-	function_name = new char[len];
-	memcpy(function_name,what_function.c_str(),len);
+	len = strlen(what_file.c_str())+1;
+	this->file_name = new char[len];
+	memcpy(this->file_name,what_file.c_str(),len);
 
-	file_line= what_line;
-	/*When error messages are not shown properly, uncomment the following line*/
-	this->Report();
+	len = strlen(what_function.c_str())+1;
+	this->function_name = new char[len];
+	memcpy(this->function_name,what_function.c_str(),len);
 
+	/*Uncomment if messages do not print properly*/
+	//this->Report();
 }/*}}}*/
 ErrorException::~ErrorException() throw(){/*{{{*/
@@ -58,5 +57,4 @@
 }/*}}}*/
 const char* ErrorException::what() const throw(){/*{{{*/
-	//this->Report();
 	return what_str;
 }/*}}}*/
@@ -64,21 +62,11 @@
 
 	/*WINDOWS*/
-	if(!function_name || file_line==0){
-		_printf_("Error message: " << what());
+	if(!this->function_name || this->file_line==0){
+		cerr << "Error message: " << what() << endl;
 		return;
 	}
 
-	/*recover my_rank and num_procs:*/
-	int my_rank   = IssmComm::GetRank();
-	int num_procs = IssmComm::GetSize();
-
-	if(num_procs==1){
-		_printf_("\n??? Error in ==> " << file_name << ":" << file_line << "\n");
-		_printf_(function_name << " error message: " << what() << "\n\n");
-	}
-	else{
-		_printf_("\n[" << my_rank<< "] ??? Error using ==> " << file_name << ":" << file_line << "\n");
-		_printf_(  "[" << my_rank << "] " << function_name << " error message: " << what() << "\n\n");
-	}
+	cerr <<"\n[" << this->rank<< "] ??? Error using ==> " << this->file_name << ":" << this->file_line << 
+	       "\n[" << this->rank<< "] " << this->function_name << " error message: " << what() << "\n" << endl;
 
 	return;
@@ -91,5 +79,5 @@
 
 	/*WINDOWS*/
-	if(!function_name || file_line==0){ 
+	if(!this->function_name || this->file_line==0){ 
 		buffer << " error message: " << this->what_str;
 	}
@@ -101,5 +89,7 @@
 	/*Convert std::ostringstream to std::string and then create char* */
 	std::string buffer2 = buffer.str();
-	message = xNew<char>(strlen(buffer2.c_str())+1); sprintf(message,"%s",buffer2.c_str());
+	message = new char[strlen(buffer2.c_str())+1];
+	sprintf(message,"%s",buffer2.c_str());
+
 	return message;
 }/*}}}*/
Index: /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 26975)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 26976)
@@ -28,5 +28,6 @@
 #include <sstream>
 
-/*macros: */
+/*macros: (should move somewhere else)*/
+#include "../io/Comm/IssmComm.h"
 /* _assert_ {{{*/
 /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
@@ -50,5 +51,5 @@
 	do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
-   throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+   throw ErrorException(IssmComm::GetRank(),__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
 #endif
 /*}}}*/
@@ -78,5 +79,5 @@
 
 /*ISSM exception class: */
-class ErrorException: public exception { /*{{{*/
+class ErrorException: public exception{ /*{{{*/
 
 	char* what_str;
@@ -84,8 +85,11 @@
 	char* file_name;
 	int   file_line;
+	int   rank;
 
 	public:
-	ErrorException(const string &what_arg); //for windows
-	ErrorException(const string &what_file,const string& what_function,int what_line,const string& what_arg);//UNIX
+	/*Windows*/
+	ErrorException(const string &what_arg);
+	/*Linux/macOS*/
+	ErrorException(int what_rank,const string &what_file,const string& what_function,int what_line,const string& what_arg);
 	~ErrorException() throw();
 	virtual const char *what() const throw();
