Index: /issm/trunk/src/m/contrib/musselman/read_netCDF.m
===================================================================
--- /issm/trunk/src/m/contrib/musselman/read_netCDF.m	(revision 27883)
+++ /issm/trunk/src/m/contrib/musselman/read_netCDF.m	(revision 27884)
@@ -17,6 +17,13 @@
 
 function model_copy = read_netCDF(filename)
-    fprintf('NetCDF42C v1.1.14\n');
-
+    if nargin > 1
+        verbose = true;
+    else
+        verbose = false;
+    end
+    
+    if verbose
+        fprintf('NetCDF42C v1.1.14\n');
+    end
     % make a model framework to fill that is in the scope of this file
     global model_copy;
@@ -25,5 +32,7 @@
     % Check if path exists
     if exist(filename, 'file')
-        fprintf('Opening %s for reading\n', filename);
+        if verbose
+            fprintf('Opening %s for reading\n', filename);
+        end
 
         % Open the given netCDF4 file
@@ -35,6 +44,6 @@
         % see if results is in there, if it is we have to instantiate some classes
         try
-            results_group_id = netcdf.inqNcid(NCData, "results");
-            make_results_subclasses();
+            results_group_id = netcdf.inqNcid(NCData, "results", verbose);
+            make_results_subclasses(verbose);
         catch
         end % 'results' group doesn't exist 
@@ -43,5 +52,5 @@
         try
             inversion_group_id = netcdf.inqNcid(NCData, "inversion");
-            check_inversion_class();
+            check_inversion_class(verbose);
         catch
         end % 'inversion' group doesn't exist 
@@ -52,10 +61,12 @@
             %disp(netcdf.inqGrpNameFull(group_id))
             % hand off first level to recursive search
-            walk_nested_groups(group_id);
+            walk_nested_groups(group_id, verbose);
         end
         
         % Close the netCDF file
         netcdf.close(NCData);
-        disp('Model Successfully Copied')
+        if verbose
+            disp('Model Successfully Copied')
+        end
     else
         fprintf('File %s does not exist.\n', filename);
@@ -64,5 +75,5 @@
 
 
-function make_results_subclasses()
+function make_results_subclasses(verbose)
     global model_copy;
     global NCData;
@@ -79,12 +90,14 @@
         %model_copy.results = setfield(model_copy.results, class_instance, class_instance_name);
     end
-    disp('Successfully recreated results structs:')
-    for fieldname = string(fieldnames(model_copy.results))
-        disp(fieldname)
-    end
-end
-
-
-function check_inversion_class()
+    if verbose
+        disp('Successfully recreated results structs:')
+        for fieldname = string(fieldnames(model_copy.results))
+            disp(fieldname)
+        end
+    end
+end
+
+
+function check_inversion_class(verbose)
     % get the name of the inversion class: either inversion or m1qn3inversion or taoinversion
     global model_copy;
@@ -95,16 +108,21 @@
     if strcmp(inversion_class, 'm1qn3inversion')
         model_copy.inversion = m1qn3inversion();
-        disp('Successfully created inversion class instance: m1qn3inversion')
+        if verbose
+            disp('Successfully created inversion class instance: m1qn3inversion')
+        end
     elseif strcmp(inversion_class, 'taoinversion')
         model_copy.inversion = taoinversion();
-        disp('Successfully created inversion class instance: taoinversion')
-    else
-        disp('No inversion class was found')
-    end
-end
-
-
-
-function walk_nested_groups(group_location_in_file)
+        if verbose
+            disp('Successfully created inversion class instance: taoinversion')
+        end
+    else
+        if verbose
+            disp('No inversion class was found')
+        end
+    end
+end
+
+
+function walk_nested_groups(group_location_in_file, verbose)
     global model_copy;
     global NCData;    
@@ -119,9 +137,9 @@
         if strcmp(varname, 'this_is_a_nested')
             is_nested = true;
-            copy_nested_struct(group_location_in_file)
+            copy_nested_struct(group_location_in_file, verbose)
         elseif strcmp(varname, 'solution')
             % band-aid pass..
         else
-            copy_variable_data_to_new_model(group_location_in_file, varname, xtype);
+            copy_variable_data_to_new_model(group_location_in_file, varname, xtype, verbose);
         end
     end
@@ -139,5 +157,5 @@
                 group_id = netcdf.inqNcid(group_location_in_file, netcdf.inqGrpName(group));
                 %disp(netcdf.inqGrpNameFull(group_id))
-                walk_nested_groups(group);
+                walk_nested_groups(group, verbose);
             end
         end
@@ -149,5 +167,5 @@
 
 
-function copy_nested_struct(group_location_in_file)
+function copy_nested_struct(group_location_in_file, verbose)
     global model_copy;
     global NCData;
@@ -216,7 +234,11 @@
         end
         model_copy.(address_in_model).(name_of_struct)(current_layer);
-        fprintf("Successfully saved layer %s to multidimension struct array\n", num2str(current_layer))
-    end
-    fprintf('Successfully recreated multidimensional structure array %s in md.%s\n', name_of_struct, address_in_model)
+        if verbose
+            fprintf("Successfully saved layer %s to multidimension struct array\n", num2str(current_layer))
+        end
+    end
+    if verbose
+        fprintf('Successfully recreated multidimensional structure array %s in md.%s\n', name_of_struct, address_in_model)
+    end
 end
 
@@ -230,5 +252,5 @@
 %}
 
-function copy_variable_data_to_new_model(group_location_in_file, varname, xtype)
+function copy_variable_data_to_new_model(group_location_in_file, varname, xtype, verbose)
     global model_copy;
     global NCData;
