Understanding & Creating BTCL Scripts, Section 2, Command Input File


Note: This file contains hypertext links and html tags and is therefore not directly useful as a command input file for a Discover run. You need to use the seg1.inp file that is found in the $$BIOSYM/tutorial/discover/BTCL directory for the actual run.

This example file contains links to the complete descriptions of the BTCL commands. The BTCL language. Added comments that were not part of the original file are in italics.

Default values that are not specified in the command input file appear in the output file.


Define a procedure before actually starting the run:

#BIOSYM btcl 3

proc compareArchive {subset filename} {
    database handle sys_h System.
    global cmprIndx

    # Save current system
    $sys_h get saveCoord Atom.Coord

    # Store current coordinates
    subset get atms $subset
    $sys_h get coord2 Coord $atms

    # Get total energy of current structure
    set currentTotalEnergy [energy]

    # Compute energy and rms comparison value
    if [info exists cmprIndx] {
	readFile archive file = $filename frame = $cmprIndx
	set oldTotalEnergy [energy]
	$totalEnergyDiff = $oldTotalEnergy - $currentTotalEnergy
        echo Energy Difference: $totalEnergyDiff
        $sys_h get coord1 Coord $atms
        geometry rmsVal rms $coord1 $coord2
        echo RMS Comparison Value: [object rmsVal]
    } else {
	echo The variable cmprIndx is not set.
    }

    # Restore pre-comparison system
    $sys_h set $saveCoord Atom.Coord
}
Main script:
set PROJECT butane

begin

subset define subset sbset "*:*:!(atom;H*)"

compareArchive sbset energy_test

$cmprIndx = 0
if [catch {compareArchive sbset energy_test}] {
   echo Oops
}

for {$loop = 1} {$loop <= 2} {incr loop} {
   $cmprIndx = $loop
   compareArchive sbset energy_test
}

Main access page Advanced-Use (BTCL) access BTCL - Tutorial Access.

Lesson on understanding & creating BTCL scripts, Introduction Lesson on understanding & creating BTCL scripts, Section 2

Copyright Biosym/MSI