# # task 2.2 C2H4 bond strength # # the initial deltax of C, C, H, H # and increment delta # dist_hcx=0.560 dist_cc0=1.324 delta=0.002 # # loads the functions # this script uses the functions: m_change m_replace m_getcolumn m_sum m_list # module load new cp2k #. ~/Scripts/myfunctions.bash . /cluster/apps/courses/mmm/m_functions.bash # # deletes old output file # rm curve.amber.c2h4 # # loop over all values of n # for n in `m_list -5 5` do dist_cc=`m_change $dist_cc0 $n $delta` c2=`m_sum $dist_hcx $dist_cc` h3=`m_sum $c2 $dist_hcx ` # # replaces coordinates in the input # m_replace _C1_ $dist_hcx < c2h4.inp.templ | m_replace _C2_ $c2 | m_replace _H3_ $h3 > c2h4.$dist_cc.inp # # Runs cp2k # echo RUNNING cp2k with the input c2h4.$dist_cc.inp cp2k.popt -i c2h4.$dist_cc.inp > c2h4.$dist_cc.out # # gets the energy from the output (in a.u.) # energy=` m_getcolumn 'ENERGY|' 9 < c2h4.$dist_cc.out ` echo $dist_cc $energy >> curve.amber.c2h4 # # loop over n # done # # Cleaning... # mkdir Logs mv c2h4.*.inp c2h4.*.out Logs rm RUN* *restart*