I was able to print the charges with the following sander input file. Set imin=6, nstlim=1, dt=0.0, ntpr=1 in the &cntrl namelist, and set printcharges=1 in the &qmmm namelist. An example input file is shown below.
The imin=5 option will run each frame through the minimizer. The imin=6 option will run each frame through the MD routine. When sander is run with nstlim=0, it will evaluate a single point energy calculation; however, the MD subroutine will only print the charges if the MD step is >= 1. Therefore, the trick is to set nstlim=1 so it will take one step of dynamics, but I also set the timestep to zero, dt=0.0, so it won't move the atoms. By setting dt=0.0 and nstlim=1, the kinetic energy will appear as "not a number" NaN. This is expected — just ignore it. You can easily verify that the potential energy is unaffected by comparing it with dt=0.0,nstlim=0. By setting imin=6, one achieves the exact same effect as having used cpptraj to write each frame of the trajectory as a restart file and then running sander with imin=0 on each restart file.
Note that if your input trajectory does NOT contain velocity information (one can store velocities in the trajectory file during dynamics with ntwv=-1), then set irest=0,ntx=1 when using imin=6. If the velocity information IS stored in the input trajectory file, you could set irest=1,ntx=5 when using imin=6 if desired.
I'll have to make time to see if I can reproduce what your other observations, but I don't have the bandwidth at the moment.
Here is the input that I used for a periodic system.
title
&cntrl
irest = 0 ! 0 = start, 1 = restart
ntx = 1 ! 1 = start, 5 = restart
ntxo = 1 ! read/write rst as formatted file
iwrap = 0 ! wrap crds to unit cell
ioutfm = 1 ! write mdcrd as netcdf
ntpr = 1 ! mdout print freq
ntwx = 0 ! mdcrd print freq
ntwr = 1000000 ! rst print freq
ntwv = 0
nstlim = 1 ! number of time steps
imin = 6
dt = 0.0 ! ps/step
ntb = 1 ! 1=periodic box
temp0 = 0 ! target temp
ntt = 0 ! nve=0
ntp = 0 !0=off 1=isotropic scaling
ntc = 2 ! 1=no shake, 2=HX constr, 3=all constr
ntf = 2 ! 1=cpt bond E, 2=ignore HX, 3=ignore all
!noshakemask=':1'
cut = 10.
ig = 1010
ifqnt = 1
/
&qmmm
qm_theory = 'DFTB'
qmmask = ':1'
qmcharge = 0
spin = 1
dftb_disper = 1
qmshake = 0
qm_ewald = 1
qmmm_switch = 1
scfconv = 1.e-10
verbosity = 0
tight_p_conv = 1
diag_routine = 0
pseudo_diag = 1
dftb_maxiter = 100
printcharges = 1 !!!! print charges
/
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Mar 26 2025 - 09:30:02 PDT