Index: /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.m	(revision 24870)
@@ -13,11 +13,11 @@
 
 classdef normal_uncertain
-    properties
-        descriptor='';
-        mean      = NaN;
-        stddev    = NaN;
-		partition = [];
-    end
-    methods
+	properties
+		descriptor	= '';
+		mean		= NaN;
+		stddev		= NaN;
+		partition	= [];
+	end
+	methods
 		function self=normal_uncertain(varargin) %constructor {{{
 
@@ -46,120 +46,119 @@
 
 		end %}}}
-	function disp(self) % {{{
-
-		disp(sprintf('   normal uncertain variable: '));
-		fielddisplay(self,'descriptor','name tag');
-		fielddisplay(self,'mean','pdf mean');
-		fielddisplay(self,'stddev','pdf standard deviation');
-		if ~isempty(self.partition),
-			fielddisplay(self,'partition','partition vector defining where sampling will occur');
-		end
-	end
-	%}}}
-	function md=checkconsistency(self,md,solution,analyses) % {{{
-
-		md = checkfield(md,'field',self.mean,'fieldname','normal_uncertain.mean','NaN',1,'Inf',1,'>=',0);
-		md = checkfield(md,'field',self.stddev,'fieldname','normal_uncertain.stddev','NaN',1,'Inf',1,'>=',0,'numel',length(self.mean));
-		if self.isscaled(),
-			if isempty(self.partition),
-				error('normal_uncertain is a scaled variable, but it''s missing a partition vector');
-			end
-			%better have a partition vector that has as many partitions as stddev's size:
-			if length(self.stddev)~=partition_npart(self.partition),
-				error('normal_uncertain error message: stddev and partition should be vectors of identical size');
-			end
-			if length(self.mean)~=partition_npart(self.partition),
-				error('normal_uncertain error message: mean and partition should be vectors of identical size');
-			end
-
-			md = checkfield(md,'field',self.partition,'fieldname','normal_uncertain.partition','NaN',1,'Inf',1,'>=',-1,'numel',[md.mesh.numberofvertices,md.mesh.numberofelements]);
-			if size(self.partition,2)>1,
-				error('normal_uncertain error message: partition should be a column vector');
-			end
-			partcheck=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');
-			end
-			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');
+		function disp(self) % {{{
+			disp(sprintf('   normal uncertain variable: '));
+			fielddisplay(self,'descriptor','name tag');
+			fielddisplay(self,'mean','pdf mean');
+			fielddisplay(self,'stddev','pdf standard deviation');
+			if ~isempty(self.partition),
+				fielddisplay(self,'partition','partition vector defining where sampling will occur');
 			end
 		end
-	end % }}}
-	%virtual functions needed by qmu processing algorithms:
-	%implemented:
-	function [desc]  =prop_desc(nuv,dstr) % {{{
-		desc=cell(1,numel(nuv));
-		for i=1:numel(nuv)
-			if ~isempty(nuv(i).descriptor)
-				desc(i)=cellstr(nuv(i).descriptor);
-			elseif ~isempty(inputname(1))
-				desc(i)=cellstr([inputname(1) string_dim(nuv,i,'vector')]);
-			elseif exist('dstr','var')
-				desc(i)=cellstr([dstr         string_dim(nuv,i,'vector')]);
+		%}}}
+		function md=checkconsistency(self,md,solution,analyses) % {{{
+
+			md = checkfield(md,'field',self.mean,'fieldname','normal_uncertain.mean','NaN',1,'Inf',1,'>=',0);
+			md = checkfield(md,'field',self.stddev,'fieldname','normal_uncertain.stddev','NaN',1,'Inf',1,'>=',0,'numel',length(self.mean));
+			if self.isscaled(),
+				if isempty(self.partition),
+					error('normal_uncertain is a scaled variable, but it''s missing a partition vector');
+				end
+				%better have a partition vector that has as many partitions as stddev's size:
+				if length(self.stddev)~=partition_npart(self.partition),
+					error('normal_uncertain error message: stddev and partition should be vectors of identical size');
+				end
+				if length(self.mean)~=partition_npart(self.partition),
+					error('normal_uncertain error message: mean and partition should be vectors of identical size');
+				end
+
+				md = checkfield(md,'field',self.partition,'fieldname','normal_uncertain.partition','NaN',1,'Inf',1,'>=',-1,'numel',[md.mesh.numberofvertices,md.mesh.numberofelements]);
+				if size(self.partition,2)>1,
+					error('normal_uncertain error message: partition should be a column vector');
+				end
+				partcheck=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');
+				end
+				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');
+				end
+			end
+		end % }}}
+		%virtual functions needed by qmu processing algorithms:
+		%implemented:
+		function [desc]  =prop_desc(nuv,dstr) % {{{
+			desc=cell(1,numel(nuv));
+			for i=1:numel(nuv)
+				if ~isempty(nuv(i).descriptor)
+					desc(i)=cellstr(nuv(i).descriptor);
+				elseif ~isempty(inputname(1))
+					desc(i)=cellstr([inputname(1) string_dim(nuv,i,'vector')]);
+				elseif exist('dstr','var')
+					desc(i)=cellstr([dstr         string_dim(nuv,i,'vector')]);
+				else
+					desc(i)=cellstr(['nuv'        string_dim(nuv,i,'vector')]);
+				end
+			end
+			desc=allempty(desc);
+		end %}}}
+		function [mean]  =prop_mean(nuv) % {{{
+			mean=zeros(1,numel(nuv));
+			for i=1:numel(nuv)
+				mean(i)=nuv(i).mean;
+			end
+		end % }}}
+		function [stddev]=prop_stddev(nuv) % {{{
+			stddev=zeros(1,numel(nuv));
+			for i=1:numel(nuv)
+				stddev(i)=nuv(i).stddev;
+			end
+		end % }}}
+		%default
+		function [abscissas] =prop_abscissas(hbu) % {{{
+			abscissas=[];
+		end % }}}
+		function [counts] =prop_counts(hbu) % {{{
+			counts=[];
+		end % }}}
+		function [pairs_per_variable] =prop_pairs_per_variable(hbu) % {{{
+			pairs_per_variable=[];
+		end % }}}
+		function [initpt]=prop_initpt(nuv) % {{{
+			initpt=[];
+		end % }}}
+		function [lower]  =prop_lower(nuv) % {{{
+			lower=[];
+		end % }}}
+		function [upper]  =prop_upper(nuv) % {{{
+			upper=[];
+		end % }}}
+		function [initst]=prop_initst(nuv) % {{{
+			initst=[];
+		end % }}}
+		function [stype] =prop_stype(nuv) % {{{
+			stype={};
+		end % }}}
+		function [scale] =prop_scale(nuv) % {{{
+			scale=[];
+		end % }}}
+		%new methods:
+		function scaled =isscaled(self) % {{{
+			if strncmp(self.descriptor,'scaled_',7),
+				scaled=1;
 			else
-				desc(i)=cellstr(['nuv'        string_dim(nuv,i,'vector')]);
+				scaled=0;
 			end
-		end
-		desc=allempty(desc);
-	end %}}}
-	function [mean]  =prop_mean(nuv) % {{{
-		mean=zeros(1,numel(nuv));
-		for i=1:numel(nuv)
-			mean(i)=nuv(i).mean;
-		end
-	end % }}}
-	function [stddev]=prop_stddev(nuv) % {{{
-		stddev=zeros(1,numel(nuv));
-		for i=1:numel(nuv)
-			stddev(i)=nuv(i).stddev;
-		end
-	end % }}}
-	%default
-	function [abscissas] =prop_abscissas(hbu) % {{{
-		abscissas=[];
-	end % }}}
-	function [counts] =prop_counts(hbu) % {{{
-		counts=[];
-	end % }}}
-	function [pairs_per_variable] =prop_pairs_per_variable(hbu) % {{{
-		pairs_per_variable=[];
-	end % }}}
-	function [initpt]=prop_initpt(nuv) % {{{
-		initpt=[];
-	end % }}}
-	function [lower]  =prop_lower(nuv) % {{{
-		lower=[];
-	end % }}}
-	function [upper]  =prop_upper(nuv) % {{{
-		upper=[];
-	end % }}}
-	function [initst]=prop_initst(nuv) % {{{
-		initst=[];
-	end % }}}
-	function [stype] =prop_stype(nuv) % {{{
-		stype={};
-	end % }}}
-	function [scale] =prop_scale(nuv) % {{{
-		scale=[];
-	end % }}}
-	%new methods:
-	function scaled =isscaled(self) % {{{
-		if strncmp(self.descriptor,'scaled_',7),
-			scaled=1;
-		else
-			scaled=0;
-		end
-	end % }}}
+		end % }}}
 	end
-    methods (Static)
-        function []=dakota_write(fidi,dvar) % {{{
+	methods (Static)
+		function []=dakota_write(fidi,dvar) % {{{
 			%  collect only the variables of the appropriate class
 			nuv=struc_class(dvar,'normal_uncertain');
 			%  write variables
-            vlist_write(fidi,'normal_uncertain','nuv',nuv);
-        end % }}}
-    end
+			vlist_write(fidi,'normal_uncertain','nuv',nuv);
+		end % }}}
+	end
 end
Index: /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py	(revision 24870)
@@ -1,34 +1,42 @@
 import numpy as np
+
 from MatlabArray import *
