vim命令备忘
先在shell中 gvim *.txt再
:silent! argdo! set fileencoding=utf-8 | update
但是反过来都转cp936,可能就不行。
在未删奇数行的前提下批量替换偶数行的内容。
execute "normal G"
let total_line=line(".")
"get the last line number
execute "normal gg"
for a in range(total_line/2)
normal j
"s/、/,/ge
s/みっちゃん/小美/ge
s/みっちゃん/小美/ge
s/美絵ちゃん/小美绘/ge
s/美絵/美绘/ge
s/\(.*\)」/\1/ge
s/\(「.*\)/\1」/ge
"first delete the last 」 if there exists one, then add 」 at the end if there is a 「 at first.
"this is OK for most lines except those like this
"「XXXXX
"XXXXX
"XXXXXX」
normal j
endfor
"back to the 1st line and replace even lines(which contain chinese)
编译GAMESS(US)
配置gamess
GAMESS(不是GAMES)的简介:
https://en.wikipedia.org/wiki/GAMESS_(US)
GAMESS的source
code是可以免费取得的,不过在distribution上有限制,所以不叫自由开源。在以下页面填入自己的邮件地址取得下载密码:
http://www.msg.chem.iastate.edu/GAMESS/download/register/
这里有一个说明:
http://www.msg.chem.iastate.edu/GAMESS/download/dist.source.shtml
需要安装
- sudo aptitude install tcsh gfortran
- sudo aptitude install libatlas-base-dev
解压缩
- tar -xzvf gamess-current.tar.gz
遵循gamess/machines/readme.unix的指示。不过注意:有个选择gfortran版本的地方,即使是4.7的gfortran也请选择输入4.6。看./config的代码可知:
- switch ($GMS_GFORTRAN_VERNO)
- case 4.1:
- case 4.2:
- case 4.3:
- case 4.4:
- case 4.5:
- echo " Alas, your version of gfortran does not support REAL*16,"
- echo " so relativistic integrals cannot use quadruple precision."
- echo " Other than this, everything will work properly."
- breaksw
- case 4.6:
- echo " Good, the newest gfortran can compile REAL*16 data type."
- breaksw
- default:
- echo "The gfortran version number is not recognized."
- echo "It should only have one decimal place, such as 4.x"
- exit 4
- breaksw
之后有个选择math library的地方,选择atlas。填入libatlas.so所在地(/usr/lib/atlas-base)。
编译DDI
- cd ddi
- ./compddi >& compddi.log
- mv ddikick.x ..
编译
- cd ..
- ./compall >& compall.log
链接
- ./lked gamess 01 >& lked.log
这个时候要改一下内核shmget的数值:
- sudo vim /etc/sysctl.conf
加入:
- kernel.shmmax = 3064372224
- kernel.shmall = 748137
For example, on a machine with 4GB of memory, you might add these to /etc/sysctl.conf:
- # cat /etc/sysctl.conf | grep shm
- kernel.shmmax = 3064372224
- kernel.shmall = 748137
Then set the new settings like so:
- # sudo sysctl -p
Since they are in /etc/sysctl.conf, they will automatically be set each time the system is booted.
rungms开头部分改为
- mkdir /tmp/$USER
- set TARGET=sockets
- set SCR=/tmp/$USER
- set USERSCR=~$USER/scr
- set GMSPATH=~$USER/git/gamess
另外
NCPUS
改成你计算机有的核心数目。
- if (null$NCPUS == null) set NCPUS=2
并在
- if ($NCPUS > 1) then
- switch (`hostname`)
一段后加入你的hostname作为case选择支之一。
- case athlonX2:
- if ($NCPUS > 2) set NCPUS=2
- set NNODES=1
- set HOSTLIST=(`hostname`:cpus=$NCPUS)
- breaksw
然后测试。
- ./runall 01 >& runall.log &
之后
- gvim exam*
查看运行成果。
可以使用avogadro生成GAMESS的输入文件。
- sudo aptitude install avogadro
执行使用:
- ~/git/gamess/rungms SF6.inp 01 2 > SF6.log
- yx@athlonX2 ~/git/gamess % cd ~/gamess
- yx@athlonX2 ~/gamess % ~/git/gamess/rungms SF6.inp 01 2 > SF6.log
- mkdir: cannot create directory `/tmp/yx': File exists
- cp SF6.inp /tmp/yx/SF6.F05
- unset echo
- /home/yx/git/gamess/ddikick.x /home/yx/git/gamess/gamess.01.x SF6 -ddi 1 2 athlonX2:cpus=2 -scr /tmp/yx