SCORPIO  1.7.0
Functions/Subroutines
PIO_def_var

Define a variable. More...

Functions/Subroutines

integer function spio_def_var::pio_def_var_md_file_vdesc (file, vname, vtype, vdimids, vdesc)
 Define a multidimensional variable in a file. More...
 
integer function spio_def_var::pio_def_var_0d_file_vdesc (file, vname, vtype, vdesc)
 Define a scalar variable in a file. More...
 
integer function spio_def_var::pio_def_var_md_fh_vid (fh, vname, vtype, vdimids, varid)
 Define a multidimensional variable in a file. More...
 
integer function spio_def_var::pio_def_var_0d_fh_vid (fh, vname, vtype, varid)
 Define a scalar variable in a file. More...
 

Detailed Description

Define a variable.

This API can be used to define a variable in a file. The variables need to defined before writing data into them. Variables can be used to store scalar (0 dimensions) and array (multidimensional) data into a file. Each dimension of a multidimensional array needs to be defined separately before defining a variable (Note that multiple variables can share the same dimensions). A variable can also be associated with attributes to store meta-data about the variables.

This API is a collective call (Although the library might internally choose to make progress on a single or small subset of MPI processes) on the I/O system associated with the file

Function/Subroutine Documentation

◆ pio_def_var_0d_fh_vid()

integer function spio_def_var::pio_def_var_0d_fh_vid ( integer, intent(in)  fh,
character(len=*), intent(in)  vname,
integer, intent(in)  vtype,
integer, intent(out)  varid 
)

Define a scalar variable in a file.

Parameters
[in]fhThe file id/handle
[in]vnameThe name of the variable
[in]vtypeThe type of the variable. The base types supported by PIO are:
  • PIO_double : 8-byte reals or double precision
  • PIO_real : 4-byte reals
  • PIO_int : 4-byte integers
  • PIO_char : character
    Parameters
    [out]varidThe id of the variable is returned in this argument
    Return values
    ierr: The error return code. Set to PIO_NOERR on success, or an error code otherwise (See PIO_seterrorhandling for more information on how to customize/set error handling)

◆ pio_def_var_0d_file_vdesc()

integer function spio_def_var::pio_def_var_0d_file_vdesc ( type(file_desc_t), intent(in)  file,
character(len=*), intent(in)  vname,
integer, intent(in)  vtype,
type(var_desc_t), intent(out)  vdesc 
)

Define a scalar variable in a file.

Parameters
[in]fileThe file handle. File descriptor structure. This structure holds information associated with each open file
[in]vnameThe name of the variable
[in]vtypeThe type of the variable. The base types supported by PIO are:
  • PIO_double : 8-byte reals or double precision
  • PIO_real : 4-byte reals
  • PIO_int : 4-byte integers
  • PIO_char : character
    Parameters
    [out]vdescThe descriptor of the variable created is stored in this argument.
    Variable description structure.
Return values
ierr: The error return code. Set to PIO_NOERR on success, or an error code otherwise (See PIO_seterrorhandling for more information on how to customize/set error handling)

◆ pio_def_var_md_fh_vid()

integer function spio_def_var::pio_def_var_md_fh_vid ( integer, intent(in)  fh,
character(len=*), intent(in)  vname,
integer, intent(in)  vtype,
integer, dimension(:), intent(in)  vdimids,
integer, intent(out)  varid 
)

Define a multidimensional variable in a file.

Parameters
[in]fhThe file id/handle
[in]vnameThe name of the variable
[in]vtypeThe type of the variable. The base types supported by PIO are:
  • PIO_double : 8-byte reals or double precision
  • PIO_real : 4-byte reals
  • PIO_int : 4-byte integers
  • PIO_char : character
    Parameters
    [in]vdimidsThe ids of the dimensions of the variable
    [out]varidThe id of the variable is returned in this argument
    Return values
    ierr: The error return code. Set to PIO_NOERR on success, or an error code otherwise (See PIO_seterrorhandling for more information on how to customize/set error handling)

◆ pio_def_var_md_file_vdesc()

integer function spio_def_var::pio_def_var_md_file_vdesc ( type(file_desc_t), intent(in)  file,
character(len=*), intent(in)  vname,
integer, intent(in)  vtype,
integer, dimension(:), intent(in)  vdimids,
type(var_desc_t), intent(out)  vdesc 
)

Define a multidimensional variable in a file.

Parameters
[in]fileThe file handle. File descriptor structure. This structure holds information associated with each open file
[in]vnameThe name of the variable
[in]vtypeThe type of the variable. The base types supported by PIO are:
  • PIO_double : 8-byte reals or double precision
  • PIO_real : 4-byte reals
  • PIO_int : 4-byte integers
  • PIO_char : character
    Parameters
    [in]vdimidsThe ids of the dimensions of the variable
    [out]vdescThe descriptor of the variable created is stored in this argument.
    Variable description structure.
Return values
ierr: The error return code. Set to PIO_NOERR on success, or an error code otherwise (See PIO_seterrorhandling for more information on how to customize/set error handling)