Index: /issm/trunk-jpl/src/m/classes/qmu.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu.py	(revision 25021)
+++ /issm/trunk-jpl/src/m/classes/qmu.py	(revision 25022)
@@ -34,4 +34,5 @@
         self.responsepartitions = []
         self.responsepartitions_npart = []
+        self.responsepartitions_nt = []
         self.mass_flux_profile_directory = float('NaN')
         self.mass_flux_profiles = float('NaN')
@@ -114,4 +115,5 @@
         s += "%s\n" % fielddisplay(self, 'variablepartitions', '')
         s += "%s\n" % fielddisplay(self, 'variablepartitions_npart', '')
+        s += "%s\n" % fielddisplay(self, 'variablepartitions_nt', '')
         s += "%s\n" % fielddisplay(self, 'variabledescriptors', '')
         s += "%s\n" % fielddisplay(self, 'responsedescriptors', '')
@@ -174,4 +176,5 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'variablepartitions', 'format', 'MatArray')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'variablepartitions_npart', 'format', 'IntMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'variablepartitions_nt', 'format', 'IntMat', 'mattype', 3)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'responsedescriptors', 'format', 'StringArray')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'responsepartitions', 'format', 'MatArray')
Index: /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.m	(revision 25021)
+++ /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.m	(revision 25022)
@@ -39,14 +39,14 @@
 				npart=qmupart2npart(self.partition);
 				if npart~=size(self.mean,1),
-					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the row size of the mean field should be identifical to the number of partitions']);
+					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the row size of the mean field should be identical to the number of partitions']);
 				end
 				if npart~=size(self.stddev,1),
-					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the row size of the stddev field should be identifical to the number of partitions']);
+					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the row size of the stddev field should be identical to the number of partitions']);
 				end
 				if self.nsteps~=size(self.mean,2),
-					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the col size of the mean field should be identifical to the number of time steps']);
+					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the col size of the mean field should be identical to the number of time steps']);
 				end
-				if npart~=size(self.stddev,1),
-					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the col size of the stddev field should be identifical to the number of time steps']);
+				if self.nsteps~=size(self.stddev,2),
+					error(['normal_uncertain constructor: for the scaled variable ' self.descriptor ' the col size of the stddev field should be identical to the number of time steps']);
 				end
 
Index: /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py	(revision 25021)
+++ /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py	(revision 25022)
@@ -6,4 +6,5 @@
 from pairoptions import pairoptions
 from partition_npart import *
+from qmupart2npart import qmupart2npart
 
 
@@ -36,4 +37,5 @@
         self.stddev     = np.NaN
         self.partition  = []
+        self.nsteps     = 0
 
     @staticmethod
@@ -61,7 +63,7 @@
 
             #initialize fields:
-            nuv.descriptor = options.getfieldvalue('descriptor', '')
-            nuv.mean       = options.getfieldvalue('mean', np.NaN)
-            nuv.stddev     = options.getfieldvalue('stddev', np.NaN)
+            nuv.descriptor = options.getfieldvalue('descriptor')
+            nuv.mean       = options.getfieldvalue('mean')
+            nuv.stddev     = options.getfieldvalue('stddev')
 
             #if the variable is scaled, a partition vector should have been supplied, and
@@ -70,9 +72,14 @@
             if nuv.isscaled():
                 nuv.partition = options.getfieldvalue('partition')
