chfl_residue type

type  chfl_residue

A chfl_residue is a group of atoms belonging to the same logical unit. They can be small molecules, amino-acids in a protein, monomers in polymers, etc.

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

Initialize the residue with a new residue with the given name and optional residue id. This subroutine allocate memory which must be released with chfl_residue%free().

Parameters:

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

Options:
subroutine  chfl_residue%copy(residue[, status])

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

Parameters:

residue [type(chfl_residue)] :: residue 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_residue%name([status])

Get the name of the residue. 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_residue%id([status])

Get the residue id. If the residue do not have an id, status is set to CHFL_GENERIC_ERROR, and no value is returned.

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.

function  chfl_residue%atoms_count([status])

Get the number of atoms in the residue.

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_residue%add_atom(index[, status])

Add the atom at the given index in the residue.

Parameters:

index [integer] :: index of the atom to add

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_residue%contains(index[, status])

Check if the atom at the given index is in the residue.

Return:

logical

Parameters:

index [integer] :: index of the atom

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_residue%atoms(data[, status])

Get the list of atoms in the topology in the pre-allocated array data of size chfl_residue%atoms_count().

Parameters:

data [integer,dimension(:)] :: array to be filled with the indexes of atoms in the residue

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_residue%set(name, property[, status])

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

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_residue%get(name[, status])

Get a copy of the property with the given name in this residue. 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_residue%properties_count([status])

Get the number of properties in this residue.

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_residue%list_properties(names[, status])

Fill the pre-allocated array names with the names of the properties in this residue. The array must have room for chfl_residue%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_residue%free()

Destroy a residue, and free the associated memory