Index: XIOS3/branches/xios-3.0-beta/src/io/nc4_data_output.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/io/nc4_data_output.cpp	(revision 2414)
+++ XIOS3/branches/xios-3.0-beta/src/io/nc4_data_output.cpp	(revision 2417)
@@ -492,6 +492,4 @@
       std::vector<StdString> dim0;
       StdString domainName = domain->name;
-      domain->assignMesh(domainName, domain->nvertex);
-      domain->mesh->createMeshEpsilon(context->intraComm_, domain->lonvalue, domain->latvalue, domain->bounds_lonvalue, domain->bounds_latvalue);
 
       StdString node_x = domainName + "_node_x";
@@ -609,4 +607,6 @@
                 SuperClassWriter::addAttribute("edge_coordinates", edge_x + " " + edge_y, &domainName);
                 SuperClassWriter::addAttribute("edge_node_connectivity", edge_nodes, &domainName);
+                SuperClassWriter::addAttribute("face_edge_connectivity", face_edges, &domainName);
+                SuperClassWriter::addAttribute("edge_face_connectivity", edge_faces, &domainName);
                 SuperClassWriter::addDimension(dimEdge, domain->mesh->nbEdgesGlo);
                 dim0.clear();
@@ -628,4 +628,5 @@
                 SuperClassWriter::addAttribute("start_index", 0, &edge_nodes);
               }
+              SuperClassWriter::addAttribute("face_face_connectivity", face_faces, &domainName);
               SuperClassWriter::addAttribute("face_coordinates", face_x + " " + face_y, &domainName);
               SuperClassWriter::addAttribute("face_node_connectivity", face_nodes, &domainName);
@@ -661,5 +662,5 @@
               dim0.push_back(dimTwo);
               SuperClassWriter::addVariable(edge_faces, NC_INT, dim0, compressionLevel);
-              SuperClassWriter::addAttribute("cf_role", StdString("edge_face connectivity"), &edge_faces);
+              SuperClassWriter::addAttribute("cf_role", StdString("edge_face_connectivity"), &edge_faces);
               SuperClassWriter::addAttribute("long_name", StdString("neighbor faces for edges"), &edge_faces);
               SuperClassWriter::addAttribute("start_index", 0, &edge_faces);
@@ -670,5 +671,5 @@
               dim0.push_back(dimVertex);
               SuperClassWriter::addVariable(face_faces, NC_INT, dim0, compressionLevel);
-              SuperClassWriter::addAttribute("cf_role", StdString("face_face connectivity"), &face_faces);
+              SuperClassWriter::addAttribute("cf_role", StdString("face_face_connectivity"), &face_faces);
               SuperClassWriter::addAttribute("long_name", StdString("Indicates which other faces neighbor each face"), &face_faces);
               SuperClassWriter::addAttribute("start_index", 0, &face_faces);
@@ -729,4 +730,5 @@
                  startNodes[0] = domain->mesh->node_start;
                  countNodes[0] = domain->mesh->node_count;
+                 if (countNodes[0]==0) startNodes[0]=0 ; // for netcdf error
                  startEdgeNodes[0] = domain->ibegin;
                  startEdgeNodes[1] = 0;
@@ -765,17 +767,25 @@
                  startNodes[0] = domain->mesh->node_start;
                  countNodes[0] = domain->mesh->node_count;
+                 if (countNodes[0]==0) startNodes[0]=0;
+
                  startEdges[0] = domain->mesh->edge_start;
                  countEdges[0] = domain->mesh->edge_count;
+                 if (countEdges[0]==0) startEdges[0]=0 ; // for netcdf error
+
                  startEdgeNodes[0] = domain->mesh->edge_start;
+                 countEdgeNodes[0] = domain->mesh->edge_count;
+                 if (countEdgeNodes[0]==0) startEdgeNodes[0]=0; // for netcdf error
                  startEdgeNodes[1] = 0;
-                 countEdgeNodes[0] = domain->mesh->edge_count;
                  countEdgeNodes[1]= 2;
+                 
                  startEdgeFaces[0] = domain->mesh->edge_start;
+                 countEdgeFaces[0] = domain->mesh->edge_count;
+                 if (countEdgeFaces[0]==0) startEdgeFaces[0]=0 ; // for netcdf error
                  startEdgeFaces[1]= 0;
-                 countEdgeFaces[0] = domain->mesh->edge_count;
                  countEdgeFaces[1]= 2;
+                 
                  startFaceConctv[0] = domain->ibegin;
+                 countFaceConctv[0] = domain->ni;
                  startFaceConctv[1] = 0;
-                 countFaceConctv[0] = domain->ni;
                  countFaceConctv[1] = domain->nvertex;
                }
