DCD_IO handles the reading and writing of trajectory files in DCD format.
The use of this module is essentially the same as that of the module TRAJECTORY_IO which it replaces. TRAJECTORY_IO is fully explained in chapters 8 and 10 of the book A Practical Introduction to the Simulation of Molecular Systems.
Module | Variables |
---|---|
DEFINITIONS | DP, MAX_RECORD_LENGTH, SP, VERSION |
FILES | NEXT_UNIT |
IO_UNITS | OUTPUT |
STATUS | ERROR |
A single public data type is defined by this module.
Type | Purpose |
---|---|
DCD_TYPE | Hold information about a DCD trajectory file. |
Field | Type | Purpose |
---|---|---|
HEADER | Character ( Len = 4 ) | The type identifier of the trajectory file. |
NATOMS | Integer | The number of atoms in the system on the trajectory file. |
NFIXED | Integer | The number of fixed atoms in the system. |
NFRAMES | Integer | The number of frames on the trajectory file. |
NFREE | Integer | The number of free atoms in the system. |
POSITION | Integer | The current frame of the trajectory file. |
UNIT | Integer | The unit number of the trajectory file. |
QCRYSTAL | Logical | A flag to indicate if the trajectory has symmetry information. |
QWRITE | Logical | A flag to indicate if the trajectory is being read or written. |
FREE | Pointer to Integer(:) | The free atom index array. |
None.
There are seven public subroutines in this module.
Subroutine | Purpose |
---|---|
DCD_ACTIVATE_READ | Activate a DCD trajectory for reading. |
DCD_ACTIVATE_WRITE | Activate a DCD trajectory for writing. |
DCD_DEACTIVATE | Deactivate a DCD trajectory. |
DCD_INITIALIZE | Initialize the type variable for a DCD trajectory. |
DCD_MERGE | Merge several DCD trajectories into a single trajectory. |
DCD_READ | Read a frame from a DCD trajectory. |
DCD_WRITE | Write a frame to a DCD trajectory. |
Argument | Type | Intent | Optional | Purpose |
---|---|---|---|---|
FILE | Character ( Len = * ) | In | No | The trajectory file name. |
DCD | DCD_Type | InOut | No | The type variable for the trajectory. |
Error | Meaning |
---|---|
The trajectory has not been initialized. | The variable DCD has not been initialized by a previous call to DCD_INITIALIZE. |
I/O Error. | There is a problem with the trajectory file. |
Argument | Type | Intent | Optional | Purpose |
---|---|---|---|---|
FILE | Character ( Len = * ) | In | No | The trajectory file name. |
DCD | DCD_Type | InOut | No | The type variable for the trajectory. |
TYPE | Character ( Len = * ) | In | No | The type identifier of the trajectory. |
NATOMS | Integer | In | No | The number of atoms in the system. |
NFIXED | Integer | In | No | The number of fixed atoms in the system. |
NFRAMES | Integer | In | No | The number of frames to be written to the trajectory file. |
QCRYSTAL | Logical | In | Yes | The crystal information flag. |
QFIX | Logical(1:NATOMS) | In | Yes | The logical fixed atom array. |
Error | Meaning |
---|---|
The trajectory has not been initialized. | The variable DCD has not been initialized by a previous call to DCD_INITIALIZE. |
I/O Error. | There is a problem with the trajectory file. |
Fixed atom array missing. | There are fixed atoms in the system but the argument QFIX is missing. |
Argument | Type | Intent | Optional | Purpose |
---|---|---|---|---|
DCD | DCD_Type | InOut | No | The type variable for the trajectory. |
Error | Meaning |
---|---|
The trajectory is not active. | The trajectory specified by DCD is not currently active. |
A trajectory open for writing is not full. | There are too few frames on a trajectory activated for writing. |
Argument | Type | Intent | Optional | Purpose |
---|---|---|---|---|
DCD | DCD_Type | InOut | No | The type variable for the trajectory. |
Argument | Type | Intent | Optional | Purpose |
---|---|---|---|---|
FILES_IN | Character ( Len = * ) (:) | In | No | The input trajectory file names. |
FILE_OUT | Character ( Len = * ) | In | No | The output trajectory file name. |
SKIP_FIRST | Logical | In | Yes | A flag to skip the first data set of the second and subsequent trajectory files. |
Error | Meaning |
---|---|
Inconsistent scalar data for input trajectories. | The scalar header data is not the same for some of the input trajectories. |
Inconsistent array data for input trajectories. | The array header data is not the same for some of the input trajectories. |
Argument | Type | Intent | Optional | Purpose |
---|---|---|---|---|
DCD | DCD_Type | InOut | No | The type variable for the trajectory. |
ATMDAT | Real(1:3,1:NATOMS) | Out | No | The atom data array. |
BOXDAT | Real(1:3) | InOut | Yes | The periodic box dimensions. |
Error | Meaning |
---|---|
The input trajectory is inactive. | There is a problem with the argument DCD. |
Incompatible atom data array dimensions. | There is a mismatch between the value of the field DCD%NATOMS and the size of the system implied by the argument ATMDAT. |
There are no more frames on the file. | The end of the trajectory has been reached. |
There is crystal information but no BOXDAT argument. | The trajectory contains crystal information but no BOXDAT argument was supplied. |
Argument | Type | Intent | Optional | Purpose |
---|---|---|---|---|
DCD | DCD_Type | InOut | No | The type variable for the trajectory. |
ATMDAT | Real(1:3,1:NATOMS) | In | No | The atom data array. |
BOXDAT | Real(1:3) | In | Yes | The periodic box dimensions. |
Error | Meaning |
---|---|
The write trajectory is inactive. | There is a problem with the argument DCD. |
Incompatible atom data array dimensions. | There is a mismatch between the value of the field DCD%NATOMS and the size of the system implied by the argument ATMDAT. |
The file is full. | No more frames can be written to the trajectory. |
There is crystal information but no BOXDAT argument. | The trajectory contains crystal information but no BOXDAT argument was supplied. |
Stable.