| 查看: 518 | 回复: 0 | ||
[求助]
gaussian计算过程中,生成geom文件出错,如何修改小程序
|
|
各位大牛好!在使用gaussian进行量化计算,用fchk文件生成geom文件时,文件输出总为空白文件,无法得到坐标信息。究其原因,可能是因为服务器升级为gaussian16版本,而生成geom文件的小程序还是以gaussian09版本编写的,请问修改小程序的哪个部分可以解决这个问题呢?以下是小程序的源代码。拜托各位了!!! # -*- coding: cp936 -*- def parse_fchk(fchkfile): f = open(fchkfile,'r') line = f.readline() # geom while True: line = f.readline() if line == '': print 'can not geom' break if line.find('Current cartesian coordinates') != -1: break geom = [] while True: line = f.readline() if line == '': print 'can not geom' break if line.find('Force Field') != -1: break ws = line.strip().split(None) geom += ws lt_xyz = [] s3 = ' '*3 for i in geom: # i = '-9.09973086E-01', i[-3:] = '-01', i[:-4] = '-9.09973086' s = '{:0=+3d}'.format(int(i[-3:]) + 1) s2 = (' {: =10.7f}' + 'E' + s).format(float(i[:-4])/10) s3 = s3 + s2 if len(s3) >= 48: lt_xyz.append(s3 + '\n') s3 = ' '*3 f.close() return lt_xyz def readpara(): lt_smep = [] f = open('dat-input.dat') lines = f.readlines() f.close() lt_5f = [w.strip() for w in lines[5:10]] return lt_5f try: lt_5f = readpara() except: print 'Cound no find dat-input.dat' datfile = raw_input('Please input the name of the fu.dat file : ') f = open(datfile,'wb') for i,v in enumerate(lt_5f): lt_xyz = parse_fchk(v) f.writelines(' rpts ' + str(i+1) + '\n') f.writelines(lt_xyz) f.close() raw_input('completed') |
» 猜你喜欢
PbS量子点如何确定浓度
已经有11人回复
200年来人们一直无法破解的难题: 气液临界点状态方程
已经有7人回复
物理化学论文润色/翻译怎么收费?
已经有68人回复
关于引力延迟下双星系统角动量不守恒的疑惑---求高手解答!
已经有10人回复
已知面上挂了,小学校实验方向无平台,感觉太难了
已经有26人回复
大湾区大学刘天辉课题组招收2026级博士生(与中山大学物理学院联合培养)
已经有22人回复
求助各位大佬,球球了,在这科萨头
已经有0人回复
PbS量子点紫外吸收
已经有0人回复
比利时鲁汶大学与国家留学基金委共同资助博士研究生CSC-KU Leuven PhD Scholarship
已经有0人回复
伦敦大学学院Benjamin Moss博士招收人工智能、原位光谱、催化相关26年博士生
已经有11人回复













回复此楼