(git:b76ce4e)
Loading...
Searching...
No Matches
cell_methods Module Reference

Handles all functions related to the CELL. More...

Functions/Subroutines

subroutine, public cell_create (cell, hmat, periodic, tag)
 allocates and initializes a cell
 
subroutine, public cell_finalize_canonical_input (cell, hmat_input, hmat_canonical)
 Store the transform between the user input cell and the canonical cell.
 
subroutine, public init_cell (cell, hmat, periodic)
 Initialise/readjust a simulation cell after hmat has been changed.
 
recursive subroutine, public read_cell (cell, cell_ref, use_ref_cell, cell_section, topology_section, check_for_ref, para_env)
 ...
 
subroutine, public set_cell_param (cell, cell_length, cell_angle, periodic, do_init_cell)
 Sets the cell using the internal parameters (a,b,c) (alpha,beta,gamma) using the convention: a parallel to the x axis, b in the x-y plane and and c univoquely determined; gamma is the angle between a and b; beta is the angle between c and a and alpha is the angle between c and b.
 
subroutine, public read_cell_cif (cif_file_name, cell, para_env)
 Reads cell information from CIF file.
 
subroutine, public read_cell_xyz (xyz_file_name, cell, para_env)
 Reads xyz file and pass comments on the second line to get cell information.
 
subroutine, public read_xyz_comment (line, cell, has_cell, step, time, ener)
 Reads comment line of XYZ files to get cell, step, time and energy info.
 
subroutine, public read_cell_pdb (pdb_file_name, cell, para_env)
 Reads cell information from CRYST1 record of PDB file.
 
subroutine, public read_cell_cp2k (cp2k_file_name, cell, para_env)
 Reads cell information from cp2k file.
 
subroutine, public read_cell_xsc (xsc_file_name, cell, para_env)
 Reads cell information from xsc file.
 
subroutine, public write_cell (cell, subsys_section, tag)
 Write the cell parameters to the output unit.
 
subroutine, public write_cell_low (cell, unit_str, output_unit, label)
 Write the cell parameters to the output unit.
 

Detailed Description

Handles all functions related to the CELL.

History
11.2008 Teodoro Laino [tlaino] - deeply cleaning cell_type from units 10.2014 Moved many routines to cell_types.F.
Author
Matthias KracK (16.01.2002, based on a earlier version of CJM, JGH)

Function/Subroutine Documentation

◆ cell_create()

subroutine, public cell_methods::cell_create ( type(cell_type), pointer  cell,
real(kind=dp), dimension(3, 3), intent(in), optional  hmat,
integer, dimension(3), intent(in), optional  periodic,
character(len=*), intent(in), optional  tag 
)

allocates and initializes a cell

Parameters
cellthe cell to initialize
hmatthe h matrix that defines the cell
periodicperiodicity of the cell
tag...
History
09.2003 created [fawzi]
Author
Fawzi Mohamed

Definition at line 93 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cell_finalize_canonical_input()

subroutine, public cell_methods::cell_finalize_canonical_input ( type(cell_type), pointer  cell,
real(kind=dp), dimension(3, 3), intent(in)  hmat_input,
real(kind=dp), dimension(3, 3), intent(in)  hmat_canonical 
)

Store the transform between the user input cell and the canonical cell.

Parameters
cell...
hmat_input...
hmat_canonical...

Definition at line 126 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_cell()

subroutine, public cell_methods::init_cell ( type(cell_type), pointer  cell,
real(kind=dp), dimension(3, 3), intent(in), optional  hmat,
integer, dimension(3), intent(in), optional  periodic 
)

Initialise/readjust a simulation cell after hmat has been changed.

Parameters
cell...
hmat...
periodic...
Date
16.01.2002
Author
Matthias Krack
Version
1.0

Definition at line 183 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_cell()

recursive subroutine, public cell_methods::read_cell ( type(cell_type), pointer  cell,
type(cell_type), pointer  cell_ref,
logical, intent(inout), optional  use_ref_cell,
type(section_vals_type), optional, pointer  cell_section,
type(section_vals_type), optional, pointer  topology_section,
logical, intent(in), optional  check_for_ref,
type(mp_para_env_type), pointer  para_env 
)

...

Parameters
cell...
cell_ref...
use_ref_cell...
cell_section...
topology_section...
check_for_ref...
para_env...
History
03.2005 created [teo] 03.2026 revamped logic with pdb and extxyz parsers
Author
Teodoro Laino

Definition at line 339 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_cell_param()

subroutine, public cell_methods::set_cell_param ( type(cell_type), pointer  cell,
real(kind=dp), dimension(3), intent(in)  cell_length,
real(kind=dp), dimension(3), intent(in)  cell_angle,
integer, dimension(3), intent(in), optional  periodic,
logical, intent(in)  do_init_cell 
)

Sets the cell using the internal parameters (a,b,c) (alpha,beta,gamma) using the convention: a parallel to the x axis, b in the x-y plane and and c univoquely determined; gamma is the angle between a and b; beta is the angle between c and a and alpha is the angle between c and b.

Parameters
cell...
cell_length...
cell_angle...
periodic...
do_init_cell...
Date
03.2008
Author
Teodoro Laino

Definition at line 667 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_cell_cif()

subroutine, public cell_methods::read_cell_cif ( character(len=*)  cif_file_name,
type(cell_type), pointer  cell,
type(mp_para_env_type), pointer  para_env 
)

Reads cell information from CIF file.

Parameters
cif_file_name...
cell...
para_env...
Date
12.2008
Format Information implemented:
_cell_length_a (_cell.length_a) _cell_length_b (_cell.length_b) _cell_length_c (_cell.length_c) _cell_angle_alpha (_cell.length_alpha) _cell_angle_beta (_cell.length_beta) _cell_angle_gamma (_cell.length_gamma)
Author
Teodoro Laino [tlaino] moved from topology_cif (1/2019 JHU)

