Changeset 607


Ignore:
Timestamp:
06/05/15 10:03:37 (6 years ago)
Author:
rlacroix
Message:

Improve the error message when compression cannot be used.

Location:
XIOS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/branchs/xios-1.0/src/output/nc4_data_output.cpp

    r606 r607  
    739739           if (field->compression_level.isEmpty()) 
    740740             field->compression_level = field->file->compression_level.isEmpty() ? 0 : field->file->compression_level; 
    741            if (field->compression_level < 0 || field->compression_level > 9) 
    742              ERROR("void CNc4DataOutput::writeField_(CField* field)", 
    743                    "Invalid compression level, the value should range between 0 and 9."); 
    744741           SuperClassWriter::setCompressionLevel(fieldid, field->compression_level); 
    745742 
  • XIOS/branchs/xios-1.0/src/output/onetcdf4.cpp

    r606 r607  
    290290      void CONetCDF4::setCompressionLevel(const StdString& varname, int compressionLevel) 
    291291      { 
     292         if (compressionLevel < 0 || compressionLevel > 9) 
     293           ERROR("void CONetCDF4::setCompressionLevel(const StdString& varname, int compressionLevel)", 
     294                 "Invalid compression level for variable \"" << varname << "\", the value should range between 0 and 9."); 
     295         if (compressionLevel && wmpi) 
     296           ERROR("void CONetCDF4::setCompressionLevel(const StdString& varname, int compressionLevel)", 
     297                 "Impossible to use compression for variable \"" << varname << "\" when using parallel mode."); 
     298 
    292299         int grpid = this->getCurrentGroup(); 
    293300         int varid = this->getVariable(varname); 
  • XIOS/trunk/src/output/nc4_data_output.cpp

    r606 r607  
    758758            if (field->compression_level.isEmpty()) 
    759759              field->compression_level = field->file->compression_level.isEmpty() ? 0 : field->file->compression_level; 
    760             if (field->compression_level < 0 || field->compression_level > 9) 
    761               ERROR("void CNc4DataOutput::writeField_(CField* field)", 
    762                     "Invalid compression level, the value should range between 0 and 9."); 
    763760            SuperClassWriter::setCompressionLevel(fieldid, field->compression_level); 
    764761 
  • XIOS/trunk/src/output/onetcdf4.cpp

    r606 r607  
    324324      void CONetCDF4::setCompressionLevel(const StdString& varname, int compressionLevel) 
    325325      { 
     326         if (compressionLevel < 0 || compressionLevel > 9) 
     327           ERROR("void CONetCDF4::setCompressionLevel(const StdString& varname, int compressionLevel)", 
     328                 "Invalid compression level for variable \"" << varname << "\", the value should range between 0 and 9."); 
     329         if (compressionLevel && wmpi) 
     330           ERROR("void CONetCDF4::setCompressionLevel(const StdString& varname, int compressionLevel)", 
     331                 "Impossible to use compression for variable \"" << varname << "\" when using parallel mode."); 
     332 
    326333         int grpid = this->getCurrentGroup(); 
    327334         int varid = this->getVariable(varname); 
Note: See TracChangeset for help on using the changeset viewer.