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.

The initialization routine for chfl_residue are:

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

Initialize the residue with a new residue with the given name and no residue id.

Parameters:character (len=*) :: residue name
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_residue%with_id(name, id[, status])

Initialize the residue with a new residue with the given name and residue id.

Parameters:
  • character (len=*) :: residue name
  • id [integer] :: residue id
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_residue%copy(residue[, status])

Initialize this residue with a copy of residue.

Parameters:residue [chfl_residue] :: residue to copy
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_residue%from_topology(topology, i[, status])

Initialize this residue with a copy of the residue at index i from a topology. The residue index in the topology is not always the same as the residue id.

Parameters:
  • topology [chfl_topology] :: topology
  • i [integer] :: index of the residue in the topology
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_residue%for_atom(topology, i[, status])

Get a copy of the residue containing the atom at index i in the topology.

Parameters:
  • topology [chfl_topology] :: topology
  • i [integer] :: index of the atom in the topology
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_residue%name(name, buffsize[, status])

Get the name of the residue in the string buffer name.

The buffer size must be passed in buffsize. This function will truncate the residue name to fit in the buffer.

Parameters:
  • character (len=buffsize) :: string buffer to be filled with the residue name
  • buffsize :: length of the string buffer
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_residue%id(id[, status])

Get the identifier of the residue in the initial topology file in id

Parameters:id [integer] :: identifier of the residue
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_residue%atoms_count(size[, status])

Get the number of atoms in the residue in size.

Parameters:size [integer] :: number of atoms in the residue
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_residue%add_atom(i[, status])

Add the atom at index i in the residue.

Parameters:i [integer] :: index of the atom to add
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_residue%contains(i, result[, status])

Check if the atom at index i is in the residue, and store the result in result.

Parameters:
  • i [integer] :: index of the atom
  • result [logical,kind=1] :: .true. if the atom is in the residue, .false. otherwise
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_residue%atoms(data, natoms[, status])

Get the list of atoms in the topology in the pre-allocated array data of size natoms.

data size must be passed in the natoms parameter, and be equal to the result of chfl_residue%atoms_count().

Parameters:
  • data (natoms) [integer] :: natoms array to be filled with the atoms in the residue
  • natoms [integer] :: size of the array. This should be equal to the value given by chfl_residue%atoms_count().
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_residue%free([status])

Destroy a residue, and free the associated memory

Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.