mimic_main Module

MiMiC main contains all API calls



Contents


Variables

TypeVisibilityAttributesNameInitial
type(mimic_communicator), public :: communicator

communicator handling data collection

integer, public, parameter:: CENTROID =1

sort fragments according to distance between centroids

integer, public, parameter:: CENTER_OF_MASS =2

sort fragments according to distance between center-of-mass

integer, public, parameter:: CENTER_OF_CHARGE =3

sort fragments according to distance between center-of-charge for charged fragments and center-of-mass for neutral fragments

integer, public, parameter:: MINIMUM_DISTANCE =4

sort fragments according to minimum distance

integer, public, parameter:: ATOM_WISE =5

sort atoms according to distance from quantum fragment centroid


Subroutines

public subroutine mimic_init(comm)

initialize MiMiC

Arguments

TypeIntentOptionalAttributesName
integer, intent(inout) :: comm

MPI communicator

public subroutine mimic_init_error_handler(process_id, error_handler)

initialize error handling

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: process_id

process id (preferrably MPI rank)

procedure(handle), optional pointer:: error_handler

optional external error handler

public subroutine mimic_handshake(paths)

MiMiC initialization routine

Read more…

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(in), dimension(:):: paths

paths to client codes

public subroutine mimic_set_num_clients(num)

set the number of clients (needed for non-root processes)

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: num

number of clients

public subroutine mimic_init_overlaps(overlaps)

initialize overlap maps using the input file data

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), dimension(:,:):: overlaps

overlaps in the format: code_id : atom_id => code_id : atom_id (e.g. code_one : atom_three => code_two : atom_one)

public subroutine mimic_finalize()

Arguments

None

public subroutine mimic_destroy()

MiMiC destruction routine - deallocates all arrays and shuts down communicator

Arguments

None

public subroutine mimic_request_sizes(sizes, system_data)

wrapper to request sizes of MM parts (number of atoms/species/fragments)

Arguments

TypeIntentOptionalAttributesName
type(sizes_type), intent(out) :: sizes

sizes data

type(system_type), intent(out) :: system_data

atom species of each atom in the system are stored here (-1 for overlapped)

public subroutine mimic_request_system_data(sizes, system_data)

return data about atomic species, masses and multipoles in the MM part

Arguments

TypeIntentOptionalAttributesName
type(sizes_type), intent(inout) :: sizes

sizes data of the MM part

type(system_type), intent(inout) :: system_data

system data

public subroutine mimic_allocate_mm_struct(subsystems, factors, tau, force, num_qm_atoms, total_species, cov_radii, sizes, system_data)

allocates fragments for MM part

Read more…

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

real(kind=dp), intent(in), dimension(:):: factors

factors applied to forces contribution (by code)

real(kind=dp), intent(in), dimension(:,:,:):: tau

coordinate matrix of CPMD

real(kind=dp), intent(in), dimension(:,:,:):: force

force matrix of CPMD

integer, dimension(:):: num_qm_atoms

number of quantum atoms per species

integer, intent(in) :: total_species

total number of species

real(kind=dp), intent(in), dimension(:):: cov_radii

covalent radius of each species

type(sizes_type), intent(in) :: sizes

sizes data

type(system_type), intent(inout) :: system_data

system data

public subroutine mimic_allocate_qm_struct(quantum_fragment, n_sp_atoms, charges, origin, box, n_points, n_points_r, rho, extf, tau, force)

allocates quantum fragment (at the moment one per simulation)

Read more…

Arguments

TypeIntentOptionalAttributesName
type(quantum_fragment_type), intent(inout) :: quantum_fragment

quantum subsystem

integer, intent(in), dimension(:):: n_sp_atoms

number of atoms per quantum species

real(kind=dp), intent(in), dimension(:):: charges

ionic charges

real(kind=dp), intent(in), dimension(3):: origin

point of origin of quantum box

real(kind=dp), intent(in), dimension(3,3):: box

quantum box vectors

integer, intent(in), dimension(3):: n_points

number of points in the electronic grid in each direction

integer, intent(in), dimension(3):: n_points_r

real number of points in the electronic grid in each direction

real(kind=dp), intent(in), dimension(:,:,:):: rho

electronic density matrix

real(kind=dp), intent(in), dimension(:,:,:):: extf

external field on the electronic grid

real(kind=dp), intent(in), dimension(:,:,:):: tau

coordinate matrix of CPMD

real(kind=dp), intent(in), dimension(:,:,:):: force

force matrix of CPMD

public subroutine mimic_collect_coordinates(subsystems)

wrapper to request coordinates of MM part

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), dimension(:):: subsystems

array of subsystems associated with client codes

public subroutine mimic_send_coords(subsystems)

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), dimension(:):: subsystems

array of subsystems associated with client codes

public subroutine mimic_collect_forces(subsystems)

wrapper to request MM forces

Read more…

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

public subroutine mimic_collect_energies(subsystems, energy)

wrapper to request MM energies

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

real(kind=dp), intent(out) :: energy

energy from external programs

public subroutine mimic_sort_fragments(subsystem, quantum_fragment, cutoff_distance, sorting_method)

sort fragments into short- and long-range according to distance criterion

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout) :: subsystem

array of subsystems associated with client codes

type(quantum_fragment_type), intent(in) :: quantum_fragment

the quantum fragment

real(kind=dp), intent(in) :: cutoff_distance

distance cutoff

integer, intent(in) :: sorting_method

sorting method (centroid, center_of_mass, center_of_charge, minimum_distance)

