Index: /issm/trunk/src/mex/Reduceload/Reduceload.cpp
===================================================================
--- /issm/trunk/src/mex/Reduceload/Reduceload.cpp	(revision 6011)
+++ /issm/trunk/src/mex/Reduceload/Reduceload.cpp	(revision 6012)
@@ -11,4 +11,5 @@
 	Mat         Kfs        = NULL;
 	Vec         ys         = NULL;
+	Parameters *parameters = NULL;
 	bool        flag_ys0=false;
 
@@ -17,5 +18,5 @@
 
 	/*checks on arguments on the matlab side: */
-	if((nlhs!=NLHS) || (nrhs!=3 && nrhs!=4)){
+	if((nlhs!=NLHS) || (nrhs!=4 && nrhs!=5)){
 		ReduceloadUsage();
 		ISSMERROR(" usage. See above");
@@ -26,9 +27,14 @@
 	FetchData(&Kfs,KFS);
 	FetchData(&ys,YS);
-	if(nrhs==4)FetchData(&flag_ys0,YSFLAG);
-	else flag_ys0=false;
+	FetchParams(&parameters,PARAMETERS);
 
 	/*!Reduce load from g to f size: */
-	Reduceloadx(pf, Kfs, ys, flag_ys0);
+	if(nrhs==5){
+		FetchData(&flag_ys0,YSFLAG);
+		Reduceloadx(pf, Kfs, ys,parameters,flag_ys0);
+	}
+	else{
+		Reduceloadx(pf, Kfs, ys,parameters);
+	}
 
 	/*write output datasets: */
@@ -39,6 +45,6 @@
 	MatFree(&Kfs);
 	VecFree(&ys);
+	delete parameters;
 
-	/*end module: */
 	MODULEEND();
 }
@@ -47,6 +53,6 @@
 {
 	_printf_("\n");
-	_printf_("   usage: [pf] = %s(pf,Kfs,ys);\n",__FUNCT__);
-	_printf_("          [pf] = %s(pf,Kfs,ys,ys0_flag);\n",__FUNCT__);
+	_printf_("   usage: [pf] = %s(pf,Kfs,ys,parameters);\n",__FUNCT__);
+	_printf_("          [pf] = %s(pf,Kfs,ys,parameters,ys0_flag);\n",__FUNCT__);
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/Reduceload/Reduceload.h
===================================================================
--- /issm/trunk/src/mex/Reduceload/Reduceload.h	(revision 6011)
+++ /issm/trunk/src/mex/Reduceload/Reduceload.h	(revision 6012)
@@ -1,7 +1,5 @@
-
 /*
 	Reduceload.h
 */
-
 
 #ifndef _REDUCELOAD_H
@@ -22,5 +20,6 @@
 #define KFS (mxArray*)prhs[1]
 #define YS (mxArray*)prhs[2]
-#define YSFLAG (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[3]
+#define YSFLAG (mxArray*)prhs[4]
 
 /* serial output macros: */
@@ -31,5 +30,5 @@
 #define NLHS  1
 #undef NRHS
-#define NRHS  4
+#define NRHS  5
 
 #endif  /* _REDUCELOAD_H */
