if{} statements

From: Thomas C. Bishop (bishop_at_latech.edu)
Date: Tue Mar 05 2013 - 07:46:29 CST

Can someone explain how IF statements work in NAMD config files.
See the code snippet below that was originally posted as
"Re: namd-l: Very long simulation"

There is a section in namd manual on tcl interface but in version 2.9
there is no information on if statements.

A short explanation of "if-then-else" usage would be appreciated.

(along w/ word "if-then-else" b/c searching for "if" in the manual does
not help:-)

Thanks in advance
TOm

>>
>> #############################################################
>> ## ADJUSTABLE PARAMETERS ##
>> #############################################################
>>
>> structure ../DMPC/dmpc_autopsf.psf
>> coordinates ../DMPC/dmpc.pdb
>> outputName dmpcout
>>
>> set temperature 300
>>
>>
>> #############################################################
>> ## SIMULATION PARAMETERS ##
>> #############################################################
>>
>> # Input
>> paraTypeCharmm on
>> parameters par_all36_lipid.prm
>> parameters par_all27_prot_lipid.inp
>>
>>
>> # NOTE: Do not set the initial velocity temperature if you
>> # have also specified a .vel restart file!
>> temperature $temperature
>>
>>
>> # Periodic Boundary Conditions
>> # NOTE: Do not set the periodic cell basis if you have also
>> # specified an .xsc restart file!
>> if {1} {
>> cellBasisVector1 46.2735 0. 0.
>> cellBasisVector2 0. 46.2735 0.
>> cellBasisVector3 0. 0. 62.3748
>> cellOrigin 0. 0. 0.
>> }
>> wrapWater on
>> wrapAll on
>>
>>
>> # Force-Field Parameters
>> exclude scaled1-4
>> 1-4scaling 1.0
>> cutoff 12.
>> switching on
>> switchdist 10.
>> pairlistdist 13.5
>> vdwForceSwitching on
>>
>>
>>
>> # Integrator Parameters
>> timestep 2.0 ;# 2fs/step
>> rigidBonds all ;# needed for 2fs steps
>> nonbondedFreq 1
>> fullElectFrequency 2
>> stepspercycle 20
>>
>>
>> #PME (for full-system periodic electrostatics)
>> if {1} {
>> PME yes
>> PMEGridSizeX 50
>> PMEGridSizeY 50
>> PMEGridSizeZ 65
>> }
>>
>>
>> # Constant Temperature Control
>> langevin on ;# do langevin dynamics
>> langevinDamping 1 ;# damping coefficient (gamma) of 5/ps
>> langevinTemp $temperature
>>
>> # Constant Pressure Control (variable volume)
>> if {0} {
>> useGroupPressure yes ;# needed for 2fs steps
>> useFlexibleCell yes ;# no for water box, yes for membrane
>> useConstantArea no ;# no for water box, yes for membrane
>>
>> langevinPiston on
>> langevinPistonTarget 1.01325 ;# in bar -> 1 atm
>> langevinPistonPeriod 200.
>> langevinPistonDecay 50.
>> langevinPistonTemp $temperature
>> }
>>
>>
>> restartfreq 1000 ;# 1000steps = every 2ps
>> dcdfreq 1000
>> xstFreq 1000
>> outputEnergies 50
>> outputPressure 50
>>
>>
>> # Fixed Atoms Constraint (set PDB beta-column to 1)
>> if {1} {
>> fixedAtoms on
>> fixedAtomsFile dmpcf.pdb
>> fixedAtomsCol B
>> fixedAtomsForces on
>> }
>>
>> #############################################################
>> ## EXTRA PARAMETERS ##
>> #############################################################
>>
>> # Put here any custom parameters that are specific to
>> # this job (e.g., SMD, TclForces, etc...)
>>
>> #############################################################
>> ## EXECUTION SCRIPT ##
>> #############################################################
>>
>> # Minimization
>> if {1} {
>> minimize 1000
>> reinitvels $temperature
>> }
>>
>> run 250000 ;# 0.5 ns
>>
>

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2013 - 23:23:01 CST