Index: /XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.cpp
===================================================================
--- /XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.cpp	(revision 1455)
+++ /XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.cpp	(revision 1456)
@@ -23,4 +23,5 @@
       {
         SuperClass::type = MULTI_FILE;
+        compressionLevel= file->compression_level.isEmpty() ? 0 :file->compression_level ;
       }
 
@@ -36,4 +37,5 @@
       {
         SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE;
+        compressionLevel= file->compression_level.isEmpty() ? 0 :file->compression_level ;
       }
 
@@ -274,10 +276,10 @@
                    {
                      case CDomain::type_attr::curvilinear :
-                       SuperClassWriter::addVariable(latid, typePrec, dim0);
-                       SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                       SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                       SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
                        break ;
                       case CDomain::type_attr::rectilinear :
-                        SuperClassWriter::addVariable(latid, typePrec, dim0);
-                        SuperClassWriter::addVariable(lonid, typePrec, dim1);
+                        SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                        SuperClassWriter::addVariable(lonid, typePrec, dim1, compressionLevel);
                         break ;
                    }
@@ -295,6 +297,6 @@
                      dim0.push_back(dimXid);
                      dim0.push_back(dimVertId);
-                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                    }
                  }
@@ -321,5 +323,5 @@
                  if (domain->hasArea)
                  {
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -376,6 +378,6 @@
                        lonid = lonName+appendDomid;
                        latid = latName+appendDomid;
-                       SuperClassWriter::addVariable(latid, typePrec, dim0);
-                       SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                       SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                       SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
                        break;
 
@@ -385,6 +387,6 @@
                        lonid = lonName+appendDomid;
                        latid = latName+appendDomid;
-                       SuperClassWriter::addVariable(latid, typePrec, dim0);
-                       SuperClassWriter::addVariable(lonid, typePrec, dim1);
+                       SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                       SuperClassWriter::addVariable(lonid, typePrec, dim1, compressionLevel);
                        break;
                    }
@@ -408,6 +410,6 @@
                      dim0.push_back(dimXid);
                      dim0.push_back(dimVertId);
-                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                    }
                  }
@@ -417,5 +419,5 @@
                    dim0.clear();
                    dim0.push_back(dimYid); dim0.push_back(dimXid);
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -593,5 +595,5 @@
       {
         dim0.clear();
-        SuperClassWriter::addVariable(domainName, NC_INT, dim0);
+        SuperClassWriter::addVariable(domainName, NC_INT, dim0, compressionLevel);
         SuperClassWriter::addAttribute("cf_role", StdString("mesh_topology"), &domainName);
         SuperClassWriter::addAttribute("long_name", StdString("Topology data of 2D unstructured mesh"), &domainName);
@@ -614,9 +616,9 @@
                 dim0.clear();
                 dim0.push_back(dimNode);
-                SuperClassWriter::addVariable(node_x, typePrec, dim0);
+                SuperClassWriter::addVariable(node_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x);
-                SuperClassWriter::addVariable(node_y, typePrec, dim0);
+                SuperClassWriter::addVariable(node_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y);
@@ -633,9 +635,9 @@
                 dim0.clear();
                 dim0.push_back(dimNode);
-                SuperClassWriter::addVariable(node_x, typePrec, dim0);
+                SuperClassWriter::addVariable(node_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x);
-                SuperClassWriter::addVariable(node_y, typePrec, dim0);
+                SuperClassWriter::addVariable(node_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y);
@@ -647,9 +649,9 @@
               dim0.clear();
               dim0.push_back(dimEdge);
-              SuperClassWriter::addVariable(edge_x, typePrec, dim0);
+              SuperClassWriter::addVariable(edge_x, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x);
               SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x);
-              SuperClassWriter::addVariable(edge_y, typePrec, dim0);
+              SuperClassWriter::addVariable(edge_y, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y);
@@ -658,5 +660,5 @@
               dim0.push_back(dimEdge);
               dim0.push_back(dimTwo);
-              SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0);
+              SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("edge_node_connectivity"), &edge_nodes);
               SuperClassWriter::addAttribute("long_name", StdString("Maps every edge/link to two nodes that it connects."), &edge_nodes);
@@ -673,9 +675,9 @@
                 dim0.clear();
                 dim0.push_back(dimNode);
-                SuperClassWriter::addVariable(node_x, typePrec, dim0);
+                SuperClassWriter::addVariable(node_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x);
-                SuperClassWriter::addVariable(node_y, typePrec, dim0);
+                SuperClassWriter::addVariable(node_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y);
@@ -689,9 +691,9 @@
                 dim0.clear();
                 dim0.push_back(dimEdge);
-                SuperClassWriter::addVariable(edge_x, typePrec, dim0);
+                SuperClassWriter::addVariable(edge_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x);
-                SuperClassWriter::addVariable(edge_y, typePrec, dim0);
+                SuperClassWriter::addVariable(edge_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y);
@@ -700,5 +702,5 @@
                 dim0.push_back(dimEdge);
                 dim0.push_back(dimTwo);
-                SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0);
+                SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("cf_role", StdString("edge_node_connectivity"), &edge_nodes);
                 SuperClassWriter::addAttribute("long_name", StdString("Maps every edge/link to two nodes that it connects."), &edge_nodes);
@@ -711,9 +713,9 @@
               dim0.clear();
               dim0.push_back(dimFace);
