Index: /issm/trunk-jpl/src/m/classes/qmu.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu.py	(revision 25014)
+++ /issm/trunk-jpl/src/m/classes/qmu.py	(revision 25015)
@@ -158,5 +158,7 @@
         fv = fieldnames(self.variables)
         for i in range(len(fv)):
-            getattr(self.variables, fv[i]).checkconsistency(md, solution, analyses)
+            variable = getattr(self.variables, fv[i])
+            if hasattr(variable, 'checkconsistency'):
+                variable.checkconsistency(md, solution, analyses)
 
         return md
Index: /issm/trunk-jpl/src/m/partition/partitioner.py
===================================================================
--- /issm/trunk-jpl/src/m/partition/partitioner.py	(revision 25014)
+++ /issm/trunk-jpl/src/m/partition/partitioner.py	(revision 25015)
@@ -16,9 +16,9 @@
     List of options to partitioner:
 
-    package: 'chaco', 'metis'
-    npart: number of partitions.
+    package: 'chaco', 'metis', or 'scotch'
+    npart: number of partitions
     weighting: 'on' or 'off': default off
-    section:  1 by defaults(1 = bisection, 2 = quadrisection, 3 = octasection)
-    recomputeadjacency:  'on' by default (set to 'off' to compute existing one)
+    section: 1 by defaults(1=bisection, 2=quadrisection, 3=octasection)
+    recomputeadjacency: 'on' by default (set to 'off' to compute existing one)
     type: 'node' or 'element' partition vector (default to 'node')
     Output: partitionvector: the partition vector
@@ -39,6 +39,7 @@
     vectortype = options.getfieldvalue('type', 'node')  #default to node
 
+    # Python only: short-circuit
     if vectortype == 'element' and not package == 'linear':
-        raise RuntimeError('partitioner error message: package ' + str(package) + ' does not allow element partitions.')
+        raise RuntimeError('partitioner error message: package %s does not allow element partitions.' % package)
 
     if(md.mesh.dimension() == 3):
@@ -62,40 +63,45 @@
 
     if package == 'chaco':
-        #raise RuntimeError('Chaco is not currently supported for this function')
-        #  default method (from chaco.m)
-        method = np.array([1, 1, 0, 0, 1, 1, 50, 0, 0.001, 7654321])
-        method[0] = 3  #  global method (3 = inertial (geometric))
-        method[2] = 0  #  vertex weights (0 = off, 1 = on)
-        #specify bisection
-        method[5] = section  #  ndims (1 = bisection, 2 = quadrisection, 3 = octasection)
+        if vectortype == 'element':
+            raise RuntimeError('partitioner error message: package %s does not allow element partitions.' % package)
+        else:
+            #  default method (from chaco.m)
+            method = np.array([1, 1, 0, 0, 1, 1, 50, 0, 0.001, 7654321])
+            method[0] = 3  #  global method (3 = inertial (geometric))
+            method[2] = 0  #  vertex weights (0 = off, 1 = on)
 
-        #are we using weights?
-        if weighting == 'on':
-            weights = np.floor(md.qmu.vertex_weight / min(md.qmu.vertex_weight))
-            method[2] = 1
-        else:
-            weights = []
+            #specify bisection
+            method[5] = section  #  ndims (1 = bisection, 2 = quadrisection, 3 = octasection)
 
-        method = method.reshape(-1, 1)  # transpose to 1x10 instead of 10
-        #  partition into nparts
-        if isinstance(md.mesh, mesh2d):
-            part = np.array(Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, np.zeros((md.mesh.numberofvertices, )), method, npart, np.array([]))).T + 1  #index partitions from 1 up. like metis.
-        else:
-            part = np.array(Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, md.mesh.z, method, npart, np.array([]))).T + 1  #index partitions from 1 up. like metis.
+            #are we using weights?
+            if weighting == 'on':
+                weights = np.floor(md.qmu.vertex_weight / min(md.qmu.vertex_weight))
+                method[2] = 1
+            else:
+                weights = []
+
+            method = method.reshape(-1, 1)  # transpose to 1x10 instead of 10
+
+            #  partition into nparts
+            if isinstance(md.mesh, mesh2d):
+                part = np.array(Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, np.zeros((md.mesh.numberofvertices, )), method, npart, np.array([]))).T + 1  #index partitions from 1 up. like metis.
+            else:
+                part = np.array(Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, md.mesh.z, method, npart, np.array([]))).T + 1  #index partitions from 1 up. like metis.
 
     elif package == 'scotch':
-        raise RuntimeError('Scotch is not currently supported for this function')
+        if vectortype == 'element':
+            raise RuntimeError('partitioner error message: package %s does not allow element partitions.' % package)
+        else:
+            #are we using weights?
+            if m.strcmpi(options.getfieldvalue('weighting'), 'on'):
+                weights = np.floor(md.qmu.vertex_weight / min(md.qmu.vertex_weight))
+            else:
+                weights = []
+            maptab = Scotch(md.qmu.adjacency, [], weights, [], 'cmplt', [npart])
 
