Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h (revision 12506) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/include/macros.h (revision 12507) @@ -49,12 +49,12 @@ /* _printLine_ {{{*/ /* macro to print a line, adds std::endl */ #define _printLine_(StreamArgs)\ - {std::cout << StreamArgs << std::endl;} + do{std::cout << StreamArgs << std::endl;}while(0) /*}}}*/ /* _printString_ {{{*/ /* macro to print some string, adds std::ends */ #define _printString_(StreamArgs)\ - {std::cout << StreamArgs;} + do{std::cout << StreamArgs;}while(0) /*}}}*/ /* _assert_ {{{*/ /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/ Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp (revision 12506) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp (revision 12507) @@ -14,6 +14,7 @@ #include "../../io/io.h" #include "../../shared/shared.h" #include +#include void BrentSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs* optargs){ Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h (revision 12506) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h (revision 12507) @@ -29,31 +29,30 @@ #endif inline void printarray(IssmDouble* array,int lines,int cols=1){ - printf("\n"); + _printLine_(""); for(int i=0;i0) { if (n&i) - printf("1"); + _printString_("1"); else - printf("0"); + _printString_("0"); i>>=1; } } Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp (revision 12506) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp (revision 12507) @@ -16,19 +16,19 @@ int interpolation_type; bool debug; int nels_data; - double* index_data=NULL; - double* x_data=NULL; - double* y_data=NULL; - double* data=NULL; - double xmin,xmax; - double ymin,ymax; - int nods_prime; - Vector* data_prime=NULL; - double* x_prime=NULL; - double* y_prime=NULL; - double* default_values=NULL; + double *index_data = NULL; + double *x_data = NULL; + double *y_data = NULL; + double *data = NULL; + double xmin ,xmax; + double ymin ,ymax; + int nods_prime; + Vector *data_prime = NULL; + double *x_prime = NULL; + double *y_prime = NULL; + double *default_values = NULL; int num_default_values; - double* incontour=NULL; + double *incontour = NULL; /*intermediary: */ int i0; @@ -45,35 +45,34 @@ num_threads=handle->num; /*recover parameters :*/ - interpolation_type=gate->interpolation_type; - debug=gate->debug; - nels_data=gate->nels_data; - index_data=gate->index_data; - x_data=gate->x_data; - y_data=gate->y_data; - data=gate->data; - xmin=gate->xmin; - xmax=gate->xmax; - ymin=gate->ymin; - ymax=gate->ymax; - nods_prime=gate->nods_prime; - data_prime=gate->data_prime; - x_prime=gate->x_prime; - y_prime=gate->y_prime; - default_values=gate->default_values; - num_default_values=gate->num_default_values; - incontour=gate->incontour; + interpolation_type = gate->interpolation_type; + debug = gate->debug; + nels_data = gate->nels_data; + index_data = gate->index_data; + x_data = gate->x_data; + y_data = gate->y_data; + data = gate->data; + xmin = gate->xmin; + xmax = gate->xmax; + ymin = gate->ymin; + ymax = gate->ymax; + nods_prime = gate->nods_prime; + data_prime = gate->data_prime; + x_prime = gate->x_prime; + y_prime = gate->y_prime; + default_values = gate->default_values; + num_default_values = gate->num_default_values; + incontour = gate->incontour; /*partition loop across threads: */ PartitionRange(&i0,&i1,nels_data,num_threads,my_thread); /*Loop over the elements*/ - if (debug && my_thread==0) printf(" interpolation progress: %5.2lf %%",0.0); - for (i=i0;i(gate.percent); } else if(strcmp(output,"idw")==0){ //Inverse distance weighting @@ -114,7 +114,7 @@ /*launch the thread manager with Krigingxt as a core: */ LaunchThread(idwt,(void*)&gate,num); - printf("\r interpolation progress: 100.00%%\n"); + _printLine_("\r interpolation progress: "<(gate.percent); } else if(strcmp(output,"prediction")==0){ @@ -134,7 +134,7 @@ /*launch the thread manager with Krigingxt as a core: */ LaunchThread(Krigingxt,(void*)&gate,num); - printf("\r interpolation progress: 100.00%%\n"); + _printLine_("\r interpolation progress: "<(gate.percent); } else{ @@ -189,7 +189,7 @@ percent[my_thread]=double(idx-i0)/double(i1-i0)*100.; localpercent=percent[0]; for(int i=1;iInterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram); @@ -238,7 +238,7 @@ percent[my_thread]=double(idx-i0)/double(i1-i0)*100.; localpercent=percent[0]; for(i=1;iInterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius); } @@ -286,7 +286,7 @@ percent[my_thread]=double(idx-i0)/double(i1-i0)*100.; localpercent=percent[0]; for(int i=1;iInterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power); } Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp (revision 12506) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp (revision 12507) @@ -57,11 +57,11 @@ for (i=0;iSetValue(i,default_value,INS_VAL); /*Loop over the elements*/ - if (debug) printf(" interpolation progress: %5.2lf %%",0.0); for (i=0;ix; double *y = gate->y; int nods = gate->nods; - Vector* data_mesh = gate->data_mesh; + Vector *data_mesh = gate->data_mesh; double *data = gate->data; double default_value = gate->default_value; int interpenum = gate->interp; int M = gate->M; int N = gate->N; + bool debug = M*N>1? true:false; + debug = true; + /*partition loop across threads: */ PartitionRange(&i0,&i1,nods,num_threads,my_thread); for (i=i0;i(already); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp (revision 12506) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp (revision 12507) @@ -376,45 +376,45 @@ void ElementMatrix::Echo(void){ int i,j; - printf("Element Matrix echo: \n"); - printf(" nrows: %i\n",nrows); - printf(" ncols: %i\n",ncols); - printf(" dofsymmetrical: %s\n",dofsymmetrical?"true":"false"); + _printLine_("Element Matrix echo:"); + _printLine_(" nrows: " << nrows); + _printLine_(" ncols: " << nrows); + _printLine_(" dofsymmetrical: " << (dofsymmetrical?"true":"false")); - printf(" values: \n"); + _printLine_(" values:"); for(i=0;itime); printf(" matrix size: %i-%i\n",this->M,this->N); for (i=0;iM;i++){ - printf(" [ "); + _printString_(" [ "); for (j=0;jN;j++){ - printf(" %12.6g ",this->values[i*this->N+j]); + _printString_( " " << setw(11) << setprecision (5) << this->values[i*this->N+j]); } - printf(" ]\n"); + _printLine_(" ]"); } - printf("\n"); } /*}}}*/ Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp (revision 12506) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Bamg/Mesh.cpp (revision 12507) @@ -2404,14 +2404,14 @@ printf(" nbq = %i\n",nbq); printf(" index:\n"); for (i=0;i