Exodus 7.21

Macros | Functions | Variables
ex_conv.c File Reference
`#include "exodusII.h"`
`#include "exodusII_int.h"`

## Macros
#define | NC_FLOAT_WORDSIZE 4
#define | CT_ASSERT(e) extern char(*ct_assert(void))[sizeof(char[1 - 2 * !(e)])]

## Functions
struct ex_file_item * | ex_find_file_item (int exoid)
void | ex_check_valid_file_id (int exoid, const char *func)
int | ex_conv_ini (int exoid, int *comp_wordsize, int *io_wordsize, int file_wordsize, int int64_status, int is_parallel, int is_hdf5, int is_pnetcdf)
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)
int | ex_set_parallel (int exoid, int is_parallel)

## Variables
static struct ex_file_item * | file_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

## ◆ CT_ASSERT

#define CT_ASSERT | ( |  | e | ) | extern char(*ct_assert(void))[sizeof(char[1 - 2 * !(e)])]

## ◆ NC_FLOAT_WORDSIZE

#define NC_FLOAT_WORDSIZE 4

## Function Documentation

## ◆ ex_check_valid_file_id()

void ex_check_valid_file_id | ( | int | exoid,
|  | const char * | func
| ) |  |

## ◆ 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

  exoid | integer 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,
|  | int | is_hdf5,
|  | int | is_pnetcdf
| ) |  |

ex_conv_ini() initializes the floating point conversion process.

Parameters

  exoid | an integer uniquely identifying the file of interest.
  comp_wordsize | compute 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_wordsize | the 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_wordsize | floating point word size in an existing netCDF file. a value of 0 should be passed in for a new netCDF file.
  int64_status | the flags specifying how integer values should be stored on the database and how they should be passes through the api functions.
  is_parallel | 1 if parallel file; 0 if serial
  is_hdf5 | 1 if parallel netcdf-4 mode; 0 if not.
  is_pnetcdf | 1 if parallel PNetCDF file; 0 if not.

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

## Variable Documentation

## ◆ file_list

struct ex_file_item* file_list = NULL
| static