Index: /issm/trunk-jpl/src/m/qmu/preqmu.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/preqmu.m	(revision 25222)
+++ /issm/trunk-jpl/src/m/qmu/preqmu.m	(revision 25223)
@@ -98,8 +98,12 @@
 	field_name=variable_fieldnames{i};
 	fieldvariable=md.qmu.variables(ivar).(field_name);
-	if fieldvariable.isscaled();
+	if fieldvariable.isscaled() | fieldvariable.isdistributed();
 		variablepartitions{end+1}=fieldvariable.partition;
 		variablepartitions_npart(end+1)=qmupart2npart(fieldvariable.partition);
-		variablepartitions_nt(end+1)=fieldvariable.nsteps;
+		if isfield(fieldvariable,'nsteps'),
+			variablepartitions_nt(end+1)=fieldvariable.nsteps;
+		else
+			variablepartitions_nt(end+1)=1;
+		end
 	else
 		variablepartitions{end+1}=[];
Index: /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 25222)
+++ /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 25223)
@@ -72,4 +72,58 @@
 	end
 
+elseif strncmp(descriptor,'distributed_',12),
+
+	%we have a distributed variable, expand it over the partition. First recover the partition: 
+	partition=variables.partition;
+	%figure out number of partitions: 
+	npart=qmupart2npart(partition);
+
+	if isa(variables,'uniform_uncertain'),
+		nlower=size(variables.lower,1);
+		nupper=size(variables.upper,1);
+		if (nlower ~= npart || nupper ~=npart),
+			error('QmuSetupVariables error message: upper and lower fields should have the same number of rows as the number of partitions');
+		end
+	elseif isa(variables,'normal_uncertain'),
+		nstddev=size(variables.stddev,1);
+		nmean=size(variables.mean,1);
+		if (nstddev ~= npart || nmean ~=npart),
+			error('QmuSetupVariables error message: stddev and mean fields should have the same number of rows as the number of partitions');
+		end
+	elseif isa(variables,'histogram_bin_uncertain'),
+		ncounts=length(variables.counts);
+		npairs=length(variables.pairs_per_variable);
+		nabs=length(variables.abscissas);
+		if (ncounts ~= npart),
+			error(sprintf('QmuSetupVariables error message: counts size (%i) should be equal to the number of partitions (%i)',ncounts,npart));
+		end
+		if (npairs ~= npart),
+			error(sprintf('QmuSetupVariables error message: pairs_per_variable size (%i) should be equal to the number of partitions (%i)',npairs,npart));
+		end
+		if (nabs ~= npart),
+			error(sprintf('QmuSetupVariables error message: abscissas size (%i) should be equal to the number of partitions (%i)',nabs,npart));
+		end
+	end
+
+	%ok, dealing with distributed variable. Distribute according to how many 
+	%partitions we want.
+	for j=1:npart,
+		dvar(end+1)           =variables;
+		dvar(end).descriptor=sprintf('%s_%d',variables.descriptor,j);
+		if isa(variables,'uniform_uncertain'),
+			dvar(end  ).lower=variables.lower(j);
+			dvar(end  ).upper=variables.upper(j);
+			dvar(end  ).partition=[];
+		elseif isa(variables,'normal_uncertain'),
+			dvar(end  ).stddev=variables.stddev(j);
+			dvar(end  ).mean=variables.mean(j);
+			dvar(end  ).partition=[];
+		elseif isa(variables,'histogram_bin_uncertain'),
+			dvar(end).pairs_per_variable=variables.pairs_per_variable(j);
+			dvar(end).abscissas=variables.abscissas{j};
+			dvar(end).counts=variables.counts{j};
+			dvar(end).partition=[];
+		end
+	end
 else
 	dvar(end+1)=variables;