-                npart = partition_npart(nuv.partition)
-                if npart != len(nuv.mean):
-                    error("normal_uncertain constructor: for the scaled variable %s the mean field is not currently a vector of values for all the partitions described in the partition vector" % nuv.descriptor)
-                if npart != len(nuv.stddev):
-                    error("normal_uncertain constructor: for the scaled variable %s the stddev field is not cureently a vector of values for all the partitions described in the partition vector" % nuv.descriptor)
+                nuv.nsteps = options.getfieldvalue('nsteps', 1)
+                npart = qmupart2npart(nuv.partition)
+                if npart != nuv.mean.shape[0]:
+                    raise RuntimeError("normal_uncertain constructor: for the scaled variable %s the row size of the mean field should be identical to the number of partitions" % nuv.descriptor)
+                if npart != nuv.stddev.shape[0]:
+                    raise RuntimeError("normal_uncertain constructor: for the scaled variable %s the row size of the stddev field should be identical to the number of partitions" % nuv.descriptor)
+                if nuv.nsteps != nuv.mean.shape[1]:
+                    raise RuntimeError("normal_uncertain constructor: for the scaled variable %s the col size of the mean field should be identical to the number of time steps" % nuv.descriptor)
+                if nuv.nsteps != nuv.stddev.shape[1]:
+                    raise RuntimeError("normal_uncertain constructor: for the scaled variable %s the col size of the stddev field should be identical to the number of time steps" % nuv.descriptor)
 
         return [nuv] # Always return a list, so we have something akin to a MATLAB single row matrix
@@ -86,4 +93,5 @@
         if self.partition != []:
             string = "%s\n%s" % (string, fielddisplay(self, 'partition', 'partition vector defining where sampling will occur'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'nsteps', 'number of time steps'))
 
         return string
@@ -102,21 +110,26 @@
         if self.isscaled():
             if self.partition == []:
-                error("normal_uncertain is a scaled variable, but it's missing a partition vector")
+                raise RuntimeError("normal_uncertain is a scaled variable, but it's missing a partition vector")
             #better have a partition vector that has as many partitions as stddev's size:
-            if len(self.stddev) != partition_npart(self.partititon):
-                error("normal_uncertain error message: stddev and partition should be vectors of identical size")
-            if len(self.mean) != partition_npart(self.partition):
-                error("normal_uncertain error message: mean and partition should be vectors of identical size")
+            if self.stddev.shape[0] != partition_npart(self.partititon):
+                raise RuntimeError("normal_uncertain error message: row size of stddev and partition size should be identical")
+            if self.mean.shape[0] != partition_npart(self.partition):
+                raise RuntimeError("normal_uncertain error message: row size of mean and partition size should be identical")
+            #we need as many steps in stddev and mean as there are in time steps
+            if self.stddev.shape[1] != self.nsteps:
+                raise RuntimeError("normal_uncertain error message: col size of stddev and partition size should be identical")
+            if self.mean.shape[1] != self.nsteps:
+                raise RuntimeError("normal_uncertain error message: col size of mean and partition size should be identical")
             md = checkfield(md, 'field', self.partition, 'fieldname', 'normal_uncertain.partition', 'NaN', 1, 'Inf', 1, '>=', -1, 'numel', [md.mesh.numberofvertices, md.mesh.numberofvertices])
             if self.partition.shape[1] > 1:
-                error("normal_uncertain error message: partition should be a column vector")
+                raise RuntimeError("normal_uncertain error message: partition should be a column vector")
             partcheck = np.unique(self.partition)
             partmin = min(partcheck)
             partmax = max(partcheck)
             if partmax < -1:
-                error("normal_uncertain error message: partition vector's min value should be -1 (for no partition), or start at 0")
+                raise RuntimeError("normal_uncertain error message: partition vector's min value should be -1 (for no partition), or start at 0")
             nmax = max(md.mesh.numberofelements, md.mesh.numberofvertices)
             if partmax > nmax:
-                error("normal_uncertain error message: partition vector's values cannot go over the number of vertices or elements")
+                raise RuntimeError("normal_uncertain error message: partition vector's values cannot go over the number of vertices or elements")
     #}}}
 
Index: /issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.py
===================================================================
--- /issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.py	(revision 25021)
+++ /issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.py	(revision 25022)
@@ -1,17 +1,20 @@
 import numpy as np
+
+from adjacency import adjacency
 import copy
-from adjacency import adjacency
 from project2d import project2d
