m_setup_artn

namespace m_setup_artn

Functions

subroutine setup_artn(nat, lerror)

This routine is performed only for istep=0. At the end of this routine, all parameters should have a good value, ready to start ARTn. This includes user parameters, and all runtime variables. “Have a good value” means to have reasonable values converted to ARTn units, and to be allocated and initialised (where needed) to proper size and values.

For user parameters:

  • the scalars which do not need unit conversion already have a good value on entering this routine. This is because they are initialised directly to default value in ARTn units. The scalars which need conversion are initialised to NAN. Their value on entering this routine can be either NAN, or has been changed through call to set_param(), in that case the units have already been converted, and that scalar already has good value. If any user param is NAN in this routine, its value should be modified to default. If we read input from file, another routine is called: read_param_file().

  • all allocatable user parameters need to be checked for allocation status. If they are not allocated, then allocate to proper size. If they are already allocated, we need to check their size, since it cannot be done inside set_params(). The allocation should happen before reading from input file, and size should be checked after reading from input file is done. For runtime parameters:

  • data from previous ARTn exploration should be destroyed

  • flags and counters should be reset to be ready to start ARTn.

  • parameters from all modules should be reset.

integer function init_user_params ()

initialise the user-input parameters. At the end of this function, all user parameters will have a sensible value.

integer function read_param_file (fname)

read parameters from file, immediately make units, and convert the defined parameters into artn units

integer function read_counter_file (fname)

read the counter

subroutine print_caller()
integer function read_params_namelist (u0)

parser for namelist from opened file. Strategy: read single line from input file, then try reading nml=artn_parameters from this line. Advantage is that we know in advance which variable will be read next, so can check allocation, make proper converisons, etc. Make special cases for reading the params which need conversion. This is to avoid multiple conversion if the value is already set. — ‘make_units’ is called here.

logical function check_namelist_variables (u0, out_msg)
subroutine reset_setup()

reset the setup status flag

Variables

integer, protected isetup   =0
character(:), dimension(:), allocatable, protected words1
interface clean_artn
interface generate_push_init

   options are specified by mode:
           (1) 'all' generates a push on all atoms
           (2) 'list' generates a push on a list of atoms
           (3) 'rad' generates a push on a list of atoms and all atoms within push_dist_thr
   the user should supply: number and list of atoms to push; and add_constraints on these atoms

Param nat:

[in] Size of list: number of atoms

Param push_ids:

[in] List of atoms on which apply a push

Param dist_thr:

[in] Threshold on the distance interatomic

Param step_size:

[in] length of initial step

Param tau:

[in] atomic position

Param lat:

[in] Box length

Param add_const:

[in] list of atomic constrain

Param mode:

[in] Actual kind displacement

Param push:

[out] list of push applied on the atoms (ORDERED)

interface start_guess_eigenvec
interface start_guess_push