@@ -289,10 +311,12 @@
             end
             
-            full_addy = netcdf.inqGrpNameFull(group_location_in_file);
-            %disp(xtype)
-            %class(data)
-            fprintf('Successfully saved %s to %s\n', varname, full_addy);
-
-        catch Me %e is an MException struct
+            if verbose
+                full_addy = netcdf.inqGrpNameFull(group_location_in_file);
+                %disp(xtype)
+                %class(data)
+                fprintf('Successfully saved %s to %s\n', varname, full_addy);
+            end
+
+        catch ME %ME is an MException struct
             % Some error occurred if you get here.
             fprintf(1,'There was an error with %s! \n', varname)
@@ -300,8 +324,8 @@
             fprintf(1, '%s\n', errorMessage);
             uiwait(warndlg(errorMessage));
-            %line = Me.stack.line
+            %line = ME.stack.line
             %fprintf(1,'There was an error with %s! \n', varname)
-            %fprintf('The message was:\n%s\n',Me.message);
-            %fprintf(1,'The identifier was:\n%s\n',Me.identifier);
+            %fprintf('The message was:\n%s\n',ME.message);
+            %fprintf(1,'The identifier was:\n%s\n',ME.identifier);
             
             % more error handling...
@@ -309,5 +333,2 @@
     end
 end
-
-
-
Index: /issm/trunk/src/m/contrib/musselman/read_netCDF.py
===================================================================
--- /issm/trunk/src/m/contrib/musselman/read_netCDF.py	(revision 27883)
+++ /issm/trunk/src/m/contrib/musselman/read_netCDF.py	(revision 27884)
@@ -12,5 +12,4 @@
 
 
-
 '''
 Given a NetCDF4 file, this set of functions will perform the following:
@@ -24,11 +23,13 @@
 model_copy = model()
 
-
-def read_netCDF(filename):
-    print('NetCDF42C v1.1.13')
+def read_netCDF(filename, verbose = False):
+    if verbose:
+        print('NetCDF42C v1.1.13')
 
     # check if path exists
     if path.exists(filename):
-        print('Opening {} for reading'.format(filename))
+        if verbose:
+            print('Opening {} for reading'.format(filename))
+        else: pass
 
         # open the given netCDF4 file
@@ -39,9 +40,10 @@
     else:
         print('The file you entered does not exist or cannot be found in the current directory')
+        return print()
     
     # continuation of band-aid for results class
     try:
         NCData.groups['results']
-        make_results_subclasses()
+        make_results_subclasses(verbose)
     except:
         pass
@@ -50,5 +52,5 @@
     try:
         NCData.groups['inversion']
-        check_inversion_class()
+        check_inversion_class(verbose)
     except:
         pass
@@ -61,11 +63,12 @@
             # have to send a custom name to this function: filename.groups['group']
             name = "NCData.groups['" + str(group) + "']"
-            walk_nested_groups(name)
-    
-    print("Model Successfully Recreated.")
+            walk_nested_groups(name, verbose)
+    
+    if verbose:
+        print("Model Successfully Recreated.")
     return model_copy
 
 
-def make_results_subclasses():
+def make_results_subclasses(verbose = False):
     '''
         There are 3 possible subclasses: solution, solutionstep, resultsdakota.
@@ -86,8 +89,9 @@
             # from here we can make new subclasses named as they were in the model saved
             setattr(model_copy.results, class_instance_name, eval(class_instance))
-            print(f'Successfully created results subclass instance {class_instance} named {class_instance_name}.')
-
-
-def check_inversion_class():
+            if verbose:
+                print(f'Successfully created results subclass instance {class_instance} named {class_instance_name}.')
+
+
+def check_inversion_class(verbose = False):
     # get the name of the inversion class: either inversion or m1qn3inversion or taoinversion
     inversion_class_is = NCData.groups['inversion'].variables['inversion_class_name'][:][...].tobytes().decode()
@@ -95,14 +99,15 @@
         # if it is m1qn3inversion we need to instantiate that class since it's not native to model()
         model_copy.inversion = m1qn3inversion(model_copy.inversion)
-        print('Conversion successful')
+        if verbose:
+            print('Conversion successful')
     elif inversion_class_is == 'taoinversion':
         # if it is taoinversion we need to instantiate that class since it's not native to model()
         model_copy.inversion = taoinverion()
-        print('Conversion successful')
+        if verbose:
+            print('Conversion successful')
     else: pass
 
 
-
-def walk_nested_groups(group_location_in_file):
+def walk_nested_groups(group_location_in_file, verbose = False):
     # first, we enter the group by: filename.groups['group_name']
     # second we search the current level for variables: filename.groups['group_name'].variables.keys()
@@ -140,5 +145,5 @@
             variable_name = matches[-1]
             location_of_variable_in_model = '.'.join(matches[:-1])
-            copy_variable_data_to_new_model(location_of_variable_in_file, location_of_variable_in_model, variable_name)
+            copy_variable_data_to_new_model(location_of_variable_in_file, location_of_variable_in_model, variable_name, verbose=verbose)
             
     if 'istruct' in locals():
@@ -147,5 +152,5 @@
         for nested_group in eval(group_location_in_file + '.groups.keys()'):
             new_nested_group = group_location_in_file + ".groups['" + str(nested_group) + "']"
-            walk_nested_groups(new_nested_group)
+            walk_nested_groups(new_nested_group, verbose=verbose)
 
 
@@ -158,5 +163,5 @@
 '''
 
-def copy_multidimensional_results_struct(group_location_in_file, name_of_struct):
+def copy_multidimensional_results_struct(group_location_in_file, name_of_struct, verbose = False):
     '''
     A common multidimensional array is the 1xn md.results.TransientSolution object.
