Index: /issm/trunk-jpl/src/m/classes/rifts.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/rifts.py	(revision 26758)
+++ /issm/trunk-jpl/src/m/classes/rifts.py	(revision 26759)
@@ -67,29 +67,31 @@
 
         numpairs = 0
-        for rift in self.riftstruct:
-            numpairs += np.size(rift['penaltypairs'], axis=0)
+        if numrifts > 0:
+            for rift in self.riftstruct:
+                numpairs += np.size(rift['penaltypairs'], axis=0)
 
-    # Convert strings in riftstruct to hard coded numbers
-        FillDict = {'Air': 0,
-                    'Ice': 1,
-                    'Melange': 2,
-                    'Water': 3}
-        for rift in self.riftstruct:
-            if rift['fill'] in ['Air', 'Ice', 'Melange', 'Water']:
-                rift['fill'] = FillDict[rift['fill']]
+            # Convert strings in riftstruct to hard coded numbers
+            FillDict = {'Air': 0,
+                        'Ice': 1,
+                        'Melange': 2,
+                        'Water': 3}
+            for rift in self.riftstruct:
+                if rift['fill'] in ['Air', 'Ice', 'Melange', 'Water']:
+                    rift['fill'] = FillDict[rift['fill']]
 
-    # 2 for nodes + 2 for elements + 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
-        data = np.zeros((numpairs, 12))
-        count = 0
-        for rift in self.riftstruct:
-            numpairsforthisrift = np.size(rift['penaltypairs'], 0)
-            data[count:count + numpairsforthisrift, 0:7] = rift['penaltypairs']
-            data[count:count + numpairsforthisrift, 7] = rift['fill']
-            data[count:count + numpairsforthisrift, 8] = rift['friction']
-            data[count:count + numpairsforthisrift, 9] = rift['fraction']
-            data[count:count + numpairsforthisrift, 10] = rift['fractionincrement']
-            data[count:count + numpairsforthisrift, 11] = rift['state'].reshape(-1)
-            count += numpairsforthisrift
-
+            # 2 for nodes + 2 for elements + 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
+            data = np.zeros((numpairs, 12))
+            count = 0
+            for rift in self.riftstruct:
+                numpairsforthisrift = np.size(rift['penaltypairs'], 0)
+                data[count:count + numpairsforthisrift, 0:7] = rift['penaltypairs']
+                data[count:count + numpairsforthisrift, 7] = rift['fill']
+                data[count:count + numpairsforthisrift, 8] = rift['friction']
+                data[count:count + numpairsforthisrift, 9] = rift['fraction']
+                data[count:count + numpairsforthisrift, 10] = rift['fractionincrement']
+                data[count:count + numpairsforthisrift, 11] = rift['state'].reshape(-1)
+                count += numpairsforthisrift
+        else:
+            data = np.zeros((numpairs, 12))
         WriteData(fid, prefix, 'data', numrifts, 'name', 'md.rifts.numrifts', 'format', 'Integer')
         WriteData(fid, prefix, 'data', data, 'name', 'md.rifts.riftstruct', 'format', 'DoubleMat', 'mattype', 3)
