datafort_types Module

DataFort Types Module

This module provides the core data_frame type definition and essential operations. It contains the type definition, constructor/destructor, and basic getter functions.

All data manipulation operations are provided as standalone functions in separate modules.



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: MAX_CHAR_LEN_DEFAULT = 100

Derived Types

type, public ::  data_frame

Main data frame type for storing heterogeneous tabular data

Read more…

Components

Type Visibility Attributes Name Initial
type(column), private, dimension(:), allocatable :: data_cols
character(len=:), private, dimension(:), allocatable :: headers
logical, private :: initialized = .false.
integer, private :: max_char_len = MAX_CHAR_LEN_DEFAULT
integer, private :: num_cols = 0
logical, private :: with_headers = .false.

Type-Bound Procedures

procedure, public :: already_header
procedure, public :: destroy => df_destructor
procedure, private :: df_get_col_type_header
procedure, private :: df_get_col_type_index
generic, public :: dtype => df_get_col_type_header, df_get_col_type_index
procedure, public :: find_header_index
procedure, public :: get_data_col
procedure, public :: get_max_char_len => df_get_max_char_len
procedure, public :: get_with_headers
procedure, public :: header => get_header
procedure, public :: increment_num_cols
procedure, public :: is_initialized => df_is_initialized
procedure, public :: ncols => df_get_num_cols
procedure, public :: new => df_constructor
procedure, public :: nrows => df_get_num_rows
procedure, public :: resize_storage
procedure, public :: set_data_col
procedure, public :: set_header_at_index
procedure, public :: set_with_headers
procedure, public :: validate_column_addition

Functions

private function already_header(this, header) result(exists)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this
character(len=*), intent(in) :: header

Return Value logical

private pure function df_get_col_type_header(this, header) result(dtype)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this
character(len=*), intent(in) :: header

Return Value integer

private pure function df_get_col_type_index(this, index) result(dtype)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this
integer, intent(in) :: index

Return Value integer

private pure function df_get_max_char_len(this) result(max_len)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this

Return Value integer

private pure function df_get_num_cols(this) result(num_cols)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this

Return Value integer

private pure function df_get_num_rows(this) result(num_rows)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this

Return Value integer

private pure function df_is_initialized(this) result(is_init)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this

Return Value logical

private pure function find_header_index(this, header) result(index)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this
character(len=*), intent(in) :: header

Return Value integer

private function get_data_col(this, index) result(col)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this
integer, intent(in) :: index

Return Value type(column)

private function get_header(this, index) result(header)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this
integer, intent(in) :: index

Return Value character(len=:), allocatable

private pure function get_with_headers(this) result(has_headers)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(in) :: this

Return Value logical


Subroutines

private subroutine df_constructor(this, char_len)

Initialize a new data frame

Read more…

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(inout) :: this
integer, intent(in), optional :: char_len

private subroutine df_destructor(this)

Destroy a data frame and free all memory

Read more…

Arguments

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

private subroutine increment_num_cols(this)

Arguments

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

private subroutine resize_storage(this)

Arguments

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

private subroutine set_data_col(this, index, col)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(inout) :: this
integer, intent(in) :: index
type(column), intent(in) :: col

private subroutine set_header_at_index(this, index, header)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(inout) :: this
integer, intent(in) :: index
character(len=*), intent(in) :: header

private subroutine set_with_headers(this, has_headers)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(inout) :: this
logical, intent(in) :: has_headers

private subroutine validate_column_addition(this, header, col_size)

Arguments

Type IntentOptional Attributes Name
class(data_frame), intent(inout) :: this
character(len=*), intent(in), optional :: header
integer, intent(in) :: col_size