@@ -189,12 +194,14 @@
         # step 2b
         steps.append(solutionstep_instance)
-        print('Succesfully saved layer ' + str(layer) + ' to results.' + str(class_instance_name) + ' struct.')
+        if verbose:
+            print('Succesfully saved layer ' + str(layer) + ' to results.' + str(class_instance_name) + ' struct.')
+        else: pass
         layer += 1
 
-    print('Successfully recreated results structure ' + str(class_instance_name))
-
-
-
-def copy_variable_data_to_new_model(location_of_variable_in_file, location_of_variable_in_model, variable_name):
+    if verbose:
+        print('Successfully recreated results structure ' + str(class_instance_name))
+
+
+def copy_variable_data_to_new_model(location_of_variable_in_file, location_of_variable_in_model, variable_name, verbose = False):
     # as simple as navigating to the location_of_variable_in_model and setting it equal to the location_of_variable_in_file
     # NetCDF4 has a property called "_FillValue" that sometimes saves empty lists, so we have to catch those
@@ -236,16 +243,13 @@
                         setattr(eval('model_copy.' + location_of_variable_in_model), variable_name, var_to_save.item())                        
             except:
-                    setattr(eval('model_copy.' + location_of_variable_in_model), variable_name, eval(location_of_variable_in_file + '[:].item()'))
+                    setattr(eval('model_copy.' + location_of_variable_in_model), variable_name, eval(location_of_variable_in_file + '[:]'))
     except AttributeError:
-        copy_variable_data_to_new_model_dict(location_of_variable_in_file, location_of_variable_in_model)
-
-    print('Successfully saved ' + location_of_variable_in_model + '.' + variable_name + ' to model.')
-
-
-
-
-
-
-def copy_variable_data_to_new_model_dict(location_of_variable_in_file, location_of_variable_in_model):
+        copy_variable_data_to_new_model_dict(location_of_variable_in_file, location_of_variable_in_model, verbose=verbose)
+
+    if verbose:
+        print('Successfully saved ' + location_of_variable_in_model + '.' + variable_name + ' to model.')
+
+
+def copy_variable_data_to_new_model_dict(location_of_variable_in_file, location_of_variable_in_model, verbose = False):
     # as simple as navigating to the location_of_variable_in_model and setting it equal to the location_of_variable_in_file
 
@@ -297,23 +301,2 @@
     else:
         print(f"Unrecognized object was saved and cannot be reconstructed: {location_of_variable_in_model}")
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: /issm/trunk/src/m/contrib/musselman/write_netCDF.m
===================================================================
--- /issm/trunk/src/m/contrib/musselman/write_netCDF.m	(revision 27883)
+++ /issm/trunk/src/m/contrib/musselman/write_netCDF.m	(revision 27884)
@@ -11,10 +11,17 @@
 
 function write_netCDF(model_var, filename)
-    disp('MATLAB C2NetCDF4 v1.1.14');
+    if nargin > 2
+        verbose = true;
+    else
+        verbose = false;
+    end
+    if verbose
+        disp('MATLAB C2NetCDF4 v1.1.14');
+    end
     % model_var = class object to be saved
     % filename = path and name to save file under
     
     % Create a NetCDF file to write to
-    make_NetCDF(filename);
+    make_NetCDF(filename, verbose);
     
     % Create an instance of an empty model class to compare model_var against
@@ -23,5 +30,5 @@
 
     % Walk through the model_var class and compare subclass states to empty_model
-    walk_through_model(model_var);
+    walk_through_model(model_var, verbose);
 
     % in order to handle some subclasses in the results class, we have to utilize this band-aid
@@ -31,5 +38,5 @@
         % if results had meaningful data, save the name of the subclass and class instance
         netcdf.inqNcid(NetCDF,'results');
-        results_subclasses_bandaid(model_var);
+        results_subclasses_bandaid(model_var, verbose);
         % otherwise, ignore
     catch
@@ -37,10 +44,12 @@
     
     netcdf.close(NetCDF);
-    disp('Model successfully saved as NetCDF4');
-end
-
-
-
-function make_NetCDF(filename)
+    if verbose
+        disp('Model successfully saved as NetCDF4');
+    end
+end
+
+
+
+function make_NetCDF(filename, verbose)
     % matlab can't handle input in the jupyter interface, so we just yell at the user to rename
     % their file if needed
@@ -68,6 +77,8 @@
         netcdf.defDim(NetCDF, 'float', 1);     % single integer dimension
         netcdf.defDim(NetCDF, 'int', 1);       % single float dimension
-    
-        fprintf('Successfully created %s\n', filename);
+
+        if verbose
+            fprintf('Successfully created %s\n', filename);
+        end
     end
 end
@@ -82,5 +93,5 @@
 %}
 
-function results_subclasses_bandaid(model_var)
+function results_subclasses_bandaid(model_var, verbose)
     global NetCDF;
     % The results class may have nested fields within it, so we need to record the name of 
@@ -95,10 +106,10 @@
     
     % Loop through each class instance in results
-    class_instance_names = fieldnames(results_var)
+    class_instance_names = fieldnames(results_var);
 
     % we save lists of instances to the netcdf
-    solutions = {}
-    solutionsteps = {}
-    resultsdakotas = {}
+    solutions = {};
+    solutionsteps = {};
+    resultsdakotas = {};
     
     for i = 1:numel(class_instance_names)
