Ignore:
Timestamp:
10/09/14 12:28:26 (10 years ago)
Author:
mhnguyen
Message:

Making a wrapper of NetCdf? C functions

+) Add a wrapper class for NetCdf? functions
+) Add a class to manage exception for NetCdf? functions
+) Replace direct call to netcdf functions by functions of the wrapper

Test
+) On Curie
+) In case of error, exception is thrown and more information is provided

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/output/onetcdf4_impl.hpp

    r369 r498  
    33 
    44#include "onetcdf4.hpp" 
     5#include "netCdfInterface.hpp" 
    56 
    67namespace xios 
     
    1819 
    1920    if (this->wmpi && collective) 
    20     CheckError(nc_var_par_access(grpid, varid, NC_COLLECTIVE)); 
     21    CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 
    2122    if (this->wmpi && !collective) 
    22     CheckError(nc_var_par_access(grpid, varid, NC_INDEPENDENT)); 
     23    CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
    2324 
    2425    this->getWriteDataInfos 
     
    3132      << " ] Invalid input data !" ); 
    3233    } 
    33           
     34 
    3435    this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
    3536  } 
    36        
     37 
    3738//---------------------------------------------------------------- 
    38             
     39 
    3940  template <class T> 
    4041  void CONetCDF4::setDefaultValue(const StdString & varname, const T * value) 
     
    4243    int grpid = this->getCurrentGroup(); 
    4344    int varid = this->getVariable(varname); 
    44           
     45 
    4546    if (value != NULL) 
    4647    { 
    47       CheckError(nc_def_var_fill(grpid, varid, 0, (void*)value)); 
     48      CNetCdfInterface::defVarFill(grpid, varid, 0, (void*)value); 
    4849      this->addAttribute(StdString("missing_value"), *value, &varname); 
    4950    } 
    50     else CheckError(nc_def_var_fill(grpid, varid, 1, NULL));          
     51    else CNetCdfInterface::defVarFill(grpid, varid, 1, NULL); 
    5152  } 
    52       
     53 
    5354  ///--------------------------------------------------------------- 
    5455 
Note: See TracChangeset for help on using the changeset viewer.