Index: /issm/trunk/src/mex/KMLMeshWrite/KMLMeshWrite.cpp
===================================================================
--- /issm/trunk/src/mex/KMLMeshWrite/KMLMeshWrite.cpp	(revision 7658)
+++ /issm/trunk/src/mex/KMLMeshWrite/KMLMeshWrite.cpp	(revision 7659)
@@ -127,8 +127,8 @@
 	if (part && (lprt != nnodes))
 		_error_("Partitioning vector, if supplied, must be supplied for all nodes.");
-	if (data && (mdata != melem))
-		_error_("Data vector, if supplied, must be supplied for all elements.");
+	if (data && !((mdata == nnodes) || (mdata == melem)))
+		_error_("Data vector, if supplied, must be supplied for all nodes or all elements.");
 	if (cmap && (ncmap != 3))
-		_error_("Colormap vector, if supplied, should have three columns for rgb.");
+		_error_("Colormap vector, if supplied, must have three columns for rgb.");
 
 	if (!strlen(filnam))
@@ -147,5 +147,5 @@
 				  lat,lng,
 				  part,
-				  data,
+				  data,mdata,ndata,
 				  cmap,mcmap,ncmap,
 				  fid);