@@ -108,8 +119,10 @@
         if contains(class_instance_name, 'solutionstep',IgnoreCase=true)
             quality_control{end+1} = 1;
-            solutionsteps{end+1} = class_instance_name
+            solutionsteps{end+1} = class_instance_name;
             %varname = ['solutionstep', num2str(i)]
             %write_string_to_netcdf(varname, class_instance_name, groupid);
-            disp('Successfully stored class python subclass instance: solutionstep')
+            if verbose
+                disp('Successfully stored class python subclass instance: solutionstep')
+            end
         end
         
@@ -117,8 +130,10 @@
         if contains(class_instance_name, 'solution',IgnoreCase=true)
             quality_control{end+1} = 1;
-            solutions{end+1} = class_instance_name
+            solutions{end+1} = class_instance_name;
             %varname = ['solution', num2str(i)]
             %write_string_to_netcdf(varname, class_instance_name, groupid);
-            disp('Successfully stored class python subclass instance: solution')
+            if verbose
+                disp('Successfully stored class python subclass instance: solution')
+            end
         end
         
@@ -126,18 +141,20 @@
         if contains(class_instance_name, 'resultsdakota',IgnoreCase=true)
             quality_control{end+1} = 1;
-            resultsdakotas{end+1} = class_instance_name
+            resultsdakotas{end+1} = class_instance_name;
             %varname = ['resultsdakota', num2str(i)]
             %write_string_to_netcdf(varname, class_instance_name, groupid);
-            disp('Successfully stored class python subclass instance: resultsdakota')
+            if verbose
+                disp('Successfully stored class python subclass instance: resultsdakota')
+            end
         end
     end
     if ~isempty(solutionsteps)
-        write_cell_with_strings('solutionstep', solutionsteps, groupid)
+        write_cell_with_strings('solutionstep', solutionsteps, groupid, verbose)
     end
     if ~isempty(solutions)
-        write_cell_with_strings('solution', solutions, groupid)
+        write_cell_with_strings('solution', solutions, groupid, verbose)
     end
     if ~isempty(resultsdakotas)
-        write_cell_with_strings('resultsdakota', resultsdakotas, groupid)
+        write_cell_with_strings('resultsdakota', resultsdakotas, groupid, verbose)
     end
     
@@ -155,5 +172,5 @@
 
 
-function walk_through_model(model_var)
+function walk_through_model(model_var, verbose)
     global empty_model;
     % Iterate over first layer of model_var attributes and assume this first layer is only classes fundamental to the model() class
@@ -166,10 +183,10 @@
         % Now we can recursively walk through the remaining subclasses
         list_of_layers = {groups{group}};
-        walk_through_subclasses(model_subclass, empty_model_subclass, list_of_layers);
-    end
-end
-        
-
-function walk_through_subclasses(model_subclass, empty_model_subclass, given_list_of_layers)
+        walk_through_subclasses(model_subclass, empty_model_subclass, list_of_layers, verbose);
+    end
+end
+        
+
+function walk_through_subclasses(model_subclass, empty_model_subclass, given_list_of_layers, verbose)
     % Recursivley iterate over each subclass' attributes and look for more subclasses and variables with relevant data
     % model_subclass is an object (ie, md.mesh.elements)
@@ -179,5 +196,5 @@
         if strcmp(given_list_of_layers{1}, 'inversion')
             create_group(model_subclass, given_list_of_layers);
-            check_inversion_class(model_subclass);
+            check_inversion_class(model_subclass, verbose);
         end
     end
@@ -203,5 +220,5 @@
                 % if the current field is a nested struct assume it has valuable data that needs to be saved
                 if isstruct(location_of_child) && any(size(location_of_child) > 1)
-                    create_group(location_of_child, list_of_layers);
+                    create_group(location_of_child, list_of_layers, verbose);
                 
                 % this would mean that the layer above the layer we're interested in is a struct, so
@@ -213,19 +230,19 @@
                     % if the current attribute is a numerical array assume it has valuable data that needs to be saved
                     if isnumeric(location_of_child) && logical(numel(location_of_child) > 1)
-                        create_group(location_of_child, list_of_layers);
+                        create_group(location_of_child, list_of_layers, verbose);
                     % if the attributes are identical we don't need to save anything
                     elseif (all(isnan(location_of_child)) && all(isnan(location_of_child_in_empty_model))) || isempty(setxor(location_of_child, location_of_child_in_empty_model))
-                        walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers);
+                        walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers, verbose);
                     % if the attributes are not the same we need to save ours
                     else
                         % THE ORDER OF THESE LINES IS CRITICAL
-                        walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers);
-                        create_group(location_of_child, list_of_layers);
+                        walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers, verbose);
+                        create_group(location_of_child, list_of_layers, verbose);
                     end
                 % this would mean that the layer we're interested in is not fundamental to the model architecture
                 % and thus needs to be saved to the netcdf
                 else
-                    walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers);
-                    create_group(location_of_child, list_of_layers);
+                    walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers, verbose);
+                    create_group(location_of_child, list_of_layers, verbose);
                 end
             % this would mean it's not a struct, and must be a class/subclass
@@ -238,5 +255,5 @@
                         % if the current attribute is a numerical array assume it has valuable data that needs to be saved
                         if isnumeric(location_of_child) && logical(numel(location_of_child) > 1)
-                            create_group(location_of_child, list_of_layers);
+                            create_group(location_of_child, list_of_layers, verbose);
                         
                         elseif iscell(location_of_child)
@@ -246,22 +263,22 @@
                             else
                             % otherwise we need to save
