 		CUDA_CHECK_RETURN( cudaMemcpy(oGRID, dev_oGRID, iMap_bytes, cudaMemcpyDeviceToHost) );
 		end_t = clock();
 		break;
+	case 3: // MEAN
+		CUDA_CHECK_RETURN( cudaMemset(dev_oGRID, 0.0,  (size_t)iMap_bytes) );
+		start_t = clock();
+		reduction_3d_mean<<<grid,block>>>( dev_iGRIDi, map_len, Nmaps, dev_oGRID );
+		CUDA_CHECK_RETURN( cudaMemcpy(oGRID, dev_oGRID, iMap_bytes, cudaMemcpyDeviceToHost) );
+		end_t = clock();
+		break;
 	}
 	// elapsed time [ms]:
 	elapsed_time += (int)( (double)(end_t  - start_t ) / (double)CLOCKS_PER_SEC * 1000 );
 
+	/*
+	 * 		****2-D aggregation****
+	 */
 	// call 2d reduction to computing mean & std for scatterplot:
 	dim3 block_2d( BLOCKSIZE*BLOCKSIZE,1,1);
 	dim3 grid_2d ( Nmaps,1,1);

	// memset:
	CUDA_CHECK_RETURN( cudaMemset(dev_oPLOT, 0,  (size_t)oPLOT_bytes) 		);

	// kernel size:
	unsigned int 	BLOCKSIZE, GRIDSIZE;
	BLOCKSIZE	= 32;//floor(sqrt( devProp.maxThreadsPerBlock ));

//	dimension of problem:		/*	  0    		 1				*/
unsigned int		multiGPU=0;	/*	{ singleGPU, multiGPU } 	*/

//	STAT:						/*	  0    1    2    3     4		*/
unsigned int		STAT	= 0;/*	{ sum, min, max, mean, std }*/
//	input:
unsigned int		Nmaps	= 21;
// 	---SMALL---
const char			*iDIR 	= "/home/giuliano/work/Projects/LIFE_Project/run_clime_daily/run#2/maps/";
const char			*clPAR	= "rain_cum_h24";
// 	---LARGE---
//const char			*iDIR 	= "/home/giuliano/git/cuda/weatherprog-cudac/data/";
//const char			*clPAR	= "L5_temp_min_h24";
//const char			*clPAR	= "L1_temp_min_h24";
const char			*YEAR	= "2011";
const char			*MONTH	= "01";
const char			*SPATMOD= "idw2";
const char			*RES	= "80";
const char			*EXT	= ".tif";
//	output:
