Index: issm/trunk-jpl/test/NightlyRun/test543.py
===================================================================
--- issm/trunk-jpl/test/NightlyRun/test543.py	(revision 26674)
+++ issm/trunk-jpl/test/NightlyRun/test543.py	(revision 26907)
@@ -1,13 +1,12 @@
 #Test Name: PigTranStochasticforcing
 import numpy as np
-
-from frontalforcingsrignotautoregression import *
+from frontalforcingsrignotautoregression import frontalforcingsrignotautoregression
 from socket import gethostname
 from model import *
-from parameterize import *
-from setflowequation import *
-from setmask import *
-from solve import *
-from triangle import *
+from parameterize import parameterize
+from setflowequation import setflowequation
+from setmask import setmask
+from solve import solve
+from triangle import triangle
 
 
@@ -41,11 +40,11 @@
             idb_df[ii] = 2
 #Dimensionalities
-nb_tf    = 2
-nb_clv   = 2
+nb_tf = 2
+nb_clv  = 2
 nb_flmlt = 2
 
 # Calving parameters
 md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
-md.calving.calvingrate = 0.3*np.ones((md.mesh.numberofvertices,))
+md.calving.calvingrate = 0.3 * np.ones((md.mesh.numberofvertices,))
 md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
 md.levelset.migration_max = 10.0
@@ -53,5 +52,5 @@
 md.frontalforcings = frontalforcingsrignotautoregression()
 md.frontalforcings.num_basins = nb_tf
-md.frontalforcings.basin_id = idb_tf - 1  # NOTE: offset because of 1-based vertex indexing
+md.frontalforcings.basin_id = idb_tf
 md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
 md.frontalforcings.beta0 = np.array([[0.05, 0.01]])  # intercept values of TF in basins [C]
@@ -62,11 +61,11 @@
 md.frontalforcings.phi = np.array([[0.1, -0.1, 0.01, -0.01], [0.2, -0.2, 0.1, 0.0]])  # autoregressive parameters
 #Floating Ice Melt parameters
-md.basalforcings.floatingice_melting_rate = 0.1*np.ones((md.mesh.numberofvertices,))
+md.basalforcings.floatingice_melting_rate = 0.1 * np.ones((md.mesh.numberofvertices,))
 
 #Covariance matrix
-covtf            = 1e-4*np.identity(nb_tf)
-covclv           = 1e-1*np.identity(nb_clv)
-covclv[0,0]      = 1/10*covclv[0,0]
-covflmlt         = 0.05*np.identity(nb_flmlt)
+covtf = 1e-4 * np.identity(nb_tf)
+covclv = 1e-1 * np.identity(nb_clv)
+covclv[0, 0] = 1 / 10 * covclv[0, 0]
+covflmlt = 0.05 * np.identity(nb_flmlt)
 #covglob          = np.zeros([6,6])
 #covglob[0:2,0:2] = covtf
@@ -75,5 +74,10 @@
 
 #Hard-coding covariance matrix because python is complaining
-covglob = np.array([[1e-4,0.,0.,0.,0.,0.],[0.,1e-4,0.,0.,0.,0.],[0.,0.,1e-2,0.,0.,0.],[0.,0.,0.,1e-1,0.,0.],[0.,0.,0.,0.,0.05,0.],[0.,0.,0.,0.,0.,0.05]])
+covglob = np.array([[1e-4, 0., 0., 0., 0., 0.],
+                    [0., 1e-4, 0., 0., 0., 0.],
+                    [0., 0., 1e-2, 0., 0., 0.],
+                    [0., 0., 0., 1e-1, 0., 0.],
+                    [0., 0., 0., 0., 0.05, 0.],
+                    [0., 0., 0., 0., 0., 0.05]])
 #testchol = np.linalg.cholesky(covglob)
 #print(testchol)
@@ -81,14 +85,14 @@
 # Stochastic forcing
 md.stochasticforcing.isstochasticforcing = 1