-                                walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers);
-                                create_group(location_of_child, list_of_layers);
+                                walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers, verbose);
+                                create_group(location_of_child, list_of_layers, verbose);
                             end
                         elseif (all(isnan(location_of_child)) && all(isnan(location_of_child_in_empty_model)))
-                            walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers);
+                            walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers, verbose);
                         % if the attributes are not the same we need to save ours
                         else
                             % THE ORDER OF THESE LINES IS CRITICAL
-                            walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers);
-                            create_group(location_of_child, list_of_layers);
+                            walk_through_subclasses(location_of_child, location_of_child_in_empty_model, list_of_layers, verbose);
+                            create_group(location_of_child, list_of_layers, verbose);
                         end
                     else
-                        walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers);
-                        create_group(location_of_child, list_of_layers);
+                        walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers, verbose);
+                        create_group(location_of_child, list_of_layers, verbose);
                     end
                 catch
-                    walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers);
-                    create_group(location_of_child, list_of_layers);
+                    walk_through_subclasses(location_of_child, empty_model_subclass, list_of_layers, verbose);
+                    create_group(location_of_child, list_of_layers, verbose);
                 end
             end
@@ -273,6 +290,6 @@
         % this is if we come accross instances/subfields in our model that are not fundamental to the model class (ie, taoinversion)
         elseif strcmp(ME.identifier, 'MATLAB:UndefinedFunction')
-            walk_through_subclasses(location_of_child, empty_model_subclass, given_list_of_layers);
-            create_group(location_of_child, list_of_layers);
+            walk_through_subclasses(location_of_child, empty_model_subclass, given_list_of_layers, verbose);
+            create_group(location_of_child, list_of_layers, verbose);
         % If it's a different error, rethrow it to MATLAB's default error handling
         else
@@ -285,5 +302,5 @@
         
 
-function create_group(location_of_child, list_of_layers)
+function create_group(location_of_child, list_of_layers, verbose)
     global NetCDF;
     % location_of_child is an object
@@ -319,16 +336,16 @@
         elseif isstruct(location_of_child) && any(size(location_of_child) > 1)
             % we have a nested struct
-            copy_nested_struct(variable_name, location_of_child, group)
+            copy_nested_struct(variable_name, location_of_child, group, verbose)
         end
     catch
         % if that line doesn't work, it means we're dealing with raw data
         % not a nested struct, so we can pass
-        create_var(variable_name, location_of_child, group);
-    end
-end
-
-
-
-function copy_nested_struct(parent_struct_name, address_of_struct, group)
+        create_var(variable_name, location_of_child, group, verbose);
+    end
+end
+
+
+
+function copy_nested_struct(parent_struct_name, address_of_struct, group, verbose)
     %{
         This function takes a struct of structs and saves them to netcdf. 
@@ -340,5 +357,7 @@
     %}
 
-    disp("Beginning transfer of nested MATLAB struct to the NetCDF")
+    if verbose
+        disp("Beginning transfer of nested MATLAB struct to the NetCDF")
+    end
     % make a new subgroup to contain all the others:
     group = netcdf.defGrp(group, parent_struct_name);
@@ -368,8 +387,10 @@
         for variable_name = string(substruct_fields)
             address_of_child = current_substruct.(variable_name);
-            create_var(variable_name, address_of_child, subgroup);
-        end
-    end
-    fprintf('Succesfully transferred nested MATLAB struct %s to the NetCDF\n', parent_struct_name)
+            create_var(variable_name, address_of_child, subgroup, verbose);
+        end
+    end
+    if verbose
+        fprintf('Succesfully transferred nested MATLAB struct %s to the NetCDF\n', parent_struct_name)
+    end
 end
 
@@ -378,5 +399,5 @@
 % ironically inversion does not have the same problem as results as inversion subfields
 % are actually subclasses and not fields
-function check_inversion_class(model_var)
+function check_inversion_class(model_var, verbose)
     global NetCDF;
     % Define a persistent variable to ensure this function is only run once
@@ -384,17 +405,25 @@
     % Check if the function has already been executed
     if isempty(executed)
-        disp('Deconstructing Inversion class instance')
+        if verbose
+            disp('Deconstructing Inversion class instance')
+        end
         % Need to make sure that we have the right inversion class: inversion, m1qn3inversion, taoinversion
         groupid = netcdf.inqNcid(NetCDF,'inversion');
 
         if isa(model_var, 'm1qn3inversion')
-            write_string_to_netcdf('inversion_class_name', 'm1qn3inversion', groupid);
-            disp('Successfully saved inversion class instance m1qn3inversion')
+            write_string_to_netcdf('inversion_class_name', 'm1qn3inversion', groupid, verbose);
+            if verbose
+                disp('Successfully saved inversion class instance m1qn3inversion')
+            end
         elseif isa(model_var, 'taoinversion')
-            write_string_to_netcdf('inversion_class_name', 'taoinversion', groupid);
-            disp('Successfully saved inversion class instance taoinversion')
+            write_string_to_netcdf('inversion_class_name', 'taoinversion', groupid, verbose);
+            if verbose 
+                disp('Successfully saved inversion class instance taoinversion')
+            end
         else
-            write_string_to_netcdf('inversion_class_name', 'inversion', groupid);
-            disp('Successfully saved inversion class instance inversion')
+            write_string_to_netcdf('inversion_class_name', 'inversion', groupid, verbose);
+            if verbose
+                disp('Successfully saved inversion class instance inversion')
+            end
         end
         % Set the persistent variable to indicate that the function has been executed