-    #are we using weights?
-    #if m.strcmpi(options.getfieldvalue('weighting'), 'on'):
-    #weights = np.floor(md.qmu.vertex_weight / min(md.qmu.vertex_weight))
-    #else:
-    #weights = []
-    #maptab = Scotch(md.qmu.adjacency, [], weights, [], 'cmplt', [npart])
-    #part = maptab[:, 1] + 1  #index partitions from 1 up. like metis.
+            part = maptab[:, 1] + 1 #index partitions from 1 up. like metis.
 
     elif package == 'linear':
-
-        if (npart == md.mesh.numberofelements) or (md.qmu.numberofpartitions == md.mesh.numberofelements):
+        if vectortype == 'element':
             part = np.arange(1, 1 + md.mesh.numberofelements, 1)
             print('Linear partitioner requesting partitions on elements')
@@ -104,10 +110,11 @@
 
     elif package == 'metis':
-        raise RuntimeError('Metis/MeshPartition is not currently supported for this function')
-    #[element_partitioning, part] = MeshPartition(md, md.qmu.numberofpartitions)
+        if vectortype == 'element':
+            raise RuntimeError('partitioner error message: package %s does not allow element partitions.' % package)
+        else:
+            [element_partitioning, part] = MeshPartition(md, md.qmu.numberofpartitions)
 
     else:
-        print(help)
-        raise RuntimeError('partitioner error message: could not find ' + str(package) + ' partitioner')
+        raise RuntimeError('partitioner error message: could not find %s partitioner' % package)
 
     #extrude if we are in 3D:
Index: /issm/trunk-jpl/src/m/qmu/importancefactors.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/importancefactors.py	(revision 25014)
+++ /issm/trunk-jpl/src/m/qmu/importancefactors.py	(revision 25015)
@@ -1,14 +1,16 @@
 import numpy as np
+
 from MatlabFuncs import *
 
 
-def importancefactors(md, variablename, responsename):
-    '''IMPORTANCEFACTORS - compute importance factors for a certain variable and response.
+def importancefactors(md, variablename, responsename, partition):
+    '''
+    IMPORTANCEFACTORS - compute importance factors for a certain variable and response.
 
-Usage:
-    factors = importancefactors(md, variablename, responsename)
+    Usage:
+        factors = importancefactors(md, variablename, responsename)
 
     Example: factors = importancefactors(md, 'drag', 'max_vel')
-'''
+    '''
 
     variablenamelength = len(variablename)
@@ -44,11 +46,11 @@
         factors = importancefactors
         return factors
-    elif count == np.max(md.qmu.epartition + 1):
+    elif count == np.max(partition + 1):
         #distribute importance factor
-        factors = importancefactors[(md.qmu.epartition.conj().T).flatten().astype(int)]
+        factors = importancefactors[(partition.conj().T).flatten().astype(int)]
     #md.qmu.partition was created to index "c" style
     else:
         #distribute importance factor
-        factors = importancefactors[(md.qmu.vpartition.conj().T).flatten().astype(int)]
+        factors = importancefactors[(partition.conj().T).flatten().astype(int)]
     #md.qmu.partition was created to index "c" style
 
Index: /issm/trunk-jpl/src/m/qmu/preqmu.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/preqmu.m	(revision 25014)
+++ /issm/trunk-jpl/src/m/qmu/preqmu.m	(revision 25015)
@@ -88,7 +88,7 @@
 
 %build a MatArray of variable partitions: 
-variable_fieldnames=fieldnames(md.qmu.variables(ivar));
 variablepartitions={};
 variablepartitions_npart=[];
+variable_fieldnames=fieldnames(md.qmu.variables(ivar));
 for i=1:length(variable_fieldnames),
 	field_name=variable_fieldnames{i};
@@ -104,10 +104,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 25014)
+++ /issm/trunk-jpl/src/m/qmu/preqmu.py	(revision 25015)
@@ -7,13 +7,14 @@
 from MatlabFuncs import *
 from process_qmu_response_data import *
-from qmupart2npart import *
+from qmupart2npart import qmupart2npart
 
 
 def preqmu(md, options):
-    '''QMU - apply Quantification of Margins and Uncertainties techniques
+    '''
+    QMU - apply Quantification of Margins and Uncertainties techniques
     to a solution sequence (like stressbalance.py, progonstic.py, etc ...),
     using the Dakota software from Sandia.
 
-   options come from the solve.py routine. They can include Dakota options:
+    options come from the solve.py routine. They can include Dakota options:
 
     qmufile: input file for Dakota
@@ -24,5 +25,5 @@
     imethod: same thing for methods
     iparams: same thing for params
-'''
+    '''
 
     print('preprocessing dakota inputs')
