Re: c-shell into NAMD configuration file

From: nordgren_at_sas.upenn.edu
Date: Wed Jun 15 2005 - 09:23:20 CDT

Ioana (and list) --

The thing is, when you use "exec" it spawns a subshell, and so invoking "env"
or "setenv" will only set variables within that subshell; in other words,
once that exec command finishes, those variables are gone.

I think the simpler way to do what you want would be something like this:

set DIR [exec sh -c {date +%m_%d_%H_%M_%y}]
exec mkdir $DIR

I haven't tested this, but hopefully it will be helpful...

- Erik

C. Erik Nordgren, Ph.D.
Department of Chemistry
University of Pennsylvania

Quoting Ioana Cozmuta <ioana73_at_gmail.com>:

> Hi,
> I am trying to set in the NAMD configuration file the name of the
> directory
> where the output files generated by NAMD will be written. However the exec
> command does not seem to be recognized by NAMD.
> Any suggestion?
> I am including below the test configuration file.
> Thank you,
> Ioana
> ******************************************************
> #Configuration file for NAMD, NVT run trying to heat up a water box
> #from 0K to 300K
>
> exec sh -c {setenv DIR `date +%m_%d_%H_%M_%y`}
> exec sh -c {mkdir $DIR}
>
> exec sh -c {echo $DIR}
> set inputname test1
> set outputname test2
>
> # initial config
> exclude scaled1-4
> 1-4scaling 0.8333 #=1/1.2 from Amber
> scnb 2.0 #this is for the van der waals
> amber on
> parmfile ../test.prmtop
> coordinates ../test/$inputname.coor
> velocities ../test/$inputname.vel
> extendedSystem ../test/$inputname.xsc
>
> restartfreq 1000
> outputEnergies 50
> outputTiming 1000
> xstFreq 1000
> dcdFreq 50
> outputname ./$DIR/$outputname.out
> restartname ./$DIR/$outputname.restrt
> binaryrestart no
> binaryoutput no
> DCDfile ./$DIR/$outputname.dcd
> COMmotion no
>
> switching on
> switchdist 8
> cutoff 9.5
> pairlistdist 10.0
>
> #Amber uses rigid water and SHAKE H-bonds.
> rigidBonds all
>
> timestep 1
>
> nonBondedFreq 2
> fullElectFrequency 4
> stepsPerCycle 20
>
> fixedAtoms on
> fixedAtomsForces on
> fixedAtomsFile ../fix.pdb
> fixedAtomsCol B
>
> # full electrostatics
> Pme on
> PmeGridSizeX 32
> PmeGridSizeY 32
> PmeGridSizeZ 32
>
> # protocol params
> numsteps 20000
>

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 05:18:49 CST