Ignore:
Timestamp:
11/26/14 12:06:21 (10 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/onetcdf4_impl.hpp

    r501 r517  
    4646    if (value != NULL) 
    4747    { 
    48       CNetCdfInterface::defVarFill(grpid, varid, 0, (void*)value); 
     48      // nc_def_var_fill will automatically set the _FillValue attribute when 
     49      // using the NetCDF 4 format but we need to do it manually otherwise 
     50      if (useClassicFormat) 
     51        this->addAttribute(StdString("_FillValue"), *value, &varname); 
     52      else 
     53        CNetCdfInterface::defVarFill(grpid, varid, 0, (void*)value); 
    4954      this->addAttribute(StdString("missing_value"), *value, &varname); 
    5055    } 
    51     else CNetCdfInterface::defVarFill(grpid, varid, 1, NULL); 
     56    else if (!useClassicFormat) 
     57    { 
     58      // The "no-fill mode" is set globally for the classic NetCDF format 
     59      CNetCdfInterface::defVarFill(grpid, varid, 1, NULL); 
     60    } 
    5261  } 
    5362 
Note: See TracChangeset for help on using the changeset viewer.