ExodusII  5.15
ex_conv.c File Reference
#include <stdlib.h>
#include "exodusII.h"
#include "exodusII_int.h"

Defines

#define NC_FLOAT_WORDSIZE   4
#define NC_DOUBLE_WORDSIZE   8

Functions

struct 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)
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)

Variables

static struct 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

Define Documentation

#define NC_DOUBLE_WORDSIZE   8
#define NC_FLOAT_WORDSIZE   4

Function Documentation

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.
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.
int ex_conv_ini ( int  exoid,
int *  comp_wordsize,
int *  io_wordsize,
int  file_wordsize,
int  int64_status 
)

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:

struct file_item* ex_find_file_item ( int  exoid) [read]
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 
)
nc_type nc_flt_code ( int  exoid)

Variable Documentation

struct file_item* file_list = NULL [static]
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines