Documentation for module mc_coordinates

contains miscellaneous subroutines used in the Monte Carlo runs,mostly geared towards changes in coordinates

source: mc_coordinates.F
Loading...

public Subroutines/Functions:

looks for overlaps (intermolecular distances less than rmin)
determine the number of cluster present in the given configuration based on the rclus value
generates an array that tells us which sides of the simulation cell we can increase or decrease using a discrete volume move
selects a molecule at random to perform a MC move on...you can specify the box the molecule should be in, its type, both, or neither
takes the last molecule in a force environment and moves it around to different center of mass positions and orientations, selecting one based on the rosenbluth weight
calculates the center of mass of a given molecule
folds all the coordinates into the center simulation box using a center of mass cutoff
rotates a molecule randomly around the center of mass, sequentially in x, y, and z directions

SUBROUTINEcheck_for_overlap(force_env, nchains, nunits, loverlap, mol_type, cell_length, molecule_number)

looks for overlaps (intermolecular distances less than rmin)

Arguments:
POINTER
:: force_env the force environment containing the coordinates
INTEGER,
INTENT(in)
:: nchains(:) the number of molecules of each type in the box
INTEGER,
INTENT(in)
:: nunits(:) the number of interaction sites for each molecule
LOGICAL,
INTENT(out)
:: loverlap returns .TRUE. if atoms overlap
INTEGER,
INTENT(in)
:: mol_type(:) an array that indicates the type of each molecule
REAL(dp),
INTENT(in),
OPTIONAL
:: cell_length(1:3) the length of the box...if none is specified, it uses the cell found in the force_env
INTEGER,
INTENT(in),
OPTIONAL
:: molecule_number if present, just look for overlaps with this molecule

SUBROUTINEcreate_discrete_array(cell, discrete_array, step_size)

generates an array that tells us which sides of the simulation cell we can increase or decrease using a discrete volume move

Arguments:
REAL(dp),
INTENT(in)
:: cell(1:3) the lengths of the sides of the cell
INTEGER,
INTENT(out)
:: discrete_array(1:3,1:2) the array that indicates which sides we can move
REAL(dp),
INTENT(in)
:: step_size the size of the discrete volume move

SUBROUTINEfind_mc_test_molecule(mc_molecule_info, start_atom, box_number, molecule_type, rng_stream, box, molecule_type_old)

selects a molecule at random to perform a MC move on...you can specify the box the molecule should be in, its type, both, or neither

Arguments:
POINTER
:: mc_molecule_info the structure that contains some global molecule data
INTEGER,
INTENT(out)
:: start_atom the number of the first atom in the choosen molecule in relation to the force_env it's in
INTEGER,
INTENT(out)
:: box_number the box the choosen molecule is in
INTEGER,
INTENT(out)
:: molecule_type the type of molecule the choosen molecule is
POINTER
:: rng_stream the stream we pull random numbers from
INTEGER,
INTENT(in),
OPTIONAL
:: box if present, tells the routine which box to grab a molecule from
INTEGER,
INTENT(in),
OPTIONAL
:: molecule_type_old if present, tells the routine which molecule type to select from

SUBROUTINEgenerate_cbmc_swap_config(force_env, beta, max_val, min_val, exp_max_val, exp_min_val, nswapmoves, rosenbluth_weight, start_atom, natoms_tot, nunits, nunits_mol, mass, loverlap, choosen_energy, old_energy, ionode, lremove, mol_type, nchains, source, group, rng_stream, avbmc_atom, rmin, rmax, move_type, target_atom)

takes the last molecule in a force environment and moves it around to different center of mass positions and orientations, selecting one based on the rosenbluth weight

