Documentation for module hfx_types

Types and set/get functions for HFX

source: hfx_types.F
Loading...

public Types:

hfx_distribution
...
hfx_type
stores some data used in construction of Kohn-Sham matrix
hfx_p_kind
...
hfx_pgf_product_list
...
hfx_potential_type
...
hfx_pgf_list
...
pair_list_element_type
...
hfx_task_list_type
...
hfx_general_type
...
pair_list_type
...
hfx_2d_map
...
hfx_memory_type
...
hfx_block_range_type
...
hfx_screen_coeff_type
...
hfx_load_balance_type
...
hfx_basis_info_type
...
pair_set_list_type
...
hfx_basis_type
...
hfx_screening_type
...
hfx_container_type
...
hfx_cache_type
...
hfx_cell_type
...

public Subroutines/Functions:

...
...
- This routine allocates and initializes all types in hfx_data
- This routine allocates and initializes the basis_info and basis_parameter types
- This routine computes the neighbor cells that are taken into account in periodic runs
- This routine deletes all list entries in a container in order to deallocate the memory.
SUBROUTINE
hfx_release (x_data)
- This routine deallocates all data structures
...
- resets the maximum memory usage for a HFX calculation subtracting all relevant buffers from the input MAX_MEM value and add 10% of safety margin
- This routine stores the data obtained from the load balance routine for the energy
- This routine stores the data obtained from the load balance routine for the forces
- Parses the memory section

Parameters:

REAL(dp)
:: log_zero = -1000.0_dp
INTEGER
:: max_atom_block = 32
INTEGER
:: max_images = 27
REAL(dp)
:: mul_fact(0:10) = (/1.0_dp,1.1781_dp,1.3333_dp,1.4726_dp,1.6000_dp,1.7181_dp,1.8286_dp,1.9328_dp,2.0317_dp,2.1261_dp,2.2165_dp/)
REAL(dp)
:: powell_min_log = -20.0_dp

Module variables:

INTEGER
:: init_t_c_g0_lmax = -1

public Types:

TYPE :: hfx_2d_map

...


INTEGER,
DIMENSION(:), POINTER :: iatom_list ...
INTEGER,
DIMENSION(:), POINTER :: jatom_list ...

TYPE :: hfx_basis_info_type

...


INTEGER
:: max_set ...
INTEGER
:: max_sgf ...
INTEGER
:: max_am ...

TYPE :: hfx_basis_type

...


INTEGER,
DIMENSION(:), POINTER :: lmax ...
INTEGER,
DIMENSION(:), POINTER :: lmin ...
INTEGER,
DIMENSION(:), POINTER :: npgf ...
INTEGER
:: nset ...
REAL(dp),
DIMENSION(:,:), POINTER :: zet ...
INTEGER,
DIMENSION(:), POINTER :: nsgf ...
INTEGER,
DIMENSION(:,:), POINTER :: first_sgf ...
REAL(dp),
DIMENSION(:,:), POINTER :: sphi ...
INTEGER
:: nsgf_total ...
INTEGER,
DIMENSION(:,:), POINTER :: nl ...
INTEGER,
DIMENSION(:,:), POINTER :: nsgfl ...
INTEGER,
DIMENSION(:), POINTER :: nshell ...
REAL(dp),
DIMENSION(:,:,:,:), POINTER :: sphi_ext ...
REAL(dp),
DIMENSION(:), POINTER :: set_radius ...
REAL(dp),
DIMENSION(:,:), POINTER :: pgf_radius ...
REAL(dp)
:: kind_radius ...

TYPE :: hfx_block_range_type

...


INTEGER
:: istart ...
INTEGER
:: iend ...
INTEGER(int_8)
:: cost ...

TYPE :: hfx_cache_type

...


INTEGER(int_8),
DIMENSION(1024) :: data ...
INTEGER
:: element_counter ...

TYPE :: hfx_cell_type

...


REAL(dp)
:: cell ...
REAL(dp)
:: cell_r ...

TYPE :: hfx_container_type

...


POINTER :: first ...
POINTER :: current ...
INTEGER
:: element_counter ...
INTEGER(int_8)
:: file_counter ...
CHARACTER(5)
:: desc ...
INTEGER
:: unit ...
:: filename ...

TYPE :: hfx_distribution

...


INTEGER(int_8)
:: istart ...
INTEGER(int_8)
:: number_of_atom_quartets ...
INTEGER(int_8)
:: cost ...
REAL(dp)
:: time_first_scf ...
REAL(dp)
:: time_other_scf ...
REAL(dp)
:: time_forces ...
INTEGER(int_8)
:: ram_counter ...

