From: Frank <fra...@gm...> - 2012-02-18 22:46:10
|
Hi, folks. I finally nailed it down. Here is the root problem: cclib (the current released version) cannot parse the log file of system with natom >= 100. In the log file for the Eigenvalues/MOs: 518 H 98 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 519 C 99 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 520 C 99 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 521 C 99 X -0.000000 0.000000 -0.000000 -0.000000 -0.000000 522 C 99 Y -0.000000 0.000000 -0.000000 -0.000000 -0.000000 523 C 99 Z -0.000000 0.000000 -0.000000 -0.000000 -0.000000 524 H 0 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 525 H 1 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 526 C 2 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 The number of atoms are recorded as 0, 1, ..., instead of 100/200/..., 101/201/..., which is however problematic in calculating CSPA. My resolution is: introducing a switch to monitor this change. The corresponding code, in gamessparser.py is partially copied in the following: LINE 714: p = re.compile("(\d+)\s*([A-Z][A-Z]?)\s*(\d+)\s*([A-Z]+)") oldatom ='0' i_atom = 0 #couter to translate to 0s to some hundreds, by C.W. flag_w = True #Flag to whether for i in range(self.nbasis): line = inputfile.next() # If line is empty, break (ex. for FMO in exam37). if not line.strip(): break # Fill atombasis and aonames only first time around if readatombasis and base == 0: aonames = [] start = line[:17].strip() m = p.search(start) if m: g = m.groups() g2 = int(g[2]) #atom index from GAMESS's log file if g2 == 0 and flag_w: #c.w. i_atom = i_atom + 100 #c.w flag_w = False if g2 != 0: flag_w = True g2 = g2 + i_atom #c.w. aoname = "%s%s_%s" % (g[1].capitalize(), str(g2), g[3]) #c.w. # aoname = "%s%s_%s" % (g[1].capitalize(), g[2], g[3]) oldatom = str(g2) #c.w. atomno = g2 - 1 #c.w. # oldatom = g[2] # atomno = int(g[2])-1 orbno = int(g[0])-1 else: # For F orbitals, as shown above g = [x.strip() for x in line.split()] g2 = int(g[2]) #atom index from GAMESS's log file if g2 == 0 and flag_w: #c.w. i_atom = i_atom + 100 #c.w. flag_w = False #c.w. if g2 != 0: #c.w. flag_w = True #c.w. g2 = g2 + i_atom #c.w. # aoname = "%s%s_%s" % (g[1].capitalize(), oldatom, g[2]) aoname = "%s%s_%s" % (g[1].capitalize(), oldatom, str(g2)) atomno = int(oldatom)-1 orbno = int(g[0])-1 self.atombasis[atomno].append(orbno) self.aonames.append(aoname) coeffs = line[15:] # Strip off the crud at the start. j = 0 while j*11+4 < len(coeffs): self.mocoeffs[0][base+j, i] = float(coeffs[j * 11:(j + 1) * 11]) j += 1 line = inputfile.next() Enjoy! Best. Frank On Fri, Jan 13, 2012 at 2:20 AM, Chengju Wang <fra...@gm...>wrote: > Hi, Adam and other folks. > > Attached please find the requested file, which was given by > " > >>> f=open("aonames.txt",'w') > >>> import pickle > >>> pickle.dump(ps.aonames,f) > >>> f.close() > " > following the previous email. > > By tail this file, one will get > " tail aonames.txt > p3711 > aS'H40_S' > p3712 > aS'H40_X' > p3713 > aS'H40_Y' > p3714 > aS'H40_Z' > p3715 > a." > > This file is incomplete. I think this is problem but I don't how to solve > it. :P > > thanks for your attention. > > Best. > > Chengju > > > On Wed, Jan 4, 2012 at 3:24 PM, Adam Tenderholt <ate...@gm...>wrote: > >> Hi Chengju, >> >> Sorry for the late reply. Your error is a bit odd, and I'm not sure >> where the code is failing. Can you send us the aonames parsed by >> cclib? If that's not available, send fonames. >> >> Cheers, >> >> Adam >> >> >> On Thu, Dec 29, 2011 at 9:30 PM, Chengju Wang >> <fra...@gm...> wrote: >> > Dear all. >> > >> > I hope someone here can help me to analysis my GAMESS log file. Thank >> you. >> > >> > I tried to use cclib to extract the pdos, but have met with >> the following >> > problem. >> > >> > >>> from cclib.parser import GAMESS >> > >>> from cclib.method import CSPA >> > >>> s=GAMESS("test.log") >> > >>> ps=s.parse() >> > [GAMESS test.log INFO] Creating attribute atomcoords[] >> > [GAMESS test.log INFO] Creating attribute atomnos[] >> > [GAMESS test.log INFO] Creating attribute gbasis[] >> > [GAMESS test.log INFO] Creating attribute nbasis: 2343 >> > [GAMESS test.log INFO] Creating attribute charge: 0 >> > [GAMESS test.log INFO] Creating attribute mult: 1 >> > [GAMESS test.log INFO] Creating attribute homos[] >> > [GAMESS test.log INFO] Creating attribute natom: 340 >> > [GAMESS test.log INFO] Creating attribute aooverlaps[] >> > [GAMESS test.log INFO] Creating attribute scftargets[] >> > [GAMESS test.log INFO] Creating attribute scfvalues[] >> > [GAMESS test.log INFO] Creating attribute scfenergies[] >> > [GAMESS test.log INFO] Creating attribute moenergies[] >> > [GAMESS test.log INFO] Creating attribute mosyms[] >> > [GAMESS test.log INFO] Creating attribute nmo: 2343 >> > [GAMESS test.log INFO] Creating attribute mocoeffs[] >> > [GAMESS test.log INFO] Creating attribute atombasis[] >> > [GAMESS test.log INFO] Creating attribute aonames[] >> > [GAMESS test.log INFO] Creating attribute coreelectrons[] >> > >>> m=CSPA(ps) >> > >>>>>> len(m.fragresults[0]) >> > 2343 >> > >>> len(m.fragresults[0][0]) >> > 204 >> > >> > Why is it not 340 here? >> > >> > >> > Sorry, the log file is too big to be attached. >> > >> > >> > My input key words: >> > >> > $CONTRL SCFTYP=RHF RUNTYP=ENERGY MAXIT=60 MULT=1 $END >> > $CONTRL MOLPLT=.TRUE. PLTORB=.TRUE. NPRINT=3 $END >> > $SYSTEM TIMLIM=525600 MWORDS=9000 $END >> > $BASIS GBASIS=N31 NGAUSS=6 NDFUNC=1 $END >> > $SCF DIRSCF=.TRUE. $END >> > $STATPT OPTTOL=0.0001 NSTEP=2000 $END >> > $DATA >> > >> > There is no such problem found for my testing runs on smaller systems >> > (~100), i.e.: len(m.fragresults[0][0] always equals to natom. >> > >> > >> > >> > ------------------------------------------------------------ >> ------------------ >> > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a >> complex >> > infrastructure or vast IT resources to deliver seamless, secure access >> to >> > virtual desktops. With this all-in-one solution, easily deploy virtual >> > desktops for less than the cost of PCs and save 60% on VDI >> infrastructure >> > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox >> > _______________________________________________ >> > cclib-users mailing list >> > ccl...@li... >> > https://lists.sourceforge.net/lists/listinfo/cclib-users >> > >> > > |