ExodusII 6.05
Loading...
Searching...
No Matches
ex_conv.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "exodusII.h"
#include "exodusII_int.h"
#include "netcdf.h"

Macros

#define NC_FLOAT_WORDSIZE   4
 
#define NC_DOUBLE_WORDSIZE   8
 

Functions

struct ex_file_itemex_find_file_item (int exoid)
 
int ex_conv_ini (int exoid, int *comp_wordsize, int *io_wordsize, int file_wordsize, int int64_status, int is_parallel)
 
void ex_conv_exit (int exoid)
 
nc_type nc_flt_code (int exoid)
 
int ex_int64_status (int exoid)
 
int ex_set_int64_status (int exoid, int mode)
 
int ex_set_option (int exoid, ex_option_type option, int option_value)
 
int ex_comp_ws (int exoid)
 
int ex_is_parallel (int exoid)
 

Variables

static struct ex_file_itemfile_list = NULL
 

Detailed Description

this file contains code needed to support the various floating point word size combinations for computation and i/o that applications might want to use. See the netcdf documentation for more details on the floating point conversion capabilities.

netCDF supports two floating point word sizes for its files:

  • NC_FLOAT - 32 bit IEEE
  • NC_DOUBLE - 64 bit IEEE

Macro Definition Documentation

◆ NC_DOUBLE_WORDSIZE

#define NC_DOUBLE_WORDSIZE   8

◆ NC_FLOAT_WORDSIZE

#define NC_FLOAT_WORDSIZE   4

Function Documentation

◆ ex_comp_ws()

int ex_comp_ws ( int exoid)

ex_comp_ws() returns 4 (i.e. sizeof(float)) or 8 (i.e. sizeof(double)), depending on the value of floating point word size used to initialize the conversion facility for this file id (exoid).

Parameters
exoidinteger which uniquely identifies the file of interest.

◆ ex_conv_exit()

void ex_conv_exit ( int exoid)

ex_conv_exit() takes the structure identified by "exoid" out of the linked list which describes the files that ex_conv_array() knows how to convert.

Note
it is absolutely necessary for ex_conv_exit() to be called after ncclose(), if the parameter used as "exoid" is the id returned from an ncopen() or nccreate() call, as netCDF reuses file ids! the best place to do this is ex_close(), which is where I did it.
Parameters
exoidinteger which uniquely identifies the file of interest.

◆ ex_conv_ini()

int ex_conv_ini ( int exoid,
int * comp_wordsize,
int * io_wordsize,
int file_wordsize,
int int64_status,
int is_parallel )

ex_conv_ini() initializes the floating point conversion process.

Parameters
exoidan integer uniquely identifying the file of interest.
comp_wordsizecompute floating point word size in the user's code. a zero value indicates that the user is requesting the default float size for the machine. The appropriate value is chosen and returned in comp_wordsize, and used in subsequent conversions. a valid but inappropriate for this parameter cannot be detected.
io_wordsizethe desired floating point word size for a netCDF file. for an existing file, if this parameter doesn't match the word size of data already stored in the file, a fatal error is generated. a value of 0 for an existing file indicates that the word size of the file was not known a priori, so use whatever is in the file. a value of 0 for a new file means to use the default size, an NC_FLOAT (4 bytes). when a value of 0 is specified the actual value used is returned in io_wordsize.
file_wordsizefloating point word size in an existing netCDF file. a value of 0 should be passed in for a new netCDF file.
int64_statusthe flags specifying how integer values should be stored on the database and how they should be passes through the api functions. See #FileVars for more information.

word size parameters are specified in bytes. valid values are 0, 4, and 8:

◆ ex_find_file_item()

struct ex_file_item * ex_find_file_item ( int exoid)

◆ ex_is_parallel()

int ex_is_parallel ( int exoid)

ex_is_parallel() returns 1 (true) or 0 (false) depending on whether the file was opened in parallel or serial/file-per-processor mode. Note that in this case parallel assumes the output of a single file, not a parallel run using file-per-processor.

◆ nc_flt_code()

nc_type nc_flt_code ( int exoid)

Variable Documentation

◆ file_list

struct ex_file_item* file_list = NULL
static