+from MatlabFuncs import *
+from fielddisplay import fielddisplay
+from pairoptions import pairoptions
+from partition_npart import *
 
 
 class normal_uncertain(object):
     '''
-  definition for the normal_uncertain class.
-
-  [nuv] = normal_uncertain.normal_uncertain(args)
-   nuv = normal_uncertain()
-
-  where the required args are:
-    descriptor    (str, description, '')
-    mean          (float, mean, float('NaN'))
-    stddev        (float, standard deviation, float('NaN'))
-  and the optional args and defaults are:
-    lower         (float, lower bound, -np.Inf)
-    upper         (float, upper bound, np.Inf)
-
-  note that zero arguments constructs a default instance, one
-  argument of the class copies the instance, and three or more
-  arguments constructs a new instance from the arguments.
-'''
+    NORMAL_UNCERTAIN class definition
+
+        Usage:
+            nuv = normal_uncertain('descriptor',descriptor,'mean',mean,'stddev',stddev,'partition',partition)
+            where nuv is the normal_uncertain object returned by the constructor, mean and stddev are self
+            explanatory.  partition is the partition vector for distributed variables. Can be a partition
+            vector over elements or vertices.
+
+        Example:
+            md.qmu.variables.rheology=normal_uncertain(
+                'descriptor','RheologyBBar',
+                'mean',1,
+                'stddev',.05
+                )
+            md.qmu.variables.rheology=normal_uncertain(
+                'descriptor','scaled_RheologyBBar',
+                'mean',1,
+                'stddev',.05,
+                'partition',vpartition
+                )
+    '''
     def __init__(self):
         self.descriptor = ''
-        self.mean = float('NaN')
-        self.stddev = float('NaN')
-        self.lower = -np.Inf
-        self.upper = np.Inf
-
-    @staticmethod
-    def normal_uncertain(*args):
+        self.mean       = np.NaN
+        self.stddev     = np.NaN
+        self.partition  = []
+
+    @staticmethod
+    def normal_uncertain(*args): #{{{
         nargin = len(args)
 
@@ -44,49 +52,78 @@
                 raise RuntimeError('Object ' + str(args[0]) + ' is a ' + str(type(args[0])) + ' class object, not "normal_uncertain".')
 
-        # not enough arguments
-        elif nargin == 2:
-            raise RuntimeError('Construction of "normal_uncertain" class object requires at least 3 inputs.')
-
-    # create the object from the input
+        # create the object from the input
         else:
             # lines differ here in other classes / tests; see asizec problem in notes
             nuv = normal_uncertain()
-            nuv.descriptor = str(args[0])
-            nuv.mean = args[1]
-            nuv.stddev = args[2]
-            if nargin >= 4:
-                nuv.lower = args[3]
-            if nargin >= 5:
-                nuv.upper = args[4]
-            if nargin > 5:
-                print('WARNING: normal_uncertain:extra_arg: Extra arguments for object of class ' + str(type(nuv)) + '.')
-
-        return [nuv]
-
-    def __repr__(self):
-        # display an individual object
-        string = '\n'
-        string += 'class "normal_uncertain" object = \n'
-        string += '    descriptor: ' + str(self.descriptor) + '\n'
-        string += '          mean: ' + str(self.mean) + '\n'
-        string += '        stddev: ' + str(self.stddev) + '\n'
-        string += '         lower: ' + str(self.lower) + '\n'
-        string += '         upper: ' + str(self.upper) + '\n'
+
+            #recover options:
+            options = pairoptions(*args)
+
+            #initialize fields:
+            nuv.descriptor = options.getfieldvalue('descriptor', '')
+            nuv.mean       = options.getfieldvalue('mean', np.NaN)
+            nuv.stddev     = options.getfieldvalue('stddev', np.NaN)
+
+            #if the variable is scaled, a partition vector should have been supplied, and
+            #that partition vector should have as many partitions as the mean and stddev
+            #vectors:
+            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)
+
+        return [nuv] # Always return a list, so we have something akin to a MATLAB single row matrix
+    #}}}
+
+    def __repr__(self): #{{{
+        string = '   normal uncertain variable: '
+        string = "%s\n%s" % (string, fielddisplay(self, 'descriptor', 'name tag'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mean', 'pdf mean'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'stddev', 'pdf standard deviation'))
+        if self.partition != []:
+            string = "%s\n%s" % (string, fielddisplay(self, 'partition', 'partition vector defining where sampling will occur'))
 
         return string
-
-    # from here on, nuv is either a single, or a 1d vector of, normal_uncertain
-
-    @staticmethod
-    def prop_desc(nuv, dstr):
-        if type(nuv) not in [list, np.ndarray]:
-            if nuv.descriptor != '' or type(nuv.descriptor) != str:
-                desc = str(nuv.descriptor)
-            elif dstr != '':
-                desc = str(dstr)
-            else:
-                desc = 'nuv'
-            return desc
-
+    #}}}
+
+    def __len__(self): #{{{
+        if type(self.mean) in [list, np.ndarray]:
+            return len(self.mean)
+        else:
+            return 1
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses): #{{{
+        md = checkfield(md, 'field', self.mean, 'fieldname', 'normal_uncertain.mean', 'NaN', 1, 'Inf', 1, '>=', 0)
+        md = checkfield(md, 'field', self.stddev, 'fieldname', 'normal_uncertain.stddev', 'NaN', 1, 'Inf', 1, '>=', 0, 'numel', len(self.mean))
+        if self.isscaled():
+            if self.partition == []:
+                error("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")
+            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")
+            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")
+            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")
+    #}}}
+
+    #virtual functions needed by qmu processing algorithms
+    #implemented:
+
+    @staticmethod
+    def prop_desc(nuv, dstr): #{{{
         desc = ['' for i in range(np.size(nuv))]
         for i in range(np.size(nuv)):
@@ -101,79 +138,102 @@
 
         return desc
-
-    @staticmethod
-    def prop_initpt(nuv):
-        initpt = []
-        return initpt
-
-    @staticmethod
-    def prop_lower(nuv):
+    #}}}
+
+    @staticmethod
+    def prop_mean(nuv): #{{{
         if type(nuv) not in [list, np.ndarray]:
-            return nuv.lower
-
-        lower = np.zeros(np.size(nuv))
-        for i in range(np.size(nuv)):
-            lower[i] = nuv[i].lower
-
-        lower = allequal(lower, -np.inf)
-
-        return lower
-
-    @staticmethod
-    def prop_upper(nuv):
-        if type(nuv) not in [list, np.ndarray]:
-            return nuv.upper
-
-        upper = np.zeros(np.size(nuv))
-        for i in range(np.size(nuv)):
-            upper[i] = nuv[i].upper
-
-        upper = allequal(upper, -np.inf)
-        return upper
-
-    @staticmethod
-    def prop_mean(nuv):
-        if type(nuv) not in [list, np.ndarray]:
-            return nuv.mean
+            return [nuv.mean]
 
         mean = np.zeros(np.size(nuv))
         for i in range(np.size(nuv)):
             mean[i] = nuv[i].mean
-
         return mean
-
-    @staticmethod
-    def prop_stddev(nuv):
+    #}}}
+
+    @staticmethod
+    def prop_stddev(nuv): #{{{
         if type(nuv) not in [list, np.ndarray]:
-            return nuv.stddev
-
+            return [nuv.stddev]
         stddev = np.zeros(np.size(nuv))
         for i in range(np.size(nuv)):
             stddev[i] = nuv[i].stddev
-
         return stddev
-
-    @staticmethod
-    def prop_initst(nuv):
-        initst = []
-        return initst
-
-    @staticmethod
-    def prop_stype(nuv):
+    #}}}
+
+    #default
+    @staticmethod
+    def prop_abscissas(hbu): #{{{
+        abscissas = []
+        return abscissas
+    #}}}
+
+    @staticmethod
+    def prop_counts(hbu): #{{{
+        counts = []
+        return counts
+    #}}}
+
+    @staticmethod
+    def prop_pairs_per_variable(hbu): #{{{
+        pairs_per_variable = []
+        return pairs_per_variable
+    #}}}
+
+    @staticmethod
+    def prop_initpt(nuv): #{{{
+        initpt = []
+        return initpt
+    #}}}
+
+    @staticmethod
+    def prop_lower(nuv): #{{{
+        lower = []
+        return lower
+    #}}}
+
+    @staticmethod
+    def prop_upper(nuv): #{{{
+        upper = []
+        return upper
+    #}}}
+
+    @staticmethod
+    def prop_initst(nuv): #{{{
+        inist = []
+        return inist
+    #}}}
+
+    @staticmethod
+    def prop_stype(nuv): #{{{
         stype = []
         return stype
-
-    @staticmethod
-    def prop_scale(nuv):
+    #}}}
+
+    @staticmethod
+    def prop_scale(nuv): #{{{
         scale = []
         return scale
+    #}}}
+
+    #new methods:
+    def isscaled(self): #{{{
+        if strncmp(self.descriptor, 'scaled_', 7):
+            return True
+        else:
+            return False
+    #}}}
 
     @staticmethod
     def dakota_write(fidi, dvar):
+        # possible namespace pollution, the above import seems not to work
+        from vlist_write import vlist_write
         # collect only the variables of the appropriate class
-        nuv = [struc_class(i, 'normal_uncertain', 'nuv') for i in dvar]
-
-    # possible namespace pollution, the above import seems not to work
-        from vlist_write import vlist_write
-    # write variables
-        vlist_write(fidi, 'normal_uncertain', 'nuv', nuv)
+        # nuv = [struc_class(i, 'normal_uncertain', 'nuv') for i in dvar]
+        fields = fieldnames(dvar)
+        for field in fields:
+            if getattr(dvar, field)[0].__class__.__name__ != 'normal_uncertain':
+                delattr(dvar, field)
+        if len(dvar) > 0:
+            vlist_write(fidi, 'normal_uncertain', 'nuv', dvar)
+    #}}}
+
Index: /issm/trunk-jpl/src/m/classes/qmu/partition_npart.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/partition_npart.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/classes/qmu/partition_npart.m	(revision 24870)
@@ -1,5 +1,5 @@
 function npart=partition_npart(vector)
 
-	%vector could be on vertices or eleemnts, and will have a small amount of possible integer 
+	%vector could be on vertices or elements, and will have a small amount of possible integer 
 	%values: 
 	uvec=unique(vector);
Index: /issm/trunk-jpl/src/m/classes/qmu/partition_npart.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/partition_npart.py	(revision 24870)
+++ /issm/trunk-jpl/src/m/classes/qmu/partition_npart.py	(revision 24870)
@@ -0,0 +1,13 @@
+import numpy as np
+
+def partition_npart(vector):
+    #vector could be on vertices or elements, and will have a small amount of possible integer
+    #values:
+    uvec = np.unique(vector)
+    uvec = np.delete(uvec, np.where(uvec == -1))
+
+    #ok, so now we should have a vector from 0 to npart-1:
+    npart = max(uvec) + 1
+    if npart != len(uvec):
+        raise RuntimeError('partition vector should be in the range 0 to numberofpartitions, with -1 values for vertices or elements not belonging to any partition')
+    return npart
Index: /issm/trunk-jpl/src/m/classes/qmu/response_function.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/response_function.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/classes/qmu/response_function.m	(revision 24870)
@@ -19,5 +19,5 @@
         rell      =[];
         grell     =[];
-		partition = [];
+        partition = [];
     end
     methods
@@ -35,5 +35,5 @@
 			self.grell=getfieldvalue(options,'general_reliability_levels',[]);
 			
-			%if the response is scaled,  a partition vector should have been supplied.
+			%if the response is scaled, a partition vector should have been supplied.
 			if self.isscaled(),
 				self.partition=getfieldvalue(options,'partition');
@@ -42,8 +42,6 @@
 		end %}}}
         function []=disp(rf)% {{{
-
-
-        %  display the object
-
+            %TODO: Convert the following to fielddisplay
+            % display the object
             disp(sprintf('\n'));
             for i=1:numel(rf)
@@ -54,5 +52,9 @@
                 disp(sprintf('         probl: %s'      ,string_vec(rf(i).probl)));
                 disp(sprintf('          rell: %s'      ,string_vec(rf(i).rell)));
-                disp(sprintf('         grell: %s\n'    ,string_vec(rf(i).grell)));
+                disp(sprintf('         grell: %s'    ,string_vec(rf(i).grell)));
+                if ~isempty(self.partition),
+                    disp(sprintf('     partition: %s'    ,string_vec(rf(i).partition)));
+                end
+                disp(sprintf('\n'));
             end
 
@@ -127,5 +129,4 @@
 			%collect only the responses of the appropriate class
             rf=struc_class(dresp,'response_function');
-
 			%write responses
 			[rdesc]=rlist_write(fidi,'response_functions','response_function',rf,rdesc);
Index: /issm/trunk-jpl/src/m/classes/qmu/response_function.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/response_function.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/classes/qmu/response_function.py	(revision 24870)
@@ -1,36 +1,43 @@
 import numpy as np
+
+from MatlabFuncs import *
+from fielddisplay import fielddisplay
+from pairoptions import pairoptions
+from partition_npart import *
+from rlev_write import *
 #from rlist_write import *
-from rlev_write import *
-from MatlabArray import *
-#move this later
-from helpers import *
 
 
 class response_function(object):
     '''
