source: XIOS/trunk/src/output/netcdf.hpp @ 379

Last change on this file since 379 was 379, checked in by ymipsl, 12 years ago
  • zoom can be output in single file without need to patch the netcdf library
  • sequential version of netcdf4 are now managed. Can be used to output in multiple_file mode

YM

File size: 1.4 KB
Line 
1#ifndef __XIOS_NETCDF_HPP__
2#define __XIOS_NETCDF_HPP__
3#include <mpi.h>
4#define MPI_INCLUDED
5#include <netcdf.h>
6#undef MPI_INCLUDED
7
8#include "netcdf_version.hpp"
9
10#if NETCDF_VERSION >= 4110
11
12#  if defined(USING_NETCDF_PAR)
13extern "C"
14{
15#  include <netcdf_par.h>
16}
17#  endif
18#endif
19
20namespace xios
21{
22  inline int nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,int *ncidp)
23  {
24#if defined(USING_NETCDF_PAR)
25    return ::nc_create_par(path, cmode, comm, info, ncidp) ;
26#else
27    ERROR("int nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,int *ncidp)",
28           << "must not be use with netcdf sequential version") ;
29    return -1 ;
30#endif
31  }
32 
33  inline int nc_open_par(const char *path, int mode, MPI_Comm comm, MPI_Info info,int *ncidp)
34  { 
35#if defined(USING_NETCDF_PAR)
36    return ::nc_open_par(path, mode, comm, info, ncidp) ;
37#else
38    ERROR("int nc_open_par(const char *path, int mode, MPI_Comm comm, MPI_Info info,int *ncidp)",
39           << "must not be use with netcdf sequential version") ;
40    return -1 ;
41#endif
42  }
43 
44  inline int nc_var_par_access(int ncid, int varid, int par_access)
45  {
46#if defined(USING_NETCDF_PAR)
47    return ::nc_var_par_access(ncid, varid, par_access) ;
48#else
49    ERROR("int nc_var_par_access(int ncid, int varid, int par_access)",
50           << "must not be use with netcdf sequential version") ;
51    return -1 ;
52#endif
53  }
54}
55
56
57#endif
Note: See TracBrowser for help on using the repository browser.