cable_netcdf_io_t Derived Type

type, public, abstract :: cable_netcdf_io_t

Abstract type defining the interface for netCDF I/O handlers. This allows for different implementations (e.g. NetCDF, ParallelIO) to be used interchangeably within the CABLE code


Type-Bound Procedures

procedure(cable_netcdf_io_init), public, deferred :: init

  • subroutine cable_netcdf_io_init(this) Prototype

    Initialise the netcdf I/O handler. This procedure is called during module initialization and can be used to set up any necessary state or resources for the I/O handler.

    Arguments

    Type IntentOptional Attributes Name
    class(cable_netcdf_io_t), intent(inout) :: this

procedure(cable_netcdf_io_finalise), public, deferred :: finalise

  • subroutine cable_netcdf_io_finalise(this) Prototype

    Finalise the netcdf I/O handler. This procedure is called during module finalization and can be used to clean up any resources allocated by the I/O handler.

    Arguments

    Type IntentOptional Attributes Name
    class(cable_netcdf_io_t), intent(inout) :: this

procedure(cable_netcdf_io_create_file), public, deferred :: create_file

  • function cable_netcdf_io_create_file(this, path, iotype, mode) result(file) Prototype

    Create a new netCDF file with the specified path and I/O type.

    Arguments

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

    Path to the netCDF file to create.

    integer, intent(in) :: iotype

    I/O type to use for the file using the CABLE_NETCDF_IOTYPE_* constants.

    integer, intent(in), optional :: mode

    Optional mode flags for file creation using the CABLE_NETCDF_MODE_* constants.

    Return Value class(cable_netcdf_file_t), allocatable

procedure(cable_netcdf_io_open_file), public, deferred :: open_file

  • function cable_netcdf_io_open_file(this, path, iotype, mode) result(file) Prototype

    Open an existing netCDF file with the specified path and I/O type.

    Arguments

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

    Path to the netCDF file to open.

    integer, intent(in) :: iotype

    I/O type to use for the file using the CABLE_NETCDF_IOTYPE_* constants.

    integer, intent(in), optional :: mode

    Optional mode flags for file opening using the CABLE_NETCDF_MODE_* constants.

    Return Value class(cable_netcdf_file_t), allocatable

procedure(cable_netcdf_io_create_decomp), public, deferred :: create_decomp

  • function cable_netcdf_io_create_decomp(this, compmap, dims, type) result(decomp) Prototype

    Create a new decomposition for parallel I/O. This follows the degree of freedom approach for specifying I/O decompositions as described in Denis et al. (2011) [10.1177/1094342011428143].

    Arguments

    Type IntentOptional Attributes Name
    class(cable_netcdf_io_t), intent(inout) :: this
    integer, intent(in) :: compmap(:)

    An array of data offsets describing where each element of the in-memory array is located in the netCDF variable data on disk.

    integer, intent(in) :: dims(:)

    An array of the global dimensions used to describe the shape of the data in the netCDF file

    integer, intent(in) :: type

    The data type of the in-memory array using the CABLE_NETCDF_TYPE_* constants.

    Return Value class(cable_netcdf_decomp_t), allocatable