+from qmupart2npart import qmupart2npart
 
 
-def AreaAverageOntoPartition(md, vector, layer=None):
-    '''AREAAVERAGEONTOPARTITION
-   compute partition values for a certain vector expressed on the vertices of the mesh.
-   Use area weighted average.
+def AreaAverageOntoPartition(md, vector, layer=None, partition):
+    '''
+    AREAAVERAGEONTOPARTITION - compute partition values for a certain vector expressed on the vertices of the mesh.
+    Use area weighted average.
 
-   Usage:
-      average = AreaAverageOntoPartition(md, vector)
-      average = AreaAverageOntoPartition(md, vector, layer)  #if in 3D, chose which layer is partitioned
-'''
+    Usage:
+        average = AreaAverageOntoPartition(md, vector)
+        average = AreaAverageOntoPartition(md, vector, layer) # If in 3D, chose which layer is partitioned
+    '''
+
     #some checks
     if(md.mesh.dimension() == 3):
@@ -35,13 +38,14 @@
     #finally, project vector:
         vector = project2d(md3d, vector, layer)
-        md.qmu.vpartition = project2d(md3d, md3d.qmu.vpartition, layer)
+        partition = project2d(md3d, partition, layer)
 
     #ok, first check that part is Matlab indexed
-    part = (md.qmu.vpartition).copy()
+    part = partition.copy()
     part = part.flatten() + 1
 
     #some check:
-    if md.qmu.numberofpartitions != max(part):
-        raise RuntimeError('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.vpartition)')
+    npart = qmupart2npart(partition)
+    if npart != max(part):
+        raise RuntimeError('AreaAverageOntoPartition error message: ''npart'' should be equal to max(partition)')
 
     #initialize output
Index: /issm/trunk-jpl/src/m/qmu/preqmu.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/preqmu.m	(revision 25021)
+++ /issm/trunk-jpl/src/m/qmu/preqmu.m	(revision 25022)
@@ -59,5 +59,5 @@
 			npart=partition_npart(fieldresponses(j).partition);
 			if str2int(fieldresponses(j).descriptor,'last')>npart,
-				error('preqmu error message: one of the expanded responses has more values than the number of partitions (setup in md.qmu.numberofpartitions)');
+				error('preqmu error message: one of the expanded responses has more values than the number of partitions');
 			end
 		end
@@ -91,8 +91,8 @@
 
 %build a MatArray of variable partitions: 
-variable_fieldnames=fieldnames(md.qmu.variables(ivar));
 variablepartitions={};
 variablepartitions_npart=[];
 variablepartitions_nt=[];
+variable_fieldnames=fieldnames(md.qmu.variables(ivar));
 for i=1:length(variable_fieldnames),
 	field_name=variable_fieldnames{i};
@@ -110,10 +110,10 @@
 
 %build a MatArray of response partitions: 
-response_fieldnames=fieldnames(md.qmu.responses(ivar));
 responsepartitions={};
 responsepartitions_npart=[];
+response_fieldnames=fieldnames(md.qmu.responses(iresp));
 for i=1:length(response_fieldnames),
 	field_name=response_fieldnames{i};
-	fieldresponse=md.qmu.responses(ivar).(field_name);
+	fieldresponse=md.qmu.responses(iresp).(field_name);
 	if fieldresponse.isscaled();
 		responsepartitions{end+1}=fieldresponse.partition;
Index: /issm/trunk-jpl/src/m/qmu/preqmu.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/preqmu.py	(revision 25021)
+++ /issm/trunk-jpl/src/m/qmu/preqmu.py	(revision 25022)
@@ -61,7 +61,9 @@
         for j in range(np.size(fieldvariables)):
             if strncmpi(fieldvariables[j].descriptor, 'scaled_', 7):
-                npart = partition_npart(fieldvariables[j].partition)
-                if str2int(fieldvariables[j].descriptor, 'last') > npart:
-                    raise RuntimeError('preqmu error message: one of the expanded variables has more values than the number of partitions (setup in md.qmu.numberofpartitions)')
+                npart = qmupart2npart(fieldvariables[j].partition)
+                nt = fieldvariables[j].nsteps
+                if nt == 1:
+                    if str2int(fieldvariables[j].descriptor, 'last') > npart:
+                        raise RuntimeError('preqmu error message: one of the expanded variables has more values than the number of partitions')
         numvariables = numvariables + np.size(vars(variables)[field_name])
 
