Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Sep 6, 2019
1 parent b53c2d3 commit 4f579cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/clib/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ typedef struct var_desc_t
/** Holds the fill value of this var. */
void *fillvalue;

/** Number of dimensions for this var. */
int ndims;

/** Non-zero if fill mode is turned on for this var. */
int use_fill;

Expand Down
14 changes: 11 additions & 3 deletions src/clib/pioc_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,8 @@ check_unlim_use(int ncid)
/**
* Internal function used when opening an existing file. This function
* is called by PIOc_openfile_retry(). It learns some things about the
* metadata in that file. The results end up in the file_desc_t.
* metadata in that file. The results end up in the file_desc_t and
* var_desc_t structs for this file and the vars in it.
*
* @param file pointer to the file_desc_t for this file.
* @param ncid the ncid assigned to the file when opened.
Expand All @@ -2230,15 +2231,21 @@ check_unlim_use(int ncid)
* @author Ed Hartnett
*/
int
inq_file_metadata(file_desc_t *file, int ncid, int iotype, int *nvars, int **rec_var,
int **pio_type, int **pio_type_size, MPI_Datatype **mpi_type, int **mpi_type_size)
inq_file_metadata(file_desc_t *file, int ncid, int iotype, int *nvars,
int **rec_var, int **pio_type, int **pio_type_size,
MPI_Datatype **mpi_type, int **mpi_type_size)
{
int nunlimdims = 0; /* The number of unlimited dimensions. */
int unlimdimid;
int *unlimdimids;
int mpierr;
int ret;

/* Check inputs. */
pioassert(rec_var && pio_type && pio_type_size && mpi_type && mpi_type_size,
"pointers must be provided", __FILE__, __LINE__);

/* How many vars in the file? */
if (iotype == PIO_IOTYPE_PNETCDF)
{
#ifdef _PNETCDF
Expand All @@ -2252,6 +2259,7 @@ inq_file_metadata(file_desc_t *file, int ncid, int iotype, int *nvars, int **rec
return pio_err(NULL, file, PIO_ENOMEM, __FILE__, __LINE__);
}

/* Allocate storage for info about each var. */
if (*nvars)
{
if (!(*rec_var = malloc(*nvars * sizeof(int))))
Expand Down

0 comments on commit 4f579cf

Please sign in to comment.