@@ -404,6 +433,5 @@
 
 
-
-function create_var(variable_name, address_of_child, group)
+function create_var(variable_name, address_of_child, group, verbose)
     global NetCDF;
     % There are lots of different variable types that we need to handle from the model class
@@ -416,9 +444,9 @@
     % This first conditional statement will catch numeric arrays (matrices) of any dimension and save them
     if any(size(address_of_child)>1) && ~iscellstr(address_of_child) && ~ischar(address_of_child)
-        write_numeric_array_to_netcdf(variable_name, address_of_child, group);
+        write_numeric_array_to_netcdf(variable_name, address_of_child, group, verbose);
 
     % check if it's a string
     elseif ischar(address_of_child)
-        write_string_to_netcdf(variable_name, address_of_child, group);
+        write_string_to_netcdf(variable_name, address_of_child, group, verbose);
 
     % or an empty variable
@@ -428,5 +456,5 @@
     % or a list of strings
     elseif iscellstr(address_of_child) || iscell(address_of_child) && ischar(address_of_child{1})
-        write_cell_with_strings(variable_name, address_of_child, group)
+        write_cell_with_strings(variable_name, address_of_child, group, verbose)
         
     % or an empty list
@@ -464,5 +492,4 @@
             variable = netcdf.defVar(group, variable_name, "NC_DOUBLE", unlimdim);
             netcdf.putVar(group,variable,address_of_child);
-            disp('Used Unlim Dim');
         catch ME
             disp(ME.message);
@@ -470,10 +497,11 @@
         end
     end