TYPE :: hfx_general_type

...


REAL(dp)
:: fraction ...
LOGICAL
:: treat_lsd_in_core ...

TYPE :: hfx_load_balance_type

...


INTEGER
:: nbins ...
INTEGER
:: block_size ...
INTEGER
:: nblocks ...
LOGICAL
:: rtp_redistribute ...
LOGICAL
:: blocks_initialized ...
LOGICAL
:: do_randomize ...

TYPE :: hfx_memory_type

...


INTEGER
:: max_memory ...
INTEGER(int_8)
:: max_compression_counter ...
INTEGER(int_8)
:: final_comp_counter_energy ...
LOGICAL
:: do_all_on_the_fly ...
REAL(dp)
:: eps_storage_scaling ...
INTEGER
:: cache_size ...
INTEGER
:: bits_max_val ...
INTEGER
:: actual_memory_usage ...
INTEGER
:: actual_memory_usage_disk ...
INTEGER(int_8)
:: max_compression_counter_disk ...
LOGICAL
:: do_disk_storage ...
:: storage_location ...
INTEGER(int_8)
:: ram_counter ...
INTEGER(int_8)
:: ram_counter_forces ...
INTEGER(int_8)
:: size_p_screen ...
LOGICAL
:: treat_forces_in_core ...
LOGICAL
:: recalc_forces ...

TYPE :: hfx_pgf_list

...


DIMENSION(:), POINTER :: image_list ...
INTEGER
:: nimages ...
REAL(dp)
:: zetapzetb ...
REAL(dp)
:: zetainv ...
REAL(dp)
:: zeta ...
REAL(dp)
:: zetb ...
INTEGER
:: ipgf ...
INTEGER
:: jpgf ...

TYPE :: hfx_pgf_product_list

...


REAL(dp)
:: ra ...
REAL(dp)
:: rb ...
REAL(dp)
:: rc ...
REAL(dp)
:: rd ...
REAL(dp)
:: zetapetainv ...
REAL(dp)
:: rho ...
REAL(dp)
:: rhoinv ...
REAL(dp)
:: p ...
REAL(dp)
:: q ...
REAL(dp)
:: w ...
REAL(dp)
:: ab ...
REAL(dp)
:: cd ...
REAL(dp)
:: fm ...

TYPE :: hfx_potential_type

...


INTEGER
:: potential_type ...
REAL(dp)
:: omega ...
REAL(dp)
:: scale_coulomb ...
REAL(dp)
:: scale_longrange ...
REAL(dp)
:: scale_gaussian ...
REAL(dp)
:: cutoff_radius ...
:: filename ...

TYPE :: hfx_p_kind

...


REAL(dp),
DIMENSION(:,:,:,:), POINTER :: p_kind ...

TYPE :: hfx_screening_type

...


REAL(dp)
:: eps_schwarz ...
REAL(dp)
:: eps_schwarz_forces ...
LOGICAL
:: do_p_screening_forces ...
LOGICAL
:: do_initial_p_screening ...

TYPE :: hfx_screen_coeff_type

...


REAL(dp)
:: x ...

TYPE :: hfx_task_list_type

...


INTEGER
:: thread_id ...
INTEGER
:: bin_id ...
INTEGER(int_8)
:: cost ...

TYPE :: hfx_type

stores some data used in construction of Kohn-Sham matrix


