Index: /issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 20636)
+++ /issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 20637)
@@ -24,5 +24,5 @@
 		if(world_rank!=0){
 			femmodel_init= new FemModel(argc,argv,evaluation_comm);
-			femmodel_init->profiler->Tag(StartCore);
+			femmodel_init->profiler->Tag(STARTCORE);
 		}
 
@@ -37,5 +37,5 @@
 
 			/*Wrap up: */
-			femmodel_init->profiler->Tag(FinishCore);
+			femmodel_init->profiler->Tag(FINISHCORE);
 			femmodel_init->CleanUp(); //only close file pointers on rank 0 of slave 1!
 
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 20636)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 20637)
@@ -68,5 +68,5 @@
 	/*Start profiler: */
 	this->profiler=new Profiler();
-	profiler->Tag(Start);
+	profiler->Tag(START);
 
 	/*From command line arguments, retrieve different filenames needed to create the FemModel: */
@@ -74,7 +74,7 @@
 
 	/*Create femmodel from input files: */
-	profiler->Tag(StartInit);
+	profiler->Tag(STARTINIT);
 	this->InitFromFiles(rootpath,binfilename,outbinfilename,petscfilename,lockfilename,restartfilename, solution_type,trace,NULL);
-	profiler->Tag(FinishInit);
+	profiler->Tag(FINISHINIT);
 
 	/*Save communicator in the parameters dataset: */
@@ -249,13 +249,13 @@
 
 	/*Before we delete the profiler, report statistics for this run: */
-	profiler->Tag(Finish);  //final tagging
+	profiler->Tag(FINISH);  //final tagging
 	_printf0_("\n");
-	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(StartInit,FinishInit) << "\n");
-	_printf0_("   "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(StartCore,FinishCore) << "\n");
+	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(STARTINIT,FINISHINIT) << "\n");
+	_printf0_("   "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(STARTCORE,FINISHCORE) << "\n");
 	_printf0_("\n");
 	_printf0_("   Total elapsed time: "
-				<<profiler->DeltaTimeModHour(Start,Finish)<<" hrs "
-				<<profiler->DeltaTimeModMin(Start,Finish)<<" min "
-				<<profiler->DeltaTimeModSec(Start,Finish)<<" sec"
+				<<profiler->DeltaTimeModHour(START,FINISH)<<" hrs "
+				<<profiler->DeltaTimeModMin(START,FINISH)<<" min "
+				<<profiler->DeltaTimeModSec(START,FINISH)<<" sec"
 				);
 	_printf0_("\n");
@@ -332,12 +332,12 @@
 
 	/*run solution core: */
-	profiler->Tag(StartCore);   
+	profiler->Tag(STARTCORE);   
 	solutioncore(this); 
-	profiler->Tag(FinishCore);
+	profiler->Tag(FINISHCORE);
 
 	/*run AD core if needed: */
-	profiler->Tag(StartAdCore); 
+	profiler->Tag(STARTADCORE); 
 	ad_core(this);      
-	profiler->Tag(FinishAdCore);
+	profiler->Tag(FINISHADCORE);
 
 	/*some profiling results for the core: */
