<p><b>mhoffman@lanl.gov</b> 2013-04-04 11:13:09 -0600 (Thu, 04 Apr 2013)</p><p>BRANCH COMMIT - land ice<br>
Adding surface mass balance (single time slice, not time-series) to the fields that this conversion script attempts to copy from a CISM grid file to an MPAS grid file.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/land_ice_projects/grid_tools/copy_CISM_grid_to_MPAS_grid.py
===================================================================
--- branches/land_ice_projects/grid_tools/copy_CISM_grid_to_MPAS_grid.py        2013-04-04 15:47:36 UTC (rev 2726)
+++ branches/land_ice_projects/grid_tools/copy_CISM_grid_to_MPAS_grid.py        2013-04-04 17:13:09 UTC (rev 2727)
@@ -292,8 +292,27 @@
     print '</font>
<font color="black">problem with balvel field (e.g. not found in input file), skipping...</font>
<font color="blue">'
   
 
+if 1: 
+    acab = infile.variables['acab']
+    try:
+      sf = acab.scale_factor
+    except:
+      sf = 1.0
+    if netCDF_module == 'netCDF4':
+      sf = 1.0   # netCDF4 should autoscale!
+    smb = outfile.variables['sfcMassBalTimeSeries']
+    print '</font>
<font color="blue">acab min/max', acab[:].min()*sf, acab[:].max()*sf
+    smbmpas = BilinearInterp(x1, y1, acab[timelev,:,:] * sf, xCell, yCell)
+    for t in range(smb.shape[1]):
+            print 'Inserting CISM acab from time ' + str(timelev) + ' into MPAS sfcMassBalTimeSeries time index ' + str(t)
+            smb[:,t] = smbmpas[:]
+    print 'new smb min/max', smb[:].min(), smb[:].max()
+    del acab, smb
+#except:
+#    print '</font>
<font color="black">problem with acab field (e.g. not found in input file), skipping...</font>
<font color="blue">'
 
 
+
 # Variables on edges...?
 #normalVelocity = outfile.variables['normalVelocity'][:]
 

</font>
</pre>