-  definition for the response_function class.
-
-  [rf] = response_function.response_function(args)
-   rf = response_function()
-
-  where the required args are:
-    descriptor    (char, description, '')
-  and the optional args and defaults are:
-    respl         (double vector, response levels, [])
-    probl         (double vector, probability levels, [])
-    rell          (double vector, reliability levels, [])
-    grell         (double vector, gen. reliability levels, [])
-
-  note that zero arguments constructs a default instance, one
-  argument of the class copies the instance, and one or more
-  arguments constructs a new instance from the arguments.
-'''
-
+    RESPONSE_FUNCTION class definition
+
+        Usage:
+            rf = response_function(
+                'descriptor', descriptor,
+                'response_levels', respl,
+                'probability_levels', probl,
+                'reliability_levels',rell,
+                'general_reliability_levels', grell,
+                'partition', partition
+            )
+
+            where rf is the response function object returned by the 
+            constructor. All options except the descriptor are optional. A partition can be provided for scaled variables.
+
+        Example:
+            md.qmu.responses.maxvel = response_function(
+                'descriptor', 'MaxVel',
+                'response_levels',[0],
+                'probl', [0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]
+                )
+    '''
     def __init__(self):
         self.descriptor = ''
-        self.respl = []
-        self.probl = []
-        self.rell = []
-        self.grell = []
+        self.respl      = []
+        self.probl      = []
+        self.rell       = []
+        self.grell      = []
+        self.partition  = []
 
     @staticmethod
@@ -43,61 +50,78 @@
 
         # copy the object or create the object from the input
-        else:
-            if nargin == 1 and isinstance(args[0], response_function):
+        elif nargin == 1:
+            if isinstance(args[0], response_function):
                 rf = args[0]
             else:
