<p><b>mhoffman@lanl.gov</b> 2012-05-11 20:26:48 -0600 (Fri, 11 May 2012)</p><p>BRANCH COMMIT -- land ice<br>
<br>
Added surface mass balance to thickness tendency calculation (and added it to the scripts that setup grids &amp; dome test case).  Added other bc fields (Tsfc &amp; basal heat flux) to setup scripts, but they arent used for calculations yet.<br>
For now SMB has no time dimension (constant over simulation).<br>
</p><hr noshade><pre><font color="gray">Modified: branches/land_ice_projects/grid_tools/add_land_ice_variables_to_mpas_grid.py
===================================================================
--- branches/land_ice_projects/grid_tools/add_land_ice_variables_to_mpas_grid.py        2012-05-12 00:02:02 UTC (rev 1904)
+++ branches/land_ice_projects/grid_tools/add_land_ice_variables_to_mpas_grid.py        2012-05-12 02:26:48 UTC (rev 1905)
@@ -68,17 +68,21 @@
 newvar[:] = numpy.zeros(newvar.shape)
 newvar = fileout.createVariable('bedTopography', 'd', ('Time', 'nCells'))
 newvar[:] = numpy.zeros(newvar.shape)
-newvar = fileout.createVariable('beta', 'd', ('Time', 'nCells'))
-newvar[:] = numpy.zeros(newvar.shape)
 newvar = fileout.createVariable('normalVelocity', 'd', ('Time', 'nEdges', 'nVertLevels'))
 newvar[:] = numpy.zeros(newvar.shape)
 newvar = fileout.createVariable('temperature', 'd', ('Time', 'nCells', 'nVertLevels'))
 #newvar = fileout.createVariable('temperature', 'd', ('Time', 'nCells', 'nVertLevelsPlus2'))
 newvar[:] = numpy.zeros(newvar.shape)
+# These boundary conditions are currently part of mesh, and are time independent.  If they change, make sure to adjust the dimensions here and in Registry.
+newvar = fileout.createVariable('beta', 'd', ( 'nCells',))
+newvar[:] = numpy.zeros(newvar.shape)
+newvar = fileout.createVariable('sfcMassBal', 'd', ('nCells',))
+newvar[:] = numpy.zeros(newvar.shape)
+newvar = fileout.createVariable('sfcAirTemp', 'd', ('nCells',))
+newvar[:] = numpy.zeros(newvar.shape)
+newvar = fileout.createVariable('basalHeatFlux', 'd', ('nCells',))
+newvar[:] = numpy.zeros(newvar.shape)
 
-
-
-
 # Assign the global attributes
 # Copy over the two attributes that are required by MPAS.  If any others exist in the input file, give a warning.
 setattr(fileout, 'on_a_sphere', getattr(filein, 'on_a_sphere'))

Modified: branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_tendency.F
===================================================================
--- branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_tendency.F        2012-05-12 00:02:02 UTC (rev 1904)
+++ branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_tendency.F        2012-05-12 02:26:48 UTC (rev 1905)
@@ -126,6 +126,9 @@
         call mpas_dmpar_abort(dminfo)
      end select
 
+     ! Add surface mass balance to tendency
+     thickness_tend = thickness_tend + mesh % sfcMassBal % array * dt / SecondsInYear
+
    end subroutine land_ice_tendency_h
 
 

Modified: branches/land_ice_projects/test_cases/dome/setup_dome_initial_conditions.py
===================================================================
--- branches/land_ice_projects/test_cases/dome/setup_dome_initial_conditions.py        2012-05-12 00:02:02 UTC (rev 1904)
+++ branches/land_ice_projects/test_cases/dome/setup_dome_initial_conditions.py        2012-05-12 02:26:48 UTC (rev 1905)
@@ -33,6 +33,9 @@
     layerThicknessFractions = gridfile.variables['layerThicknessFractions'][:]
     temperature = gridfile.variables['temperature'][:]
     beta = gridfile.variables['beta'][:]
+    SMB = gridfile.variables['sfcMassBal'][:]
+    Tsfc = gridfile.variables['sfcAirTemp'][:]
+    G = gridfile.variables['basalHeatFlux'][:]
 except:
     sys.exit('Error: The grid file specified is either missing or lacking needed dimensions/variables.')
 
@@ -58,11 +61,14 @@
 # Setup layerThicknessFractions
 layerThicknessFractions[:] = 1.0 / nVertLevels
 
+# boundary conditions
+# Sample values to use, or comment these out for them to be 0.
 beta[:] = 10000.
+SMB[:] = 2.0/1000.0 * (thickness[:] + bedTopography[:]) - 1.0  # units: m weq/yr, lapse rate of 1 m/yr with 0 at 500 m
+Tsfc[:] = -5.0/1000.0 * (thickness[:] + bedTopography[:]) # lapse rate of 5 deg / km
+G = 0.01
 
-# (lowerSurface and upperSurface need to be calculated in MPAS)
 
-
 # Reassign the modified numpy array values back into netCDF variable objects
 gridfile.variables['thickness'][:] = thickness
 gridfile.variables['normalVelocity'][:] = normalVelocity
@@ -70,7 +76,9 @@
 gridfile.variables['temperature'][:] = temperature
 gridfile.variables['layerThicknessFractions'][:] = layerThicknessFractions
 gridfile.variables['beta'][:] = beta
+gridfile.variables['sfcMassBal'][:] = SMB
+gridfile.variables['sfcAirTemp'][:] = Tsfc
+gridfile.variables['basalHeatFlux'][:] = G
 
-
 gridfile.close()
 

</font>
</pre>