@@ -104,6 +105,9 @@
     #fieldresponses = vars(md.qmu.responses[iresp])[field_name]
         fieldresponses = vars(md.qmu.responses)[field_name]
-        for j in range(np.size(fieldresponses)):
-            responsedescriptors.append(fieldresponses[j].descriptor)
+        if type(fieldresponses) in [list, np.ndarray]:
+            for j in range(np.size(fieldresponses)):
+                responsedescriptors.append(fieldresponses[j].descriptor)
+        else:
+            responsedescriptors.append(fieldresponses.descriptor)
     #}}}
 
@@ -114,11 +118,20 @@
     for i in range(len(variable_fieldnames)):
         field_name = variable_fieldnames[i]
-        fieldvariable = getattr(md.qmu.variables, field_name)
-        if fieldvariable.isscaled():
-            variablepartitions.append(fieldvariable.partition)
-            variablepartitions_npart.append(qmupart2npart(fieldvariable.partition))
+        fieldvariable = vars(md.qmu.variables)[field_name]
+        if type(fieldvariable) in [list, np.ndarray]:
+            for j in range(np.size(fieldvariable)):
+                if fieldvariable[j].isscaled():
+                    variablepartitions.append(fieldvariable[j].partition)
+                    variablepartitions_npart.append(qmupart2npart(fieldvariable[j].partition))
+                else:
+                    variablepartitions.append([])
+                    variablepartitions_npart.append(0)
         else:
-            variablepartitions.append([])
-            variablepartitions_npart.append(0)
+            if fieldvariable.isscaled():
+                variablepartitions.append(fieldvariable.partition)
+                variablepartitions_npart.append(qmupart2npart(fieldvariable.partition))
+            else:
+                variablepartitions.append([])
+                variablepartitions_npart.append(0)
 
     # Build a list of response partitions
@@ -128,11 +141,20 @@
     for i in range(len(response_fieldnames)):
         field_name = response_fieldnames[i]
-        fieldresponse = getattr(md.qmu.variables, field_name)
-        if fieldresponse.isscaled():
-            responsepartitions.append(fieldresponse.partition)
-            responsepartitions_npart.append(qmupart2npart(fieldresponse.partition))
+        fieldresponse = vars(md.qmu.responses)[field_name]
+        if type(fieldresponses) in [list, np.ndarray]:
+            for j in range(np.size(fieldresponses)):
+                if fieldresponse[j].isscaled():
+                    responsepartitions.append(fieldresponse[j].partition)
+                    responsepartitions_npart.append(qmupart2npart(fieldresponse.partition))
+                else:
+                    responsepartitions.append([])
+                    responsepartitions_npart.append(0)
         else:
-            responsepartitions.append([])
-            responsepartitions_npart.append(0)
+            if fieldresponse.isscaled():
+                responsepartitions.append(fieldresponse.partition)
+                responsepartitions_npart.append(qmupart2npart(fieldresponse.partition))
+            else:
+                responsepartitions.append([])
+                responsepartitions_npart.append(0)
 
     # register the fields that will be needed by the Qmu model.
Index: /issm/trunk-jpl/test/NightlyRun/test244.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test244.py	(revision 25014)
+++ /issm/trunk-jpl/test/NightlyRun/test244.py	(revision 25015)
@@ -68,14 +68,13 @@
 
 #partitioning
-md.qmu.numberofpartitions = md.mesh.numberofelements
-md = partitioner(md, 'package', 'linear', 'type', 'element')
-md.qmu.epartition = (md.qmu.epartition - 1)
+npart = md.mesh.numberofelements
+partition = partitioner(md, 'package', 'linear', 'type', 'element', 'npart', npart) - 1
 
 #variables
 md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain(
     'descriptor', 'scaled_SmbC',
-    'mean', np.ones(md.qmu.numberofpartitions),
-    'stddev', .5 * np.ones(md.qmu.numberofpartitions),
-    'partition', md.qmu.epartition
+    'mean', np.ones(md.mesh.numberofelements),
+    'stddev', .5 * np.ones(md.mesh.numberofelements),
+    'partition', partition
     )
 Tmin = 273.
@@ -83,5 +82,5 @@
 mint_on_partition = telms.flatten()
 for pa in range(np.size(mint_on_partition)):
-    vi = np.where(md.qmu.epartition == pa)
+    vi = np.where(partition == pa)
     mint = telms[0, vi] * 1.05
     pos = np.where(mint < Tmin)
@@ -92,7 +91,7 @@
 md.qmu.variables.surface_mass_balanceTa = uniform_uncertain.uniform_uncertain(
     'descriptor', 'scaled_SmbTa',
-    'lower', .95 * np.ones(md.qmu.numberofpartitions),
+    'lower', .95 * np.ones(md.mesh.numberofelements),
     'upper', np.maximum(np.minimum(np.maximum(1.05, mint_on_partition), 0.9999), 0.0001),
-    'partition', md.qmu.epartition
+    'partition', partition
     )
 