public subroutine mimic_compute_tensors(subsystems, quantum_fragment, tensors, tensor_sums, atom_start, atom_end)

compute folded tensors for long-range electrostatics

Read more…

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

type(quantum_fragment_type), intent(inout) :: quantum_fragment

quantum subsystem

real(kind=dp), intent(out), dimension(:,:), allocatable:: tensors

array with tensors

real(kind=dp), intent(out), dimension(:,:), allocatable:: tensor_sums

array with tensor sums

integer, intent(in), dimension(:):: atom_start

first atom id in the chunk

integer, intent(in), dimension(:):: atom_end

last atom id in the chunk

public subroutine mimic_compute_energy(subsystems, quantum_fragment, energy, sr_atom_start, sr_atom_end, tensor_sums)

compute interaction energy

Read more…

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

type(quantum_fragment_type), intent(inout) :: quantum_fragment

quantum subsystem

real(kind=dp), intent(out) :: energy

interaction energy

integer, intent(in), dimension(:):: sr_atom_start

index of the first short-range atom for this process

integer, intent(in), dimension(:):: sr_atom_end

index of the last short-range atom for this process

real(kind=dp), intent(in), dimension(:,:), allocatable:: tensor_sums

Array stroing tensor sums

public subroutine mimic_compute_forces(subsystems, quantum_fragment, x_start, x_end, gr_sr_atom_start, gr_sr_atom_end, gr_lr_atom_start, gr_lr_atom_end, pr_sr_atom_start, pr_sr_atom_end, pr_lr_atom_start, pr_lr_atom_end, root)

compute forces from electrostatic interactions

Read more…

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

type(quantum_fragment_type), intent(inout) :: quantum_fragment

quantum subsystem

integer, intent(in) :: x_start

index of the first yz-plane for this process

integer, intent(in) :: x_end

index of the last yz-plane for this process

integer, intent(in), dimension(:):: gr_sr_atom_start

index of the first short-range atom for this process group

integer, intent(in), dimension(:):: gr_sr_atom_end

index of the last short-range atom for this process group

integer, intent(in), dimension(:):: gr_lr_atom_start

index of the first long-ange atom for this process group

integer, intent(in), dimension(:):: gr_lr_atom_end

index of the last long-range atom for this process group

integer, intent(in), dimension(:):: pr_sr_atom_start

index of the first short-range atom for this process

integer, intent(in), dimension(:):: pr_sr_atom_end

index of the last short-range atom for this process

integer, intent(in), dimension(:):: pr_lr_atom_start

index of the first long-ange atom for this process

integer, intent(in), dimension(:):: pr_lr_atom_end

index of the last long-range atom for this process

logical, intent(in) :: root

logical for root process

public subroutine mimic_compute_potential(subsystems, quantum_fragment, x_start, x_end, sr_atom_start, sr_atom_end, tensor_sums)

compute electrostatic potential

Read more…

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

type(quantum_fragment_type), intent(inout) :: quantum_fragment

quantum subsystem

integer, intent(in) :: x_start

index of the first yz-plane for this process

integer, intent(in) :: x_end

index of the last yz-plane for this process

integer, intent(in), dimension(:):: sr_atom_start

index of the first short-range atom for this process

integer, intent(in), dimension(:):: sr_atom_end

index of the last short-range atom for this process

real(kind=dp), intent(inout), dimension(:,:), allocatable:: tensor_sums

Array stroing tensor sums

public subroutine mimic_compute_multipoles(quantum_fragment, order, x_start, x_end)

compute multipoles of the quantum fragment

Arguments

TypeIntentOptionalAttributesName
type(quantum_fragment_type), intent(inout) :: quantum_fragment

quantum subsystem

integer, intent(in) :: order

order of the multipole expansion

integer, intent(in) :: x_start

index of the first yz-plane for this process

integer, intent(in) :: x_end

index of the last yz-plane for this process

public subroutine mimic_min_image(box, pivot, subsystems)

apply MIC to the whole system with respect to a pivot point

Read more…

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in), dimension(3,3):: box

vectors of the encompassing box

real(kind=dp), intent(in), dimension(3):: pivot

pivot point

class(subsystem_type), intent(inout), dimension(:):: subsystems

classical fragments

public subroutine mimic_center_qm(r_diff, subsystem, quantum_fragment)

re-center the quantum box

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(out), dimension(3):: r_diff

resulting translation vector

class(subsystem_type), intent(in), dimension(:):: subsystem

classical subsystem

class(quantum_fragment_type), intent(in) :: quantum_fragment

quantum fragment

public subroutine mimic_count_trcnst(nconn, conn_map, bonds, bonds_pcode)

Routine to count the number of interdependent constraints amoung bonds

Arguments

TypeIntentOptionalAttributesName
integer, intent(out), dimension(:), allocatable:: nconn

number of dependencies per bond

integer, intent(out), dimension(:, :), allocatable:: conn_map

dependency map

type(bond_type), intent(in), dimension(:,:):: bonds

list of bond constraints

integer, intent(in), dimension(:):: bonds_pcode

number of bonds per code

public subroutine mimic_translate(quantum_fragment, subsystems, shift)

Routine that does translation of the whole system with a given vector

Arguments

TypeIntentOptionalAttributesName
type(quantum_fragment_type), intent(inout) :: quantum_fragment
type(subsystem_type), intent(inout), dimension(:):: subsystems
real(kind=dp), dimension(3):: shift

Vector of translation to apply

public subroutine mimic_print_timings()

Routine that prints timings accumulated during the current run of MiMiC

Arguments

None