Index: /issm/trunk-jpl/test/NightlyRun/runme.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/runme.py	(revision 12650)
+++ /issm/trunk-jpl/test/NightlyRun/runme.py	(revision 12651)
@@ -1,32 +1,33 @@
 #! /usr/bin/env python
-"""RUNME - test deck for ISSM nightly runs"""
-#
-#   In a test deck directory (tests/Vertification/NightlyRun for example)
-#   The following command will launch all the existing tests:
-#   >> runme
-#   To run the tests 101 and 102:
-#   >> runme('id',[101 102])
-#   etc...
-#
-#   Available options:
-#      'id'            followed by the list of ids requested
-#      'exclude'       ids to be excluded from the test
-#      'benchmark'     'nightly' (nightly run/ daily run)
-#                      'ismip'  : validation of ismip-hom tests
-#                      'eismint': validation of eismint tests
-#                      'thermal': validation of thermal tests
-#                      'mesh'   : validation of mesh tests
-#                      ...
-#      'procedure'     'check' : run the test (default)
-#                      'update': update the archive
-#                      'model' : prepare the model but no test is run
-#
-#   Usage:
-#      md=runme(varargin);
-#
-#   Examples:
-#      runme;
-#      runme('exclude',101);
-#      md=runme('id',102,'procedure','model');
+"""
+RUNME - test deck for ISSM nightly runs
+ 
+    In a test deck directory (tests/Vertification/NightlyRun for example)
+    The following command will launch all the existing tests:
+    >>> runme()
+    To run the tests 101 and 102:
+    >>> runme(id=[101,102])
+    etc...
+ 
+    Available options:
+       'id'            followed by the list of ids requested
+       'exclude'       ids to be excluded from the test
+       'benchmark'     'nightly' (nightly run/ daily run)
+                       'ismip'  : validation of ismip-hom tests
+                       'eismint': validation of eismint tests
+                       'thermal': validation of thermal tests
+                       'mesh'   : validation of mesh tests
+                       ...
+       'procedure'     'check' : run the test (default)
+                       'update': update the archive
+ 
+    Usage:
+       md=runme(varargin);
+ 
+    Examples:
+       runme()
+       runme(exclude=101)
+       md=runme(id=102,procedure='update')
+"""
 
 import os
@@ -34,5 +35,6 @@
 import socket
 import numpy
-import h5py
+#import h5py
+import netCDF4
 import sys
 from parallelrange import parallelrange
@@ -142,10 +144,15 @@
 #					raise RuntimeError("Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"').")
 					print "Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"')."
-				f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'w')
+#				f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'w')
+				f = netCDF4.Dataset(os.path.join('..','Archives',archive_name+'.nc'),'w')
 				for k,fieldname in enumerate(field_names):
 					field=numpy.array(field_values[k],dtype=float)
-					f.create_dataset(archive_name+'_field'+str(k),data=field)
+#					f.create_dataset(archive_name+'_field'+str(k),data=field)
+					f.createDimension(archive_name+'_field'+str(k)+'_0',numpy.size(field,0))
+					f.createDimension(archive_name+'_field'+str(k)+'_1',numpy.size(field,1))
+					v = f.createVariable(archive_name+'_field'+str(k),'f8',(archive_name+'_field'+str(k)+'_0',archive_name+'_field'+str(k)+'_1'))
+					v[:] = field
 				f.close()
-				print "File '%s' saved.\n" % os.path.join('..','Archives',archive_name+'.hdf5')
+				print "File '%s' saved.\n" % os.path.join('..','Archives',archive_name+'.nc')
 
 			#ELSE: CHECK TEST
@@ -153,8 +160,9 @@
 
 				#load archive
-				if os.path.exists(os.path.join('..','Archives',archive_name+'.hdf5')):
-					f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'r')
+				if os.path.exists(os.path.join('..','Archives',archive_name+'.nc')):
+#					f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'r')
+					f = netCDF4.Dataset(os.path.join('..','Archives',archive_name+'.nc'),'r')
 				else:
-					raise IOError("Archive file '"+os.path.join('..','Archives',archive_name+'.hdf5')+"' does not exist.")
+					raise IOError("Archive file '"+os.path.join('..','Archives',archive_name+'.nc')+"' does not exist.")
 
 				for k,fieldname in enumerate(field_names):
@@ -168,6 +176,8 @@
 
 						#compare to archive
-						if archive_name+'_field'+str(k) in f:
-							archive=f[archive_name+'_field'+str(k)][...]
+#						if archive_name+'_field'+str(k) in f:
+#							archive=f[archive_name+'_field'+str(k)][...]
+						if archive_name+'_field'+str(k) in f.variables:
+							archive=f.variables[archive_name+'_field'+str(k)][:]
 						else:
 							raise NameError("Field name '"+archive_name+'_field'+str(k)+"' does not exist in archive file.")
