chfl_atom type

type  chfl_atom

A chfl_atom is a particle in the current chfl_frame.

All atoms have an atomic name; an atomic type; an atomic mass and an atomic charge.

The atomic name is usually an unique identifier (H1, C_a) while the atomic type will be shared between all particles of the same type: H, Ow, CH3.

Type fields:
subroutine  chfl_atom%init(name[, status])

Initialize this atom with the given name, and set the atom type to name. This subroutine allocate memory which must be released with chfl_atom%free().

Parameters:

name [character(len=*)] :: atom name

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%copy(atom[, status])

Initialize this atom with a copy of atom. This subroutine allocate memory which must be released with chfl_atom%free().

Parameters:

atom [type(chfl_atom)] :: atom to copy

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%mass([status])

Get the mass of the atom in atomic mass units.

Return:

real

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%set_mass(mass[, status])

Set the mass of the atom to mass. The value should be in atomic mass units.

Parameters:

mass [real] :: new atom mass

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%charge([status])

Get the charge of the atom in number of the electron charge e.

Return:

real

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%set_charge(charge[, status])

Set the charge of the atom to charge. The charge should be in number of the electron charge e.

Parameters:

charge [real] :: new atom charge

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%name([status])

Get the name of an atom. If the name is longer than CHFL_STRING_LENGTH, it will be truncated.

Return:

character (len=CHFL_STRING_LENGTH)

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%set_name(name[, status])

Set the name of an atom to name.

Parameters:

name [character(len=*)] :: new atom name

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%full_name([status])

Get the full name of an atom from its type. If the name is longer than CHFL_STRING_LENGTH, it will be truncated.

Return:

character (len=CHFL_STRING_LENGTH)

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%type([status])

Get the type of an atom. If the name is longer than CHFL_STRING_LENGTH, it will be truncated.

Return:

character (len=CHFL_STRING_LENGTH)

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%set_type(type[, status])

Set the type of an atom to type.

Parameters:

name [character(len=*)] :: new atom type

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%vdw_radius([status])

Get the Van der Waals radius of an atom from the atom type. If the radius in unknown, this function returns 0.

Return:

real

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%covalent_radius([status])

Get the covalent radius of an atom from the atom type. If the radius in unknown, this function set radius to 0.

Return:

real

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%atomic_number([status])

Get the atomic number of an atom from the atom type. If the atomic number in unknown, this function set number to 0.

Parameters:

integer

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%set(name, property[, status])

Add a new property with the given name to this atom.

If a property with the same name already exists, this function override the existing property with the new one.

property can either be a chfl_property, or any value that can be stored in a chfl_property: logical, real, string, or vector3d.

Parameters:
  • name [character(len=*)] :: property name

  • property [type(chfl_property)] :: the new property

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%get(name[, status])

Get a copy of the property with the given name in this atom. If no property exist with this name, status will be set to CHFL_PROPERTY_ERROR.

The associated memory must be released by calling chfl_property%free().

Return:

type (chfl_property)

Parameters:

name [character(len=*)] :: property name

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

function  chfl_atom%properties_count([status])

Get the number of properties in this atom.

Return:

integer

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%list_properties(names[, status])

Fill the pre-allocated array names with the names of the properties in this atom. The array must have room for chfl_atom%properties_count() values of type character(len=CHFL_STRING_LENGTH).

Return:

integer

Parameters:

names (:) [character(len=CHFL_STRING_LENGTH)] :: list of properties names

Options:

status [integer(chfl_status)] :: status code of the operation. If it is not CHFL_SUCCESS, use chfl_last_error() to learn more about the error.

subroutine  chfl_atom%free()

Destroy an atom, and free the associated memory