-              SuperClassWriter::addVariable(face_x, typePrec, dim0);
+              SuperClassWriter::addVariable(face_x, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &face_x);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh faces."), &face_x);
               SuperClassWriter::addAttribute("units", StdString("degrees_east"), &face_x);
-              SuperClassWriter::addVariable(face_y, typePrec, dim0);
+              SuperClassWriter::addVariable(face_y, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &face_y);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh faces."), &face_y);
@@ -722,5 +724,5 @@
               dim0.push_back(dimFace);
               dim0.push_back(dimVertex);
-              SuperClassWriter::addVariable(face_nodes, NC_INT, dim0);
+              SuperClassWriter::addVariable(face_nodes, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("face_node_connectivity"), &face_nodes);
               SuperClassWriter::addAttribute("long_name", StdString("Maps every face to its corner nodes."), &face_nodes);
@@ -729,5 +731,5 @@
               dim0.push_back(dimFace);
               dim0.push_back(dimVertex);
-              SuperClassWriter::addVariable(face_edges, NC_INT, dim0);
+              SuperClassWriter::addVariable(face_edges, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("face_edge_connectivity"), &face_edges);
               SuperClassWriter::addAttribute("long_name", StdString("Maps every face to its edges."), &face_edges);
@@ -737,5 +739,5 @@
               dim0.push_back(dimEdge);
               dim0.push_back(dimTwo);
-              SuperClassWriter::addVariable(edge_faces, NC_INT, dim0);
+              SuperClassWriter::addVariable(edge_faces, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("edge_face connectivity"), &edge_faces);
               SuperClassWriter::addAttribute("long_name", StdString("neighbor faces for edges"), &edge_faces);
@@ -746,5 +748,5 @@
               dim0.push_back(dimFace);
               dim0.push_back(dimVertex);
-              SuperClassWriter::addVariable(face_faces, NC_INT, dim0);
+              SuperClassWriter::addVariable(face_faces, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("face_face connectivity"), &face_faces);
               SuperClassWriter::addAttribute("long_name", StdString("Indicates which other faces neighbor each face"), &face_faces);
@@ -1073,6 +1075,6 @@
                  if (domain->hasLonLat)
                  {
-                   SuperClassWriter::addVariable(latid, typePrec, dim0);
-                   SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                   SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
                    this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid);
                    if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_lonid, &lonid);
@@ -1086,6 +1088,6 @@
                    dim0.push_back(dimXid);
                    dim0.push_back(dimVertId);
-                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                  }
 
@@ -1094,5 +1096,5 @@
                  if (domain->hasArea)
                  {
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -1132,6 +1134,6 @@
                  if (domain->hasLonLat)
                  {
-                   SuperClassWriter::addVariable(latid, typePrec, dim0);
-                   SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                   SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
 
                    this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid);
@@ -1147,6 +1149,6 @@
                    dim0.push_back(dimXid);
                    dim0.push_back(dimVertId);
-                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                  }
 
@@ -1155,5 +1157,5 @@
                    dim0.clear();
                    dim0.push_back(dimXid);
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -1264,5 +1266,5 @@
             if (!axis->label.isEmpty()) dims.push_back(strId);
 
-            SuperClassWriter::addVariable(axisid, typePrec, dims);
+            SuperClassWriter::addVariable(axisid, typePrec, dims, compressionLevel);
 
             if (!axis->name.isEmpty())
@@ -1314,5 +1316,5 @@
             {
               dims.push_back("axis_nbounds");
-              SuperClassWriter::addVariable(axisBoundsId, typePrec, dims);
+              SuperClassWriter::addVariable(axisBoundsId, typePrec, dims, compressionLevel);
               SuperClassWriter::addAttribute("bounds", axisBoundsId, &axisid);
 
Index: /XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.hpp
===================================================================
--- /XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.hpp	(revision 1455)
+++ /XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.hpp	(revision 1456)
@@ -41,4 +41,5 @@
             bool singleDomain ;
             bool isCollective ;
+            int compressionLevel ;
                       
             CFile* file;
Index: /XIOS/dev/XIOS_DEV_CMIP6/src/io/onetcdf4.cpp
===================================================================
--- /XIOS/dev/XIOS_DEV_CMIP6/src/io/onetcdf4.cpp	(revision 1455)
+++ /XIOS/dev/XIOS_DEV_CMIP6/src/io/onetcdf4.cpp	(revision 1456)
@@ -308,5 +308,5 @@
 
       int CONetCDF4::addVariable(const StdString& name, nc_type type,
-                                 const std::vector<StdString>& dim)
+                                 const std::vector<StdString>& dim, int compressionLevel)
       {
          int varid = 0;
@@ -350,4 +350,6 @@
          }
 
+         setCompressionLevel(name, compressionLevel) ;
+         
          return varid;
       }
Index: /XIOS/dev/XIOS_DEV_CMIP6/src/io/onetcdf4.hpp
===================================================================
--- /XIOS/dev/XIOS_DEV_CMIP6/src/io/onetcdf4.hpp	(revision 1455)
+++ /XIOS/dev/XIOS_DEV_CMIP6/src/io/onetcdf4.hpp	(revision 1456)
@@ -49,5 +49,5 @@
             int addDimension(const StdString& name, const StdSize size = UNLIMITED_DIM);
             int addVariable(const StdString& name, nc_type type,
-                            const std::vector<StdString>& dim);
+                            const std::vector<StdString>& dim, int compressionLevel=0);
 
       //----------------------------------------------------------------