Arguments:
POINTER
:: force_env the force environment containing the coordinates
REAL(dp),
INTENT(in)
:: beta the value of 1/kT for this simulations, in a.u.
REAL(dp),
INTENT(in)
:: max_val ...
REAL(dp),
INTENT(in)
:: min_val ...
REAL(dp),
INTENT(in)
:: exp_max_val ...
REAL(dp),
INTENT(in)
:: exp_min_val ...
INTEGER,
INTENT(in)
:: nswapmoves the number of desired trial configurations
REAL(dp),
INTENT(out)
:: rosenbluth_weight the Rosenbluth weight for this set of configs
INTEGER,
INTENT(in)
:: start_atom the atom number that the molecule to be swapped starts on
INTEGER,
INTENT(in)
:: natoms_tot the total number of interaction sites in the box
INTEGER,
INTENT(in)
:: nunits(:) the number of interaction sites for every molecule_type
INTEGER,
INTENT(in)
:: nunits_mol ...
REAL(dp),
INTENT(in)
:: mass(1:nunits_mol) the mass for every interaction site of every molecule type
LOGICAL,
INTENT(out)
:: loverlap the flag that indicates if all of the configs have an atomic overlap
REAL(dp),
INTENT(out)
:: choosen_energy the energy of the choosen config
REAL(dp),
INTENT(in)
:: old_energy the energy that we subtract from all of the trial energies to prevent numerical overflows
LOGICAL,
INTENT(in)
:: ionode indicates if we're on the main CPU
LOGICAL,
INTENT(in)
:: lremove is this the Rosenbluth weight for a removal box?
INTEGER,
INTENT(in)
:: mol_type(:) an array that contains the molecule type for every atom in the box
INTEGER,
INTENT(in)
:: nchains(:) the number of molecules of each type in this box
INTEGER,
INTENT(in)
:: source the MPI source value, for broadcasts
INTEGER,
INTENT(in)
:: group the MPI group value, for broadcasts
POINTER
:: rng_stream the random number stream that we draw from
INTEGER,
INTENT(in),
OPTIONAL
:: avbmc_atom ...
REAL(dp),
INTENT(in),
OPTIONAL
:: rmin ...
REAL(dp),
INTENT(in),
OPTIONAL
:: rmax ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: move_type ...
INTEGER,
INTENT(in),
OPTIONAL
:: target_atom ...

SUBROUTINEget_center_of_mass(coordinates, natom, center_of_mass, mass)

calculates the center of mass of a given molecule

Arguments:
REAL(dp),
INTENT(in)
:: coordinates(:,:) the coordiantes of the atoms in the molecule
INTEGER,
INTENT(in)
:: natom the number of atoms in the molecule
REAL(dp),
INTENT(out)
:: center_of_mass(1:3) the coordinates of the center of mass
REAL(dp),
INTENT(in)
:: mass(:) the mass of the atoms in the molecule

SUBROUTINEmc_coordinate_fold(coordinates, nchains_tot, mol_type, mass, nunits, box_length)

folds all the coordinates into the center simulation box using a center of mass cutoff

Arguments:
REAL(dp),
INTENT(inout)
:: coordinates(:,:) the coordiantes of the atoms in the system
INTEGER,
INTENT(in)
:: nchains_tot the total number of molecules in the box
INTEGER,
INTENT(in)
:: mol_type(:) an array that indicates the type of every molecule in the box
REAL(dp),
INTENT(in)
:: mass(:,:) the mass of every atom for all molecule types
INTEGER,
INTENT(in)
:: nunits(:) the number of interaction sites for each molecule type
REAL(dp),
INTENT(in)
:: box_length(1:3) an array for the lengths of the simulation box sides

SUBROUTINErotate_molecule(r, mass, natoms, rng_stream)

rotates a molecule randomly around the center of mass, sequentially in x, y, and z directions

Arguments:
REAL(dp),
INTENT(inout)
:: r(1:3,1:natoms) the coordinates of the molecule to rotate
REAL(dp),
INTENT(in)
:: mass(1:natoms) the mass of all the atoms in the molecule
INTEGER,
INTENT(in)
:: natoms the number of atoms in the molecule
POINTER
:: rng_stream the stream we pull random numbers from