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 chfl_residue%init(), chfl_residue%from_topology(), chfl_residue%for_atom() and chfl_residue%copy().

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

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

Parameters:

name [character,len=*] :: residue name

Options:
  • id [integer] :: residue id
  • 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:
  • name [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%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.