@@ -345,7 +345,7 @@
 	if(profiling){
 
-		solution_time=profiler->DeltaTime(StartCore,FinishCore);
-		solution_flops=profiler->DeltaFlops(StartCore,FinishCore);
-		solution_memory=profiler->Memory(FinishCore);
+		solution_time=profiler->DeltaTime(STARTCORE,FINISHCORE);
+		solution_flops=profiler->DeltaFlops(STARTCORE,FINISHCORE);
+		solution_memory=profiler->Memory(FINISHCORE);
 
 		_printf0_("Core solution elapsed time    : " << solution_time   << " Seconds\n");
@@ -359,7 +359,7 @@
 
 		#ifdef _HAVE_ADOLC_
-		solution_time=profiler->DeltaTime(StartAdCore,FinishAdCore);
-		solution_flops=profiler->DeltaFlops(StartAdCore,FinishAdCore);
-		solution_memory=profiler->Memory(FinishAdCore);
+		solution_time=profiler->DeltaTime(STARTADCORE,FINISHADCORE);
+		solution_flops=profiler->DeltaFlops(STARTADCORE,FINISHADCORE);
+		solution_memory=profiler->Memory(FINISHADCORE);
 
 		_printf0_("AD Solution elapsed time    : " << solution_time   << " Seconds\n");
@@ -2591,5 +2591,5 @@
 	/*Start profiler: */
 	this->profiler=new Profiler();
-	profiler->Tag(Start);
+	profiler->Tag(START);
 
 	/*From command line arguments, retrieve different filenames needed to create the FemModel: */
@@ -2597,7 +2597,7 @@
 	
 	/*Create femmodel from input files: */
-	profiler->Tag(StartInit);
+	profiler->Tag(STARTINIT);
 	this->InitFromBuffers((char*)buffer,buffersize,toolkits, solution_type,trace,NULL);
-	profiler->Tag(FinishInit);
+	profiler->Tag(FINISHINIT);
 	
 	/*Save communicator in the parameters dataset: */
@@ -2687,13 +2687,13 @@
 	
 	/*Before we delete the profiler, report statistics for this run: */
-	profiler->Tag(Finish);  //final tagging
+	profiler->Tag(FINISH);  //final tagging
 	_printf0_("\n");
-	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(StartInit,FinishInit) << "\n");
-	_printf0_("   "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(StartCore,FinishCore) << "\n");
+	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(STARTINIT,FINISHINIT) << "\n");
+	_printf0_("   "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(STARTCORE,FINISHCORE) << "\n");
 	_printf0_("\n");
 	_printf0_("   Total elapsed time: "
-				<<profiler->DeltaTimeModHour(Start,Finish)<<" hrs "
-				<<profiler->DeltaTimeModMin(Start,Finish)<<" min "
-				<<profiler->DeltaTimeModSec(Start,Finish)<<" sec"
+				<<profiler->DeltaTimeModHour(START,FINISH)<<" hrs "
+				<<profiler->DeltaTimeModMin(START,FINISH)<<" min "
+				<<profiler->DeltaTimeModSec(START,FINISH)<<" sec"
 				);
 	_printf0_("\n");
Index: /issm/trunk-jpl/src/c/classes/Profiler.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Profiler.cpp	(revision 20636)
+++ /issm/trunk-jpl/src/c/classes/Profiler.cpp	(revision 20637)
@@ -11,5 +11,4 @@
 
 #include "./Profiler.h"
-#include "./Params/Parameters.h"
 #include "./Params/DoubleParam.h"
 #include "../toolkits/toolkits.h"
@@ -18,26 +17,22 @@
 /*Profiler constructors and destructors:*/
 Profiler::Profiler(){/*{{{*/
-		 this->time=new Parameters();
-		 this->flops=new Parameters();
-		 this->memory=new Parameters();
-}
-/*}}}*/
+	for(int i=0;i<MAXIMUMSIZE;i++){
+		this->time[i]  =NAN;
+		this->flops[i] =NAN;
+		this->memory[i]=NAN;
+	}
+} /*}}}*/
 Profiler::~Profiler(){/*{{{*/
-	delete time;
-	delete flops;
-	delete memory;
-}
-/*}}}*/
+	/*Nothing to delete, everything is statically allocated*/
+} /*}}}*/
 Object* Profiler::copy(){/*{{{*/
 	/*First do simple copy: */
 	Profiler* output=new Profiler();
-	delete output->time;
-	delete output->flops;
-	delete output->memory;
 
-	/*Now for deep copy: */
-	output->time=(Parameters*)this->time->Copy();
-	output->flops=(Parameters*)this->flops->Copy();
-	output->memory=(Parameters*)this->memory->Copy();
+	for(int i=0;i<MAXIMUMSIZE;i++){
+		output->time[i]  =this->time[i];
+		output->flops[i] =this->flops[i];
+		output->memory[i]=this->memory[i];
+	}
 
 	return (Object*)output;
@@ -50,5 +45,5 @@
 	_printf_("Profiler:\n");
 	_printf_("   time tags: \n");
-	this->time->Echo();
+	_error_("not implemented yet");
 
 }
