#############################################################
## JOB DESCRIPTION                                         ##
#############################################################
# Min. and Eq. 
#
#
#############################################################
## ADJUSTABLE PARAMETERS                                   ##
#############################################################

structure          4m9p_ionized.psf
coordinates        4m9p_ionized.pdb
outputName         4m9p_ionized_minEqu

set temp           298

# Continuing a job from the restart files
if {0} {
set inputname      4m9p_ionized_minEqu
binCoordinates     $inputname.restart.coor
binVelocities      $inputname.restart.vel  ;# remove the "temperature" entry if you use this!
extendedSystem	   $inputname.restart.xsc
} else {
 temperature       $temp
}

firsttimestep      0      

#############################################################
## SIMULATION PARAMETERS                                   ##
#############################################################

# Input
paraTypeCharmm	    on
parameters          toppar_water_ions_namd.str
parameters          toppar_all36_carb_glycopeptide.str
parameters          par_all36_lipid.prm
parameters          par_all36_na.prm
parameters          par_all36_prot.prm
parameters          par_all36_carb.prm
parameters          par_all36_cgenff.prm

# Periodic Boundary Conditions
# NOTE: Do not set the periodic cell basis if you have also 
# specified an .xsc restart file!
if {1} { 
cellBasisVector1   74.680   0.   0.
cellBasisVector2     0.  74.627  0.
cellBasisVector3     0.    0.  93.86799
cellOrigin          -1.3204  -1.0991  0.2056
}
wrapAll             on

#PME (for full-system periodic electrostatics)
if {1} {
PME                yes
PMEGridSizeX       128
PMEGridSizeY       128
PMEGridSizeZ       128
}
margin 5

# Force-Field Parameters
exclude             scaled1-4
1-4scaling          1.0
cutoff              12.
switching           on
switchdist          10.
pairlistdist        13.5

# Integrator Parameters
timestep            2.0  ;# 2fs/step
rigidBonds          all  ;# needed for 2fs steps
nonbondedFreq       1
fullElectFrequency  2  
stepspercycle       20

# Constant Temperature Control
langevin            on    ;# dont langevin dynamics
langevinDamping     1     ;# damping coefficient (gamma) of 5/ps
langevinTemp        $temp

# Constant Pressure Control (variable volume)
if {0} {
useGroupPressure      yes ;# needed for 2fs steps
useFlexibleCell       no  ;# 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    $temp
}

restartfreq        2500     ;# 1000steps = every 2ps
dcdfreq            2500
xstFreq            2500
outputEnergies     2500
outputPressure     2500

#############################################################
## EXECUTION SCRIPT                                        ##
#############################################################

# Minimization. turn off when rerstarting a simulation
if {1} {
minimize            10000
reinitvels          $temp
}
run 500000 ;# 1 ns