-                asizec = array_size(*args[0:min(nargin, 1)])
-                rf = [response_function() for i in range(asizec[0]) for j in range(asizec[1])]
-
-                for i in range(np.size(rf)):
-                    if (np.size(args[0]) > 1):
-                        rf[i].descriptor = args[0][i]
-                    else:
-                        rf[i].descriptor = str(args[0]) + string_dim(rf, i, 'vector')
-
-                if nargin >= 2:
-                    for i in range(np.size(rf)):
-                        rf[i].respl = args[1]
-
-                if nargin >= 3:
-                    for i in range(np.size(rf)):
-                        rf[i].probl = args[2]
-
-                if nargin >= 4:
-                    for i in range(np.size(rf)):
-                        rf[i].rell = args[3]
-
-                if nargin >= 5:
-                    for i in range(np.size(rf)):
-                        rf[i].grell = args[4]
-
-                if nargin > 5:
-                    print('WARNING: response_function:extra_arg: Extra arguments for object of class ' + str(type(rf)) + '.')
-
-        return rf
-
-    def __repr__(self):
-        #  display the object
-        string = '\n'
-        string += 'class "response_function" object = \n'
-        string += '    descriptor: ' + str(self.descriptor) + '\n'
-        string += '         respl: ' + str(self.respl) + '\n'
-        string += '         probl: ' + str(self.probl) + '\n'
-        string += '          rell: ' + str(self.rell) + '\n'
-        string += '         grell: ' + str(self.grell) + '\n'
+                raise RuntimeError('Object ' + str(args[0]) + ' is a ' + str(type(args[0])) + ' class object, not "response_function".')
+        else:
+            # asizec = array_size(*args[0:min(nargin, 1)])
+            # rf = [response_function() for i in range(asizec[0]) for j in range(asizec[1])]
+
+            # for i in range(np.size(rf)):
+            #     if (np.size(args[0]) > 1):
+            #         rf[i].descriptor = args[0][i]
+            #     else:
+            #         rf[i].descriptor = str(args[0]) + string_dim(rf, i, 'vector')
+
+            # if nargin >= 2:
+            #     for i in range(np.size(rf)):
+            #         rf[i].respl = args[1]
+
+            # if nargin >= 3:
+            #     for i in range(np.size(rf)):
+            #         rf[i].probl = args[2]
+
+            # if nargin >= 4:
+            #     for i in range(np.size(rf)):
+            #         rf[i].rell = args[3]
+
+            # if nargin >= 5:
+            #     for i in range(np.size(rf)):
+            #         rf[i].grell = args[4]
+
+            # if nargin > 5:
+            #     print('WARNING: response_function:extra_arg: Extra arguments for object of class ' + str(type(rf)) + '.')
+
+            rf = response_function()
+
+            #recover options:
+            options = pairoptions(*args)
+
+            #initialize fields:
+            rf.descriptor = options.getfieldvalue('descriptor')
+            rf.respl = options.getfieldvalue('response_levels', [])
+            rf.probl = options.getfieldvalue('probability_levels', [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+            rf.rell = options.getfieldvalue('reliability_levels', [])
+            rf.grell = options.getfieldvalue('general_reliability_levels', [])
+
+            #if the response is scaled, a partition vector should have been supplied.
+            if rf.isscaled():
+                rf.partition = options.getfieldvalue('partition')
+                npart = partition_npart(rf.partition)
+
+        return [rf] # Always return a list, so we have something akin to a MATLAB single row matrix
+
+    def __repr__(self): #{{{
+        # display the object
+        string = 'class "response_function" object = \n'
+        string = "%s\n%s" % (string, fielddisplay(self, 'descriptor', 'name tag'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'respl', 'response levels'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'probl', 'probability levels'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rell', 'reliability levels'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'grell', 'general reliability levels'))
+
+        if self.partition != []:
+            string = "%s\n%s" % (string, fielddisplay(self, 'partition', 'partition'))
 
         return string
-
-    def __len__(self):
+    #}}}
+
+    def __len__(self): #{{{
         return max(len(self.respl), len(self.probl), len(self.rell), len(self.grell))
-
-    # from here on, rf is either a single, or a 1d vector of, response_function
-
-    @staticmethod
-    def prop_desc(rf, dstr):
-        # response_function is always a vector, or should be, even with just 1
-        if type(rf) not in [list, np.ndarray]:
-            rf = [rf]
-
+    #}}}
+
+    @staticmethod
+    def prop_desc(rf, dstr): #{{{
         desc = ['' for i in range(np.size(rf))]
         for i in range(np.size(rf)):
@@ -111,46 +135,48 @@
         desc = allempty(desc)
         return desc
-
-    @staticmethod
-    def prop_stype(rf):
+    #}}}
+
+    @staticmethod
+    def prop_stype(rf): #{{{
         stype = []
         return stype
-
-    @staticmethod
-    def prop_scale(rf):
+    #}}}
+
+    @staticmethod
+    def prop_scale(rf): #{{{
         scale = []
         return scale
-
-    @staticmethod
-    def prop_weight(rf):
+    #}}}
+
+    @staticmethod
+    def prop_weight(rf): #{{{
         weight = []
         return weight
-
-    @staticmethod
-    def prop_lower(rf):
+    #}}}
+
+    @staticmethod
+    def prop_lower(rf): #{{{
         lower = []
         return lower
-
-    @staticmethod
-    def prop_upper(rf):
+    #}}}
+
+    @staticmethod
+    def prop_upper(rf): #{{{
         upper = []
         return upper
-
-    @staticmethod
-    def prop_target(rf):
+    #}}}
+
+    @staticmethod
+    def prop_target(rf): #{{{
         target = []
         return target
+    #}}}
 
     @staticmethod
     def prop_levels(rf):
-        # response_function is always a vector, or should be, even with just 1
-        if type(rf) not in [list, np.ndarray]:
-            rf = [rf]
-
         respl = empty_nd_list(np.size(rf))
         probl = empty_nd_list(np.size(rf))
         rell = empty_nd_list(np.size(rf))
         grell = empty_nd_list(np.size(rf))
-
         for i in range(np.size(rf)):
             respl[i] = rf[i].respl
@@ -158,5 +184,4 @@
             rell[i] = rf[i].rell
             grell[i] = rf[i].grell
-
         respl = allempty(respl)
         probl = allempty(probl)
@@ -165,14 +190,24 @@
         return [respl, probl, rell, grell]
 
+    #new methods:
+    def isscaled(self): #{{{
+        if strncmpi(self.descriptor, 'scaled_', 7):
+            return True
+        else:
+            return False
+    #}}}
+
     @staticmethod
     def dakota_write(fidi, dresp, rdesc):
-        # collect only the responses of the appropriate class
-        rf = [struc_class(vars(dresp)[i][j], 'response_function', 'rf') for i in fieldnames(dresp) for j in range(len(vars(dresp)[i]))]
-
         #possible namespace pollution here
         from rlist_write import rlist_write
-        # write responses
-        rdesc = rlist_write(fidi, 'response_function', 'rf', rf, rdesc)
-
+        # collect only the responses of the appropriate class
+        #rf = [struc_class(vars(dresp)[i][j], 'response_function', 'rf') for i in fieldnames(dresp) for j in range(len(vars(dresp)[i]))]
+        fields = fieldnames(dresp)
+        for field in fields:
+            if getattr(dresp, field)[0].__class__.__name__ != 'response_function':
+                delattr(dresp, field)
+        if len(dresp) > 0:
+            rdesc = rlist_write(fidi, 'response_function', 'rf', dresp, rdesc)
         return rdesc
 
Index: /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.m	(revision 24870)
@@ -13,11 +13,11 @@
 
 classdef uniform_uncertain
-    properties
-        descriptor='';
-        lower     =-Inf;
-        upper     = Inf;
-		partition = [];
-    end
-    methods
+	properties
+		descriptor	= '';
+		lower		= -Inf;
+		upper		= Inf;
+		partition	= [];
+	end
+	methods
 		function self=uniform_uncertain(varargin) %constructor {{{
 
@@ -30,7 +30,7 @@
 			self.lower=getfieldvalue(options,'lower');
 
-			%if the variable is scaled,  a partition vector should have been supplied, and 
-			%that partition vector should have as many partitions as the lower and upper 
-			%vectors:
+			%if the variable is scaled, a partition vector should have been 
+			%supplied, and  that partition vector should have as many 
+			%partitions as the lower and upper vectors:
 			if self.isscaled(),
 				self.partition=getfieldvalue(options,'partition'); 
@@ -40,5 +40,5 @@
 				end
 				if npart~=length(self.lower),
-					error(['uniform_uncertain constructor: for the scaled variable' self.described ' the lower field is not currently a vector of values for all the partitions described in the partition vector']);
+					error(['uniform_uncertain constructor: for the scaled variable' self.descriptor ' the lower field is not currently a vector of values for all the partitions described in the partition vector']);
 				end
 			end
@@ -58,37 +58,37 @@
 		function md=checkconsistency(self,md,solution,analyses) % {{{
 
-		md = checkfield(md,'field',self.upper,'fieldname','uniform_uncertain.upper','NaN',1,'Inf',1,'>',self.lower,'numel',length(self.lower));
-		md = checkfield(md,'field',self.lower,'fieldname','uniform_uncertain.lower','NaN',1,'Inf',1,'<',self.upper,'numel',length(self.upper));
-		if self.isscaled(),
-			if isempty(self.partition),
-				error('normal_uncertain is a scaled variable, but it''s missing a partition vector');
+			md = checkfield(md,'field',self.upper,'fieldname','uniform_uncertain.upper','NaN',1,'Inf',1,'>',self.lower,'numel',length(self.lower));
+			md = checkfield(md,'field',self.lower,'fieldname','uniform_uncertain.lower','NaN',1,'Inf',1,'<',self.upper,'numel',length(self.upper));
+			if self.isscaled(),
+				if isempty(self.partition),
+					error('uniform_uncertain is a scaled variable, but it''s missing a partition vector');
+				end
+				%better have a partition vector that has as many partitions as upper and lower's size: 
+				if length(self.upper)~=partition_npart(self.partition),
+					error('uniform_uncertain error message: upper and partition should be vectors of identical size');
+				end
+				if length(self.lower)~=partition_npart(self.partition),
+					error('uniform_uncertain error message: lower and partition should be vectors of identical size');
+				end
+
+				md = checkfield(md,'field',self.partition,'fieldname','uniform_uncertain.partition','NaN',1,'Inf',1,'>=',-1,'numel',[md.mesh.numberofvertices,md.mesh.numberofelements]);
+				if size(self.partition,2)>1,
+					error('uniform_uncertain error message: partition should be a column vector');
+				end
+				partcheck=unique(self.partition); 
+				partmin=min(partcheck); 
+				partmax=max(partcheck);
+				if partmax<-1,
+					error('uniform_uncertain error message: partition vector''s min value should be -1 (for no partition), or start at 0');
+				end
+				nmax=max(md.mesh.numberofelements,md.mesh.numberofvertices);
+				if partmax>nmax,
+					error('uniform_uncertain error message: partition vector''s values cannot go over the number of vertices or elements');
+				end
 			end
-			%better have a partition vector that has as many partitions as stddev's size: 
-			if  length(self.upper)~=partition_npart(self.partition),
-				error('uniform_uncertain error message: upper and partition should be vectors of identical size');
-			end
-			if  length(self.lower)~=partition_npart(self.partition),
-				error('uniform_uncertain error message: lower and partition should be vectors of identical size');
-			end
-
-			md = checkfield(md,'field',self.partition,'fieldname','normal_uncertain.partition','NaN',1,'Inf',1,'>=',-1,'numel',[md.mesh.numberofvertices,md.mesh.numberofelements]);
-			if size(self.partition,2)>1,
-				error('uniform_uncertain error message: partition should be a column vector');
-			end
-			partcheck=unique(self.partition); 
-			partmin=min(partcheck); 
-			partmax=max(partcheck);
-			if partmax<-1,
-				error('uniform_uncertain error message: partition vector''s min value should be -1 (for no partition), or start at 0');
-			end
-			nmax=max(md.mesh.numberofelements,md.mesh.numberofvertices);
-			if partmax>nmax,
-				error('uniform_uncertain error message: partition vector''s values cannot go over the number of vertices or elements');
-			end
-		end
-	end % }}}
-	%virtual functions needed by qmu processing algorithms:
-	%implemented:
-		function [desc]  =prop_desc(uuv,dstr) % {{{
+		end % }}}
+		%virtual functions needed by qmu processing algorithms:
+		%implemented:
+		function [desc] = prop_desc(uuv,dstr) % {{{
 			desc=cell(1,numel(uuv));
 			for i=1:numel(uuv)
@@ -105,5 +105,5 @@
 			desc=allempty(desc);
 		end %}}}
-		function [lower] =prop_lower(uuv) % {{{
+		function [lower] = prop_lower(uuv) % {{{
 			lower=zeros(1,numel(uuv));
 			for i=1:numel(uuv)
@@ -112,5 +112,5 @@
 			lower=allequal(lower,-Inf);
 		end %}}}
-		function [upper] =prop_upper(uuv) % {{{
+		function [upper] = prop_upper(uuv) % {{{
 			upper=zeros(1,numel(uuv));
 			for i=1:numel(uuv)
@@ -119,48 +119,48 @@
 			upper=allequal(upper, Inf);
 		end % }}}
-	%default
+		%default
 		function [stddev]=prop_stddev(uuv)  %{{{
 			stddev=[];
-			end % }}}
-			function [mean]  =prop_mean(nuv) % {{{
+		end % }}}
+		function [mean]  =prop_mean(nuv) % {{{
 			mean=[];
-			end % }}}
-			function [initpt]=prop_initpt(uuv) %{{{
+		end % }}}
+		function [initpt]=prop_initpt(uuv) %{{{
 			initpt=[];
-			end %}}}
-			function [initst]=prop_initst(uuv) %{{{
-				initst=[];
-				end %}}}
-				function [stype] =prop_stype(uuv) %{{{
-				stype={};
-				end %}}}
-				function [scale] =prop_scale(uuv) %{{{
-				scale=[];
-				end %}}}
-				function [abscissas] =prop_abscissas(hbu) % {{{
-				abscissas=[]; 
-				end % }}}
-				function [counts] =prop_counts(hbu) % {{{
-				counts=[]; 
-				end % }}}
-	function [pairs_per_variable] =prop_pairs_per_variable(hbu) % {{{
-		pairs_per_variable=[];
-	end % }}}
-	%new methods: 
-	function scaled =isscaled(self) % {{{
-		if strncmp(self.descriptor,'scaled_',7),
-			scaled=1;
-		else
-			scaled=0;
-		end
-	end % }}}
-    end
+		end %}}}
+		function [initst]=prop_initst(uuv) %{{{
+			initst=[];
+		end %}}}
+		function [stype] =prop_stype(uuv) %{{{
+			stype={};
+		end %}}}
+		function [scale] =prop_scale(uuv) %{{{
+			scale=[];
+		end %}}}
+		function [abscissas] =prop_abscissas(hbu) % {{{
+			abscissas=[]; 
+		end % }}}
+		function [counts] =prop_counts(hbu) % {{{
+			counts=[]; 
+		end % }}}
+		function [pairs_per_variable] =prop_pairs_per_variable(hbu) % {{{
+			pairs_per_variable=[];
+		end % }}}
+		%new methods: 
+		function scaled =isscaled(self) % {{{
+			if strncmp(self.descriptor,'scaled_',7),
+				scaled=1;
+			else
+				scaled=0;
+			end
+		end % }}}
+	end
 	methods (Static)
-        function []=dakota_write(fidi,dvar) % {{{
+		function []=dakota_write(fidi,dvar) % {{{
 			%  collect only the variables of the appropriate class
-            uuv=struc_class(dvar,'uniform_uncertain');
+			uuv=struc_class(dvar,'uniform_uncertain');
 			%  write variables
-            vlist_write(fidi,'uniform_uncertain','uuv',uuv);
-        end %}}}
-    end
+			vlist_write(fidi,'uniform_uncertain','uuv',uuv);
+		end %}}}
+	end
 end
Index: /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.py	(revision 24870)
@@ -1,28 +1,46 @@
 import numpy as np
-#from vlist_write import *
+
 from MatlabArray import *
+from MatlabFuncs import *
+from fielddisplay import fielddisplay
+from pairoptions import pairoptions
+from partition_npart import *
 
 
 class uniform_uncertain(object):
     '''
-  definition for the uniform_uncertain class.
-
-  [uuv] = uniform_uncertain.uniform_uncertain(args)
-   uuv = uniform_uncertain()
-
-  where the required args are:
-    descriptor    (str, description, '')
-    lower         (float, lower bound, -np.Inf)
-    upper         (float, upper bound, np.Inf)
-
-  note that zero arguments constructs a default instance, one
-  argument of the class copies the instance, and three or more
-  arguments constructs a new instance from the arguments.
-'''
-
+    UNIFORM_UNCERTAIN class definition
+
+    Usage:
+        nuv = uniform_uncertain(
+            'descriptor', descriptor,
+            'lower', lower,
+            'upper', upper,
+            'partition', partition
+            )
+
+        where nuv is the uniform_uncertain object returned by the constructor, 
+        lower and upper are the pdf distribution bounds, and partition is the 
+        partition vector for distributed variables. Can be a partition vector 
+        over elements or vertices.
+
+    Example:
+        md.qmu.variables.rheology = uniform_uncertain(
+            'descriptor', 'RheologyBBar',
+            'lower', 1e8,
+            'upper', 1e9
+            )
+        md.qmu.variables.rheology = uniform_uncertain(
+            'descriptor', 'RheologyBBar',
+            'lower', 1e8,
+            'upper', 1e9,
+            'partition', vpartition
+            )
+    '''
     def __init__(self):
         self.descriptor = ''
-        self.lower = -np.Inf
-        self.upper = np.Inf
+        self.lower      = -np.Inf
+        self.upper      = np.Inf
+        self.partition  = []
 
     @staticmethod
@@ -41,45 +59,75 @@
                 raise RuntimeError('Object ' + str(args[0]) + ' is a ' + str(type(args[0])) + ' class object, not "uniform_uncertain".')
 
-        # not enough arguments
-        elif nargin == 2:
-            raise RuntimeError('Construction of "uniform_uncertain" class object requires at least 3 inputs.')
-
         # create the object from the input
         else:
-            # leaving this here in case it becomes important in the future
-            #asizec = array_size(*args[0:min(nargin, 3)])
-            #uuv = [uniform_uncertain() for i in range(asizec[0]) for j in range(asizec[1])]
             uuv = uniform_uncertain()
-            uuv.descriptor = str(args[0])
-            uuv.lower = args[1]
-            uuv.upper = args[2]
-        if (nargin > 3):
-            print('WARNING: uniform_uncertain:extra_arg: Extra arguments for object of class ' + type(uuv) + '.')
-
-        return [uuv]
-
-    def __repr__(self):
-        # display an individual object
-        string = '\n'
-        string += 'class "uniform_uncertain" object = \n'
-        string += '    descriptor: ' + str(self.descriptor) + '\n'
-        string += '         lower: ' + str(self.lower) + '\n'
-        string += '         upper: ' + str(self.upper) + '\n'
-
+
+            #recover options:
+            options = pairoptions(*args)
+
+            #initialize fields:
+            uuv.descriptor = options.getfieldvalue('descriptor', '')
+            uuv.lower      = options.getfieldvalue('lower', -np.Inf)
+            uuv.upper      = options.getfieldvalue('upper', np.Inf)
+
+            #if the variable is scaled, a partition vector should have been 
+            #supplied, and  that partition vector should have as many partitions as 
+            #the lower and upper vectors:
+            if uuv.isscaled():
+                uuv.partition = options.getfieldvalue('partition')
+                npart = partition_npart(uuv.partition)
+                if npart != len(uuv.upper):
+                    raise RuntimeError("uniform_uncertain constructor: for the scaled variable %s the upper field is not currently a vector of values for all the partitions described in the partition vector" % uuv.descriptor)
+                if npart != len(uuv.lower):
+                    raise RuntimeError("uniform_uncertain constructor: for the scaled variable %s the lower field is not currently a vector of values for all the partitions described in the partition vector" % uuv.descriptor)
+                    
+        return [uuv] # Always return a list, so we have something akin to a MATLAB single row matrix
+
+    def __repr__(self): #{{{
+        string = '   uniform uncertain variable: '
+        string = "%s\n%s" % (string, fielddisplay(self, 'descriptor', 'name tag'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'lower', 'pdf lower bound'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'upper', 'pdf upper bound'))
+        if self.partition != []:
+            string = "%s\n%s" % (string, fielddisplay(self, 'partition', 'partition vector defining where sampling will occur'))
         return string
-
-    # from here on, uuv is either a single, or a 1d vector of, uniform_uncertain
-
-    @staticmethod
-    def prop_desc(uuv, dstr):
-        if type(uuv) not in [list, np.ndarray]:
-            if uuv.descriptor != '' or type(uuv.descriptor) != str:
-                desc = str(uuv.descriptor)
-            elif dstr != '':
-                desc = str(dstr)
-            else:
-                desc = 'uuv'
-            return desc
-
+    #}}}
+
+    def __len__(self): #{{{
+        if type(self.lower) in [list, np.ndarray]:
+            return len(self.lower)
+        else:
+            return 1
+    #}}}
+    
+    def checkconsistency(self, md, solution, analyses): #{{{
+        md = checkfield(md, 'field', self.upper, 'fieldname', 'uniform_uncertain.upper', 'NaN', 1, 'Inf', 1, '>', self.lower, 'numel', len(self.lower))
+        md = checkfield(md, 'field', self.lower, 'fieldname', 'uniform_uncertain.upper', 'NaN', 1, 'Inf', 1, '<', self.upper, 'numel', len(self.upper))
+        if self.isscaled():
+            if self.partition == []:
+                raise RuntimeError("uniform_uncertain is a scaled variable, but it's missing a partition vector")
+            #better have a partition vector that has as many partitions as upper and lower's size: 
+            if len(self.upper) != partition_npart(self.partititon):
+                raise RuntimeError("uniform_uncertain error message: upper and partition should be vectors of identical size")
+            if len(self.lower) != partition_npart(self.partition):
+                raise RuntimeError("uniform_uncertain error message: lower and partition should be vectors of identical size")
+            md = checkfield(md, 'field', self.partition, 'fieldname', 'uniform_uncertain.partition', 'NaN', 1, 'Inf', 1, '>=', -1, 'numel', [md.mesh.numberofvertices, md.mesh.numberofvertices])
+            if self.partition.shape[1] > 1:
+                raise RuntimeError("uniform_uncertain error message: partition should be a column vector")
+            partcheck = np.unique(self.partition)
+            partmin = min(partcheck)
+            partmax = max(partcheck)
+            if partmax < -1:
+                raise RuntimeError("uniform_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:
+                raise RuntimeError("uniform_uncertain error message: partition vector's values cannot go over the number of vertices or elements")
+    #}}}
+
+    #virtual functions needed by qmu processing algorithms:
+    #implemented:
+
+    @staticmethod
+    def prop_desc(uuv, dstr): #{{{
         desc = ['' for i in range(np.size(uuv))]
         for i in range(np.size(uuv)):
@@ -94,14 +142,10 @@
 
         return desc
-
-    @staticmethod
-    def prop_initpt(uuv):
-        initpt = []
-        return initpt
-
-    @staticmethod
-    def prop_lower(uuv):
+    #}}}
+
+    @staticmethod
+    def prop_lower(uuv): #{{{
         if type(uuv) not in [list, np.ndarray]:
-            return uuv.lower
+            return [uuv.lower]
 
         lower = np.zeros(np.size(uuv))
@@ -112,9 +156,10 @@
 
         return lower
-
-    @staticmethod
-    def prop_upper(uuv):
+    #}}}
+
+    @staticmethod
+    def prop_upper(uuv): #{{{
         if type(uuv) not in [list, np.ndarray]:
-            return uuv.upper
+            return [uuv.upper]
 
         upper = np.zeros(np.size(uuv))
@@ -125,36 +170,79 @@
 
         return upper
-
-    @staticmethod
-    def prop_mean(uuv):
+    #}}}
+
+    @staticmethod
+    def prop_stddev(uuv): #{{{
+        stddev = []
+        return stddev
+    #}}}
+
+    @staticmethod
+    def prop_mean(uuv): #{{{
         mean = []
         return mean
-
-    @staticmethod
-    def prop_stddev(uuv):
-        stddev = []
-        return stddev
-
-    @staticmethod
-    def prop_initst(uuv):
+    #}}}
+
+    @staticmethod
+    def prop_initpt(uuv): #{{{
+        initpt = []
+        return initpt
+    #}}}
+
+    @staticmethod
+    def prop_initst(uuv): #{{{
         initst = []
         return initst
-
-    @staticmethod
-    def prop_stype(uuv):
+    #}}}
+
+    @staticmethod
+    def prop_stype(uuv): #{{{
         stype = []
         return stype
-
-    @staticmethod
-    def prop_scale(uuv):
+    #}}}
+
+    @staticmethod
+    def prop_scale(uuv): #{{{
         scale = []
         return scale
-
-    @staticmethod
-    def dakota_write(fidi, dvar):
-        # collect only the variables of the appropriate class
-        uuv = [struc_class(i, 'uniform_uncertain', 'uuv') for i in dvar]
+    #}}}
+
+    @staticmethod
+    def prop_abscissas(hbu): #{{{
+        abscissas = []
+        return abscissas
+    #}}}
+
+    @staticmethod
+    def prop_counts(hbu): #{{{
+        counts = []
+        return counts
+    #}}}
+
+    @staticmethod
+    def prop_pairs_per_variable(hbu): #{{{
+        pairs_per_variable = []
+        return pairs_per_variable
+    #}}}
+
+    #new methods:
+    def isscaled(self): #{{{
+        if strncmp(self.descriptor, 'scaled_', 7):
+            return True
+        else:
+            return False
+    #}}}
+
+    @staticmethod
+    def dakota_write(fidi, dvar): #{{{
         # possible namespace pollution, the above import seems not to work
         from vlist_write import vlist_write
-        # write variables
-        vlist_write(fidi, 'uniform_uncertain', 'uuv', uuv)
+        # # collect only the variables of the appropriate class
+        # uuv = [struc_class(i, 'uniform_uncertain', 'uuv') for i in dvar]
+        fields = fieldnames(dvar)
+        for field in fields:
+            if getattr(dvar, field)[0].__class__.__name__ != 'uniform_uncertain':
+                delattr(dvar, field)
+        if len(dvar) > 0:
+            vlist_write(fidi, 'uniform_uncertain', 'uuv', dvar)
+    #}}}
Index: /issm/trunk-jpl/src/m/qmu/dakota_in_write.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/dakota_in_write.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/dakota_in_write.m	(revision 24870)
@@ -109,7 +109,9 @@
 responses_write(fidi,dmeth,dresp,params);
 
-
 fclose(fidi);
 display('End of file successfully written.');
+
+% Uncomment to print contents of Dakota input file (for debugging)
+% type([name ext]);
 
 end
@@ -186,5 +188,4 @@
 
 %  variables vary by method
-
 for i=1:length(dmeth.variables)
     fhvar=str2func([dmeth.variables{i} '.dakota_write']);
Index: /issm/trunk-jpl/src/m/qmu/dakota_in_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/dakota_in_write.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/dakota_in_write.py	(revision 24870)
@@ -94,4 +94,7 @@
     print('End of file successfully written.')
 
+    # Uncomment to print contents of Dakota input file (for debugging)
+    # with open(filei2, 'r') as fidi:
+    #     print(fidi.read())
 
 #  function to write the strategy section of the file
@@ -153,40 +156,59 @@
 def variables_write(fidi, dmeth, dvar):
 
+    # print('Writing variables section of Dakota input file.')
+
+    # fidi.write('variables, \n')
+
+    # #  variables vary by method
+    # fd = fieldnames(dvar)
+    # types = []
+    # var = []
+    # for i in range(len(fd)):
+    #     i_type = eval('dvar.{}[0].__class__.__name__'.format(fd[i]))
+    #     j = dmeth.variables.index(i_type)
+    #     str_name = dmeth.variables[j]
+
+    # # organize so that multiple instances of the same qmu class
+    # # (2 different variable instances of "normal_uncertain" for example)
+    # # are in the same dakota_write call regardless of individual size
+    # # but that each class has its own dakota_write call
+    #     if str_name not in types:
+    #         types.append(str_name)
+    #         var.append(eval('dvar.{}'.format(fd[i])))
+    #     else:
+    #         t = types.index(str_name)
+    #         var[t].extend(eval('dvar.{}'.format(fd[i])))
+
+    # for t in range(len(types)):
+    #     v = eval('{}.{}()'.format(types[t], types[t]))
+    #     v.dakota_write(fidi, var[t])
+
+    # #  linear constraints vary by method
+    # fc = dmeth.lcspec
+
+    # for i in range(len(dmeth.lcspec)):
+    #     str_name = dmeth.lcspec[i]
+    #     var = eval('{}.{}()'.format(str_name, str_name))
+    # # check that str_name is correct against matlab version which has no argument there
+    #     var.dakota_write(fidi, eval('dvar.{}[i]'.format(j)), str_name)
+
+    # fidi.write('\n')
+
     print('Writing variables section of Dakota input file.')
 
     fidi.write('variables, \n')
 
-    #  variables vary by method
-    fd = fieldnames(dvar)
-    types = []
-    var = []
-    for i in range(len(fd)):
-        i_type = eval('dvar.{}[0].__class__.__name__'.format(fd[i]))
-        j = dmeth.variables.index(i_type)
-        str_name = dmeth.variables[j]
-
-    # organize so that multiple instances of the same qmu class
-    # (2 different variable instances of "normal_uncertain" for example)
-    # are in the same dakota_write call regardless of individual size
-    # but that each class has its own dakota_write call
-        if str_name not in types:
-            types.append(str_name)
-            var.append(eval('dvar.{}'.format(fd[i])))
-        else:
-            t = types.index(str_name)
-            var[t].extend(eval('dvar.{}'.format(fd[i])))
-
-    for t in range(len(types)):
-        v = eval('{}.{}()'.format(types[t], types[t]))
-        v.dakota_write(fidi, var[t])
-
-    #  linear constraints vary by method
-    fc = dmeth.lcspec
+    for i in range(len(dmeth.variables)):
+        str_name = dmeth.variables[i]
+        # TODO: Remove this check after continuous_state.py has been updated!
+        if str_name != 'continuous_state':
+            var = eval('{}.{}()'.format(str_name, str_name))
+            var.dakota_write(fidi, dvar)
 
     for i in range(len(dmeth.lcspec)):
         str_name = dmeth.lcspec[i]
         var = eval('{}.{}()'.format(str_name, str_name))
-    # check that str_name is correct against matlab version which has no argument there
-        var.dakota_write(fidi, eval('dvar.{}[i]'.format(j)), str_name)
+        # check that str_name is correct against matlab version which has no argument there
+        var.dakota_write(fidi, eval('dvar.{}[i]'.format(str_name)), str_name)
 
     fidi.write('\n')
@@ -275,5 +297,4 @@
 
     rdesc = []
-
     for i in range(len(dmeth.responses)):
         resp = eval(dmeth.responses[i])
Index: /issm/trunk-jpl/src/m/qmu/expandvariables.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/expandvariables.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/expandvariables.m	(revision 24870)
@@ -5,5 +5,4 @@
 for i=1:length(fnames)
 
-		
     if isa(variables.(fnames{i}),'linear_inequality_constraint') || isa(variables.(fnames{i}),'linear_equality_constraint'  )
 		%for linear constraints, just copy
Index: /issm/trunk-jpl/src/m/qmu/expandvariables.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/expandvariables.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/expandvariables.py	(revision 24870)
@@ -1,5 +1,4 @@
 from QmuSetupVariables import *
 from helpers import *
-
 from qmu_classes import *
 
@@ -13,5 +12,5 @@
 
     for k in fnames:
-        v = eval('variables.{}'.format(k))
+        v = getattr(variables, k)
 
     #  for linear constraints, just copy
@@ -24,4 +23,4 @@
             for j in range(len(v)):
                 #call setupdesign
-                exec('dvar.{}=QmuSetupVariables(md, dvar.{}, v[j])'.format(k, k))
+                exec('dvar.{}=QmuSetupVariables(md, v[j])'.format(k, k))
     return dvar
Index: /issm/trunk-jpl/src/m/qmu/helpers.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/helpers.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/helpers.py	(revision 24870)
@@ -176,5 +176,5 @@
 
     def __delattr__(self, key):
-        if name not in self._k:
+        if key not in self._k:
             raise AttributeError('Attribute "' + str(attr) + '" does not exist or is an internal field and therefore cannot be deleted safely.')
         self.pop(key)
Index: /issm/trunk-jpl/src/m/qmu/importancefactors.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/importancefactors.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/importancefactors.m	(revision 24870)
@@ -8,5 +8,4 @@
 %   Example: factors=importancefactors(md,'drag','max_vel');
 %
-
 variablenamelength=length(variablename);
 
Index: /issm/trunk-jpl/src/m/qmu/importancefactors.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/importancefactors.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/importancefactors.py	(revision 24870)
@@ -10,6 +10,5 @@
 
     Example: factors = importancefactors(md, 'drag', 'max_vel')
-'''
-
+    '''
     variablenamelength = len(variablename)
 
Index: /issm/trunk-jpl/src/m/qmu/preqmu.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/preqmu.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/preqmu.py	(revision 24870)
@@ -50,5 +50,5 @@
     # go through variables and responses, and check they don't have more than
     #   md.qmu.numberofpartitions values. Also determine numvariables and numresponses
-    #[[[
+    #{{{
     numvariables = 0
     variable_fieldnames = fieldnames(variables)
@@ -57,7 +57,8 @@
         fieldvariables = vars(variables)[field_name]
         for j in range(np.size(fieldvariables)):
-            if strncmpi(fieldvariables[j].descriptor, '\'scaled_', 8) and str2int(fieldvariables[j].descriptor, 'last') > md.qmu.numberofpartitions:
-                raise RuntimeError('preqmu error message: one of the expanded variables has more values than the number of partitions (setup in md.qmu.numberofpartitions)')
-
+            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)')
         numvariables = numvariables + np.size(vars(variables)[field_name])
 
@@ -68,10 +69,10 @@
         fieldresponses = vars(responses)[field_name]
         for j in range(np.size(fieldresponses)):
-            if strncmpi(fieldresponses[j].descriptor, '\'scaled_', 8) and 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 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)')
         numresponses = numresponses + np.size(vars(responses)[field_name])
-
-    #]]]
+    #}}}
 
     # create in file for dakota
Index: /issm/trunk-jpl/src/m/qmu/rlist_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/rlist_write.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/rlist_write.py	(revision 24870)
@@ -9,7 +9,6 @@
 def rlist_write(fidi, cstring, cstring2, dresp, rdesc):
     '''
-  function to write response list
-'''
-
+    function to write response list
+    '''
     if dresp is None:
         return
@@ -17,9 +16,8 @@
     func = eval(cstring)
 
-    if type(dresp) not in [list, np.ndarray]:
-        dresp = [dresp]
+    # if type(dresp) not in [list, np.ndarray]:
+    #     dresp = [dresp]
 
-    # put responses into lists for writing
-    # (and accumulate descriptors into list for subsequent writing)
+    fnames = fieldnames(dresp)
 
     nresp = 0
@@ -31,17 +29,14 @@
     ptarget = []
 
-    # assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
-    #   which will always be true since this is called per field
-    fnames = fieldnames(dresp[0])
-    for j in range(len(dresp)):
-        for i in range(np.size(fnames)):
-            nresp = nresp + np.size(vars(dresp[j])[fnames[i]])
-            pstype.extend(func.prop_stype(vars(dresp[j])[fnames[i]]))
-            pscale.extend(func.prop_scale(vars(dresp[j])[fnames[i]]))
-            pweight.extend(func.prop_weight(vars(dresp[j])[fnames[i]]))
-            plower.extend(func.prop_lower(vars(dresp[j])[fnames[i]]))
-            pupper.extend(func.prop_upper(vars(dresp[j])[fnames[i]]))
-            ptarget.extend(func.prop_target(vars(dresp[j])[fnames[i]]))
-            rdesc.extend(func.prop_desc(vars(dresp[j])[fnames[i]], fnames[i]))
+    for i in range(len(fnames)):
+        field = getattr(dresp, format(fnames[i]))
+        nresp = nresp + len(field)
+        pstype.extend(func.prop_stype(field))
+        pscale.extend(func.prop_scale(field))
+        pweight.extend(func.prop_weight(field))
+        plower.extend(func.prop_lower(field))
+        pupper.extend(func.prop_upper(field))
+        ptarget.extend(func.prop_target(field))
+        rdesc.extend(func.prop_desc(field, field[0].descriptor))
 
     # write responses
Index: /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 24870)
@@ -23,5 +23,4 @@
 	%ok, dealing with semi-discrete distributed variable. Distribute according to how many 
 	%partitions we want
-
 	for j=1:md.qmu.numberofpartitions
 		dvar(end+1)           =variables;
Index: /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.py	(revision 24870)
@@ -1,10 +1,10 @@
 from MatlabFuncs import *
+from copy import deepcopy
+from helpers import *
+from normal_uncertain import *
 from uniform_uncertain import *
-from normal_uncertain import *
-from copy import deepcopy
 
 
-def QmuSetupVariables(md, dvar, variables):
-
+def QmuSetupVariables(md, variables):
     #get descriptor
     descriptor = variables.descriptor
@@ -12,4 +12,6 @@
     #decide whether this is a distributed variable, which will drive whether we expand it into npart values,
     #or if we just carry it forward as is.
+
+    dvar = []
 
     #ok, key off according to type of descriptor:
@@ -19,58 +21,39 @@
             if ((type(variables.lower) in [list, np.ndarray] and len(variables.lower) > md.qmu.numberofpartitions) or (type(variables.upper) in [list, np.ndarray] and len(variables.upper) > md.qmu.numberofpartitions)):
                 raise RuntimeError('QmuSetupDesign error message: upper and lower should be either a scalar or a "npart" length vector')
-
         elif isinstance(variables, normal_uncertain):
             if type(variables.stddev) in [list, np.ndarray] and len(variables.stddev) > md.qmu.numberofpartitions:
                 raise RuntimeError('QmuSetupDesign error message: stddev should be either a scalar or a "npart" length vector')
 
-        #ok, dealing with semi - discrete distributed variable. Distribute according to how many
+        #ok, dealing with semi-discrete distributed variable. Distribute according to how many
         #partitions we want
         for j in range(md.qmu.numberofpartitions):
             dvar.append(deepcopy(variables))
-            # "'" is because qmu.in files need for strings to be in actual ''
-            # must also account for whether we are given 1 instance or an array of instances
-            # handle descriptors for everything
-            if type(dvar[-1].descriptor) in [list, np.ndarray] and len(variables.descriptor) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-                if type(variables.descriptor) == np.ndarray:
-                    dvar[-1].descriptor = np.append(dvar[-1].descriptor, "'" + str(variables.descriptor) + '_' + str(j + 1) + "'")
-                else:
-                    dvar[-1].descriptor.append("'" + str(variables.descriptor) + '_' + str(j + 1) + "'")
-            else:
-                dvar[-1].descriptor = "'" + str(variables.descriptor) + '_' + str(j + 1) + "'"
 
-    # handle uniform_uncertain
+            # text parsing in dakota requires literal "'identifier'" not just "identifier"
+            dvar[-1].descriptor = "'" + str(variables.descriptor) + '_' + str(j + 1) + "'"
+
             if isinstance(variables, uniform_uncertain):
-                if type(variables.lower) in [list, np.ndarray] and len(variables.lower) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-                    if type(variables.lower) == np.ndarray:
-                        dvar[-1].lower = np.append(dvar[-1].lower, variables.lower[j])
-                    else:
-                        dvar[-1].lower.append(variables.lower[j])
+                if type(variables.lower) in [list, np.ndarray]:
+                    dvar[-1].lower = variables.lower[j]
                 else:
                     dvar[-1].lower = variables.lower
-
-                if type(variables.upper) in [list, np.ndarray] and len(variables.upper) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-                    if type(variables.upper) == np.ndarray:
-                        dvar[-1].upper = np.append(dvar[-1].upper, variables.upper[j])
-                    else:
-                        dvar[-1].upper.append(variables.upper[j])
+                if type(variables.upper) in [list, np.ndarray]:
+                    dvar[-1].upper = variables.upper[j]
                 else:
                     dvar[-1].upper = variables.upper
-
-    # handle normal_uncertain
             elif isinstance(variables, normal_uncertain):
-                if type(variables.stddev) in [list, np.ndarray] and len(variables.stddev) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-                    if type(variables.stddev) == np.ndarray:
-                        dvar[-1].stddev = np.append(dvar[-1].stddev, variables.stddev[j])
-                    else:
-                        dvar[-1].stddev.append(variables.stddev[j])
+                if type(variables.stddev) in [list, np.ndarray]:
+                    dvar[-1].stddev = variables.stddev[j]
                 else:
                     dvar[-1].stddev = variables.stddev
+                if type(variables.mean) in [list, np.ndarray]:
+                    dvar[-1].mean = variables.mean[j]
+                else:
+                    dvar[-1].mean = variables.mean
+    else:
+        dvar.append(deepcopy(variables))
 
-    # running with a single instance, and therefore length 1 arrays of qmu classes
-    else:
-        dvar.append(variables)
-    # text parsing in dakota requires literal "'identifier'" not just "identifier"
-        for v in dvar:
-            v.descriptor = "'" + str(v.descriptor) + "'"
+        # text parsing in dakota requires literal "'identifier'" not just "identifier"
+        dvar[-1].descriptor = "'" + str(variables.descriptor) + "'"
 
     return dvar
Index: /issm/trunk-jpl/src/m/qmu/vlist_write.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/vlist_write.m	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/vlist_write.m	(revision 24870)
@@ -7,4 +7,6 @@
     return;
 end
+
+fnames=fieldnames(dvar);
 
 %  put variables into lists for writing
@@ -24,5 +26,4 @@
 pdesc  =[];
 
-fnames=fieldnames(dvar);
 for i=1:numel(fnames)
     nvar=nvar+numel(dvar.(fnames{i}));
Index: /issm/trunk-jpl/src/m/qmu/vlist_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/vlist_write.py	(revision 24869)
+++ /issm/trunk-jpl/src/m/qmu/vlist_write.py	(revision 24870)
@@ -13,5 +13,4 @@
     This is used for when both the input dvar and the 'cstring' variables have non - 1 length
     '''
-
     if np.size(a) == l:
         if p == 0:
@@ -41,40 +40,42 @@
     if dvar is None:
         return
-    #from uniform_uncertain import *
+
     func = eval(cstring)
 
+    # if type(dvar) not in [list, np.ndarray]:
+    #     dvar = [dvar]
+    
+    fnames = fieldnames(dvar)
+    
     # put variables into lists for writing
-
-    if type(dvar) not in [list, np.ndarray]:
-        dvar = [dvar]
-
-    # assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
-    #   which will always be true since this vlist_write is called per field
-    fnames = fieldnames(dvar[0])
-
     nvar = 0
-    pinitpt = [[] for i in range(len(fnames))]
-    plower = [[] for i in range(len(fnames))]
-    pupper = [[] for i in range(len(fnames))]
-    pmean = [[] for i in range(len(fnames))]
-    pstddev = [[] for i in range(len(fnames))]
-    pinitst = [[] for i in range(len(fnames))]
-    pstype = [[] for i in range(len(fnames))]
-    pscale = [[] for i in range(len(fnames))]
-    pdesc = [[] for i in range(len(fnames))]
+    pinitpt = []
+    plower = []
+    pupper = []
+    pmean = []
+    pstddev = []
+    pinitst = []
+    pstype = []
+    pscale = []
+    ppairs_per_variable = []
+    pabscissas = []
+    pcounts = []
+    pdesc = []
 
     for i in range(len(fnames)):
-        nvar += len(dvar)
-        for j in dvar:
-            j = vars(j)[fnames[i]]
-            pinitpt[i].extend(check(func.prop_initpt(j), len(dvar), len(pinitpt[i])))
-            plower[i].extend(check(func.prop_lower(j), len(dvar), len(plower[i])))
-            pupper[i].extend(check(func.prop_upper(j), len(dvar), len(pupper[i])))
-            pmean[i].extend(check(func.prop_mean(j), len(dvar), len(pmean[i])))
-            pstddev[i].extend(check(func.prop_stddev(j), len(dvar), len(pstddev[i])))
-            pinitst[i].extend(check(func.prop_initst(j), len(dvar), len(pinitst[i])))
-            pstype[i].extend(check(func.prop_stype(j), len(dvar), len(pstype[i])))
-            pscale[i].extend(check(func.prop_scale(j), len(dvar), len(pscale[i])))
-            pdesc[i].extend(check(func.prop_desc(j, fnames[i]), len(dvar), len(pdesc[i])))
+        field = getattr(dvar, format(fnames[i]))
+        nvar = nvar + len(field)
+        pinitpt.extend(func.prop_initpt(field))
+        plower.extend(func.prop_lower(field))
+        pupper.extend(func.prop_upper(field))
+        pmean.extend(func.prop_mean(field))
+        pstddev.extend(func.prop_stddev(field))
+        pinitst.extend(func.prop_initst(field))
+        pstype.extend(func.prop_stype(field))
+        pscale.extend(func.prop_scale(field))
+        ppairs_per_variable.extend(func.prop_pairs_per_variable(field))
+        pabscissas.extend(func.prop_abscissas(field))
+        pcounts.extend(func.prop_counts(field))
+        pdesc.extend(func.prop_desc(field, field[0].descriptor))
 
     pinitpt = allempty(pinitpt)
@@ -86,4 +87,7 @@
     pstype = allempty(pstype)
     pscale = allempty(pscale)
+    ppairs_per_variable = allempty(ppairs_per_variable)
+    pabscissas = allempty(pabscissas)
+    pcounts = allempty(pcounts)
     pdesc = allempty(pdesc)
 
@@ -124,6 +128,18 @@
         vector_write(fidi, '\t    ', pscale, 6, 76)
 
+    if not isempty(ppairs_per_variable):
+        fidi.write('\t  ' + cstring2 + '_pairs_per_variable =\n')
+        vector_write(fidi, '\t    ', ppairs_per_variable, 6, 76)
+
+    if not isempty(pabscissas):
+        fidi.write('\t  ' + cstring2 + '_abscissas =\n')
+        vector_write(fidi, '\t    ', pabscissas, 6, 76)
+
+    if not isempty(pcounts):
+        fidi.write('\t  ' + cstring2 + '_counts =\n')
+        vector_write(fidi, '\t    ', pcounts, 6, 76)
+
     if not isempty(pdesc):
-        fidi.write('\t  ' + cstring2 + '_descriptors =\n')
+        fidi.write('\t  ' + 'descriptors =\n')
         vector_write(fidi, '\t    ', pdesc, 6, 76)
 
Index: /issm/trunk-jpl/test/NightlyRun/test218.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test218.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test218.py	(revision 24870)
@@ -84,8 +84,13 @@
 
 #variables
-md.qmu.variables.rheology_B = normal_uncertain.normal_uncertain('scaled_MaterialsRheologyB', 1, .05)
+md.qmu.variables.rheology_B = normal_uncertain.normal_uncertain(
+	'descriptor', 'scaled_MaterialsRheologyB',
+	'mean', np.ones(md.mesh.numberofvertices),
+	'stddev', .05 * np.ones(md.mesh.numberofvertices),
+	'partition', md.qmu.vpartition
+	)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor', 'MaxVel')
 
 #method
Index: /issm/trunk-jpl/test/NightlyRun/test234.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test234.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test234.py	(revision 24870)
@@ -43,15 +43,20 @@
 
 #variables
-md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance', 1, 0.1)
+md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_SmbMassBalance',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .1 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
+md.qmu.responses.IceVolume = response_function.response_function('descriptor','IceVolume')
+md.qmu.responses.MassFlux1 = response_function.response_function('descriptor','indexed_MassFlux_1')
+md.qmu.responses.MassFlux2 = response_function.response_function('descriptor','indexed_MassFlux_2')
+md.qmu.responses.MassFlux3 = response_function.response_function('descriptor','indexed_MassFlux_3')
+md.qmu.responses.MassFlux4 = response_function.response_function('descriptor','indexed_MassFlux_4')
+md.qmu.responses.MassFlux5 = response_function.response_function('descriptor','indexed_MassFlux_5')
+md.qmu.responses.massFlux6 = response_function.response_function('descriptor','indexed_MassFlux_6')
 
 #mass flux profiles
Index: /issm/trunk-jpl/test/NightlyRun/test244.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test244.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test244.py	(revision 24870)
@@ -73,5 +73,10 @@
 
 #variables
-md.qmu.variables.surface_mass_balanceC = normal_uncertain.normal_uncertain('scaled_SmbC', 1, 0.5)
+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
+    )
 Tmin = 273.
 telms = np.atleast_2d(np.min(md.smb.Ta[0:-1, :], 1))
@@ -85,12 +90,15 @@
 
 mint_on_partition[np.where(np.isnan(mint_on_partition))] = 10**-10
-md.qmu.variables.surface_mass_balanceTa = uniform_uncertain.uniform_uncertain('scaled_SmbTa', 1, 0.05)
-md.qmu.variables.surface_mass_balanceTa[0].lower = 0.95
-md.qmu.variables.surface_mass_balanceTa[0].upper = np.maximum(np.minimum(np.maximum(1.05, mint_on_partition), 0.9999), 0.0001)
+md.qmu.variables.surface_mass_balanceTa = uniform_uncertain.uniform_uncertain(
+    'descriptor', 'scaled_SmbTa',
+    'lower', .95 * np.ones(md.qmu.numberofpartitions),
+    'upper', np.maximum(np.minimum(np.maximum(1.05, mint_on_partition), 0.9999), 0.0001),
+    'partition', md.qmu.epartition
+    )
 
 #responses
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.IceMass = response_function.response_function('IceMass', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.TotalSmb = response_function.response_function('TotalSmb', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolume = response_function.response_function('descriptor','IceVolume')
+md.qmu.responses.IceMass = response_function.response_function('descriptor','IceMass')
+md.qmu.responses.TotalSmb = response_function.response_function('descriptor','TotalSmb')
 
 #  nond_sampling study
Index: /issm/trunk-jpl/test/NightlyRun/test250.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test250.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test250.py	(revision 24870)
@@ -41,15 +41,20 @@
 
 #variables
-md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance', 1, 0.1)
+md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_SmbMassBalance',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .1 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
+md.qmu.responses.IceVolume = response_function.response_function('descriptor','IceVolume')
+md.qmu.responses.MassFlux1 = response_function.response_function('descriptor','indexed_MassFlux_1')
+md.qmu.responses.MassFlux2 = response_function.response_function('descriptor','indexed_MassFlux_2')
+md.qmu.responses.MassFlux3 = response_function.response_function('descriptor','indexed_MassFlux_3')
+md.qmu.responses.MassFlux4 = response_function.response_function('descriptor','indexed_MassFlux_4')
+md.qmu.responses.MassFlux5 = response_function.response_function('descriptor','indexed_MassFlux_5')
+md.qmu.responses.massFlux6 = response_function.response_function('descriptor','indexed_MassFlux_6')
 
 #mass flux profiles
Index: /issm/trunk-jpl/test/NightlyRun/test251.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test251.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test251.py	(revision 24870)
@@ -42,15 +42,20 @@
 
 #variables
-md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance', 1, 100)
+md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_SmbMassBalance',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', 100 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
+md.qmu.responses.IceVolume = response_function.response_function('descriptor','IceVolume')
+md.qmu.responses.MassFlux1 = response_function.response_function('descriptor','indexed_MassFlux_1')
+md.qmu.responses.MassFlux2 = response_function.response_function('descriptor','indexed_MassFlux_2')
+md.qmu.responses.MassFlux3 = response_function.response_function('descriptor','indexed_MassFlux_3')
+md.qmu.responses.MassFlux4 = response_function.response_function('descriptor','indexed_MassFlux_4')
+md.qmu.responses.MassFlux5 = response_function.response_function('descriptor','indexed_MassFlux_5')
+md.qmu.responses.massFlux6 = response_function.response_function('descriptor','indexed_MassFlux_6')
 
 #mass flux profiles
Index: /issm/trunk-jpl/test/NightlyRun/test412.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test412.m	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test412.m	(revision 24870)
@@ -11,5 +11,4 @@
 md.qmu.vpartition=md.qmu.vpartition-1;
 md.qmu.isdakota=1;
-
 
 %Dakota options
Index: /issm/trunk-jpl/test/NightlyRun/test412.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test412.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test412.py	(revision 24870)
@@ -31,9 +31,18 @@
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain(
+    'descriptor', 'MaterialsRhoIce',
+    'mean', md.materials.rho_ice,
+    'stddev', .01
+    )
+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),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
 
 #method
Index: /issm/trunk-jpl/test/NightlyRun/test413.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test413.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test413.py	(revision 24870)
@@ -28,9 +28,18 @@
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain(
+    'descriptor', 'MaterialsRhoIce',
+    'mean', md.materials.rho_ice,
+    'stddev', 0.1
+    )
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_FrictionCoefficient',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .01 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
 
 #method
Index: /issm/trunk-jpl/test/NightlyRun/test414.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test414.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test414.py	(revision 24870)
@@ -37,15 +37,21 @@
 
 #variables
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_FrictionCoefficient',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .01 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
+md.qmu.responses.IceVolume = response_function.response_function('descriptor','IceVolume')
+md.qmu.responses.MassFlux1 = response_function.response_function('descriptor','indexed_MassFlux_1')
+md.qmu.responses.MassFlux2 = response_function.response_function('descriptor','indexed_MassFlux_2')
+md.qmu.responses.MassFlux3 = response_function.response_function('descriptor','indexed_MassFlux_3')
+md.qmu.responses.MassFlux4 = response_function.response_function('descriptor','indexed_MassFlux_4')
+md.qmu.responses.MassFlux5 = response_function.response_function('descriptor','indexed_MassFlux_5')
+md.qmu.responses.massFlux6 = response_function.response_function('descriptor','indexed_MassFlux_6')
+md.qmu.responses.massFlux7 = response_function.response_function('descriptor','indexed_MassFlux_7')
 
 #mass flux profiles
Index: /issm/trunk-jpl/test/NightlyRun/test417.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test417.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test417.py	(revision 24870)
@@ -37,15 +37,21 @@
 
 #variables
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_FrictionCoefficient',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .01 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
+md.qmu.responses.IceVolume = response_function.response_function('descriptor','IceVolume')
+md.qmu.responses.MassFlux1 = response_function.response_function('descriptor','indexed_MassFlux_1')
+md.qmu.responses.MassFlux2 = response_function.response_function('descriptor','indexed_MassFlux_2')
+md.qmu.responses.MassFlux3 = response_function.response_function('descriptor','indexed_MassFlux_3')
+md.qmu.responses.MassFlux4 = response_function.response_function('descriptor','indexed_MassFlux_4')
+md.qmu.responses.MassFlux5 = response_function.response_function('descriptor','indexed_MassFlux_5')
+md.qmu.responses.massFlux6 = response_function.response_function('descriptor','indexed_MassFlux_6')
+md.qmu.responses.massFlux7 = response_function.response_function('descriptor','indexed_MassFlux_7')
 
 #mass flux profiles
Index: /issm/trunk-jpl/test/NightlyRun/test420.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test420.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test420.py	(revision 24870)
@@ -29,8 +29,15 @@
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain(
+    'descriptor', 'MaterialsRhoIce',
+    'mean', 1,
+    'stddev', .01
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function(
+    'descriptor', 'scaled_Thickness',
+    'partition', md.qmu.vpartition
+    )
 
 #method
Index: /issm/trunk-jpl/test/NightlyRun/test440.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test440.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test440.py	(revision 24870)
@@ -30,8 +30,15 @@
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain(
+    'descriptor', 'MaterialsRhoIce',
+    'mean', 1,
+    'stddev', 0.01
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function(
+    'descriptor', 'scaled_Thickness',
+    'partition', md.qmu.vpartition
+    )
 
 #method
Index: /issm/trunk-jpl/test/NightlyRun/test444.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test444.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test444.py	(revision 24870)
@@ -65,19 +65,31 @@
 version = float(version[0])
 
+#partitioning
+md.qmu.numberofpartitions = 10
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
+md.qmu.isdakota = 1
+
 #variables
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_BasalforcingsFloatingiceMeltingRate', 1, 0.1)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_BasalforcingsFloatingiceMeltingRate',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .1 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
+
 
 #responses
-md.qmu.responses.IceMass1 = response_function.response_function('Outputdefinition5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.IceVolume1 = response_function.response_function('Outputdefinition6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.IceVolumeAboveFloatation1 = response_function.response_function('Outputdefinition7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.IceVolumeAboveFloatation = response_function.response_function('IceVolumeAboveFloatation', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.GroundedArea1 = response_function.response_function('Outputdefinition1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.FloatingArea1 = response_function.response_function('Outputdefinition2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.TotalFloatingBmb1 = response_function.response_function('Outputdefinition3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.TotalGroundedBmb1 = response_function.response_function('Outputdefinition4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.TotalSmb1 = response_function.response_function('Outputdefinition8', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.TotalSmb2 = response_function.response_function('Outputdefinition9', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.FloatingArea = response_function.response_function('FloatingArea', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceMass1 = response_function.response_function('descriptor','Outputdefinition5')
+md.qmu.responses.IceVolume1 = response_function.response_function('descriptor','Outputdefinition6')
+md.qmu.responses.IceVolumeAboveFloatation1 = response_function.response_function('descriptor','Outputdefinition7')
+md.qmu.responses.IceVolumeAboveFloatation = response_function.response_function('descriptor','IceVolumeAboveFloatation')
+md.qmu.responses.GroundedArea1 = response_function.response_function('descriptor','Outputdefinition1')
+md.qmu.responses.FloatingArea1 = response_function.response_function('descriptor','Outputdefinition2')
+md.qmu.responses.TotalFloatingBmb1 = response_function.response_function('descriptor','Outputdefinition3')
+md.qmu.responses.TotalGroundedBmb1 = response_function.response_function('descriptor','Outputdefinition4')
+md.qmu.responses.TotalSmb1 = response_function.response_function('descriptor','Outputdefinition8')
+md.qmu.responses.TotalSmb2 = response_function.response_function('descriptor','Outputdefinition9')
+md.qmu.responses.FloatingArea = response_function.response_function('descriptor','FloatingArea')
 
 #method
Index: /issm/trunk-jpl/test/NightlyRun/test445.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test445.m	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test445.m	(revision 24870)
@@ -29,5 +29,5 @@
 	'stddev',.05*ones(md.qmu.numberofpartitions,1),...
 	'partition',md.qmu.vpartition);
-md.qmu.variables.neff=normal_uncertain('descriptor','scaled_BasalforcingsGeothermalflux',...
+md.qmu.variables.geoflux=normal_uncertain('descriptor','scaled_BasalforcingsGeothermalflux',...
 	'mean',ones(md.qmu.numberofpartitions,1),...
 	'stddev',.05*ones(md.qmu.numberofpartitions,1),...
Index: /issm/trunk-jpl/test/NightlyRun/test445.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test445.py	(revision 24869)
+++ /issm/trunk-jpl/test/NightlyRun/test445.py	(revision 24870)
@@ -34,17 +34,33 @@
 version = float(version[0])
 
+#partitioning
+md.qmu.numberofpartitions = 10
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
+md.qmu.isdakota = 1
+
 #variables
-md.qmu.variables.neff = normal_uncertain.normal_uncertain('scaled_FrictionEffectivePressure', 1, .05)
-md.qmu.variables.geoflux = normal_uncertain.normal_uncertain('scaled_BasalforcingsGeothermalflux', 1, .05)
+md.qmu.variables.neff = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_FrictionEffectivePressure',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .05 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
+md.qmu.variables.geoflux = normal_uncertain.normal_uncertain(
+    'descriptor', 'scaled_BasalforcingsGeothermalflux',
+    'mean', np.ones(md.qmu.numberofpartitions),
+    'stddev', .05 * np.ones(md.qmu.numberofpartitions),
+    'partition', md.qmu.vpartition
+    )
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
-md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
+md.qmu.responses.MassFlux1 = response_function.response_function('descriptor','indexed_MassFlux_1')
+md.qmu.responses.MassFlux2 = response_function.response_function('descriptor','indexed_MassFlux_2')
+md.qmu.responses.MassFlux3 = response_function.response_function('descriptor','indexed_MassFlux_3')
+md.qmu.responses.MassFlux4 = response_function.response_function('descriptor','indexed_MassFlux_4')
+md.qmu.responses.MassFlux5 = response_function.response_function('descriptor','indexed_MassFlux_5')
+md.qmu.responses.massFlux6 = response_function.response_function('descriptor','indexed_MassFlux_6')
+md.qmu.responses.massFlux7 = response_function.response_function('descriptor','indexed_MassFlux_7')
 
 #mass flux profiles