@@ -56,7 +51,5 @@
 void Profiler::DeepEcho(void){/*{{{*/
 
-	_printf_("Profiler:\n");
-	_printf_("   time tags: \n");
-	this->time->DeepEcho();
+	this->Echo();
 
 }
@@ -72,12 +65,15 @@
 void Profiler::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
 
+	IssmDouble* pointer = NULL;
+
 	MARSHALLING_ENUM(ProfilerEnum);
+	pointer = &this->time[0];
+	MARSHALLING_DYNAMIC(pointer,IssmDouble,MAXIMUMSIZE);
+	pointer = &this->flops[0];
+	MARSHALLING_DYNAMIC(pointer,IssmDouble,MAXIMUMSIZE);
+	pointer = &this->memory[0];
+	MARSHALLING_DYNAMIC(pointer,IssmDouble,MAXIMUMSIZE);
 
-	time->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	flops->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	memory->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-
-}
-/*}}}*/
+} /*}}}*/
 
 /*Profiler routines:*/
@@ -110,7 +106,12 @@
 
 	/*Plug into this->time: */
-	this->time->AddObject(new DoubleParam(tagenum,t));
-	this->flops->AddObject(new DoubleParam(tagenum,f));
-	this->memory->AddObject(new DoubleParam(tagenum,m));
+	_assert_(tagenum>=0); 
+	_assert_(tagenum<MAXIMUMSIZE); 
+	if(!xIsNan<IssmDouble>(this->time[tagenum])) _error_("Tag already exists");
+	this->time[tagenum]  = t;
+	if(!xIsNan<IssmDouble>(this->flops[tagenum])) _error_("Tag already exists");
+	this->flops[tagenum] = f;
+	if(!xIsNan<IssmDouble>(this->memory[tagenum])) _error_("Tag already exists");
+	this->memory[tagenum]= m;
 
 }
