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

Last change on this file since 462 was 412, checked in by ymipsl, 11 years ago

management of internal netcdf library

YM

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