Ignore:
Timestamp:
11/26/14 12:06:21 (9 years ago)
Author:
rlacroix
Message:

Add a new attribute to the file definition so that the output format can be controlled.

Currently the supported formats are "netcdf4" and "netcdf4_classic". The "format" attribute is optional. The "netcdf4" format will be used when no format is explicitly defined. Since "netcdf4" is the format which was previously used by XIOS, existing configuration files will not be affected by this change.

If "netcdf4_classic" is used, the output file(s) will be created using the classic NetCDF format. This format can be used with the attribute "type" set to "one_file" if the NetCDF4 library was compiled with Parallel NetCDF support (--enable-pnetcdf).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/output/netCdfInterface.cpp

    r505 r517  
    524524   } 
    525525 
     526  /*! 
     527  Set or unset the fill mode for a NetCDF file specified by its file id. 
     528  \param [in] ncid File id 
     529  \param [in] fill Define whether the fill mode should be enabled or not 
     530  \return Status code 
     531  */ 
     532  int CNetCdfInterface::setFill(int ncid, bool fill) 
     533  { 
     534    int old_fill_mode; 
     535    int status = nc_set_fill(ncid, fill ? NC_FILL : NC_NOFILL, &old_fill_mode); 
     536    if (NC_NOERR != status) 
     537    { 
     538      StdString errormsg(nc_strerror(status)); 
     539      StdStringStream sstr; 
     540 
     541      sstr << "Error when calling function nc_set_fill(ncid, fill ? NC_FILL : NC_NOFILL, &old_fill_mode)" << std::endl; 
     542      sstr << errormsg << std::endl; 
     543      sstr << "Unable to set the fill mode to : " << (fill ? "NC_FILL" : "NC_NOFILL") << std::endl; 
     544      StdString e = sstr.str(); 
     545      throw CNetCdfException(e); 
     546    } 
     547 
     548    return status; 
     549  } 
     550 
    526551   /*! 
    527552   This function makes a request to netcdf with a ncid, to set the fill parameters for a variable, 
Note: See TracChangeset for help on using the changeset viewer.