From owner-nwchem-users@emsl.pnl.gov Fri Dec 12 02:22:10 2008 Received: from odyssey.emsl.pnl.gov (localhost.pnl.gov [127.0.0.1]) by odyssey.emsl.pnl.gov (8.14.1/8.14.1) with ESMTP id mBCAM9vT000823 for ; Fri, 12 Dec 2008 02:22:10 -0800 (PST) Received: (from majordom@localhost) by odyssey.emsl.pnl.gov (8.14.1/8.14.1/Submit) id mBCAM9rK000822 for nwchem-users-outgoing-0915; Fri, 12 Dec 2008 02:22:09 -0800 (PST) X-Authentication-Warning: odyssey.emsl.pnl.gov: majordom set sender to owner-nwchem-users@emsl.pnl.gov using -f X-Ironport-SG: OK_Domains X-Ironport-SBRS: 2.9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgDABjKQUmNDoMPgWdsb2JhbACBbJFlAQEWIq93CYtMAYFygQiDcw X-IronPort-AV: E=Sophos;i="4.36,210,1228118400"; d="awk'?scan'208";a="87457641" Message-ID: <49423B48.9060700@fhi-berlin.mpg.de> Date: Fri, 12 Dec 2008 11:22:00 +0100 From: Erik McNellis User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: "Michael E. Green" CC: nwchem-users@emsl.pnl.gov Subject: Re: [NWCHEM] xyz coord output References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------020000070903050903080601" X-Seen-By: PP&B-Host divok X-PMX-Version: 5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.12.12.101016 X-PPB-Spam: Gauge=, Probability=0% Sender: owner-nwchem-users@emsl.pnl.gov Precedence: bulk This is a multi-part message in MIME format. --------------020000070903050903080601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Dear Michael, dear List, going through that script I sent you, I realize it is both messy and a little buggy. I've attached a rewrite that ought to be easier to follow, and hopefully works better. Cheers, Erik Michael E. Green wrote: > Hello, > We have been having the following problem for the last two days: > with the input file below, we have not gotten the xyz coordinate output > file. However, we need this file to avoid having the coords accompanied > by a great deal of additional information that must be deleted in order > to use the file for other purposes. The input file (below) does request > xyz in the driver module. What is it necessary to do to get the xyz > output file again? Thanks. > Mike Green > > scratch_dir /scratch > permanent_dir /dtemp/green/ > > title "T75-26WK-D-6-31-1.nw" > memory 3250 mb > > start T75-26WK-D-6-31-1.nw > echo > > charge 1 > geometry NOAUTOZ > N -0.01228824 7.88135837 3.44936907 > C -0.78994374 6.66611877 3.46155942 > C -0.41143778 5.77756376 2.28635511 > O -0.92678822 4.64707732 2.15234490 > C -2.30684816 6.94964249 3.41864340 > O -2.45944720 7.79451989 2.26053940 > C -2.79671456 7.62616513 4.69433256 > H -0.45713025 8.65428134 3.00564982 > H 0.52075547 8.11278319 4.25477447 > H -0.57470783 6.08837954 4.35282902 > H -2.83455185 6.01932645 3.25830142 > H -3.35124403 8.07818353 2.09247703 > H -3.86897365 7.92855141 4.64240260 > H -2.13542425 8.49041228 4.93840264 > H -2.69781738 6.88594277 5.52195814 > N 0.47990038 6.25997958 1.42858572 > C 0.83178954 5.63653247 0.15896459 > > > > > O -3.05804621 0.73924838 1.66982279 > H -3.69533502 0.03077912 1.52687815 > H -2.94841634 1.27900251 0.87374125 > O 4.17255579 -4.33698943 2.55107517 > H 4.41242372 -3.63455161 3.19767990 > H 4.28506827 -4.05660200 1.65183532 > O 1.51465120 -2.55366530 7.60084770 > H 1.10982749 -3.18922980 7.00524335 > H 0.84193721 -1.91203327 7.82841214 > end > constraints > fix atom 1 7 8 9 13 14 15 31 37 38 39 43 44 45 61 67 68 69 73 74 75 > 91 97 98 99 103 104 105 > end > > basis > * library "6-31G" > end > driver > maxiter 888 > xyz T75-26WK-D-6-31-1 > end > > scf > rhf;singlet > maxiter 50 > print kinetic_energy > direct > end > > task scf optimize > > > ********************** > Michael E. Green > Professor of Chemistry > City College of New York > 160 Convent Avenue > New York NY 10031 > (212)650-6034 > (212)650-6107 (fax) > green@sci.ccny.cuny.edu -- -------------------------------------------------------------------- Erik McNellis phone : ++49-30-8413 4817 Fritz-Haber-Institut fax : ++49-30-8413 4701 der Max-Planck-Gesellschaft Faradayweg 4-6 e-mail: mcnellis@fhi-berlin.mpg.de D-14 195 Berlin-Dahlem / Germany -------------------------------------------------------------------- WWW: http://www.fhi-berlin.mpg.de/th/th.html ----------------------key:1-0.0735-11600-23.05:fhi------------------ --------------020000070903050903080601 Content-Type: text/plain; x-mac-type="534D4C64"; x-mac-creator="534D554C"; name="nw_print_geometry.awk" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nw_print_geometry.awk" #!/bin/awk -f BEGIN{ if(ARGC < 2 || (ARGV[2] == "-h" || ARGV[2] == "--help")){ print "\nnw_print_geometry.awk:\n" print "Awk script printing geometries found in an NWChem output file.\n" print "With the optional variable 'select'={|'all'}, geometry number" print "n or all geometries are printed. The optional variable 'unique'=<'T'>," print "when set, makes the script only print the symmetry unique atoms." print "The optional variable 'print_to'<=string> prints geometries" print "to XYZ files named '_.xyz'." print "By default, all atoms of the last geometry found are printed" print "to standard output.\n" print "Example: nw_print_geometry.awk select=all unique=T print_to=myfile h2o.out\n" help = "T" exit 1 } step = geom_no = -1 outfile = "/dev/stdout" uniq = "F" } function skip_lines(n_to_skip) { for (skipped_lines=1;skipped_lines<=n_to_skip;skipped_lines++) {getline} } function print_geometry() { if ((step == -1 || uniq == "F")) { print natoms > outfile } else { print n_unique > outfile } if (step >= 0){ print "Geometry optimization step number "step > outfile } else { print "Initial geometry; all atoms" > outfile } for (k=1;k<=natoms;k++){ if ((step == -1 || uniq == "F") || (k in symm_unique_atoms)) { printf("%-2s %14.8f %14.8f %14.8f\n",\ e[k],x[k],y[k],z[k]) > outfile } } } $0 ~ "Symmetry unique atoms" { if (unique) {uniq = "T"} skip_lines(2) n_unique = 0 while (NF) { for (i=1;i<=NF;i++) {n_unique++; symm_unique_atoms[$i] = "T"} getline } } $1 == "Step" && NF == 2 {step = $2} $1 == "Geometry" && $3 == "->" { skip_lines(5) if ($0 ~ "No. Tag Charge") { geom_no++ if (print_to) {outfile = sprintf("%1s_%04d.xyz",print_to,geom_no)} skip_lines(2) while (NF){ natoms = $1 e[natoms] = $2 x[natoms] = $4 y[natoms] = $5 z[natoms] = $6 getline } if (select != "" && (select == geom_no || select == "all")) { print_geometry() } } } END{ if (help != "T" && select == "" ) {print_geometry()} } --------------020000070903050903080601--