@@ -118,7 +119,15 @@
 IssmDouble  Profiler::DeltaTime(int inittag, int finaltag){/*{{{*/
 
-	IssmDouble init, final;
-	this->time->FindParam(&init,inittag);
-	this->time->FindParam(&final,finaltag);
+	/*Get initial time*/
+	_assert_(inittag>=0); 
+	_assert_(inittag<MAXIMUMSIZE); 
+	if(xIsNan<IssmDouble>(this->time[inittag])) _error_("Tag not set");
+	IssmDouble init = this->time[inittag];
+
+	/*Get final time*/
+	_assert_(finaltag>=0); 
+	_assert_(finaltag<MAXIMUMSIZE); 
+	if(xIsNan<IssmDouble>(this->time[finaltag])) _error_("Tag not set");
+	IssmDouble final = this->time[finaltag];
 
 	#ifdef _HAVE_MPI_
@@ -131,7 +140,15 @@
 IssmDouble  Profiler::DeltaFlops(int inittag, int finaltag){/*{{{*/
 
-	IssmDouble init, final;
-	this->flops->FindParam(&init,inittag);
-	this->flops->FindParam(&final,finaltag);
+	/*Get initial flops*/
+	_assert_(inittag>=0); 
+	_assert_(inittag<MAXIMUMSIZE); 
+	if(xIsNan<IssmDouble>(this->flops[inittag])) _error_("Tag not set");
+	IssmDouble init = this->flops[inittag];
+
+	/*Get final flops*/
+	_assert_(finaltag>=0); 
+	_assert_(finaltag<MAXIMUMSIZE); 
+	if(xIsNan<IssmDouble>(this->flops[finaltag])) _error_("Tag not set");
+	IssmDouble final = this->flops[finaltag];
 
 	return final-init;
@@ -140,13 +157,6 @@
 int Profiler::DeltaTimeModHour(int inittag, int finishtag){/*{{{*/
 
-	IssmDouble init, finish;
-	this->time->FindParam(&init,inittag);
-	this->time->FindParam(&finish,finishtag);
-
-	#ifdef _HAVE_MPI_
-	return int((reCast<int,IssmDouble>(finish-init))/3600);
-	#else
-	return int((reCast<int,IssmDouble>(finish-init))/CLOCKS_PER_SEC/3600);
-	#endif
+	IssmDouble delta = this->DeltaTime(inittag,finishtag);
+	return int((reCast<int,IssmDouble>(delta))/3600);
 
 }
@@ -154,34 +164,21 @@
 int Profiler::DeltaTimeModMin(int inittag, int finishtag){/*{{{*/
 
-	IssmDouble init, finish;
-	this->time->FindParam(&init,inittag);
-	this->time->FindParam(&finish,finishtag);
-
-	#ifdef _HAVE_MPI_
-	return int(int(reCast<int,IssmDouble>(finish-init))%3600/60);
-	#else
-	return int(int(reCast<int,IssmDouble>(finish-init))/CLOCKS_PER_SEC%3600/60);
-	#endif
+	IssmDouble delta = this->DeltaTime(inittag,finishtag);
+	return int(int(reCast<int,IssmDouble>(delta))%3600/60);
 }
 /*}}}*/
 int Profiler::DeltaTimeModSec(int inittag, int finishtag){/*{{{*/
 
-	IssmDouble init, finish;
-	this->time->FindParam(&init,inittag);
-	this->time->FindParam(&finish,finishtag);
-
-	#ifdef _HAVE_MPI_
-	return int(reCast<int,IssmDouble>(finish-init))%60;
-	#else
-	return int(reCast<int,IssmDouble>(finish-init))/CLOCKS_PER_SEC%60;
-	#endif
+	IssmDouble delta = this->DeltaTime(inittag,finishtag);
+	return int(reCast<int,IssmDouble>(delta)%60);
 }
 /*}}}*/
 IssmDouble  Profiler::Memory(int tag){/*{{{*/
 
-	IssmDouble m;
-	this->memory->FindParam(&m,tag);
-
-	return m;
+	/*Get initial flops*/
+	_assert_(tag>=0); 
+	_assert_(tag<MAXIMUMSIZE); 
+	if(xIsNan<IssmDouble>(this->flops[tag])) _error_("Tag not set");
+	return this->memory[tag];
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Profiler.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Profiler.h	(revision 20636)
+++ /issm/trunk-jpl/src/c/classes/Profiler.h	(revision 20637)
@@ -12,24 +12,22 @@
 /*}}}*/
 
-class DataSet;
-class Parameters;
+class DoubleParam;
 
-enum ProfilerEnums {
-	Start=ParametersSTARTEnum+1,//FIXME
-	StartInit,
-	FinishInit,
-	StartCore,
-	FinishCore,
-	StartAdCore,
-	FinishAdCore,
-	Finish
-};
+#define START 0
+#define STARTINIT 1
+#define FINISHINIT 2
+#define STARTCORE 3
+#define FINISHCORE 4
+#define STARTADCORE 5
+#define FINISHADCORE 6
+#define FINISH 7
+#define MAXIMUMSIZE 8 
 
 class Profiler: public Object{
 
 	public: 
-		Parameters*  time;
-		Parameters*  flops;
-		Parameters*  memory;
+		IssmDouble time[MAXIMUMSIZE];
+		IssmDouble flops[MAXIMUMSIZE];
+		IssmDouble memory[MAXIMUMSIZE];
 
 		/*Profiler constructors, destructors {{{*/