@@ -74,6 +76,6 @@
             if strncmpi(fieldresponses[j].descriptor, 'scaled_', 7):
                 npart = partition_npart(fieldresponses[j].partition)
-                if str2int(fieldresponses[j].descriptor, 'last') > md.qmu.numberofpartitions:
-                    raise RuntimeError('preqmu error message: one of the expanded responses has more values than the number of partitions (setup in md.qmu.numberofpartitions)')
+                if str2int(fieldresponses[j].descriptor, 'last') > npart:
+                    raise RuntimeError('preqmu error message: one of the expanded responses has more values than the number of partitions')
         numresponses = numresponses + np.size(vars(responses)[field_name])
     #}}}
@@ -112,7 +114,8 @@
     #}}}
 
-    # Build a list of variable partitions
+    #build a list of variable partitions
     variablepartitions = []
     variablepartitions_npart = []
+    variablepartitions_nt = []
     variable_fieldnames = fieldnames(md.qmu.variables)
     for i in range(len(variable_fieldnames)):
@@ -124,16 +127,20 @@
                     variablepartitions.append(fieldvariable[j].partition)
                     variablepartitions_npart.append(qmupart2npart(fieldvariable[j].partition))
+                    variablepartitions_nt.append(fieldvariable.nsteps)
                 else:
                     variablepartitions.append([])
                     variablepartitions_npart.append(0)
+                    variablepartitions_nt.append(1)
         else:
             if fieldvariable.isscaled():
                 variablepartitions.append(fieldvariable.partition)
                 variablepartitions_npart.append(qmupart2npart(fieldvariable.partition))
+                variablepartitions_nt.append(fieldvariable.nsteps)
             else:
                 variablepartitions.append([])
                 variablepartitions_npart.append(0)
+                variablepartitions_nt.append(1)
 
-    # Build a list of response partitions
+    #build a list of response partitions
     responsepartitions = []
     responsepartitions_npart = []
@@ -146,5 +153,5 @@
                 if fieldresponse[j].isscaled():
                     responsepartitions.append(fieldresponse[j].partition)
-                    responsepartitions_npart.append(qmupart2npart(fieldresponse.partition))
+                    responsepartitions_npart.append(qmupart2npart(fieldresponse[j].partition))
                 else:
                     responsepartitions.append([])
@@ -163,4 +170,5 @@
     md.qmu.variablepartitions = variablepartitions
     md.qmu.variablepartitions_npart = variablepartitions_npart
+    md.qmu.variablepartitions_nt = variablepartitions_nt
     md.qmu.responsedescriptors = responsedescriptors
     md.qmu.responsepartitions = responsepartitions
Index: /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 25021)
+++ /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 25022)
@@ -25,10 +25,10 @@
 		nmean=size(variables.mean,1);
 		if (nstddev ~= npart || nmean ~=npart),
-			error('QmuSetupVariables error message: stddev and mean fields should be row sized as the number of partitions');
+			error('QmuSetupVariables error message: stddev and mean fields should have the same number of rows as the number of partitions');
 		end
 		nstddev=size(variables.stddev,2);
 		nmean=size(variables.mean,2);
 		if (nstddev ~= nt || nmean ~=nt),
-			error('QmuSetupVariables error message: stddev and mean fields should be col sized as the number of time steps');
+			error('QmuSetupVariables error message: stddev and mean fields should have the same number of cols as the number of time steps');
 		end
 
Index: /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.py	(revision 25021)
+++ /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.py	(revision 25022)
@@ -21,31 +21,52 @@
         partition = variables.partition
         #figure out number of partitions
-        npart=qmupart2npart(partition)
+        npart = qmupart2npart(partition)
+        #figure out number of time steps
+        nt = variables.nsteps
 
         if isinstance(variables, uniform_uncertain):
