Index: /issm/trunk-jpl/src/m/mesh/bamg.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 27119)
+++ /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 27120)
@@ -23,92 +23,92 @@
     Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
 
-    - domain :                              followed by an ARGUS file that 
+    - domain :                              followed by an ARGUS file that
                                             prescribes the domain outline
-    - holes :                               followed by an ARGUS file that 
+    - holes :                               followed by an ARGUS file that
                                             prescribes the holes
-    - subdomains :                          followed by an ARGUS file that 
-                                            prescribes the list of subdomains 
+    - subdomains :                          followed by an ARGUS file that
+                                            prescribes the list of subdomains
                                             (that need to be inside domain)
 
-    - hmin :                                minimum edge length (default is 
+    - hmin :                                minimum edge length (default is
                                             1.0e-100)
-    - hmax :                                maximum edge length (default is 
+    - hmax :                                maximum edge length (default is
                                             1.0e100)
-    - hVertices :                           imposed edge length for each vertex 
+    - hVertices :                           imposed edge length for each vertex
                                             (geometry or mesh)
-    - hminVertices :                        minimum edge length for each vertex 
+    - hminVertices :                        minimum edge length for each vertex
                                             (mesh)
-    - hmaxVertices :                        maximum edge length for each vertex 
+    - hmaxVertices :                        maximum edge length for each vertex
                                             (mesh)
 
-    - anisomax :                            maximum ratio between the smallest 
-                                            and largest edges (default is 
+    - anisomax :                            maximum ratio between the smallest
+                                            and largest edges (default is
                                             1.0e30)
-    - coeff :                               coefficient applied to the metric 
-                                            (2 -> twice as many elements, 
+    - coeff :                               coefficient applied to the metric
+                                            (2 -> twice as many elements,
                                             default is 1)
-    - cutoff :                              scalar used to compute the metric 
+    - cutoff :                              scalar used to compute the metric
                                             when metric type 2 or 3 are applied
-    - err :                                 error used to generate the metric 
+    - err :                                 error used to generate the metric
                                             from a field
     - errg :                                geometric error (default is 0.1)
-    - field :                               field of the model that will be 
-                                            used to compute the metric to apply 
-                                            several fields, use one column per 
+    - field :                               field of the model that will be
+                                            used to compute the metric to apply
+                                            several fields, use one column per
                                             field
-    - gradation :                           maximum ratio between two adjacent 
+    - gradation :                           maximum ratio between two adjacent
                                             edges
-    - Hessiantype :                         0 -> use double P2 projection 
+    - Hessiantype :                         0 -> use double P2 projection
                                             (default)
                                             1 -> use Green formula
-    - KeepVertices :                        try to keep initial vertices when 
-                                            adaptation is done on an existing 
+    - KeepVertices :                        try to keep initial vertices when
+                                            adaptation is done on an existing
                                             mesh (default 1)
-    - NoBoundaryRefinement :                do not refine boundary, only follow 
-                                            contour provided (default 0). Allow 
-                                            subdomain boundary refinement 
+    - NoBoundaryRefinement :                do not refine boundary, only follow
+                                            contour provided (default 0). Allow
+                                            subdomain boundary refinement
                                             though
-    - NoBoundaryRefinementAllBoundaries :   do not refine boundary, only follow 
+    - NoBoundaryRefinementAllBoundaries :   do not refine boundary, only follow
                                             contour provided (default 0)
-    - maxnbv :                              maximum number of vertices used to 
+    - maxnbv :                              maximum number of vertices used to
                                             allocate memory (default is 1.0e6)
-    - maxsubdiv :                           maximum subdivision of exisiting 
+    - maxsubdiv :                           maximum subdivision of exisiting
                                             elements (default is 10)
-    - metric :                              matrix (numberofnodes x 3) used as 
+    - metric :                              matrix (numberofnodes x 3) used as
                                             a metric
-    - Metrictype :                          1 -> absolute error 
+    - Metrictype :                          1 -> absolute error
                                             c/(err coeff^2) * Abs(H) (default)
-                                            2 -> relative error 
-                                            c / (err coeff^2) * Abs(H) / 
+                                            2 -> relative error
+                                            c / (err coeff^2) * Abs(H) /
                                             max(s, cutoff * max(s))
-                                            3 -> rescaled absolute error 
-                                            c / (err coeff^2) * Abs(H) / 
+                                            3 -> rescaled absolute error
+                                            c / (err coeff^2) * Abs(H) /
                                             (smax - smin)
-    - nbjacoby :                            correction used by Hessiantype = 1 
+    - nbjacoby :                            correction used by Hessiantype = 1
                                             (default is 1)
-    - nbsmooth :                            number of metric smoothing 
+    - nbsmooth :                            number of metric smoothing
                                             procedure (default is 3)
-    - omega :                               relaxation parameter of the 
-                                            smoothing procedure (default is 
+    - omega :                               relaxation parameter of the
+                                            smoothing procedure (default is
                                             1.8)
-    - power :                               power applied to the metric 
+    - power :                               power applied to the metric
                                             (default is 1)
-    - splitcorners :                        split triangles which have 3 
-                                            vertices on the outline (default is 
+    - splitcorners :                        split triangles which have 3
+                                            vertices on the outline (default is
                                             1)
     - verbose :                             level of verbosity (default is 1)
 
-    - rifts :                               followed by an ARGUS file that 
+    - rifts :                               followed by an ARGUS file that
                                             prescribes the rifts
-    - toltip :                              tolerance to move tip on an 
-                                            existing point of the domain 
+    - toltip :                              tolerance to move tip on an
+                                            existing point of the domain
                                             outline
-    - tracks :                              followed by an ARGUS file that 
-                                            prescribes the tracks that the mesh 
+    - tracks :                              followed by an ARGUS file that
+                                            prescribes the tracks that the mesh
                                             will stick to
-    - RequiredVertices :                    mesh vertices that are required. 
+    - RequiredVertices :                    mesh vertices that are required.
                                             [x, y, ref]; ref is optional
-    - tol :                                 if the distance between 2 points of 
-                                            the domain outline is less than 
+    - tol :                                 if the distance between 2 points of
+                                            the domain outline is less than
                                             tol, they will be merged
 
@@ -250,9 +250,8 @@
 
             # Flag how many edges we have now, that way we know which edges
-            # belong to the subdomain. Will be used later fo required edges 
+            # belong to the subdomain. Will be used later fo required edges
             # if NoBoundaryRefinement equals 1.
             new_edge_length = len(bamg_geometry.Edges)
-            edges_required = range((edge_length + 1), (new_edge_length + 1)) # NOTE: Upper bound of range is non-inclusive (compare to src/m/mesh/bamg.m)
-
+            edges_required = np.asarray(range((edge_length + 1), (new_edge_length + 1)))  # NOTE: Upper bound of range is non-inclusive (compare to src/m/mesh/bamg.m)
             if i: # NOTE: same as `if i > 0` (MATLAB is `if i > 1`)
                 bamg_geometry.SubDomains = np.vstack((bamg_geometry.SubDomains, [2, count + 1, 1, -subdomain_ref]))
@@ -445,5 +444,5 @@
                                     np.array([[count, count + 1, 2]]),
                                     np.hstack((
-                                        np.arange(count + 1, count + nods).reshape(-1, ), 
+                                        np.arange(count + 1, count + nods).reshape(-1, ),
                                         np.arange(count + 2, count + nods + 1).reshape(-1, ),
                                         (1 + i) * np.ones((nods - 1, 1))
@@ -455,5 +454,5 @@
                     nods = rift[i]['nods'] - 1
                     bamg_geometry.Vertices = np.vstack((
-                        bamg_geometry.Vertices, 
+                        bamg_geometry.Vertices,
                         np.hstack((
                             rift[i]['x'][:],
