Index: XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.cpp	(revision 316)
+++ XIOS/trunk/src/output/nc4_data_output.cpp	(revision 318)
@@ -70,11 +70,13 @@
          StdString domid     = (!domain->name.isEmpty())
                              ? domain->name.getValue() : domain->getId();
-         StdString lonid     = StdString("lon_").append(domid);
-         StdString latid     = StdString("lat_").append(domid);
+         StdString appendDomid  = (singleDomain) ? "" : "_"+domid ;
+
+         StdString lonid     = StdString("lon").append(appendDomid);
+         StdString latid     = StdString("lat").append(appendDomid);
          StdString lonid_loc = (server->intraCommSize > 1)
-                             ? StdString("lon_").append(domid).append("_local")
+                             ? StdString("lon").append(appendDomid).append("_local")
                              : lonid;
          StdString latid_loc = (server->intraCommSize > 1)
-                             ? StdString("lat_").append(domid).append("_local")
+                             ? StdString("lat").append(appendDomid).append("_local")
                              : latid;
 // supress mask         StdString maskid    = StdString("mask_").append(domid).append("_local");
@@ -101,6 +103,6 @@
                {
                  dim0.push_back(latid_loc); dim0.push_back(lonid_loc);
-                 lonid = StdString("nav_lon_").append(domid);
-                 latid = StdString("nav_lat_").append(domid);
+                 lonid = StdString("nav_lon").append(appendDomid);
+                 latid = StdString("nav_lat").append(appendDomid);
                }
                else
@@ -118,5 +120,5 @@
                                              domain->zoom_jbegin_srv,
                                              domain->zoom_nj_srv,
-                                             domid);
+                                             appendDomid);
                }
                
@@ -172,6 +174,6 @@
                {
                   dim0.push_back(latid); dim0.push_back(lonid);
-                  lonid = StdString("nav_lon_").append(domid);
-                  latid = StdString("nav_lat_").append(domid);
+                  lonid = StdString("nav_lon").append(appendDomid);
+                  latid = StdString("nav_lat").append(appendDomid);
                   SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
                   SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
@@ -283,11 +285,13 @@
          StdString domid     = (!domain->name.isEmpty())
                              ? domain->name.getValue() : domain->getId();
-         StdString lonid     = StdString("lon_").append(domid);
-         StdString latid     = StdString("lat_").append(domid);
+         StdString appendDomid  = (singleDomain) ? "" : "_"+domid ;
+
+         StdString lonid     = StdString("lon").append(appendDomid);
+         StdString latid     = StdString("lat").append(appendDomid);
          StdString lonid_loc = (server->intraCommSize > 1)
-                             ? StdString("lon_").append(domid).append("_local")
+                             ? StdString("lon").append(appendDomid).append("_local")
                              : lonid;
          StdString latid_loc = (server->intraCommSize > 1)
-                             ? StdString("lat_").append(domid).append("_local")
+                             ? StdString("lat").append(appendDomid).append("_local")
                              : latid;
          StdString fieldid   = (!field->name.isEmpty())
@@ -324,6 +328,6 @@
          if (isCurvilinear)
          {
-            coodinates.push_back(StdString("nav_lat_").append(domid));
-            coodinates.push_back(StdString("nav_lon_").append(domid));
+            coodinates.push_back(StdString("nav_lat").append(appendDomid));
+            coodinates.push_back(StdString("nav_lon").append(appendDomid));
          }
          else
@@ -426,4 +430,6 @@
                                    StdString("An IPSL model"),
                                    this->getTimeStamp());
+         if (file->nbDomain==1) singleDomain=true ;
+         else singleDomain=false ;
       }
 
@@ -454,4 +460,5 @@
       {
          shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+          if (field->getRelFile()->isSyncTime()) SuperClassWriter::sync() ;
 
          boost::shared_ptr<CGrid> grid = field->grid ;
@@ -615,8 +622,8 @@
          (int ibegin, int ni, int jbegin, int nj, StdString domid)
       {
-         SuperClassWriter::addAttribute(StdString("ibegin_").append(domid), ibegin);
-         SuperClassWriter::addAttribute(StdString("ni_"    ).append(domid), ni);
-         SuperClassWriter::addAttribute(StdString("jbegin_").append(domid), jbegin);
-         SuperClassWriter::addAttribute(StdString("nj_"    ).append(domid), nj);
+         SuperClassWriter::addAttribute(StdString("ibegin").append(domid), ibegin);
+         SuperClassWriter::addAttribute(StdString("ni"    ).append(domid), ni);
+         SuperClassWriter::addAttribute(StdString("jbegin").append(domid), jbegin);
+         SuperClassWriter::addAttribute(StdString("nj"    ).append(domid), nj);
       }
 
