cable_netcdf_file_def_var Interface

interface
private subroutine cable_netcdf_file_def_var(this, var_name, type, dim_names, shuffle, deflate_level)

Arguments

Type IntentOptional Attributes Name
class(cable_netcdf_file_t), intent(inout) :: this
character(len=*), intent(in) :: var_name

Name of the variable to define.

integer, intent(in) :: type

Data type of the variable, using the CABLE_NETCDF_* constants (e.g., CABLE_NETCDF_INT, CABLE_NETCDF_REAL32).

character(len=*), intent(in), optional :: dim_names(:)

Array of dimension names for the variable. If not provided, the variable will be defined as a scalar.

logical, intent(in), optional :: shuffle

Whether to apply the shuffle filter. Only used together with deflate_level. Defaults to false.

integer, intent(in), optional :: deflate_level

Deflate compression level from 1 (fastest) to 9 (smallest). Zero or absent means no compression. Compression needs a netCDF-4 file (CABLE_NETCDF_IOTYPE_NETCDF4C) and is ignored for scalars.

Description

Define a variable in the netCDF file with the specified name, dimensions, and type.