Previous Thread
Next Thread
Print Thread
#38029 08/12/20 06:58 AM
Joined: Oct 2017
Posts: 42
R
Rohit Offline OP
Forum Member
OP Offline
Forum Member
R
Joined: Oct 2017
Posts: 42
Hello everyone,

Below is the script I am using for force calculation. I have the following questions.

1. I want to write the forces of all frames into a single file? How do I do it append does not work?
2. Both "TEST FIRST" and "COOR FORCE COMP" gives the same values but later is faster so which would you recommend?
3. Should I use UPDATe keyword in the loop before "COOR FORCE COMP"?

Code
 NBOND CUTNB @ctl CUTIM @ctl CTOFnb @rc CTONnb @ci -
       atom vatom vdistance                        -
       VSWITCH  SHIFT  CDIE eps 1.0  e14fac 1.0  wmin 1.5

 ! ENERGY

!================================================================                         
!Set up for reading coordinate sets from the trajectory and writing data                      
!================================================================      
OPEN READ UNIT 51 FILE NAME ./prod/diala_recen.dcd
TRAJECTORY QUERY UNIT 51
OPEN UNIT 12 WRITE CARD NAME ./anal/forces/all_forces.dat

calc nstop = ?NFILE             ! last step = number of frames * runs per frame * steps per run

TRAJECTORY FIRSTU 51 NUNIT 1 IREAD BEGIN 0 STOP ?NFILE

SET frame 0
LABEL TimeFrame

TRAJ READ
ENERGY

DEFINE FATOMS SELE SEGID PRT END
! TEST FIRST TOL 0.00000001 UNIT 12 CRYSTAL SELE FATOMS END

COOR FORCE COMP 
WRITE COOR CARD UNIT 12 COMP SELE FATOMS END
* title
*

! CLOSE UNIT 12
increment frame
if frame .LT. 10 GOTO TimeFrame         !!!! small run to check that script runs correctly
! if frame .LT. ?NFILE GOTO TimeFrame

STOP

Thank-you,
Regards,
Rohit

Joined: Sep 2003
Posts: 4,883
Likes: 12
Forum Member
Offline
Forum Member
Joined: Sep 2003
Posts: 4,883
Likes: 12
1. WRITE COOR cannot append to an existing file. You can use the CHARMM SYSTEM command to concatenate this file to an existing file, something like SYSTTEM "cat single_focec.dat >> all_forces.dat"
2. Use COOR FORCE COMP. TEST FIRST is a command for testing (and does more than just compute the force, so is slow).
3. The ENERGY command should do an update, which is necessary.


Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden
Joined: Oct 2017
Posts: 42
R
Rohit Offline OP
Forum Member
OP Offline
Forum Member
R
Joined: Oct 2017
Posts: 42
Thank you for the SYSTEM command suggestion. It's nice to have it in CHARMM.


Moderated by  lennart, rmv 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Release build 20201027)
Responsive Width:

PHP: 7.3.31-1~deb10u5 Page Time: 0.013s Queries: 20 (0.010s) Memory: 0.7380 MB (Peak: 0.7832 MB) Data Comp: Off Server Time: 2023-12-10 18:02:05 UTC
Valid HTML 5 and Valid CSS