readFile

Jump to Description or Examples; explanation of how commands are documented.


Purpose

The readFile command is used to read in a data file created by previous Discover or Insight runs (e.g., a coordinate snapshot from an archive file). It also allows you to give your system a name, so that multiple systems can be calculated and compared.


Syntax

readFile filetype ?keyword = value?...


Keyword Values Default Meaning
filetype molec*ular_system molecular_system Specify the type of file(s) to arc*hive read data from. One of these coord*inate values must be the first or car argument after readFile, since dynamics_restart the filetype is specified by a forcef*ield positional argument. his*tory binary Boolean false Read the binary form of the file. Currently available only for the forcefield filetype (which must be binary). file*name string run_name.extension User-defined name of file. The default is the current run name with the appropriate extension. See below. frame integer 1 For archive and history files, specifies which frame to read. system_name string -- If unspecified, the most- recently read system becomes the current system. If specified, the file is read into a virtual system (with this name), which can later be chosen with the database default command.

Description

Jump to Syntax or Examples

The readFile command reads data from a particular file. If the filename parameter is not specified, the filenames used depend on the filetype parameter and are as follows:

archive
run_name.arc
coordinate
run_name.car
molecular_system
run_name.car and run_name.mdf
dynamics_restart
run_name.xdyn
history
run_name.his

(In the above file types, run_name is your name for the calculation.)

forcefield
$FORCEFIELD.xfrc (with binary option), where $FORCEFIELD is the value of the $FORCEFIELD environment variable.

Note--If the filename parameter is given without an extension, the appropriate extension is added.

The dynamics_restart file contains data needed to restart a dynamics run.

For the archive and history files, the readFile command returns the value of the energy specified for this frame. This is the total energy of the system when it was written to the file (potential energy for frames generated by minimizations and potential + kinetic energy for frames generated by dynamics). If an attempt is made to read beyond the last frame in the file, an empty string is returned. This can be used to indicate when the end of the file has been reached, as in Example 1. To control the precision of the energy value, the TCL variable tcl_precision may be used.


Example 1

Jump to Syntax or Description

for {$i = 1} {[set energy [readFile archive frame = $i]] != ""} {incr i} {
	puts $file "$i	$energy"
	...
}
Construct a loop that reads each frame in turn from the archive file run_name.arc. Print the frame number and energy to $file. The loop ends when the readFile command returns an empty string for the energy. This occurs upon reaching the end of the file. Hence it is not necessary to know a priori how many frames are in the archive file.

Example 2

readFile history frame = 2
Read the second frame from the history file run_name.his.

Example 3

readFile molecular_system filename = test
Read the coordinate and molecular data files test.mdf and test.car.

Example 4

readFile forcefield +binary filename = cff91
Read the binary forcefield file cff91.xfrc.

Example 5

readFile car file = test1
Read the coordinate file test1.car.

Example 6

readFile dynamics_restart filename = crn.restart 
cdlConfig dynamics temperature = 390.0 
dynamics
Read the dynamics restart file crn.restart. The default values of dynamics parameters are set to those used by the dynamics run that wrote the crn.restart file. Then change the dynamics temperatures to 390 K for the new dynamics run. The order in which these two commands appear is important--the readFile dynamics_restart command overwrites any previous default parameter values.


Main access page Advanced-Use access writeFile command.

List of BTCL commands rattle command reset command

Copyright Biosym/MSI