Definition at line 754 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_cell_xyz()

subroutine, public cell_methods::read_cell_xyz ( character(len=*)  xyz_file_name,
type(cell_type), pointer  cell,
type(mp_para_env_type), pointer  para_env 
)

Reads xyz file and pass comments on the second line to get cell information.

Parameters
xyz_file_name...
cell...
para_env...
History
03.2026 - Created as read_cell_extxyz with extended XYZ parser 06.2026 - Refactored the parser to allow for reftraj use
Author
HE Zilong

Definition at line 890 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_xyz_comment()

subroutine, public cell_methods::read_xyz_comment ( character(len=*), intent(in)  line,
type(cell_type), intent(inout), pointer  cell,
logical, intent(out)  has_cell,
integer, intent(out), optional  step,
real(kind=dp), intent(out), optional  time,
real(kind=dp), intent(out), optional  ener 
)

Reads comment line of XYZ files to get cell, step, time and energy info.

Parameters
linethe single comment line of an XYZ file
cellthe pointer to which cell is written
has_cella flag for presence of cell information
stepan integer value for step number, if requested; HUGE(0) if not available
timea real value for time, if requested; HUGE(0.0_dp) if not available
enera real value for energy, if requested; HUGE(0.0_dp) if not available
Intended for both the FORCE_EVAL/SUBSYS/CELL and MOTION/MD/REFTRAJ.
At minimum, should work with outputs from write_trajectory() in src/motion_utils.F, around line 879 of src/motion/dumpdcd.F and write_final_structure() in src/particle_methods.F (for cell only). Recognized formats (case insensitive, no hard restriction on data width): (1) Extended xyz format, whose comment on the second line contains fields: Lattice="Ax Ay Az Bx By Bz Cx Cy Cz" where Ax, Ay, Az are three Cartesian components of cell vector A, Bx, By, Bz are components of B, Cx, Cy, Cz are components of C, all in the unit of angstrom, and must occur; Step=S where S is the integer step number; Time=T where T is the time in femtoseconds; Energy=E where E is the energy. No whitespace around the = sign is present; the whitespace is used as the delimiter between fields; apart from lattice= at the front, other fields are optional and do not have a fixed order. (2) dumpdcd format, whose comment on the second line contains fields: a = A, b = B, c = C, alpha = ALPHA, beta = BETA, gamma = GAMMA where A, B, C are three lengths of cell vectors in angstrom, ALPHA, BETA, GAMMA are three angles between cell vectors in degrees; i = I, where I is the integer step number; time = T, where T is the time in femtoseconds; E = ENER, where ENER is the energy. There is one whitespace before and after each equal sign; the comma is used as the delimiter between fields; the cell information is optional.

History 06.2026 - Created by combining the extxyz parser from former read_cell_extxyz and the parser for reftraj in src/motion/integrator.F

Author
HE Zilong

Definition at line 965 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_cell_pdb()

subroutine, public cell_methods::read_cell_pdb ( character(len=*)  pdb_file_name,
type(cell_type), pointer  cell,
type(mp_para_env_type), pointer  para_env 
)

Reads cell information from CRYST1 record of PDB file.

Parameters
pdb_file_name...
cell...
para_env...
Date
03.2026
CRYST1 record may contain space group and Z value at the end,
but here only the first entries are read:

COLUMNS DATA TYPE FIELD DEFINITION

1 - 6 Record name "CRYST1" 7 - 15 Real(9.3) a a (Angstroms). 16 - 24 Real(9.3) b b (Angstroms). 25 - 33 Real(9.3) c c (Angstroms). 34 - 40 Real(7.2) alpha alpha (degrees). 41 - 47 Real(7.2) beta beta (degrees). 48 - 54 Real(7.2) gamma gamma (degrees).

Definition at line 1173 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_cell_cp2k()

subroutine, public cell_methods::read_cell_cp2k ( character(len=*)  cp2k_file_name,
type(cell_type), pointer  cell,
type(mp_para_env_type), pointer  para_env 
)

Reads cell information from cp2k file.

Parameters
cp2k_file_name...
cell...
para_env...
Date
03.2026
Isolated from former read_cell_from_external_file

Definition at line 1226 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_cell_xsc()

subroutine, public cell_methods::read_cell_xsc ( character(len=*)  xsc_file_name,
type(cell_type), pointer  cell,
type(mp_para_env_type), pointer  para_env 
)

Reads cell information from xsc file.

Parameters
xsc_file_name...
cell...
para_env...
Date
03.2026
Isolated from former read_cell_from_external_file

Definition at line 1271 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_cell()

subroutine, public cell_methods::write_cell ( type(cell_type), pointer  cell,
type(section_vals_type), pointer  subsys_section,
character(len=*), intent(in), optional  tag 
)

Write the cell parameters to the output unit.

Parameters
cell...
subsys_section...
tag...
Date
02.06.2000
History
  • 11.2008 Teodoro Laino [tlaino] - rewrite and enabling user driven units
Author
Matthias Krack
Version
1.0

Definition at line 1347 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_cell_low()

subroutine, public cell_methods::write_cell_low ( type(cell_type), pointer  cell,
character(len=*), intent(in)  unit_str,
integer, intent(in)  output_unit,
character(len=*), intent(in), optional  label 
)

Write the cell parameters to the output unit.

Parameters
cell...
unit_str...
output_unit...
label...
Date
17.05.2023
History
  • Extracted from write_cell (17.05.2023, MK)
Version
1.0

Definition at line 1383 of file cell_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function: