Exodus 7.10

Functions
ex_create.c File Reference
`#include "exodusII.h"`
`#include "exodusII_int.h"`

## Functions
int | ex_create_int (const char *path, int cmode, int *comp_ws, int *io_ws, int run_version)

## Function Documentation

## ◆ ex_create_int()

int ex_create_int | ( | const char * | path,
|  | int | cmode,
|  | int * | comp_ws,
|  | int * | io_ws,
|  | int | run_version
| ) |  |

Note
  The ex_create_int() is an internal function called by ex_create(). The user should call ex_create() and not ex_create_int().

The function ex_create() creates a new exodus file and returns an ID that can subsequently be used to refer to the file.

All floating point values in an exodus file are stored as either 4-byte (float) or 8-byte (double) numbers; no mixing of 4- and 8-byte numbers in a single file is allowed. An application code can compute either 4- or 8-byte values and can designate that the values be stored in the exodus file as either 4- or 8-byte numbers; conversion between the 4- and 8-byte values is performed automatically by the API routines. Thus, there are four possible combinations of compute word size and storage (or I/O) word size.

Returns
  In case of an error, ex_create() returns a negative number. Possible causes of errors include:
  - Passing a file name that includes a directory that does not exist.
  - Specifying a file name of a file that exists and also specifying a no clobber option.
  - Attempting to create a file in a directory without permission to create files there.
  - Passing an invalid file clobber mode.

Parameters

  | path | The file name of the new exodus file. This can be given as either an absolute path name (from the root of the file system) or a relative path name (from the current directory).
  | cmode | Mode. Use one of the following predefined constants: EX_NOCLOBBER To create the new file only if the given file name does not refer to a file that already exists. EX_CLOBBER To create the new file, regardless of whether a file with the same name already exists. If a file with the same name does exist, its contents will be erased. EX_64BIT_OFFSET To create a model that can store individual datasets larger than 2 gigabytes. This modifies the internal storage used by exodusII and also puts the underlying NetCDF file into the 64-bit offset' mode. See largemodel for more details on this mode. A large model file will also be created if the environment variable EXODUS_LARGE_MODEL is defined in the users environment. A message will be printed to standard output if this environment variable is found. EX_LARGE_MODEL is alias. EX_NORMAL_MODEL Create a standard model. EX_64BIT_DATA To create a model using the CDF5 format which uses the classic model but has 64-bit dimensions and sizes. This type will also be created if the environment variable EXODUS_NETCDF5 is defined in the users environment. A message will be printed to standard output if this environment variable is found. EX_NETCDF4 To create a model using the HDF5-based NetCDF-4 output. An HDF5-based NetCDF-4 file will also be created if the environment variable EXODUS_NETCDF4 is defined in the users environment. A message will be printed to standard output if this environment variable is found. EX_NOSHARE Do not open the underlying NetCDF file in share mode. See the NetCDF documentation for more details. EX_SHARE Do open the underlying NetCDF file in share mode. See the NetCDF documentation for more details.
  [in,out] | comp_ws | The word size in bytes (0, 4 or 8) of the floating point variables used in the application program. If 0 (zero) is passed, the default sizeof(float) will be used and returned in this variable. WARNING: all exodus functions requiring floats must be passed floats declared with this passed in or returned compute word size (4 or 8).}
  | io_ws | The word size in bytes (4 or 8) of the floating point data as they are to be stored in the exodus file.
  | run_version | (internally generated) used to verify compatibility of library and include files.

The following code segment creates an exodus file called `test.exo`:

#include "exodusII.h"
int CPU_word_size, IO_word_size, exoid;
CPU_word_size = sizeof(float); /* use float or double */
IO_word_size = 8; /* store variables as doubles */
/* create exodus file */
exoid = ex_create ("test.exo" /* filename path */
EX_CLOBBER, /* create mode */
&CPU_word_size, /* CPU float word size in bytes */
&IO_word_size); /* I/O float word size in bytes */