:: potential_parameter stores information on the potential (1/r, erfc(wr)/r
:: screening_parameter stores screening infos such as epsilon
:: memory_parameter stores infos on memory used for in-core calculations
:: periodic_parameter stores information on how to apply pbc
:: load_balance_parameter contains infos for Monte Carlo simulated annealing
:: general_parameter ...
DIMENSION(:), POINTER :: maxval_container stores the maxvals in compressed form
DIMENSION(:), POINTER :: maxval_cache cache for maxvals in decompressed form
DIMENSION(:,:), POINTER :: integral_containers 64 containers for compressed integrals
DIMENSION(:,:), POINTER :: integral_caches 64 caches for decompressed integrals
DIMENSION(:), POINTER :: maxval_container_forces ...
DIMENSION(:), POINTER :: maxval_cache_forces ...
DIMENSION(:,:), POINTER :: integral_containers_forces ...
DIMENSION(:,:), POINTER :: integral_caches_forces ...
POINTER :: maxval_container_disk ...
:: maxval_cache_disk ...
POINTER, DIMENSION(:) :: integral_containers_disk ...
:: integral_caches_disk ...
DIMENSION(:), POINTER :: neighbor_cells manages handling of periodic cells
DIMENSION(:), POINTER :: distribution_energy stores information on parallelization of energy
DIMENSION(:), POINTER :: distribution_forces stores information on parallelization of forces
INTEGER,
DIMENSION(:,:), POINTER :: is_assoc_atomic_block reflects KS sparsity
INTEGER
:: number_of_p_entries Size of P matrix
DIMENSION(:), POINTER :: basis_parameter ...
INTEGER
:: n_rep_hf Number of HFX replicas
LOGICAL
:: b_first_load_balance_energy ...
LOGICAL
:: b_first_load_balance_forces ...
REAL(dp),
DIMENSION(:,:), POINTER :: full_ks_alpha ...
REAL(dp),
DIMENSION(:,:), POINTER :: full_ks_beta ...
TYPE(lib_int)
:: lib libint type for eris
:: basis_info contains information for basis sets
DIMENSION(:,:,:,:,:,:), POINTER :: screen_funct_coeffs_pgf pgf based near field screening coefficients
DIMENSION(:,:,:,:,:,:), POINTER :: pair_dist_radii_pgf pgf based radii coefficients of pair distributions
DIMENSION(:,:,:,:), POINTER :: screen_funct_coeffs_set set based near field screening coefficients
DIMENSION(:,:), POINTER :: screen_funct_coeffs_kind kind based near field screening coefficients
LOGICAL
:: screen_funct_is_initialized flag that indicates if the coefficients have already been fitted
TYPE(hfx_p_kind),
DIMENSION(:), POINTER :: initial_p stores the initial guess if requested
TYPE(hfx_p_kind),
DIMENSION(:), POINTER :: initial_p_forces ...
INTEGER,
DIMENSION(:), POINTER :: map_atom_to_kind_atom ...
TYPE(hfx_2d_map),
DIMENSION(:), POINTER :: map_atoms_to_cpus ...
INTEGER,
DIMENSION(:,:), POINTER :: atomic_block_offset ...
INTEGER,
DIMENSION(:,:,:,:), POINTER :: set_offset ...
INTEGER,
DIMENSION(:), POINTER :: block_offset ...
DIMENSION(:), POINTER :: blocks ...
DIMENSION(:), POINTER :: task_list ...
REAL(dp),
DIMENSION(:,:), POINTER :: pmax_atom ...
REAL(dp),
DIMENSION(:,:), POINTER :: pmax_atom_forces ...
TYPE(lib_int)
:: lib_int ...
TYPE(lib_deriv)
:: lib_deriv ...
REAL(dp),
DIMENSION(:,:), POINTER :: pmax_block ...
LOGICAL,
DIMENSION(:,:), POINTER :: atomic_pair_list ...
LOGICAL,
DIMENSION(:,:), POINTER :: atomic_pair_list_forces ...

TYPE :: pair_list_element_type

...


INTEGER,
DIMENSION(2) :: pair ...
INTEGER,
DIMENSION(2) :: set_bounds ...
INTEGER,
DIMENSION(2) :: kind_pair ...
REAL(dp)
:: r1 ...
REAL(dp)
:: r2 ...
REAL(dp)
:: dist2 ...

TYPE :: pair_list_type

...


DIMENSION(MAX_ATOM_BLOCK**2) :: elements ...
INTEGER
:: n_element ...

TYPE :: pair_set_list_type

...


INTEGER,
DIMENSION(2) :: pair ...

SUBROUTINEalloc_containers(x_data, bin_size, eval_type)

...

Arguments:
TYPE(hfx_type),
POINTER
:: x_data ...
INTEGER,
INTENT(in)
:: bin_size ...
INTEGER,
INTENT(in)
:: eval_type ...

SUBROUTINEdealloc_containers(x_data, eval_type)

...

Arguments:
TYPE(hfx_type),
POINTER
:: x_data ...
INTEGER,
INTENT(in)
:: eval_type ...

SUBROUTINEhfx_create(x_data, para_env, hfx_section, natom, atomic_kind_set, qs_kind_set, dft_control, cell, do_exx)

- This routine allocates and initializes all types in hfx_data

Arguments:
TYPE(hfx_type),
POINTER
:: x_data(:,:) contains all relevant data structures for hfx runs
:: para_env ...
POINTER
:: hfx_section input section
INTEGER,
INTENT(in)
:: natom ...
POINTER
:: atomic_kind_set(:) ...
POINTER
:: qs_kind_set(:) ...
POINTER
:: dft_control ...
TYPE(cell_type),
POINTER
:: cell ...
LOGICAL,
OPTIONAL
:: do_exx ...

SUBROUTINEhfx_create_basis_types(basis_parameter, basis_info, qs_kind_set, do_admm)

- This routine allocates and initializes the basis_info and basis_parameter types

Arguments:
POINTER
:: basis_parameter(:) ...
:: basis_info ...
POINTER
:: qs_kind_set(:) ...
LOGICAL
:: do_admm ...

SUBROUTINEhfx_create_neighbor_cells(x_data, pbc_shells, cell, i_thread)

- This routine computes the neighbor cells that are taken into account in periodic runs

Arguments:
TYPE(hfx_type),
POINTER
:: x_data contains all relevant data structures for hfx runs
INTEGER,
INTENT(inout)
:: pbc_shells number of shells taken into account
TYPE(cell_type),
POINTER
:: cell cell
INTEGER,
INTENT(in)
:: i_thread current thread ID

SUBROUTINEhfx_init_container(container, memory_usage, do_disk_storage)

- This routine deletes all list entries in a container in order to deallocate the memory.

Arguments:
:: container container that contains the compressed elements
INTEGER
:: memory_usage ...
LOGICAL
:: do_disk_storage ...

SUBROUTINEhfx_release(x_data)

- This routine deallocates all data structures

Arguments:
TYPE(hfx_type),
POINTER
:: x_data(:,:) contains all relevant data structures for hfx runs

SUBROUTINEhfx_release_basis_types(basis_parameter)

...

Arguments:
POINTER
:: basis_parameter(:) ...

SUBROUTINEhfx_reset_memory_usage_counter(memory_parameter, subtr_size_mb)

- resets the maximum memory usage for a HFX calculation subtracting all relevant buffers from the input MAX_MEM value and add 10% of safety margin

Arguments:
:: memory_parameter Memory information
INTEGER(int_8),
INTENT(in)
:: subtr_size_mb size of buffers in MiB

SUBROUTINEhfx_set_distr_energy(ptr_to_distr, x_data)

- This routine stores the data obtained from the load balance routine for the energy

Arguments:
POINTER
:: ptr_to_distr(:) contains data to store
TYPE(hfx_type),
POINTER
:: x_data contains all relevant data structures for hfx runs

SUBROUTINEhfx_set_distr_forces(ptr_to_distr, x_data)

- This routine stores the data obtained from the load balance routine for the forces

Arguments:
POINTER
:: ptr_to_distr(:) contains data to store
TYPE(hfx_type),
POINTER
:: x_data contains all relevant data structures for hfx runs

SUBROUTINEparse_memory_section(memory_parameter, hf_sub_section, storage_id, i_thread, n_threads, para_env, irep, skip_disk, skip_in_core_forces)

- Parses the memory section

Arguments:
:: memory_parameter ...
POINTER
:: hf_sub_section ...
INTEGER,
INTENT(out),
OPTIONAL
:: storage_id ...
INTEGER,
INTENT(in),
OPTIONAL
:: i_thread ...
INTEGER,
INTENT(in),
OPTIONAL
:: n_threads ...
OPTIONAL
:: para_env ...
INTEGER,
INTENT(in),
OPTIONAL
:: irep ...
LOGICAL,
INTENT(in)
:: skip_disk ...
LOGICAL,
INTENT(in)
:: skip_in_core_forces ...

private Parameters/Types:

private Types:

TYPE :: hfx_container_node

...


POINTER :: next ...
POINTER :: prev ...
INTEGER(int_8),
DIMENSION(1024) :: data ...

TYPE :: hfx_periodic_type

...


INTEGER
:: number_of_shells ...
LOGICAL
:: do_periodic ...
INTEGER
:: perd ...
INTEGER
:: mode ...
REAL(dp)
:: r_max_stress ...
INTEGER
:: number_of_shells_from_input ...

TYPE :: hfx_pgf_image

...


REAL(dp)
:: ra ...
REAL(dp)
:: rb ...
REAL(dp)
:: rab2 ...
REAL(dp)
:: s1234 ...
REAL(dp)
:: p ...
REAL(dp)
:: r ...
REAL(dp)
:: pgf_max ...
REAL(dp),
DIMENSION(3) :: bcell ...