YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
io_utils.h
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef IO_UTILS_H
6#define IO_UTILS_H
7
8#include "yac_config.h"
9
10#ifdef YAC_NETCDF_ENABLED
11#include <netcdf.h>
12#endif
13
14#include <mpi.h>
15
16#include "yac_assert.h"
17
18// YAC PUBLIC HEADER START
19
20int yac_file_exists(const char * filename);
21
23 MPI_Comm comm, int * local_is_io, int ** io_ranks, int * num_io_ranks);
24
25void yac_nc_open(const char * path, int omode, int * ncidp);
26void yac_nc_create(const char * path, int cmode, int * ncidp);
27void yac_nc_inq_dimid(int ncid, char const * name, int * dimidp);
28void yac_nc_inq_varid(int ncid, char const * name, int * varidp);
29
30#define YAC_HANDLE_ERROR(exp) \
31 do { \
32 int handle_error_status = (exp); \
33 YAC_ASSERT_F( \
34 (handle_error_status) == NC_NOERR, \
35 "%s", nc_strerror(handle_error_status)) \
36 } while(0)
37
38// YAC PUBLIC HEADER STOP
39
40#endif // IO_UTILS_H
void yac_nc_create(const char *path, int cmode, int *ncidp)
Definition io_utils.c:367
void yac_nc_inq_varid(int ncid, char const *name, int *varidp)
Definition io_utils.c:411
void yac_get_io_ranks(MPI_Comm comm, int *local_is_io, int **io_ranks, int *num_io_ranks)
Definition io_utils.c:309
int yac_file_exists(const char *filename)
Definition utils_core.c:12
void yac_nc_open(const char *path, int omode, int *ncidp)
Definition io_utils.c:350
void yac_nc_inq_dimid(int ncid, char const *name, int *dimidp)
Definition io_utils.c:385