| 查看: 2761 | 回复: 24 | |||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | |||
[求助]
homo和lumo批量提取的脚本
|
|||
最近在弄一批分子,一万个左右 ,想提取其中的homo和lumo能量值,但是发现很难实现,因为才接触脚本半年,还是自学的,所以搞不定了,有哪位大侠给个小脚本?我只会一点shell,提取个Energy还行,homo和lumo不好提取,若可以分享一下不胜感激!![]() ![]() |
» 猜你喜欢
华南师范大学广州市光谱分析与功能探针重点实验室诚招青年英才和博士后岗位研究人员
已经有11人回复
华南师范大学广州市光谱分析与功能探针重点实验室诚招青年英才和博士后岗位研究人员
已经有10人回复
物理化学论文润色/翻译怎么收费?
已经有111人回复
200年来人们一直无法破解的难题: 气液临界点状态方程
已经有7人回复
关于引力延迟下双星系统角动量不守恒的疑惑---求高手解答!
已经有10人回复
求标准卡片Cu0.4In0.4Zn1.2S2 PDF#32-0340
已经有2人回复
请问四氢呋喃溶解的聚合物用甲醇沉淀时,如何使沉淀过程加速?
已经有2人回复
量子点电致发光器件(QLED):蓝光量子点(QDs)和纳米氧化锌电子传输材料
已经有0人回复
需要一个圆偏振光诱导化学反应,请问使用圆偏振光作为光源,应该需要哪些设备搭建
已经有0人回复
» 本主题相关商家推荐: (我也要在这里推广)

|
再来个Fortran PROGRAM HOLU2 ! ! Program to extract HOMO and LUMO data from multiple Gaussian output files ! SRK 2011/06/30 ! SRK 2011/10/18 Modified to produce 3 output files, bug fix ! ! Input : A file containing a list of filenames, one per line ! Output: One line per input filename, 3 columns, holding the filename, the HOMO and the LUMO ! Input filename, HOMO and LUMO are written to file 'HOMOandLUMO.txt' ! HOMO is written to file 'HOMO.txt' ! LUMO is written to file 'LUMO.txt' ! IMPLICIT NONE ! Variable declarations INTEGER, PARAMETER :: inunit=22, listunit=23 ! Unit numbers for input files and list file INTEGER, PARAMETER :: hlunit=24, hunit=25, lunit=26 ! Unit numbers for output files INTEGER :: i ! Loop variable INTEGER :: n ! Number of characters in current line INTEGER :: stat ! Holds the current state of the input file, 0=OK INTEGER :: numfiles ! Number of filenames detected in the input INTEGER :: blockflag ! Flag variable to find the correct HOMO-LUMO data CHARACTER (LEN=100) :: listname ! File containing the list of filenames to be processed CHARACTER (LEN=100) :: inpfile ! Current input filename CHARACTER (LEN=100) :: line ! Current line in the input file CHARACTER (LEN=100) :: prevline ! Previous line in the input file CHARACTER (LEN=9) :: homostring, lumostring ! Strings containing the HOMO/LUMO eigenvalues ! ! Executable code WRITE (*,*) 'HOLU - a program to extract HOMO and LUMO data' WRITE (*,*) 'Enter the name of an input file containing a list of filenames (no blank lines!)' READ (*,'(A)') listname OPEN(listunit,FILE=listname) ! ! Find out how many files are in the list numfiles = 0 stat = 0 DO READ(listunit,'(A)',iostat=stat) line IF (stat /= 0) EXIT numfiles = numfiles + 1 END DO CLOSE(listunit) WRITE (*,*) 'Detected ',numfiles,' lines in list file' ! ! Open output files OPEN(hlunit,FILE='HOMOandLUMO.txt') OPEN(hunit,FILE='HOMO.txt') OPEN(lunit,FILE='LUMO.txt') ! Now loop over these files OPEN(listunit,FILE=listname) DO i = 1, numfiles READ(listunit,'(A)') inpfile OPEN(inunit,file=TRIM(inpfile)) blockflag = 0 ! ! Search for the needed information in the input file prevline = '' DO READ(inunit,FMT='(A)',IOSTAT=stat) line ! Read in the next line of the file using '(A)' format IF (stat /= 0 ) EXIT IF (index(line,'Alpha virt.') > 0 ) THEN ! found a line listing virtual states IF (blockflag == 0) blockflag = 1 IF (blockflag == 2) THEN ! we have found the second block lumostring = line(30:40) ! first number on this line n = len_trim(prevline) homostring = prevline(n-8:n) ! last number on previous line WRITE(*,*) TRIM(inpfile),' ', 'HOMO', ' ', homostring,' ', 'LUMO', ' ', lumostring WRITE(hlunit,'(A),(A),(A),(A)') TRIM(inpfile),' ', 'HOMO', ' ', homostring,' ', 'LUMO', ' ', lumostring WRITE(hunit,'(A)') TRIM(inpfile),' ', 'HOMO', ' ', homostring WRITE(lunit,'(A)') TRIM(inpfile),' ', 'LUMO', ' ', lumostring EXIT END IF ELSE IF (blockflag == 1) blockflag = 2 END IF prevline = line END DO CLOSE(inunit) END DO ! Close all files that are still open CLOSE(listunit) CLOSE(hlunit) CLOSE(hunit) CLOSE(lunit) ! END PROGRAM HOLU2 这是source code,需要编译。 编译后,`ls -l *.log | awk '{print $9}' > file_list 再运行编译后的程序,输入文件就是file_list。所有的输出结果都显示在屏幕上,可以拷入txt文档,进行后续的计算。 |
24楼2011-12-12 13:37:45

2楼2011-12-06 14:11:26
![]() ![]() |
3楼2011-12-07 11:23:16
abbott
金虫 (著名写手)
不要用QQ问我东西
- 应助: 16 (小学生)
- 金币: 1071.6
- 散金: 2787
- 红花: 10
- 帖子: 1015
- 在线: 105.2小时
- 虫号: 452267
- 注册: 2007-11-05
- 性别: GG
- 专业: 计算机硬件技术

4楼2011-12-08 10:57:14








回复此楼

