Index: /issm/trunk/src/c/shared/Numerics/README
===================================================================
--- /issm/trunk/src/c/shared/Numerics/README	(revision 6310)
+++ /issm/trunk/src/c/shared/Numerics/README	(revision 6310)
@@ -0,0 +1,9 @@
+
+DO NOT MODIFY the following files:
+- Verbosity.cpp
+- src/m/shared/Verb*.m
+all these files are automatically synchronized with Verbosity.h
+
+TO ADD A VERBOSITY LEVEL:
+add the corresponding line to Verbosity.h
+and execute synchronizing script.
Index: /issm/trunk/src/c/shared/Numerics/Synchronize.sh
===================================================================
--- /issm/trunk/src/c/shared/Numerics/Synchronize.sh	(revision 6309)
+++ /issm/trunk/src/c/shared/Numerics/Synchronize.sh	(revision 6310)
@@ -7,5 +7,34 @@
 
 #Get all lines of Verbosity.cpp
-cat Verbosity.cpp | grep "bool" | grep "GetVerbosityLevel()" | awk '{ printf "%s %s\n", NR, $0 }' > temp
+cat Verbosity.h |  grep "bool Verb" | awk '{print $2}' | sed -e "s/(/ /" | awk '{print $1}' | awk '{ printf "%s %s\n", NR, $0 }' >temp
+#Build header of Verbosity.cpp {{{1
+cat <<END > Verbosity.cpp
+/*
+* \file Verbosity.cpp:
+* \brief: Manage verbosity levels
+*
+*   WARNING: DO NOT MODIFY THIS FILE
+*            this file has been automatically generated by Synchronize.sh
+*            Please read README for more information
+*/
+
+/*include*/
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+   #include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+#include "./Verbosity.h"
+#include "../../include/macros.h"
+#include "../Exceptions/exceptions.h"
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+/*}}}*/
+
+/*Verbosityt levels*/
+END
+#}}}
 
 #get number of lines in temp
@@ -16,6 +45,10 @@
 
 	#Get name of the line i
-	FILENAME=$(cat temp | grep "^[ ]*$i " | awk '{printf("%s",$3);}');
-	ENUM=$(cat temp | grep "^[ ]*$i " | awk '{printf("%s",$7);}');
+	FILENAME=$(cat temp | grep "^[ ]*$i " | awk '{printf("%s",$2);}');
+
+	let POWER=$i-1
+	let BINARY=2**$POWER
+
+	echo "$FILENAME -> 2^$POWER = $BINARY"
 
 	#Add Verbosity Matlab file{{{
@@ -31,9 +64,61 @@
 %      bool=$FILENAME()
 
-bool=logical(bitand(GetVerbosityLevel(),$ENUM));
+bool=logical(bitand(GetVerbosityLevel(),$BINARY));
+END
+	#}}}
+	#Add case to Verbosity.cpp {{{
+	cat <<END >> Verbosity.cpp
+bool $FILENAME(void){return (GetVerbosityLevel() & $BINARY);} /* 2^$POWER*/
+END
+	#}}}
+
+done
+
+#Add footer of Verbosity.cpp{{{1
+cat <<END >> Verbosity.cpp
+
+/*Verbosity Setup*/
+static int verbositylevel=-1;
+/*FUNCTION SetVerbosityLevel {{{*/
+void SetVerbosityLevel(int level){
+
+	if(level<0) ISSMERROR("vebosity level should be a positive integer (user provided %i)",level);
+
+#ifdef _SERIAL_
+
+	mxArray* output=NULL;
+	mxArray* input=NULL;
+	input=mxCreateDoubleScalar((double)level);
+
+	mexCallMATLAB(0,&output,1,&input,"SetVerbosityLevel");
+#else
+
+	verbositylevel = level;
+
+#endif
+}/*}}}*/
+/*FUNCTION GetVerbosityLevel {{{*/
+int  GetVerbosityLevel(void){
+#ifdef _SERIAL_
+
+	mxArray* output=NULL;
+	mxArray* input=NULL;
+	double   level;
+
+	mexCallMATLAB(1,&output,0,&input,"GetVerbosityLevel");
+	level=mxGetScalar(output);
+
+	verbositylevel = (int)level;
+
+#else
+
+	ISSMASSERT(verbositylevel>=0);
+	return verbositylevel;
+
+#endif
+}/*}}}*/
 END
 #}}}
 
-done
 #clean up{{{
 rm temp
Index: /issm/trunk/src/c/shared/Numerics/Verbosity.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/Verbosity.cpp	(revision 6309)
+++ /issm/trunk/src/c/shared/Numerics/Verbosity.cpp	(revision 6310)
@@ -1,5 +1,13 @@
+/*
+* \file Verbosity.cpp:
+* \brief: Manage verbosity levels
+*
+*   WARNING: DO NOT MODIFY THIS FILE
+*            this file has been automatically generated by Synchronize.sh
+*            Please read README for more information
+*/
 
 /*include*/
-/*{{{1*/
+/*{{{*/
 #ifdef HAVE_CONFIG_H
    #include "config.h"
@@ -16,12 +24,12 @@
 
 /*Verbosityt levels*/
-bool VerbModule   (void){return (GetVerbosityLevel() & 1 );}/* 2^0 -> 000000001*/
-bool VerbConverge (void){return (GetVerbosityLevel() & 2 );}/* 2^1 -> 000000010*/
-bool VerbModProc  (void){return (GetVerbosityLevel() & 4 );}/* 2^2 -> 000000100*/
-bool VerbSolver   (void){return (GetVerbosityLevel() & 8 );}/* 2^3 -> 000001000*/
+bool VerbModule(void){return (GetVerbosityLevel() & 1);} /* 2^0*/
+bool VerbConverge(void){return (GetVerbosityLevel() & 2);} /* 2^1*/
+bool VerbModProc(void){return (GetVerbosityLevel() & 4);} /* 2^2*/
+bool VerbSolver(void){return (GetVerbosityLevel() & 8);} /* 2^3*/
 
 /*Verbosity Setup*/
 static int verbositylevel=-1;
-/*FUNCTION SetVerbosityLevel {{{1*/
+/*FUNCTION SetVerbosityLevel {{{*/
 void SetVerbosityLevel(int level){
 
@@ -40,9 +48,7 @@
 
 #endif
-
 }/*}}}*/
-/*FUNCTION GetVerbosityLevel {{{1*/
+/*FUNCTION GetVerbosityLevel {{{*/
 int  GetVerbosityLevel(void){
-
 #ifdef _SERIAL_
 
Index: /issm/trunk/src/c/shared/Numerics/Verbosity.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/Verbosity.h	(revision 6309)
+++ /issm/trunk/src/c/shared/Numerics/Verbosity.h	(revision 6310)
@@ -1,4 +1,4 @@
-/*!\file:  isnan.h
- * \brief: only used for intel compiler.
+/*!\file:Verbosity.h
+ * \brief: Deal with verbosity levels
  */ 
 
@@ -6,7 +6,5 @@
 #define _VERBOSITY_H_
 
-void SetVerbosityLevel(int level);
-int  GetVerbosityLevel(void);
-
+/*List of Verbosity levels (Add your own and Synchronize)*/
 bool VerbModule(void);
 bool VerbConverge(void);
@@ -14,3 +12,7 @@
 bool VerbSolver(void);
 
+/*Setup Verbosity level*/
+void SetVerbosityLevel(int level);
+int  GetVerbosityLevel(void);
+
 #endif