-md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression','DefaultCalving','FloatingMeltRate']
+md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression', 'DefaultCalving', 'FloatingMeltRate']
 md.stochasticforcing.defaultdimension = 2
-md.stochasticforcing.default_id       = idb_df-1 #NOTE: offset because of 1-based vertex indexing
-md.stochasticforcing.covariance       = covglob # global covariance among- and between-fields
-md.stochasticforcing.randomflag       = 0 # determines true/false randomness
+md.stochasticforcing.default_id = idb_df
+md.stochasticforcing.covariance = covglob  # global covariance among- and between-fields
+md.stochasticforcing.randomflag = 0  # determines true/false randomness
 
-md.transient.ismovingfront   = 1
+md.transient.ismovingfront = 1
 md.transient.isgroundingline = 1
 
-md.transient.requested_outputs = ['default', 'CalvingCalvingrate','CalvingMeltingrate','BasalforcingsFloatingiceMeltingRate']
+md.transient.requested_outputs = ['default', 'CalvingCalvingrate', 'CalvingMeltingrate', 'BasalforcingsFloatingiceMeltingRate']
 md.cluster = generic('name', gethostname(), 'np', 2)
 md = solve(md, 'Transient')
@@ -96,14 +100,12 @@
 # Fields and tolerances to track changes
 field_names = [
-    'Vx1' ,'Vy1' ,'Vel1' ,'Thickness1' ,'MaskIceLevelset1' ,'CalvingCalvingrate1' ,'CalvingMeltingrate1' ,'BasalforcingsFloatingiceMeltingRate1',
-    'Vx2' ,'Vy2' ,'Vel2' ,'Thickness2' ,'MaskIceLevelset2' ,'CalvingCalvingrate1' ,'CalvingMeltingrate2' ,'BasalforcingsFloatingiceMeltingRate2',
-    'Vx10','Vy10','Vel10','Thickness10','MaskIceLevelset10','CalvingCalvingrate10','CalvingMeltingrate10','BasalforcingsFloatingiceMeltingRate10'
-]
+    'Vx1', 'Vy1', 'Vel1', 'Thickness1', 'MaskIceLevelset1', 'CalvingCalvingrate1', 'CalvingMeltingrate1', 'BasalforcingsFloatingiceMeltingRate1',
+    'Vx2', 'Vy2', 'Vel2', 'Thickness2', 'MaskIceLevelset2', 'CalvingCalvingrate1', 'CalvingMeltingrate2', 'BasalforcingsFloatingiceMeltingRate2',
+    'Vx10', 'Vy10', 'Vel10', 'Thickness10', 'MaskIceLevelset10', 'CalvingCalvingrate10', 'CalvingMeltingrate10', 'BasalforcingsFloatingiceMeltingRate10']
 
 field_tolerances = [
-    1e-11,2e-11,2e-11,1e-11,1e-9,1e-10,1e-10,1e-10,
-    2e-11,1e-11,1e-11,9e-11,2e-9,1e-10,1e-10,1e-10,
-    2e-10,1e-10,1e-10,1e-10,5e-9,1e-10,1e-10,1e-10
-]
+    1e-11, 2e-11, 2e-11, 1e-11, 1e-9, 1e-10, 1e-10, 1e-10,
+    2e-11, 1e-11, 1e-11, 9e-11, 2e-9, 1e-10, 1e-10, 1e-10,
+    2e-10, 1e-10, 1e-10, 1e-10, 5e-9, 1e-10, 1e-10, 1e-10]
 field_values = [
     md.results.TransientSolution[0].Vx,
@@ -130,4 +132,3 @@
     md.results.TransientSolution[9].CalvingCalvingrate,
     md.results.TransientSolution[9].CalvingMeltingrate,
-    md.results.TransientSolution[9].BasalforcingsFloatingiceMeltingRate
-]
+    md.results.TransientSolution[9].BasalforcingsFloatingiceMeltingRate]