-            nlower=len(variables.lower)
-            nupper=len(variables.upper)
+            nlower = len(variables.lower)
+            nupper = len(variables.upper)
             if nlower != npart or nupper != npart:
                 raise RuntimeError('QmuSetupVariables error message: upper and lower fields should be same size as the number of partitions')
         elif isinstance(variables, normal_uncertain):
-            nstddev=len(variables.stddev)
-            nmean=len(variables.mean)
+            nstddev = variables.stddev.shape[0]
+            nmean = variables.mean.shape[0]
             if nstddev != npart or nmean != npart:
-                raise RuntimeError('QmuSetupVariables error message: stddev and mean fields should be same size as the number of partitions')
+                raise RuntimeError('QmuSetupVariables error message: stddev and mean fields should have the same number of rows as the number of partitions')
+            nstddev = variables.stddev.shape[1]
+            nmean = variables.mean.shape[1]
+            if nstddev != nt or nmean != nt:
+                raise RuntimeError('QmuSetupVariables error message: stddev and mean fields should have the same number of cols as the number of partitions')
 
         #ok, dealing with semi-discrete distributed variable. Distribute according to how many
-        #partitions we want
-        for j in range(npart):
-            dvar.append(deepcopy(variables))
+        #partitions we want, and number of time steps
+        if nt == 1:
+            for j in range(npart):
+                dvar.append(deepcopy(variables))
 
-            # text parsing in dakota requires literal "'identifier'" not just "identifier"
-            dvar[-1].descriptor = "'" + str(variables.descriptor) + '_' + str(j + 1) + "'"
+                # text parsing in dakota requires literal "'identifier'" not just "identifier"
+                dvar[-1].descriptor = "'" + str(variables.descriptor) + '_' + str(j + 1) + "'"
 
-            if isinstance(variables, uniform_uncertain):
-                dvar[-1].lower = variables.lower[j]
-                dvar[-1].upper = variables.upper[j]
-            elif isinstance(variables, normal_uncertain):
-                dvar[-1].stddev = variables.stddev[j]
-                dvar[-1].mean = variables.mean[j]
+                if isinstance(variables, uniform_uncertain):
+                    dvar[-1].lower = variables.lower[j]
+                    dvar[-1].upper = variables.upper[j]
+                elif isinstance(variables, normal_uncertain):
+                    dvar[-1].stddev = variables.stddev[j]
+                    dvar[-1].mean = variables.mean[j]
+        else:
+            for j in range(npart):
+                for k in range(nt):
+                    dvar.append(deepcopy(variables))
+
+                    # text parsing in dakota requires literal "'identifier'" not just "identifier"
+                    dvar[-1].descriptor = "'" + str(variables.descriptor) + '_' + str(j + 1) + '_' + str(k + 1) + "'"
+
+                    if isinstance(variables, uniform_uncertain):
+                        dvar[-1].lower = variables.lower[j][k]
+                        dvar[-1].upper = variables.upper[j][k]
+                    elif isinstance(variables, normal_uncertain):
+                        dvar[-1].stddev = variables.stddev[j][k]
+                        dvar[-1].mean = variables.mean[j][k]
     else:
         dvar.append(deepcopy(variables))
Index: /issm/trunk-jpl/test/NightlyRun/test412.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test412.py	(revision 25021)
+++ /issm/trunk-jpl/test/NightlyRun/test412.py	(revision 25022)
@@ -19,5 +19,6 @@
 
 #partitioning
-md = partitioner(md, 'package', 'linear', 'npart', md.mesh.numberofvertices) - 1
+npart = md.mesh.numberofvertices
+partition = partitioner(md, 'package', 'linear', 'npart', npart) - 1
 md.qmu.isdakota = 1
 
@@ -36,6 +37,6 @@
 md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain(
     'descriptor', 'scaled_FrictionCoefficient',
-    'mean', np.ones(md.mesh.numberofvertices),
-    'stddev', .01 * np.ones(md.mesh.numberofvertices),
+    'mean', np.ones(npart),
+    'stddev', .01 * np.ones(npart),
     'partition', partition
     )