-
-    fprintf('Successfully transferred data from %s to the NetCDF\n', variable_name);
-end
-
-
-function write_cell_with_strings(variable_name, address_of_child, group)
+    if verbose
+        fprintf('Successfully transferred data from %s to the NetCDF\n', variable_name);
+    end
+end
+
+
+function write_cell_with_strings(variable_name, address_of_child, group, verbose)
     %{
     Write cell array (ie {'one' 'two' 'three'}) to netcdf
@@ -514,5 +542,5 @@
 
 
-function write_string_to_netcdf(variable_name, address_of_child, group)
+function write_string_to_netcdf(variable_name, address_of_child, group, verbose)
     % netcdf and strings don't get along.. we have to do it 'custom':
     global NetCDF;
@@ -556,10 +584,11 @@
     end
 
-    disp(['Successfully transferred data from ', variable_name, ' to the NetCDF']);
-end
-
-
-
-function write_numeric_array_to_netcdf(variable_name, address_of_child, group)
+    if verbose
+        disp(['Successfully transferred data from ', variable_name, ' to the NetCDF']);
+    end
+end
+
+
+function write_numeric_array_to_netcdf(variable_name, address_of_child, group, verbose)
     global NetCDF;
     % get the dimensions we'll need
Index: /issm/trunk/src/m/contrib/musselman/write_netCDF.py
===================================================================
--- /issm/trunk/src/m/contrib/musselman/write_netCDF.py	(revision 27883)
+++ /issm/trunk/src/m/contrib/musselman/write_netCDF.py	(revision 27884)
@@ -24,13 +24,16 @@
 
 
-def write_netCDF(md, filename: str):
-    print('Python C2NetCDF4 v1.1.14')
+def write_netCDF(md, filename: str, verbose = False):
+    if verbose:
+        print('Python C2NetCDF4 v1.1.14')
+    else: pass
     '''
     md = model() class instance to be saved
     filename = path and name to save file under
+    verbose = T/F muted or show log statements. Naturally muted
     '''
     
     # Create a NetCDF file to write to
-    make_NetCDF(filename)
+    make_NetCDF(filename, verbose)
     
     # Create an instance of an empty md class to compare md_var against
@@ -39,5 +42,5 @@
 
     # Walk through the md class and compare subclass states to empty_model
-    walk_through_model(md)
+    walk_through_model(md, verbose)
 
     # in order to handle some subclasses in the results class, we have to utilize this band-aid
@@ -46,5 +49,5 @@
         # if results has meaningful data, save the name of the subclass and class instance
         NetCDF.groups['results']
-        results_subclasses_bandaid(md)
+        results_subclasses_bandaid(md, verbose)
         # otherwise, ignore
     except KeyError:
@@ -52,8 +55,10 @@
         
     NetCDF.close()
-    print('Model successfully saved as NetCDF4')
-    
-
-def results_subclasses_bandaid(md):
+    if verbose:
+        print('Model successfully saved as NetCDF4')
+    else: pass
+    
+
+def results_subclasses_bandaid(md, verbose = False):
     # since the results class may have nested classes within it, we need to record the name of the 
     # nested class instance variable as it appears in the md that we're trying to save
@@ -66,5 +71,6 @@
     
     for class_instance_name in md.results.__dict__.keys():
-        print(class_instance_name)
+        if verbose:
+            print(class_instance_name)
         # for each class instance in results, see which class its from and record that info in the netcdf to recreate structure later
         # check to see if there is a solutionstep class instance
@@ -84,11 +90,11 @@
 
     if solutionsteps != []:
-        write_string_to_netcdf(variable_name=str('solutionstep'), address_of_child=solutionsteps, group=NetCDF.groups['results'], list=True)
+        write_string_to_netcdf(variable_name=str('solutionstep'), address_of_child=solutionsteps, group=NetCDF.groups['results'], list=True, verbose=verbose)
 
     if solutions != []:
-        write_string_to_netcdf(variable_name=str('solution'), address_of_child=solutions, group=NetCDF.groups['results'], list=True)
+        write_string_to_netcdf(variable_name=str('solution'), address_of_child=solutions, group=NetCDF.groups['results'], list=True, verbose=verbose)
 
     if resultsdakotas != []:
-        write_string_to_netcdf(variable_name=str('resultsdakota'), address_of_child=resultsdakotas, group=NetCDF.groups['results'], list=True)
+        write_string_to_netcdf(variable_name=str('resultsdakota'), address_of_child=resultsdakotas, group=NetCDF.groups['results'], list=True, verbose=verbose)
 
     
@@ -97,8 +103,10 @@
         print(type(md.results.__dict__[class_instance_name]))
     else:
-        print('The results class was successfully stored on disk')
-
-
-def make_NetCDF(filename: str):
+        if verbose:
+            print('The results class was successfully stored on disk')
+        else: pass
+
+
+def make_NetCDF(filename: str, verbose = False):
     # If file already exists delete / rename it
     if os.path.exists(filename):
@@ -122,8 +130,9 @@
         NetCDF.createDimension('int', 1)       # single float dimension
     
-    print('Successfully created ' + filename)
-
-
-def walk_through_model(md):
+    if verbose:
+        print('Successfully created ' + filename)
+
+
+def walk_through_model(md, verbose = False):
     # Iterate over first layer of md_var attributes and assume this first layer is only classes
     for group in md.__dict__.keys():
@@ -134,8 +143,8 @@
 
         # Recursively walk through subclasses
-        walk_through_subclasses(address, empty_address, layers)       
-
-
-def walk_through_subclasses(address, empty_address, layers: list):
+        walk_through_subclasses(address, empty_address, layers, verbose)       
+
+
+def walk_through_subclasses(address, empty_address, layers: list, verbose = False):
     # See if we have an object with keys or a not
     try:
@@ -158,9 +167,9 @@
             # if the current object is a results.<solution> object and has the steps attr it needs special treatment
             if isinstance(address_of_child, solution) and len(address_of_child.steps) != 0:
-                create_group(address_of_child, current_layer, is_struct = True)
+                create_group(address_of_child, current_layer, is_struct = True, verbose = verbose)
 
             # if the variable is an array, assume it has relevant data (this is because the next line cannot evaluate "==" with an array)
             elif isinstance(address_of_child, np.ndarray):
-                create_group(address_of_child, current_layer)
+                create_group(address_of_child, current_layer, is_struct = False, verbose = verbose)
             
             # see if the child exists in the empty md. If not, record it in the netcdf
@@ -172,18 +181,18 @@
                     # if the attributes are identical we don't need to save anything
                     if address_of_child == address_of_child_in_empty_class:
-                        walk_through_subclasses(address_of_child, address_of_child_in_empty_class, current_layer)
+                        walk_through_subclasses(address_of_child, address_of_child_in_empty_class, current_layer, verbose)
     
                     # If it has been modified, record it in the NetCDF file
                     else:
-                        create_group(address_of_child, current_layer)
-                        walk_through_subclasses(address_of_child, address_of_child_in_empty_class, current_layer)
+                        create_group(address_of_child, current_layer, is_struct = False, verbose = verbose)
+                        walk_through_subclasses(address_of_child, address_of_child_in_empty_class, current_layer, verbose)
     
                 except KeyError: # record in netcdf and continue to walk thru md
-                    walk_through_subclasses(address_of_child, empty_address, current_layer)
-                    create_group(address_of_child, current_layer)
+                    walk_through_subclasses(address_of_child, empty_address, current_layer, verbose)
+                    create_group(address_of_child, current_layer, is_struct = False, verbose = verbose)
     else: pass
 
 
-def create_group(address_of_child, layers, is_struct = False):
+def create_group(address_of_child, layers, is_struct = False, verbose = False):
 
     # Handle the first layer of the group(s)
@@ -196,5 +205,5 @@
     # need to check if inversion or m1qn3inversion class
     if group_name == 'inversion':
-        check_inversion_class(address_of_child)
+        check_inversion_class(address_of_child, verbose)
     else: pass
 
@@ -211,11 +220,10 @@
     if is_struct:
         parent_struct_name = layers[-1]
-        copy_nested_results_struct(parent_struct_name, address_of_child, group)
+        copy_nested_results_struct(parent_struct_name, address_of_child, group, verbose)
     
     else:
         variable_name = layers[-1]
-        create_var(variable_name, address_of_child, group)
+        create_var(variable_name, address_of_child, group, verbose)
             
-
 
 def singleton(func):
@@ -234,20 +242,21 @@
 
 @singleton
-def check_inversion_class(address_of_child):
-    print('inversion ... ')
+def check_inversion_class(address_of_child, verbose = False):
     # need to make sure that we have the right inversion class: inversion, m1qn3inversion, taoinversion
     if isinstance(address_of_child, m1qn3inversion):
-        write_string_to_netcdf(variable_name=str('inversion_class_name'), address_of_child=str('m1qn3inversion'), group=NetCDF.groups['inversion'])
-        print('Successfully saved inversion class instance ' + 'm1qn3inversion')
+        write_string_to_netcdf(variable_name=str('inversion_class_name'), address_of_child=str('m1qn3inversion'), group=NetCDF.groups['inversion'], verbose = verbose)
+        if verbose:
+            print('Successfully saved inversion class instance ' + 'm1qn3inversion')
     elif isinstance(address_of_child, taoinversion):
-        write_string_to_netcdf(variable_name=str('inversion_class_name'), address_of_child=str('taoinversion'), group=NetCDF.groups['inversion'])
-        print('Successfully saved inversion class instance ' + 'taoinversion')
-    else:
-        write_string_to_netcdf(variable_name=str('inversion_class_name'), address_of_child=str('inversion'), group=NetCDF.groups['inversion'])
-        print('Successfully saved inversion class instance ' + 'inversion')
-
-
-
-def copy_nested_results_struct(parent_struct_name, address_of_struct, group):
+        write_string_to_netcdf(variable_name=str('inversion_class_name'), address_of_child=str('taoinversion'), group=NetCDF.groups['inversion'], verbose = verbose)
+        if verbose:
+            print('Successfully saved inversion class instance ' + 'taoinversion')
+    else:
+        write_string_to_netcdf(variable_name=str('inversion_class_name'), address_of_child=str('inversion'), group=NetCDF.groups['inversion'], verbose = verbose)
+        if verbose:
+            print('Successfully saved inversion class instance ' + 'inversion')
+
+
+def copy_nested_results_struct(parent_struct_name, address_of_struct, group, verbose = False):
     '''
         This function takes a solution class instance and saves the solutionstep instances from <solution>.steps to the netcdf. 
@@ -258,5 +267,6 @@
         For each variable, we create dimensions that are assigned to each subgroup uniquely.
     '''
-    print("Beginning transfer of nested MATLAB struct to the NetCDF")
+    if verbose:
+        print("Beginning transfer of nested MATLAB struct to the NetCDF")
     
     # make a new subgroup to contain all the others:
@@ -264,5 +274,5 @@
 
     # make sure other systems can flag the nested struct type
-    write_string_to_netcdf('this_is_a_nested', 'struct', group, list=False)
+    write_string_to_netcdf('this_is_a_nested', 'struct', group, list=False, verbose = verbose)
 
     # other systems know the name of the parent struct because it's covered by the results/qmu functions above
@@ -280,15 +290,16 @@
         for variable in substruct_fields:
             address_of_child = current_substruct.__dict__[variable]
-            create_var(variable, address_of_child, subgroup)
-
-    print(f'Successfully transferred struct {parent_struct_name} to the NetCDF\n')
+            create_var(variable, address_of_child, subgroup, verbose = verbose)
+    
+    if verbose:
+        print(f'Successfully transferred struct {parent_struct_name} to the NetCDF\n')
     
         
-def create_var(variable_name, address_of_child, group):
+def create_var(variable_name, address_of_child, group, verbose = False):
     # There are lots of different variable types that we need to handle from the md class
     
     # This first conditional statement will catch numpy arrays of any dimension and save them
     if isinstance(address_of_child, np.ndarray):
-        write_numpy_array_to_netcdf(variable_name, address_of_child, group)
+        write_numpy_array_to_netcdf(variable_name, address_of_child, group, verbose=verbose)
     
     # check if it's an int
@@ -304,5 +315,5 @@
     # or a string
     elif isinstance(address_of_child, str):
-        write_string_to_netcdf(variable_name, address_of_child, group)
+        write_string_to_netcdf(variable_name, address_of_child, group, verbose=verbose)
 
     #or a bool
@@ -320,9 +331,8 @@
     elif isinstance(address_of_child,list) and isinstance(address_of_child[0],str):
         for string in address_of_child:
-            write_string_to_netcdf(variable_name, string, group, list=True)
+            write_string_to_netcdf(variable_name, string, group, list=True, verbose=verbose)
 
     # or a regular list
     elif isinstance(address_of_child, list):
-        print('made list w/ unlim dim')
         variable = group.createVariable(variable_name, type(address_of_child[0]), ('Unlim',))
         variable[:] = address_of_child
@@ -333,5 +343,5 @@
             variable = group.createVariable(variable_name, type(address_of_child), ('Unlim',))
             variable[:] = address_of_child
-            print('Used Unlim Dim')
+            print(f'Unrecognized variable was saved {variable_name}')
         except TypeError: pass # this would mean that we have an object, so we just let this continue to feed thru the recursive function above
         except Exception as e:
@@ -340,9 +350,10 @@
             print(e)
             print('Datatype given: ' + str(type(address_of_child)))
-
-    print(f'Successfully transferred data from {variable_name} to the NetCDF')
-    
-
-def write_string_to_netcdf(variable_name, address_of_child, group, list=False):
+    
+    if verbose:
+        print(f'Successfully transferred data from {variable_name} to the NetCDF')
+    
+
+def write_string_to_netcdf(variable_name, address_of_child, group, list=False, verbose = False):
     # netcdf and strings dont get along.. we have to do it 'custom':
     # if we hand it an address we need to do it this way:
@@ -390,6 +401,7 @@
             # save array to netcdf file
             string_var[:] = arr
-    
-            print(f'Saved {len(modded_strings)} strings to {variable_name}')
+
+            if verbose:
+                print(f'Saved {len(modded_strings)} strings to {variable_name}')
     
         except Exception as e:
@@ -419,6 +431,5 @@
 
 
-
-def write_numpy_array_to_netcdf(variable_name, address_of_child, group):
+def write_numpy_array_to_netcdf(variable_name, address_of_child, group, verbose = False):
     # to make a nested array in netCDF, we have to get the dimensions of the array,
     # create corresponding dimensions in the netCDF file, then we can make a variable
@@ -462,5 +473,5 @@
                 variable[:] = address_of_child[0]
             else:
-                print('Encountered single datatype that was not float64 or int64, saving under unlimited dimension, may cause errors.')
+                print(f'Encountered single datatype from {variable_name} that was not float64 or int64, saving under unlimited dimension, may cause errors.')
                 variable = group.createVariable(variable_name, typeis, ('Unlim',))
                 variable[:] = address_of_child[0]
@@ -482,2 +493,4 @@
             # write the variable:
             variable[:] = address_of_child
+
+            
