df_set_col_real Subroutine

public subroutine df_set_col_real(df, col_index, col)

Set entire real column by index

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(inout) :: df
integer, intent(in) :: col_index
real(kind=rk), intent(in), dimension(:) :: col

Source Code

    subroutine df_set_col_real(df, col_index, col)
        type(data_frame), intent(inout) :: df
        integer, intent(in) :: col_index
        real(rk), dimension(:), intent(in) :: col

        type(column) :: data_col

        if (col_index < 1 .or. col_index > df % ncols()) error stop "column index out of range"

        data_col = df % get_data_col(col_index)
        if (data_col % get_type() /= REAL_NUM) error stop "column is not real type"
        if (size(col) /= df % nrows()) error stop "column size mismatch"

        call data_col % destroy()
        call data_col % new(col)
        call df % set_data_col(col_index, data_col)
    end subroutine df_set_col_real