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