MPI-SCATCI  2.0
An MPI version of SCATCI
writermatrix_module Module Reference

Write matrix module. More...

Data Types

type  writermatrix
 Matrix associated with a disk drive. More...
 

Functions/Subroutines

integer function get_matrix_unit (this)
 Return Hamiltonian disk file unit. More...
 
subroutine set_options_writer (this, option_val)
 Initialize the matrix cache using the Options object. More...
 
subroutine get_matelem_writer (this, idx, i, j, coeff)
 Not implemented. More...
 
subroutine write_cache_to_unit (this)
 Write matrix chunk to file. More...
 
logical function insert_into_write_cache (this, row, column, coefficient)
 Insert matrix element. More...
 
subroutine finalize_matrix_writer (this)
 Write Hamiltonian to disk. More...
 
subroutine print_writer (this)
 Print matrix to standard output. More...
 
subroutine clear_writer (this)
 Clear matrix. More...
 
subroutine destroy_writer (this)
 Destroy matrix. More...
 

Detailed Description

Write matrix module.

Authors
A Al-Refaie
Date
2017

Defines the WriterMatrix type which is responsible for writing the Hamiltonian matrix to a disk file. This matrix type is used by all serial diagonalizers.

Note
16/01/2019 - Jakub Benda: Unifom coding style and expanded documentation.

Function/Subroutine Documentation

◆ clear_writer()

subroutine writermatrix_module::clear_writer ( class(writermatrix this)
private

Clear matrix.

Authors
A Al-Refaie
Date
2017

Clears matrix element cache.

Definition at line 239 of file WriterMatrix_module.f90.

◆ destroy_writer()

subroutine writermatrix_module::destroy_writer ( class(writermatrix this)
private

Destroy matrix.

Authors
A Al-Refaie
Date
2017

Definition at line 251 of file WriterMatrix_module.f90.

◆ finalize_matrix_writer()

subroutine writermatrix_module::finalize_matrix_writer ( class(writermatrix this)
private

Write Hamiltonian to disk.

Authors
A Al-Refaie
Date
2017

Uses SCATCI subroutine WRTEM to write Hamiltonian matrix to its disk file unit. Also, appends a dummy finalizing record at the end of the file.

Definition at line 202 of file WriterMatrix_module.f90.

◆ get_matelem_writer()

subroutine writermatrix_module::get_matelem_writer ( class(writermatrix this,
integer, intent(in)  idx,
integer, intent(out)  i,
integer, intent(out)  j,
real(wp), intent(out)  coeff 
)
private

Not implemented.

Authors
A Al-Refaie
Date
2017

Definition at line 110 of file WriterMatrix_module.f90.

◆ get_matrix_unit()

integer function writermatrix_module::get_matrix_unit ( class(writermatrix this)
private

Return Hamiltonian disk file unit.

Authors
A Al-Refaie
Date
2017

Definition at line 81 of file WriterMatrix_module.f90.

◆ insert_into_write_cache()

logical function writermatrix_module::insert_into_write_cache ( class(writermatrix this,
integer, intent(in)  row,
integer, intent(in)  column,
real(wp), intent(in)  coefficient 
)
private

Insert matrix element.

Authors
A Al-Refaie
Date
2017

This inserts an element into the hard storage which is considered the final location before diagonalization. It also checks wherther the element exists within the allowed range and tells us if it was successfully inserted. Elements smaller than a specific threshold will be ignored. When the limit size of the cache is reached, it is emptied (appended) to the Hamiltonian disk file.

Definition at line 158 of file WriterMatrix_module.f90.

◆ print_writer()

subroutine writermatrix_module::print_writer ( class(writermatrix this)
private

Print matrix to standard output.

Authors
A Al-Refaie
Date
2017

Definition at line 222 of file WriterMatrix_module.f90.

◆ set_options_writer()

subroutine writermatrix_module::set_options_writer ( class(writermatrix this,
class(options), intent(in)  option_val 
)
private

Initialize the matrix cache using the Options object.

Authors
A Al-Refaie
Date
2017

Definition at line 93 of file WriterMatrix_module.f90.

◆ write_cache_to_unit()

subroutine writermatrix_module::write_cache_to_unit ( class(writermatrix this)
private

Write matrix chunk to file.

Authors
A Al-Refaie
Date
2017

Unless the element cache is empty, this subroutine flushes the elements in cache to the Hamiltonian disk file unit as a new record. The matrix element cache is empty on return from this subroutine.

Definition at line 132 of file WriterMatrix_module.f90.