YetAnotherCoupler 3.4.0
|
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <netcdf.h>
#include "read_woa_data.h"
#include "utils_common.h"
#include "io_utils.h"
Go to the source code of this file.
Functions | |
int | yac_open_woa_output (char const *input_file) |
void | yac_close_woa_output (int ncid) |
void | yac_read_woa_dimensions (int fileId, char const *fieldName, struct yac_fieldMetadata *fieldInfo) |
double * | yac_get_woa_memory (struct yac_fieldMetadata fieldInfo) |
void | yac_free_woa_memory (double *data) |
void | yac_read_woa_timestep_level (int fileId, double *cell_data, struct yac_fieldMetadata fieldInfo, int timeStep, int level) |
void yac_close_woa_output | ( | int | fileId | ) |
To close a NetCDF file
[in] | fileId | NetCDF file ID as it was returned by yac_open_woa_output |
Definition at line 41 of file read_woa_data.c.
void yac_free_woa_memory | ( | double * | data | ) |
To release allocated memory
[in] | data | memory for data from NetCDF file |
Definition at line 152 of file read_woa_data.c.
double * yac_get_woa_memory | ( | struct yac_fieldMetadata | fieldInfo | ) |
To get the appropriate memory for the data to be read in
[in] | fieldInfo | metadata information for the array |
Definition at line 144 of file read_woa_data.c.
int yac_open_woa_output | ( | char const * | input_file | ) |
To open a NetCDF file
[in] | input_file | file name of the NetCDF input file including the file extension The function returns an integer value (the NetCDF ID) which has to be used by subsequent calls when this file is accessed. |
Definition at line 22 of file read_woa_data.c.
void yac_read_woa_dimensions | ( | int | fileId, |
char const * | fieldName, | ||
struct yac_fieldMetadata * | fieldInfo ) |
To read in the dimensions for arrays stored in the file
[in] | fileId | NetCDF file ID as it was returned by yac_open_woa_output |
[in] | fieldName | name of the array that shall be read in |
[out] | fieldInfo | metadata information for the array |
Definition at line 57 of file read_woa_data.c.
void yac_read_woa_timestep_level | ( | int | fileId, |
double * | cell_data, | ||
struct yac_fieldMetadata | fieldInfo, | ||
int | timestep, | ||
int | level ) |
To read in on timestep of one particular field
[in] | fileId | NetCDF file ID as it was returned by yac_open_woa_output |
[out] | cell_data | one level of the requested field |
[out] | fieldInfo | metadata information for the array |
[in] | timestep | time step to be read from the NetCDF file |
[in] | level | vertical level to be read from the NetCDF file |
Definition at line 158 of file read_woa_data.c.