From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RIpfL-0007Sn-Pv for garchives@archives.gentoo.org; Tue, 25 Oct 2011 22:40:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B5D1E21C038; Tue, 25 Oct 2011 22:40:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E6EDB21C038 for ; Tue, 25 Oct 2011 22:40:06 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1DEB51B4022 for ; Tue, 25 Oct 2011 22:40:05 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 80A5A80042 for ; Tue, 25 Oct 2011 22:40:04 +0000 (UTC) From: "Reinis Danne" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Reinis Danne" Message-ID: Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/ambertools/files/, sci-chemistry/ambertools/ X-VCS-Repository: proj/sci X-VCS-Files: sci-chemistry/ambertools/ChangeLog sci-chemistry/ambertools/ambertools-1.5-r2.ebuild sci-chemistry/ambertools/files/ambertools-1.5-bugfix_1-21.patch sci-chemistry/ambertools/files/ambertools-1.5-gentoo2.patch sci-chemistry/ambertools/metadata.xml X-VCS-Directories: sci-chemistry/ambertools/files/ sci-chemistry/ambertools/ X-VCS-Committer: rei4dan X-VCS-Committer-Name: Reinis Danne X-VCS-Revision: e8d5143df06530547f5da4bab64f50a271ccb0ca Date: Tue, 25 Oct 2011 22:40:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 6532282c4931a6484c5ccac68b444504 commit: e8d5143df06530547f5da4bab64f50a271ccb0ca Author: Reinis Danne gmail com> AuthorDate: Tue Oct 25 22:29:20 2011 +0000 Commit: Reinis Danne gmail com> CommitDate: Tue Oct 25 22:29:20 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/sci.git;a=3Dc= ommit;h=3De8d5143d sci-chemistry/ambertools: Add bugfixes up to 21, other fixes --- sci-chemistry/ambertools/ChangeLog | 22 + sci-chemistry/ambertools/ambertools-1.5-r2.ebuild | 156 + .../files/ambertools-1.5-bugfix_1-21.patch | 5330 ++++++++++++++= ++++++ .../ambertools/files/ambertools-1.5-gentoo2.patch | 1056 ++++ sci-chemistry/ambertools/metadata.xml | 10 + 5 files changed, 6574 insertions(+), 0 deletions(-) diff --git a/sci-chemistry/ambertools/ChangeLog b/sci-chemistry/ambertool= s/ChangeLog new file mode 100644 index 0000000..08267f6 --- /dev/null +++ b/sci-chemistry/ambertools/ChangeLog @@ -0,0 +1,22 @@ +# ChangeLog for sci-chemistry/ambertools +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ambertools/ChangeLog,v = 1.2 2011/08/02 14:42:37 alexxy Exp $ + +*ambertools-1.5-r2 (25 Oct 2011) + + 25 Oct 2011; Reinis Danne +ambertools-1.5-r2.ebuil= d, + +files/ambertools-1.5-bugfix_1-21.patch, +files/ambertools-1.5-gentoo2= .patch, + +metadata.xml: + Add bugfixes up to bugfix 21, use system byacc, fix arpack unbundling, + respect *FLAGS, remove mpi use, don't build sleap (it is broken), enab= le + tests. + + 02 Aug 2011; Alexey Shvetsov ambertools-1.5-r1.ebu= ild: + Add ~amd64-linux keyword + +*ambertools-1.5-r1 (28 Jul 2011) + + 28 Jul 2011; Alexey Shvetsov +ambertools-1.5-r1.eb= uild, + +files/ambertools-1.5-gentoo.patch, +metadata.xml: + Initial import to tree + diff --git a/sci-chemistry/ambertools/ambertools-1.5-r2.ebuild b/sci-chem= istry/ambertools/ambertools-1.5-r2.ebuild new file mode 100644 index 0000000..39413fd --- /dev/null +++ b/sci-chemistry/ambertools/ambertools-1.5-r2.ebuild @@ -0,0 +1,156 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ambertools/ambertools-1= .5-r1.ebuild,v 1.2 2011/08/02 14:42:37 alexxy Exp $ + +EAPI=3D4 + +inherit eutils fortran-2 toolchain-funcs + +DESCRIPTION=3D"A suite for carrying out complete molecular mechanics inv= estigations" +HOMEPAGE=3D"http://ambermd.org/#AmberTools" +SRC_URI=3D" + AmberTools-${PV}.tar.bz2" + +LICENSE=3D"GPL-2" +SLOT=3D"0" +KEYWORDS=3D"~amd64 ~x86 ~amd64-linux" +IUSE=3D"openmp X" + +RESTRICT=3D"fetch" + +RDEPEND=3D" + virtual/cblas + virtual/lapack + sci-libs/clapack + sci-libs/arpack + sci-libs/cifparse-obj + sci-chemistry/mopac7 + sci-libs/netcdf + sci-libs/fftw:2.1 + sci-chemistry/reduce + virtual/fortran" +DEPEND=3D"${RDEPEND} + dev-util/byacc + dev-libs/libf2c + sys-devel/ucpp" +S=3D"${WORKDIR}/amber11" + +pkg_nofetch() { + einfo "Go to ${HOMEPAGE} and get ${A}" + einfo "Place it in ${DISTDIR}" +} + +pkg_setup() { + fortran-2_pkg_setup + if use openmp; then + tc-has-openmp || \ + die "Please select an openmp capable compiler like gcc[openmp]" + fi + AMBERHOME=3D"${S}" +} + +src_prepare() { + epatch \ + "${FILESDIR}/${P}-bugfix_1-21.patch" \ + "${FILESDIR}/${P}-gentoo2.patch" + cd "${S}"/AmberTools/src + rm -r \ + arpack \ + blas \ + byacc \ + lapack \ + fftw-2.1.5 \ + fftw-3.2.2 \ + c9x-complex \ + cifparse \ + netcdf \ + pnetcdf \ + reduce \ + ucpp-1.3 \ + || die +} + +src_configure() { + cd "${S}"/AmberTools/src + sed -e "s:\\\\\$(LIBDIR)/arpack.a:-larpack:g" \ + -e "s:\\\\\$(LIBDIR)/lapack.a:$(pkg-config lapack --libs) -lclapack:g"= \ + -e "s:\\\\\$(LIBDIR)/blas.a:$(pkg-config blas cblas --libs):g" \ + -e "s:\\\\\$(LIBDIR)/libdrfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfft= w.a:g" \ + -e "s:\\\\\$(LIBDIR)/libdfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfftw= .a:g" \ + -e "s:GENTOO_CFLAGS:${CFLAGS} -DBINTRAJ :g" \ + -e "s:GENTOO_CXXFLAGS:${CXXFLAGS}:g" \ + -e "s:GENTOO_FFLAGS:${FFLAGS}:g" \ + -e "s:GENTOO_LDFLAGS:${LDFLAGS}:g" \ + -e "s:fc=3Dg77:fc=3D$(tc-getFC):g" \ + -e "s:\$netcdflib:$(pkg-config netcdf --libs):g" \ + -e "s:NETCDF=3D\$netcdf:NETCDF=3Dnetcdf.mod:g" \ + -i configure || die + sed -e "s:arsecond_:arscnd_:g" \ + -i sff/time.c \ + -i sff/sff.h \ + -i sff/sff.c || die + sed -e "s:\$(NAB):\$(NAB) -lrfftw:g" \ + -i nss/Makefile || die + + local myconf + + use X || myconf=3D"${myconf} -noX11" + + use openmp && myconf=3D"${myconf} -openmp" + + ./configure \ + ${myconf} \ + -nobintraj \ + -nomdgx \ + -nomtkpp \ + -nopython \ + -nosleap \ + gnu +} + +src_compile() { + cd "${S}"/AmberTools/src + emake || die +} + +src_test() { + cd "${S}"/AmberTools/test + make test || die +} + +src_install() { + rm -r bin/chemistry bin/MMPBSA_mods + rm bin/ante-MMPBSA.py bin/extractFrcmod.py + + for x in bin/* + do dobin ${x} || die + done + + dobin AmberTools/src/antechamber/mopac.sh + sed -e "s:\$AMBERHOME/bin/mopac:mopac7:g" \ + -i "${ED}/usr/bin/mopac.sh" || die + + # Make symlinks untill binpath for amber will be fixed + dodir /usr/share/${PN}/bin + cd "${ED}/usr/bin" + for x in * + do dosym /usr/bin/${x} /usr/share/${PN}/bin/${x} + done + cd "${S}" + + dodoc doc/AmberTools.pdf doc/leap_pg.pdf + dolib.a lib/* + insinto /usr/include/${PN} + doins include/* + insinto /usr/share/${PN} + doins -r dat + cd AmberTools + doins -r benchmarks + doins -r examples + doins -r test + + cat >> "${T}"/99ambertools <<- EOF + AMBERHOME=3D"${EPREFIX}/usr/share/ambertools" + EOF + doenvd "${T}"/99ambertools +} diff --git a/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_1-21.pa= tch b/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_1-21.patch new file mode 100644 index 0000000..911bc4d --- /dev/null +++ b/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_1-21.patch @@ -0,0 +1,5330 @@ +diff -urN amber11.orig/AmberTools/src/configure amber11/AmberTools/src/c= onfigure +--- amber11.orig/AmberTools/src/configure 2011-04-14 15:30:55.000000000 = +0300 ++++ amber11/AmberTools/src/configure 2011-10-25 15:01:28.222288537 +0300 +@@ -650,7 +650,7 @@ + if [ "$cuda" =3D 'yes' -o "$cuda_SPSP" =3D 'yes' -o "$cuda_DPDP" =3D= 'yes' ]; then + pmemd_cu_includes=3D'-I$(CUDA_HOME)/include -IB40C -IB40C/KernelC= ommon' + pmemd_cu_defines=3D'-DCUDA' +- pmemd_cu_libs=3D'-L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib -lcufft = -lcudart ./cuda/cuda.a' ++ pmemd_cu_libs=3D'-L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib -lcurand= -lcufft -lcudart ./cuda/cuda.a' + if [ "$optimise" =3D 'no' ]; then + nvcc=3D'$(CUDA_HOME)/bin/nvcc -use_fast_math -O0 -gencode arch=3D= compute_13,code=3Dsm_13 -gencode arch=3Dcompute_20,code=3Dsm_20' + else +@@ -909,7 +909,7 @@ +=20 + pmemd_cu_includes=3D'-I$(CUDA_HOME)/include -IB40C -IB40C/Kerne= lCommon' + pmemd_cu_defines=3D'-DCUDA' +- pmemd_cu_libs=3D'-L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib -lcuff= t -lcudart ./cuda/cuda.a' ++ pmemd_cu_libs=3D'-L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib -lcura= nd -lcufft -lcudart ./cuda/cuda.a' + if [ "$optimise" =3D 'yes' ]; then + nvcc=3D'$(CUDA_HOME)/bin/nvcc -use_fast_math -O3 -gencode a= rch=3Dcompute_13,code=3Dsm_13 -gencode arch=3Dcompute_20,code=3Dsm_20' + else +@@ -2111,21 +2111,21 @@ + echo "Change to \$AMBERHOME/src/ and type 'make clean' followed by" + echo "'make parallel_win'." + elif [ "$cuda" =3D 'yes' -o "$cuda_SPSP" =3D 'yes' -o "$cuda_DPDP" =3D= 'yes' ]; then +- echo "The next step is to cd to ../../src and type 'make install'" ++ echo "The next step is to cd to ../../src and type 'make $installty= pe'" + else + echo "If you have amber11, the most common next step is to " +- echo "'cd ../../src; make clean; make install'. See the Users' Man= ual" ++ echo "'cd ../../src; make clean; make $installtype'. See the Users= ' Manual" + echo "for information on building a parallel version of AmberTools" + fi + elif [ "$cuda" =3D 'yes' -o "$cuda_SPSP" =3D 'yes' -o "$cuda_DPDP" =3D = 'yes' ]; then +- echo "The next step is to cd to ../../src and type 'make install'" ++ echo "The next step is to cd to ../../src and type 'make $installtype= '" + elif [ "$windows" =3D 'yes' ]; then + echo "The next step is to switch to a dos shell with ifort enabled." + echo "Change to \$AMBERHOME/src/ and type 'make serial_win'." + elif [ "$openmp" =3D 'yes' ]; then + echo "The next step is to type 'make nabonly'" + else +- echo "The next step is to type 'make install'" ++ echo "The next step is to type 'make $installtype'" + fi + echo " " +=20 +@@ -2149,7 +2149,7 @@ + echo " NOTE: after installing AmberTools, if you want to compile" + echo " Amber11 using AmberTools 1.5, you must run the " + echo " AT15_Amber11.py script first, e.g.:" +- echo " cd $AMBERHOME; ./AT15_Amber11.py; make $installtype" ++ echo " cd $AMBERHOME; ./AT15_Amber11.py; cd src; make $install= type" + echo " (See the Amber11 Users' Manual for full instructions," + echo " and be sure to have a backup, since the AT15_Amber11.py= " + echo " script will modify your Amber11 files.)" +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Center.cpp ambe= r11/AmberTools/src/cpptraj/src/Action_Center.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Center.cpp 2011-04-14= 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Center.cpp 2011-10-25 15:0= 1:28.108288642 +0300 +@@ -72,7 +72,7 @@ + // else + // mass =3D NULL; +=20 +- if (!origin && P->ifbox=3D=3D0) { ++ if (!origin && P->BoxType=3D=3D0) { + mprintf(" Error: Center::setup: Box center specified but no box = information.\n"); + //fprintf(stdout," Centering on origin.\= n"); + return 1; +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Closest.cpp amb= er11/AmberTools/src/cpptraj/src/Action_Closest.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Closest.cpp 2011-04-1= 4 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Closest.cpp 2011-10-25 15:= 01:28.108288642 +0300 +@@ -181,8 +181,8 @@ + // NOTE: Should box be figured out from read-in coords? + imageType =3D 0; + if (!noimage) { +- imageType =3D P->ifbox; +- if (P->ifbox=3D=3D0) { ++ imageType =3D P->BoxType; ++ if (P->BoxType=3D=3D0) { + mprintf(" Warning: Closest::setup: "); + mprintf(" Imaging specified but no box information in prmtop %s= \n",P->parmName); + mprintf(" No imaging can occur..\n"); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Distance.cpp am= ber11/AmberTools/src/cpptraj/src/Action_Distance.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Distance.cpp 2011-04-= 14 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Distance.cpp 2011-10-25 15= :01:28.194288563 +0300 +@@ -57,8 +57,6 @@ + mprintf(" DISTANCE: %s to %s",Mask1.maskString, Mask2.maskString); + if (noimage)=20 + mprintf(", non-imaged"); +- else +- mprintf(", imaged"); + if (useMass)=20 + mprintf(", center of mass"); + else +@@ -68,6 +66,11 @@ + return 0; + } +=20 ++/* ++ * Distance::setup() ++ * Determine what atoms each mask pertains to for the current parm file= . ++ * Also determine whether imaging should be performed. ++ */ + int Distance::setup() { +=20 + if ( Mask1.SetupMask(P,debug) ) return 1; +@@ -89,11 +92,19 @@ + // Check imaging - check box based on prmtop box + imageType =3D 0; + if (!noimage) { +- imageType =3D P->ifbox; +- if (P->ifbox=3D=3D0 && debug>0) { ++ imageType =3D P->BoxType; ++ if (P->BoxType=3D=3D0 && debug>0) { + mprintf(" Warning: No box info in %s, disabling imaging.\n",P-= >parmName); + } + } ++ ++ // Print imaging info for this parm ++ mprintf(" DISTANCE: %s to %s",Mask1.maskString, Mask2.maskString); ++ if (imageType > 0) ++ mprintf(", imaged"); ++ else ++ mprintf(", imaging off"); ++ mprintf(".\n"); + =20 + return 0; =20 + } +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_DSSP.cpp amber1= 1/AmberTools/src/cpptraj/src/Action_DSSP.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_DSSP.cpp 2011-04-14 1= 5:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_DSSP.cpp 2011-10-25 15:01:= 28.195288561 +0300 +@@ -76,7 +76,7 @@ + int selected, atom, res; + Residue RES; +=20 +- // Set up mask ++ // Set up mask for this parm + if ( Mask.SetupMask(P,debug) ) return 1; + if ( Mask.None() ) { + mprintf(" Error: DSSP::setup: Mask has no atoms.\n"); +@@ -90,25 +90,25 @@ + Nres=3DP->nres; + //mprintf(" DSSP: Setting up for %i residues.\n",Nres); +=20 +- // Free up SecStruct if previously allocated. +- // NOTE: In action setup, should check if Parm has really changed... +- SecStruct.clear(); ++ // Set up for each residue of the current Parm if not already set-up. + for (res =3D 0; res < Nres; res++) { +- RES.sstype=3DSECSTRUCT_NULL; +- RES.isSelected=3Dfalse; +- RES.C=3D-1; +- RES.O=3D-1; +- RES.N=3D-1; +- RES.H=3D-1; +- RES.CO_HN_Hbond.assign( Nres, 0 ); +- RES.SSprob[0]=3D0.0; +- RES.SSprob[1]=3D0.0; +- RES.SSprob[2]=3D0.0; +- RES.SSprob[3]=3D0.0; +- RES.SSprob[4]=3D0.0; +- RES.SSprob[5]=3D0.0; +- RES.SSprob[6]=3D0.0; +- SecStruct.push_back(RES); ++ if (res>=3D(int)SecStruct.size()) { ++ RES.sstype=3DSECSTRUCT_NULL; ++ RES.isSelected=3Dfalse; ++ RES.C=3D-1; ++ RES.O=3D-1; ++ RES.N=3D-1; ++ RES.H=3D-1; ++ RES.CO_HN_Hbond.assign( Nres, 0 ); ++ RES.SSprob[0]=3D0.0; ++ RES.SSprob[1]=3D0.0; ++ RES.SSprob[2]=3D0.0; ++ RES.SSprob[3]=3D0.0; ++ RES.SSprob[4]=3D0.0; ++ RES.SSprob[5]=3D0.0; ++ RES.SSprob[6]=3D0.0; ++ SecStruct.push_back(RES); ++ } + } +=20 + // Go through all atoms in mask. Set up a residue for each C, O, N, a= nd H atom +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Image.cpp amber= 11/AmberTools/src/cpptraj/src/Action_Image.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Image.cpp 2011-04-14 = 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Image.cpp 2011-10-25 15:01= :28.110288640 +0300 +@@ -98,14 +98,14 @@ + useMass =3D false; + } +=20 +- if (P->ifbox=3D=3D0) { ++ if (P->BoxType=3D=3D0) { + mprintf(" Error: Image::setup: Parm %s does not contain box info= rmation.\n", + P->parmName); + return 1; + } +=20 + ortho =3D false; =20 +- if (P->ifbox=3D=3D1 && triclinic=3D=3DOFF) ortho=3Dtrue; ++ if (P->BoxType=3D=3D1 && triclinic=3D=3DOFF) ortho=3Dtrue; +=20 + if (triclinic =3D=3D FAMILIAR) { + if (ComMask!=3DNULL) { +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Outtraj.cpp amb= er11/AmberTools/src/cpptraj/src/Action_Outtraj.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Outtraj.cpp 2011-04-1= 4 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Outtraj.cpp 2011-10-25 15:= 01:28.129288623 +0300 +@@ -6,6 +6,9 @@ + // CONSTRUCTOR + Outtraj::Outtraj() { + //fprintf(stderr,"Outtraj Con\n"); ++ min=3D0.0; ++ max=3D0.0; ++ Dset=3DNULL; + }=20 +=20 + // DESTRUCTOR +@@ -13,11 +16,40 @@ +=20 + /* + * Outtraj::init() +- * Action wrapper for trajout ++ * Action wrapper for trajout. ++ * Expected call: outtraj [ trajout args ]=20 ++ * [maxmin min max + */ + int Outtraj::init() { ++ char *datasetName; ++ ++#ifdef MPI ++ mprintf("ERROR: OUTTRAJ currently not functional with MPI.\n"); ++ return 1; ++#endif ++ ++ mprintf(" OUTTRAJ: Will write to [%s]\n",A->Arg(1)); ++ outtraj.SetDebug(debug); ++ // If maxmin, get the name of the dataset as well as the max and min = values. ++ datasetName =3D A->getKeyString("maxmin",NULL); ++ if (datasetName!=3DNULL) { ++ Dset =3D DSL->Get(datasetName); ++ if (Dset=3D=3DNULL) { ++ mprintf("Error: Outtraj maxmin: Could not get dataset %s\n",datas= etName); ++ return 1; ++ } else { ++ // Currently dont allow for string datasets ++ if (Dset->Type()=3D=3DSTRING) { ++ mprintf("Error: Outtraj maxmin: String dataset (%s) not support= ed.\n",datasetName); ++ return 1; ++ } ++ max =3D A->getKeyDouble("max",0.0); ++ min =3D A->getKeyDouble("min",0.0); ++ mprintf(" maxmin: Printing trajectory frames based on= %lf <=3D %s <=3D %lf\n", ++ min, datasetName, max); ++ } ++ } +=20 +- mprintf(" OUTTRAJ: [%s]\n",A->ArgLine()); + return ( outtraj.Add(A,PFL,worldsize) ); + }=20 +=20 +@@ -33,8 +65,32 @@ + * Outtraj::action() + */ + int Outtraj::action() { ++ double dVal; ++ int iVal; +=20 +- return ( outtraj.Write(currentFrame, F, P) ); ++ // If dataset defined, check if frame is within max/min ++ if (Dset!=3DNULL) { ++ if (Dset->Type() =3D=3D DOUBLE) { ++ if (Dset->Get(&dVal, currentFrame)) return 1; ++ } else if (Dset->Type() =3D=3D INT) { ++ if (Dset->Get(&iVal, currentFrame)) return 1; ++ dVal =3D (double) iVal; ++ } else ++ return 1; ++ //mprintf("DBG: maxmin: dVal =3D %lf\n",dVal); ++ // If value from dataset not within min/max, exit now. ++ if (dVal < min || dVal > max) return 0; ++ } ++ if ( outtraj.Write(currentFrame, F, P) !=3D 0 ) return 1; ++ return 0; + }=20 +=20 ++/* ++ * Outtraj::print() ++ * Close trajectory. ++ */ ++void Outtraj::print() { ++ mprintf(" OUTTRAJ: [%s] Wrote %i frames.\n",A->Arg(1),outtraj.front(= )->CurrentFrame()); ++ outtraj.Close(); ++} +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Outtraj.h amber= 11/AmberTools/src/cpptraj/src/Action_Outtraj.h +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Outtraj.h 2011-04-14 = 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Outtraj.h 2011-10-25 15:01= :28.129288623 +0300 +@@ -6,6 +6,9 @@ +=20 + class Outtraj: public Action { + TrajoutList outtraj; ++ double max; ++ double min; ++ DataSet *Dset; + public: + Outtraj(); + ~Outtraj(); +@@ -13,5 +16,6 @@ + int init(); + //int setup(); + int action(); ++ void print(); + }; + #endif +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Rms2d.cpp amber= 11/AmberTools/src/cpptraj/src/Action_Rms2d.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Rms2d.cpp 1970-01-01 = 03:00:00.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Rms2d.cpp 2011-10-25 15:01= :28.074288674 +0300 +@@ -0,0 +1,71 @@ ++// Rms2d=20 ++#include "Action_Rms2d.h" ++#include "CpptrajStdio.h" ++ ++// CONSTRUCTOR ++Rms2d::Rms2d() { ++ //fprintf(stderr,"Rms2d Con\n"); ++ nofit=3Dfalse; ++ useMass=3Dfalse; ++}=20 ++ ++// DESTRUCTOR ++Rms2d::~Rms2d() { } ++ ++/* ++ * Rms2d::init() ++ * Expected call: rms2d [rmsout filename] [mass] [nofi= t] ++ * Dataset name will be the last arg checked for. Check order is: ++ * 1) Keywords ++ * 2) Masks ++ * 3) Dataset name ++ */ ++int Rms2d::init() { ++ char *mask0, *maskRef; ++ ++ // Get keywords ++ nofit =3D A->hasKey("nofit"); ++ useMass =3D A->hasKey("mass"); ++ rmsdFile =3D A->getKeyString("rmsout",NULL); ++ ++ // Get the RMS mask string for frames ++ mask0 =3D A->getNextMask(); ++ FrameMask.SetMaskString(mask0); ++ // Get RMS mask string for reference ++ maskRef =3D A->getNextMask(); ++ // If no reference mask specified, make same as RMS mask ++ if (maskRef=3D=3DNULL) maskRef=3Dmask0; ++ RefMask.SetMaskString(maskRef); ++ ++ mprintf(" RMS2D: (%s) to (%s)",FrameMask.maskString,RefMask.maskSt= ring); ++ if (nofit) ++ mprintf(" (no fitting)"); ++ if (useMass) ++ mprintf(" (mass-weighted)"); ++ if (rmsdFile!=3DNULL)=20 ++ mprintf(" output to %s",rmsdFile); ++ mprintf("\n"); ++ ++ return 0; ++} ++ ++/* ++ * Rms2d::setup() ++ * Not important for Rms2d, initial pass is only for storing frames. ++ */ ++int Rms2d::setup() { ++ return 0; =20 ++} ++ ++/* ++ * Rms2d::action() ++ * Store current frame as a reference frame. ++ */ ++int Rms2d::action() { ++ ++ ReferenceFrames.Add(F,P); ++ =20 ++ return 0; ++}=20 ++ ++ +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Rms2d.h amber11= /AmberTools/src/cpptraj/src/Action_Rms2d.h +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Rms2d.h 1970-01-01 03= :00:00.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Rms2d.h 2011-10-25 15:01:2= 8.075288673 +0300 +@@ -0,0 +1,21 @@ ++#ifndef INC_ACTION_RMS2D_H ++#define INC_ACTION_RMS2D_H ++// Rms2d ++#include "Action.h" ++ ++class Rms2d: public Action { ++ FrameList ReferenceFrames; ++ bool nofit; ++ bool useMass; ++ AtomMask RefMask; ++ AtomMask FrameMask; ++ char *rmsdFile; ++ public: ++ Rms2d(); ++ ~Rms2d(); ++ ++ int init(); ++ int setup(); ++ int action(); ++}; ++#endif +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Action_Rmsd.cpp amber1= 1/AmberTools/src/cpptraj/src/Action_Rmsd.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Action_Rmsd.cpp 2011-04-14 1= 5:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Action_Rmsd.cpp 2011-10-25 15:01:= 28.229288531 +0300 +@@ -256,6 +256,7 @@ + PerResRMSD=3Dnew DataSetList(); + resName[4]=3D'\0'; + for (it=3DResRange.begin(); it!=3DResRange.end(); it++) { ++ //res =3D *it - 1; // res is the internal resnumber, *it the user= resnumber + // Get corresponding reference resnum - if none specified use cur= rent res + if (RefRange.empty())=20 + refRes =3D (*it); +@@ -263,7 +264,18 @@ + refRes =3D RefRange.front(); + RefRange.pop_front(); + } +- //res =3D *it - 1; // res is the internal resnumber, *it the user= resnumber ++ ++ // Check if either the residue num or the reference residue num o= ut of range. ++ if ( (*it) < 1 || (*it) > P->nres) { ++ mprintf(" Warning: Rmsd: perres: Specified residue # %i is o= ut of range.\n",*it); ++ continue; ++ } ++ if ( refRes < 1 || refRes > P->nres ) { ++ mprintf(" Warning: Rmsd: perres: Specified reference residue= # %i is out of range.\n", ++ refRes); ++ continue; ++ } ++ + // Setup Dataset Name to be name of this residue=20 + P->ResName(resName,(*it)-1); + =20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberNetcdf.cpp amber1= 1/AmberTools/src/cpptraj/src/AmberNetcdf.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/AmberNetcdf.cpp 2011-04-14 1= 5:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/AmberNetcdf.cpp 2011-10-25 15:01:= 28.131288621 +0300 +@@ -49,6 +49,7 @@ + * and close calls. + */ + void AmberNetcdf::close() { ++ if (ncid<0) return; + checkNCerr(nc_close(ncid),"Closing netcdf file."); + if (debug>0) rprintf("Successfully closed ncid %i\n",ncid); + ncid=3D-1; +@@ -92,8 +93,10 @@ + * Open the netcdf file, read all dimension and variable IDs, close.=20 + */ + int AmberNetcdf::SetupRead() { +- char *attrText; // For checking conventions and version=20 +- int spatial; // For checking spatial dimensions ++ char *attrText; // For checking conventions and version=20 ++ int spatial; // For checking spatial dimensions ++ double box[6]; // For checking box type ++ size_t start[3], count[3]; // For checking box type +=20 + if (open()) return 1; +=20 +@@ -147,15 +150,15 @@ + if ( nc_inq_varid(ncid,"cell_lengths",&cellLengthVID)=3D=3DNC_NOERR )= { + if (checkNCerr(nc_inq_varid(ncid,"cell_angles",&cellAngleVID), + "Getting cell angles.")!=3D0) return 1; +- if (debug>0) mprintf(" Netcdf Box information found.\n");=20 +- if (P->ifbox=3D=3D0) { +- mprintf("Warning: Netcdf file contains box info but no box info f= ound\n"); +- mprintf(" in associated parmfile %s; defaulting to orthog= onal.\n", +- P->parmName); +- isBox=3D1; +- } else { +- isBox=3DP->ifbox; +- } ++ if (debug>0) mprintf(" Netcdf Box information found.\n"); ++ // Determine box type from angles ++ start[0]=3D0; start[1]=3D0; start[2]=3D0;=20 ++ count[0]=3D1; count[1]=3D3; count[2]=3D0; ++ if ( checkNCerr(nc_get_vara_double(ncid, cellLengthVID, start, coun= t, box), ++ "Getting cell lengths.")!=3D0 ) return 1; ++ if ( checkNCerr(nc_get_vara_double(ncid, cellAngleVID, start, count= , box+3), ++ "Getting cell angles.")!=3D0 ) return 1; ++ CheckBoxType(box); + }=20 +=20 + // Replica Temperatures +@@ -258,7 +261,7 @@ + "Defining cell angular variable.")) return 1; +=20 + // Box Info +- if (isBox>0) { ++ if (BoxType!=3D0) { + dimensionID[0]=3DframeDID; + dimensionID[1]=3Dcell_spatialDID; + if (checkNCerr(nc_def_var(ncid,"cell_lengths",NC_DOUBLE,2,dimension= ID,&cellLengthVID), +@@ -362,7 +365,7 @@ + "Getting frame %i",set)!=3D0 ) return 1; +=20 + // Read box info=20 +- if (isBox!=3D0) { ++ if (BoxType!=3D0) { + count [1]=3D3; + count [2]=3D0; + if ( checkNCerr(nc_get_vara_double(ncid, cellLengthVID, start, coun= t, F->box), +@@ -399,7 +402,7 @@ + F->frameToFloat(Coord); +=20 + // write coords +- start[0]=3Dset; ++ start[0]=3DcurrentFrame; + start[1]=3D0; + start[2]=3D0; + count[0]=3D1; +@@ -409,7 +412,7 @@ + "Netcdf Writing frame %i",set)) return 1; +=20 + // write box +- if (isBox>0 && cellLengthVID!=3D-1) { ++ if (BoxType!=3D0 && cellLengthVID!=3D-1) { + count[1]=3D3; + count[2]=3D0; + if (checkNCerr(nc_put_vara_double(ncid,cellLengthVID,start,count,F-= >box), +@@ -427,6 +430,8 @@ + =20 + nc_sync(ncid); // Necessary after every write?? +=20 ++ currentFrame++; ++ + return 0; + } =20 +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberParm.cpp amber11/= AmberTools/src/cpptraj/src/AmberParm.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/AmberParm.cpp 2011-04-14 15:= 30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/AmberParm.cpp 2011-10-25 15:01:28= .231288529 +0300 +@@ -1,6 +1,12 @@ + /* AmberParm.cpp +- * Class that holds parameter information. Can be read in from Amber To= pology +- * or PDB files. ++ * Class that holds parameter information. Can be read in from Amber To= pology, ++ * PDB, or Mol2 files (implemented in the ReadParmXXX functions). The f= ollowing ++ * parameters of AmberParm must always be set: ++ * The NATOM, NRES, and IFBOX entries of the values array. ++ * The names, resnames, resnums arrays. ++ * The natom and nres variables. ++ * NOTES: ++ * Eventually make the mol2 read parm function use the AddBond functi= on. + */ + #include + #include +@@ -11,7 +17,7 @@ + #include "CpptrajStdio.h" +=20 + #define AMBERPOINTERS 31 +- ++#define TRUNCOCTBETA 109.4712206344906917365733534097672 + #define ELECTOAMBER 18.2223 + #define AMBERTOELEC 1/ELECTOAMBER + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +@@ -21,7 +27,7 @@ + * Given a residue number, set buffer with residue name. Replace blanks= with _ + */ + void AmberParm::ResName(char *buffer, int res) { +- if (res<0 || res>nres) return; ++ if (res<0 || res>=3Dnres) return; + strcpy(buffer, resnames[res]); + if (buffer[3]=3D=3D' ') buffer[3]=3D'_'; + } +@@ -203,7 +209,9 @@ + bondsh=3DNULL; =20 + types=3DNULL; =20 + atomsPerMol=3DNULL;=20 +- Box=3DNULL; =20 ++ Box[0]=3D0.0; Box[1]=3D0.0; Box[2]=3D0.0; ++ Box[3]=3D0.0; Box[4]=3D0.0; Box[5]=3D0.0; ++ BoxType=3D0;=20 + pindex=3D0; =20 + parmFrames=3D0;=20 + outFrame=3D0; +@@ -217,7 +225,6 @@ + solventMoleculeStop=3DNULL; + natom=3D0; =20 + nres=3D0;=20 +- ifbox=3D0;=20 + parmName=3DNULL;=20 + SurfaceInfo=3DNULL; + } +@@ -234,7 +241,6 @@ + if (bonds!=3DNULL) free(bonds); + if (bondsh!=3DNULL) free(bondsh); + if (atomsPerMol!=3DNULL) free(atomsPerMol); +- if (Box!=3DNULL) free(Box); + if (solventMoleculeStart!=3DNULL) free(solventMoleculeStart); + if (solventMoleculeStop!=3DNULL) free(solventMoleculeStop); + if (solventMask!=3DNULL) free(solventMask); +@@ -271,54 +277,7 @@ + return NULL; + } +=20 +-/*=20 +- * AmberParm::OpenParm() +- * Attempt to open file and read in parameters. +- */ +-int AmberParm::OpenParm(char *filename) { +- if ( File.SetupFile(filename,READ,UNKNOWN_FORMAT, UNKNOWN_TYPE,debug)= ) return 1; +- +- // Copy parm filename to parmName. Separate from File.filename in cas= e of stripped parm +- parmName=3D(char*) malloc( (strlen(File.basefilename)+1) * sizeof(cha= r)); +- strcpy(parmName,File.basefilename); +- +- if ( File.OpenFile() ) return 1; +- +- switch (File.fileFormat) { +- case AMBERPARM : if (ReadParmAmber()) return 1; break; +- case PDBFILE : if (ReadParmPDB() ) return 1; break; +- case MOL2FILE : if (ReadParmMol2() ) return 1; break; +- default:=20 +- rprintf("Unknown parameter file type: %s\n",File.filename); +- return 1; +- } +- +- File.CloseFile(); +- +- // Create a last dummy residue in resnums that holds natom, which wou= ld be +- // the atom number of the next residue if it existed. Atom #s in resn= ums +- // should correspond with cpptraj atom #s (start from 0) instead of A= mber +- // atom #s (start from 1).=20 +- // Do this to be consistent with ptrajmask selection behavior - saves= an=20 +- // if-then statement. +- resnums=3D(int*) realloc(resnums,(nres+1)*sizeof(int)); +- resnums[nres]=3Dnatom; +- // DEBUG +- //fprintf(stdout,"=3D=3D=3D=3D DEBUG =3D=3D=3D=3D Resnums for %s:\n",= File.filename); +- //for (err=3D0; err0) { +- mprintf(" Number of atoms=3D %i\n",natom); +- mprintf(" Number of residues=3D %i\n",nres); +- } +- +- return 0; +-} +- ++// ---------=3D=3D=3D=3D=3D=3D=3D=3D=3D ROUTINES PERTAINING TO SURFACE = AREA =3D=3D=3D=3D=3D=3D=3D=3D=3D--------- + /* + * AmberParm::AssignLCPO() + * Assign parameters for LCPO method. All radii are incremented by 1.4 = Ang. +@@ -478,6 +437,7 @@ + return 0; + } +=20 ++// ---------=3D=3D=3D=3D=3D=3D=3D=3D=3D ROUTINES PERTAINING TO SOLVENT = INFO =3D=3D=3D=3D=3D=3D=3D=3D=3D--------- + /* + * AmberParm::SetSolventInfo() + * Assuming atomsPerMol has been read in, set solvent information. +@@ -536,7 +496,56 @@ +=20 + return 0;=20 + } +- =20 ++ =20 ++// --------=3D=3D=3D=3D=3D=3D=3D=3D=3D ROUTINES PERTAINING TO READING P= ARAMETERS =3D=3D=3D=3D=3D=3D=3D=3D=3D-------- ++/*=20 ++ * AmberParm::OpenParm() ++ * Attempt to open file and read in parameters. ++ */ ++int AmberParm::OpenParm(char *filename) { ++ if ( File.SetupFile(filename,READ,UNKNOWN_FORMAT, UNKNOWN_TYPE,debug)= ) return 1; ++ ++ // Copy parm filename to parmName. Separate from File.filename in cas= e of stripped parm ++ parmName=3D(char*) malloc( (strlen(File.basefilename)+1) * sizeof(cha= r)); ++ strcpy(parmName,File.basefilename); ++ ++ if ( File.OpenFile() ) return 1; ++ ++ switch (File.fileFormat) { ++ case AMBERPARM : if (ReadParmAmber()) return 1; break; ++ case PDBFILE : if (ReadParmPDB() ) return 1; break; ++ case MOL2FILE : if (ReadParmMol2() ) return 1; break; ++ default:=20 ++ rprintf("Unknown parameter file type: %s\n",File.filename); ++ return 1; ++ } ++ ++ File.CloseFile(); ++ ++ // Create a last dummy residue in resnums that holds natom, which wou= ld be ++ // the atom number of the next residue if it existed. Atom #s in resn= ums ++ // should correspond with cpptraj atom #s (start from 0) instead of A= mber ++ // atom #s (start from 1).=20 ++ // Do this to be consistent with ptrajmask selection behavior - saves= an=20 ++ // if-then statement. ++ resnums=3D(int*) realloc(resnums,(nres+1)*sizeof(int)); ++ resnums[nres]=3Dnatom; ++ // DEBUG ++ //fprintf(stdout,"=3D=3D=3D=3D DEBUG =3D=3D=3D=3D Resnums for %s:\n",= File.filename); ++ //for (err=3D0; err0) { ++ mprintf(" Number of atoms=3D %i\n",natom); ++ mprintf(" Number of residues=3D %i\n",nres); ++ } ++ ++ return 0; ++} ++ + /*=20 + * AmberParm::ReadParmAmber()=20 + * Read parameters from Amber Topology file +@@ -544,6 +553,7 @@ + int AmberParm::ReadParmAmber() { + int err, atom; + int *solvent_pointer; ++ double *boxFromParm; +=20 + if (debug>0) mprintf("Reading Amber Topology file %s\n",parmName); +=20 +@@ -555,7 +565,6 @@ +=20 + natom=3Dvalues[NATOM]; + nres=3Dvalues[NRES]; +- ifbox=3Dvalues[IFBOX]; + if (debug>0) + mprintf(" Amber top contains %i atoms, %i residues.\n",natom,nre= s); +=20 +@@ -583,7 +592,8 @@ + if (bonds=3D=3DNULL) {mprintf("Error in bonds w/o H.\n"); err++;} + bondsh=3D(int*) getFlagFileValues("BONDS_INC_HYDROGEN",values[NBONH]*= 3); + if (bondsh=3D=3DNULL) {mprintf("Error in bonds inc H.\n"); err++;} +- if (ifbox>0) { ++ // Get solvent info if IFBOX>0 ++ if (values[IFBOX]>0) { + solvent_pointer=3D(int*) getFlagFileValues("SOLVENT_POINTERS",3); + if (solvent_pointer=3D=3DNULL) { + mprintf("Error in solvent pointers.\n");=20 +@@ -596,12 +606,20 @@ + } + atomsPerMol=3D(int*) getFlagFileValues("ATOMS_PER_MOLECULE",molecul= es); + if (atomsPerMol=3D=3DNULL) {mprintf("Error in atoms per molecule.\n= "); err++;} +- Box=3D(double*) getFlagFileValues("BOX_DIMENSIONS",4); +- if (Box=3D=3DNULL) {mprintf("Error in Box information.\n"); err++;} ++ // boxFromParm =3D {OLDBETA, BOX(1), BOX(2), BOX(3)} ++ boxFromParm=3D(double*) getFlagFileValues("BOX_DIMENSIONS",4); ++ if (boxFromParm=3D=3DNULL) {mprintf("Error in Box information.\n");= err++;} ++ // Determine box type: 1-Ortho, 2-Nonortho ++ SetBoxInfo(boxFromParm[0],boxFromParm[1],boxFromParm[2],boxFromParm= [3]); ++ free(boxFromParm); + if (debug>0) { + mprintf(" %s contains box info: %i mols, first solvent mol is = %i\n", + parmName, molecules, firstSolvMol); +- mprintf(" BOX: %lf %lf %lf %lf\n",Box[0],Box[1],Box[2],Box[3])= ; ++ mprintf(" BOX: %lf %lf %lf | %lf %lf %lf\n",Box[0],Box[1],Box[= 2],Box[3],Box[4],Box[5]); ++ if (BoxType=3D=3D1) ++ mprintf(" Box is orthogonal.\n"); ++ else ++ mprintf(" Box is non-orthogonal.\n"); + } + } +=20 +@@ -686,6 +704,7 @@ + values =3D (int*) calloc(AMBERPOINTERS, sizeof(int)); + values[NATOM] =3D natom; + values[NRES] =3D nres; ++ values[IFBOX] =3D 0; +=20 + if (debug>0)=20 + mprintf(" PDB contains %i atoms, %i residues, %i molecules.\n", +@@ -799,6 +818,7 @@ + values[NRES] =3D nres; + values[NBONH] =3D numbondsh; + values[MBONA] =3D numbonds; ++ values[IFBOX] =3D 0; +=20 + mprintf(" Mol2 contains %i atoms, %i residues,\n", natom,nres); + mprintf(" %i bonds to H, %i other bonds.\n", numbondsh,numbonds); +@@ -806,6 +826,61 @@ + return 0; + } +=20 ++// ---------=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D--------- ++/* ++ * AmberParm::SetBoxInfo() ++ * Given 3 box lengths and an angle determine the box type and set ++ * the box information. If called with negative beta, set no box. ++ * Currently recognized betas: ++ * 90.00 - Orthogonal ++ * 109.47 - Truncated octahedral ++ * 60.00 - Rhombic dodecahedron ++ * Any other beta just sets all angles to beta and a warning is printed= . ++ */ ++int AmberParm::SetBoxInfo(double beta, double bx, double by, double bz)= { ++ int ifbox=3D0; ++ ++ // Determine box type from beta (none, ortho, non-ortho (truncated oc= t/triclinic) ++ if (beta<=3D0.0) { ++ if (BoxType>0)=20 ++ mprintf(" %s: Removing box information.\n",parmName); ++ BoxType=3D0; ++ ifbox=3D0; ++ Box[0]=3D0.0; Box[1]=3D0.0; Box[2]=3D0.0; ++ Box[3]=3D0.0; Box[4]=3D0.0; Box[5]=3D0.0; ++ } else if (beta =3D=3D 90.0) { ++ BoxType=3D1; ++ ifbox=3D1; ++ Box[0]=3Dbx; Box[1]=3Dby; Box[2]=3Dbz; ++ Box[3]=3D90.0; Box[4]=3D90.0; Box[5]=3D90.0; ++ if (debug>0) mprintf(" %s: Setting box to be orthogonal.\n",parm= Name); ++ } else if (beta > 109.47 && beta < 109.48) { ++ BoxType=3D2; ++ ifbox=3D2; ++ Box[0]=3Dbx; Box[1]=3Dby; Box[2]=3Dbz; ++ //Box[3] =3D TRUNCOCTBETA; ++ Box[3] =3D beta; ++ Box[4]=3DBox[3]; Box[5]=3DBox[3]; ++ if (debug>0) mprintf(" %s: Setting box to be a truncated octahed= ron, angle is %lf\n", ++ parmName,Box[3]); ++ } else if (beta =3D=3D 60.0) { ++ BoxType=3D2; ++ ifbox=3D1; ++ Box[0]=3Dbx; Box[1]=3Dby; Box[2]=3Dbz; ++ Box[3]=3D60.0; Box[4]=3D90.0; Box[5]=3D60.0; ++ if (debug>0)=20 ++ mprintf(" %s: Setting box to be a rhombic dodecahedron, alpha=3D= gamma=3D60.0, beta=3D90.0\n", ++ parmName); ++ } else { ++ BoxType=3D2; ++ ifbox=3D1; ++ Box[0]=3Dbx; Box[1]=3Dby; Box[2]=3Dbz; ++ Box[3]=3Dbeta; Box[4]=3Dbeta; Box[5]=3Dbeta; ++ mprintf(" Warning: %s: Unrecognized box type, beta is %lf\n",bet= a); ++ } ++ return 0; =20 ++} ++ + /* + * AmberParm::AtomInfo() + * Print parm information for atom. +@@ -829,8 +904,8 @@ + */ + void AmberParm::Info(char *buffer) { +=20 +- sprintf(buffer,"%i atoms, %i res, box %i, %i mol, %i solvent mol, %i = frames", +- natom,nres,ifbox,molecules,solventMolecules,parmFrames); ++ sprintf(buffer,"%i atoms, %i res, boxtype %i, %i mol, %i solvent mol,= %i frames", ++ natom,nres,BoxType,molecules,solventMolecules,parmFrames); + } + =20 + // NOTE: The following atomToX functions do not do any memory checks! +@@ -963,6 +1038,7 @@ + return bonds; + } +=20 ++// ---------=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D--------- + /* + * AmberParm::modifyStateByMap() + * Currently only intended for use with AtomMap. +@@ -1028,24 +1104,21 @@ + // Set up new parm information + newParm->natom =3D this->natom; + newParm->nres =3D this->nres; +- newParm->ifbox =3D this->ifbox; + newParm->parmFrames =3D this->parmFrames; +=20 + // Give mapped parm the same pindex as original parm + newParm->pindex =3D this->pindex; +=20 + // Copy box information +- if (this->Box!=3DNULL) { +- newParm->Box=3D(double*) malloc(4*sizeof(double)); +- for (int i=3D0; i<4; i++) +- newParm->Box[i] =3D this->Box[i]; +- } ++ for (int i=3D0; i<6; i++) ++ newParm->Box[i] =3D this->Box[i]; ++ newParm->BoxType=3Dthis->BoxType; +=20 + // Set values up + // NOTE: Eventually set all pointers up? + newParm->values[NATOM] =3D newParm->natom; + newParm->values[NRES] =3D newParm->nres; +- newParm->values[IFBOX] =3D newParm->ifbox; ++ newParm->values[IFBOX] =3D this->values[IFBOX]; +=20 + return newParm; + } +@@ -1152,7 +1225,6 @@ + // Set up new parm information + newParm->natom =3D j; + newParm->nres =3D jres+1;=20 +- newParm->ifbox =3D this->ifbox; + newParm->parmFrames =3D this->parmFrames; + if (this->molecules>0)=20 + newParm->molecules =3D jmol+1; +@@ -1184,26 +1256,25 @@ + } + =20 + // Copy box information +- if (this->Box!=3DNULL) { +- newParm->Box=3D(double*) malloc(4*sizeof(double)); +- for (i=3D0; i<4; i++) +- newParm->Box[i] =3D this->Box[i]; +- } ++ for (i=3D0; i<6; i++) ++ newParm->Box[i] =3D this->Box[i]; ++ newParm->BoxType=3Dthis->BoxType; +=20 + // Set values up + // NOTE: Eventually set all pointers up? + newParm->values[NATOM] =3D newParm->natom; + newParm->values[NRES] =3D newParm->nres; +- newParm->values[IFBOX] =3D newParm->ifbox; ++ newParm->values[IFBOX] =3D this->values[IFBOX]; +=20 + mprintf(" New parmtop contains %i atoms.\n",newParm->natom)= ; + mprintf(" %i residues.\n",newParm->nre= s); + mprintf(" %i molecules.\n",newParm->mo= lecules); +- mprintf(" %i solvent molcules.\n",newP= arm->solventMolecules); ++ mprintf(" %i solvent molecules.\n",new= Parm->solventMolecules); +=20 + return newParm; + } +=20 ++// ---------=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D--------- + /*=20 + * AmberParm::DataToBuffer() + * Return char buffer containing N data elements stored in I, D, or C w= ith=20 +@@ -1267,6 +1338,7 @@ + char *buffer; + int solvent_pointer[3]; + int atom; ++ double parmBox[4]; +=20 + if (parmName=3D=3DNULL) return 1; +=20 +@@ -1346,7 +1418,7 @@ + } +=20 + // SOLVENT POINTERS +- if (ifbox>0) { ++ if (values[IFBOX]>0) { + PrintFlagFormat(&outfile, "%FLAG SOLVENT_POINTERS", "%FORMAT(3I8)")= ; + solvent_pointer[0]=3DfinalSoluteRes; + solvent_pointer[1]=3Dmolecules; +@@ -1360,8 +1432,12 @@ + outfile.IO->Write(buffer, sizeof(char), BufferSize); +=20 + // BOX DIMENSIONS ++ parmBox[0] =3D Box[4]; // beta ++ parmBox[1] =3D Box[0]; // boxX ++ parmBox[2] =3D Box[1]; // boxY ++ parmBox[3] =3D Box[2]; // boxZ + PrintFlagFormat(&outfile, "%FLAG BOX_DIMENSIONS", "%FORMAT(5E16.8)"= ); +- buffer =3D DataToBuffer(buffer,"%FORMAT(5E16.8)", NULL, Box, NULL, = 4); ++ buffer =3D DataToBuffer(buffer,"%FORMAT(5E16.8)", NULL, parmBox, NU= LL, 4); + outfile.IO->Write(buffer, sizeof(char), BufferSize); + } +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberParm.h amber11/Am= berTools/src/cpptraj/src/AmberParm.h +--- amber11.orig/AmberTools/src/cpptraj/src/AmberParm.h 2011-04-14 15:30= :16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/AmberParm.h 2011-10-25 15:01:28.1= 17288634 +0300 +@@ -75,14 +75,14 @@ + int *resnums; // IPRES(NRES)=20 + int natom; // NATOM + int nres; // NRES +- int ifbox; // IFBOX + int finalSoluteRes; // IPTRES + int molecules; // NSPM + int firstSolvMol; // NSPSOL + int *atomsPerMol; // NSP(NSPM) + double *mass; // AMASS(NATOM) + double *charge; // CHARGE(NATOM) +- double *Box; // OLDBETA, BOX(1), BOX(2), BOX(3) ++ double Box[6]; // X, Y, Z, alpha, beta, gamma=20 ++ int BoxType; // 0: None, 1: Orthogonal, 2: Non-orthogonal + // From Ptraj + char *solventMask; // T for atoms in the solvent + int solventMolecules; // number of solvent molecules +@@ -96,6 +96,7 @@ + ~AmberParm(); + void ResName(char *, int); + int OpenParm(char *); ++ int SetBoxInfo(double,double,double,double); + int SetSurfaceInfo(); + int SetSolventInfo(); + void AtomInfo(int); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberRestart.cpp amber= 11/AmberTools/src/cpptraj/src/AmberRestart.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/AmberRestart.cpp 2011-04-14 = 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/AmberRestart.cpp 2011-10-25 15:01= :28.125288626 +0300 +@@ -109,7 +109,7 @@ + frameSize+=3DframeSize; +=20 + // If box coords are present, allocate extra space for them +- if (isBox>0) { ++ if (BoxType!=3D0) { + numBoxCoords=3D6; + frameSize+=3D((numBoxCoords*12)+1); + } +@@ -167,13 +167,12 @@ +=20 + // If 0 probably at EOF. No box or velo. + // } else if (lineSize=3D=3D0) { +- isBox=3D0; ++ BoxType=3D0; + hasVelocity=3D0; +=20 + // If 36 or 72 (+1 newline) box info. + } else if (lineSize=3D=3D37 || lineSize=3D=3D73) { +- isBox=3D1; +- numBoxCoords =3D (lineSize-1) / 12; ++ getBoxType(frameBuffer,lineSize); + hasVelocity=3D0; +=20 + // If filled framebuffer again, has velocity info. Check for box afte= r velocity. +@@ -182,15 +181,14 @@ + if (File->IO->Gets(buffer,82)=3D=3D0) { + lineSize=3Dstrlen(buffer); + if (lineSize=3D=3D37 || lineSize=3D=3D73) { +- isBox=3D1; +- numBoxCoords =3D (lineSize-1) / 12; ++ getBoxType(buffer,lineSize); + } else { + mprintf("Error: AmberRestart::SetupRead():\n"); + mprintf(" Expect only 3 or 6 box coords in box coord line= .\n"); + return 1; + } + } else +- isBox=3D0; ++ BoxType=3D0; +=20 + // Otherwise, who knows what was read? + } else { +@@ -202,12 +200,12 @@ +=20 + // Recalculate the frame size + if (hasVelocity) frameSize+=3DframeSize; +- if (isBox) frameSize+=3D( (numBoxCoords*12) + 1 ); ++ if (BoxType!=3D0) frameSize+=3D( (numBoxCoords*12) + 1 ); + frameBuffer=3D(char*) realloc(frameBuffer, frameSize*sizeof(char)); +=20 + if (debug > 0) { +- mprintf(" Amber Restart isBox=3D%i hasVelocity=3D%i numBoxCoords= =3D%i\n", +- isBox,hasVelocity,numBoxCoords); ++ mprintf(" Amber Restart BoxType=3D%i hasVelocity=3D%i numBoxCoor= ds=3D%i\n", ++ BoxType,hasVelocity,numBoxCoords); + mprintf(" Amber Restart frameSize=3D %i\n",frameSize); + } + =20 +@@ -221,6 +219,20 @@ + } +=20 + /* ++ * AmberRestart::getBoxType() ++ * Based on input buffer, determine box type and num box coords. ++ */ ++void AmberRestart::getBoxType(char *boxline, int boxlineSize) { ++ double box[6]; ++ numBoxCoords =3D (boxlineSize-1) / 12; ++ if (numBoxCoords>3) { ++ sscanf(boxline, "%8lf%8lf%8lf%8lf%8lf%8lf",box,box+1,box+2,box+3,bo= x+4,box+5); ++ CheckBoxType(box); ++ } else ++ BoxType =3D P->BoxType; ++} ++ ++/* + * AmberRestart::getFrame() + * Get the restart file frame. If velocities are present, read those to= o. + */ +@@ -251,7 +263,7 @@ + //F->V->printAtomCoord(0); + } + // Convert box to Frame if present +- if (isBox) { ++ if (BoxType!=3D0) { + if ( (bufferPosition =3D F->BufferToBox(bufferPosition, numBoxCoord= s, 12))=3D=3DNULL ) { + mprintf("Error: AmberRestart::getFrame: * detected in box coordin= ates of %s\n", + trajfilename); +@@ -287,7 +299,7 @@ + if (F->V!=3DNULL) // NOTE: Use hasVelocity in addition/instead? + bufferPosition =3D F->V->FrameToBuffer(bufferPosition,"%12.7lf",12,= 6); + // Write box to buffer +- if (isBox) ++ if (BoxType!=3D0) + bufferPosition =3D F->BoxToBuffer(bufferPosition, numBoxCoords, "%1= 2.7lf",12); +=20 + //if (seekable) fseek(fp, titleSize+(set*frameSize),SEEK_SET); +@@ -297,6 +309,8 @@ +=20 + File->IO->Close(); +=20 ++ currentFrame++; ++ + return 0; + } +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberRestart.h amber11= /AmberTools/src/cpptraj/src/AmberRestart.h +--- amber11.orig/AmberTools/src/cpptraj/src/AmberRestart.h 2011-04-14 15= :30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/AmberRestart.h 2011-10-25 15:01:2= 8.118288633 +0300 +@@ -14,6 +14,7 @@ +=20 + int SetupRead(); + int SetupWrite(); ++ void getBoxType(char *, int); +=20 + public: +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberRestartNC.cpp amb= er11/AmberTools/src/cpptraj/src/AmberRestartNC.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/AmberRestartNC.cpp 2011-04-1= 4 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/AmberRestartNC.cpp 2011-10-25 15:= 01:28.126288625 +0300 +@@ -60,15 +60,8 @@ + /* + * AmberRestartNC::open() + * Open up Netcdf restart file and set all dimension and variable IDs. +- * This is done every time the file is opened up since Im not sure +- * the variable IDs stay the same throughout each opening. +- * Could eventually be separated. +- * NOTE: Replace attrText allocs with static buffer?=20 + */ + int AmberRestartNC::open() { +- char *attrText; // For checking conventions and version=20 +- int spatial; // For checking spatial dimensions +- + mprintf("DEBUG: AmberRestartNC::open() called for %s, ncid=3D%i\n",Fi= le->filename,ncid); + // If already open, return + if (ncid!=3D-1) return 0; +@@ -94,6 +87,23 @@ + // Netcdf files are always seekable + seekable=3D1; +=20 ++ return 0; ++} ++ ++/* ++ * AmberRestartNC::SetupRead() ++ * Set up netcdf restart file for reading, get all variable and dimensi= on IDs.=20 ++ * Also check number of atoms against associated parmtop. ++ * NOTE: Replace attrText allocs with static buffer?=20 ++ */ ++int AmberRestartNC::SetupRead() { ++ char *attrText; // For checking conventions and version=20 ++ int spatial; // For checking spatial dimensions ++ double box[6]; ++ size_t start[2], count[2]; ++ ++ if (open()) return 1; ++ + // Get global attributes + if (title=3D=3DNULL) title =3D GetAttrText(ncid,NC_GLOBAL, "title"); + attrText =3D GetAttrText(ncid,NC_GLOBAL, "Conventions"); +@@ -147,20 +157,18 @@ + mprintf(" Netcdf restart time=3D %lf\n",restartTime); +=20 + // Box info +- // NOTE: If no box info found in parm should really try to determine = correct +- // box type from angles.=20 + if ( nc_inq_varid(ncid,"cell_lengths",&cellLengthVID)=3D=3DNC_NOERR )= { + if (checkNCerr(nc_inq_varid(ncid,"cell_angles",&cellAngleVID), + "Getting cell angles.")!=3D0) return 1; +- if (debug>0) mprintf(" Netcdf restart Box information found.\n");=20 +- if (P->ifbox=3D=3D0) { +- mprintf("Warning: Netcdf restart file contains box info but no bo= x info found\n"); +- mprintf(" in associated parmfile %s; defaulting to orthog= onal.\n", +- P->parmName); +- isBox=3D1; +- } else { +- isBox=3DP->ifbox; +- } ++ if (debug>0) mprintf(" Netcdf restart Box information found.\n"); ++ // Determine box type from angles ++ start[0]=3D0; start[1]=3D0; ++ count[0]=3D3; count[1]=3D0;=20 ++ if ( checkNCerr(nc_get_vara_double(ncid, cellLengthVID, start, coun= t, box), ++ "Getting cell lengths.")!=3D0 ) return 1; ++ if ( checkNCerr(nc_get_vara_double(ncid, cellAngleVID, start, count= , box+3), ++ "Getting cell angles.")!=3D0 ) return 1; ++ CheckBoxType(box); + }=20 +=20 + // Replica Temperatures +@@ -175,15 +183,6 @@ + //int cell_spatialDID, cell_angularDID; + //int spatialVID, cell_spatialVID, cell_angularVID; +=20 +- return 0; +-} +- +-/* +- * AmberRestartNC::SetupRead() +- * Just a frontend to open for now. Also check number of atoms. +- */ +-int AmberRestartNC::SetupRead() { +- if (open()) return 1; + if (ncatom!=3DP->natom) { + mprintf("Warning: Number of atoms in NetCDF restart file %s (%i) do= es not\n", + File->filename,ncatom); +@@ -210,7 +209,7 @@ + */ + int AmberRestartNC::setupWriteForSet(int set) { + int dimensionID[NC_MAX_VAR_DIMS]; +- size_t start[3], count[3]; ++ size_t start[2], count[2]; + char buffer[1024]; + char xyz[3]; + char abc[15] =3D { 'a', 'l', 'p', 'h', 'a',=20 +@@ -280,7 +279,7 @@ + "Defining cell angular variable.")) return 1; +=20 + // Box Info +- if (isBox>0) { ++ if (BoxType!=3D0) { + dimensionID[0]=3Dcell_spatialDID; + if (checkNCerr(nc_def_var(ncid,"cell_lengths",NC_DOUBLE,1,dimension= ID,&cellLengthVID), + "Defining cell length variable.")) return 1; +@@ -388,9 +387,9 @@ + } +=20 + // Read box info=20 +- if (isBox!=3D0) { +- count [0]=3D3; +- count [1]=3D0; ++ if (BoxType!=3D0) { ++ count[0]=3D3; ++ count[1]=3D0; + if ( checkNCerr(nc_get_vara_double(ncid, cellLengthVID, start, coun= t, F->box), + "Getting cell lengths.")!=3D0 ) return 1; + if ( checkNCerr(nc_get_vara_double(ncid, cellAngleVID, start, count= , &(F->box[3])), +@@ -425,7 +424,7 @@ + } +=20 + // write box +- if (isBox>0 && cellLengthVID!=3D-1) { ++ if (BoxType!=3D0 && cellLengthVID!=3D-1) { + count[0]=3D3; + count[1]=3D0; + if (checkNCerr(nc_put_vara_double(ncid,cellLengthVID,start,count,F-= >box), +@@ -439,6 +438,8 @@ + // Close file for this set + close(); +=20 ++ currentFrame++; ++ + return 0; + } =20 +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberTraj.cpp amber11/= AmberTools/src/cpptraj/src/AmberTraj.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/AmberTraj.cpp 2011-04-14 15:= 30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/AmberTraj.cpp 2011-10-25 15:01:28= .226288534 +0300 +@@ -104,16 +104,18 @@ + rprintf("Error: AmberTraj::getFrame: * detected in coordinates of %= s\n",trajfilename); + return 1; =20 + }=20 +- if (isBox) {=20 ++ if (BoxType!=3D0) {=20 + if ( (bufferPosition =3D F->BufferToBox(bufferPosition,numBoxCoords= ,8))=3D=3DNULL ) { + rprintf("Error: AmberTraj::getFrame: * detected in box coordinate= s of %s\n", + trajfilename); + return 1; + } +- // Set box angles to parmtop default +- F->box[3] =3D P->Box[0]; +- F->box[4] =3D P->Box[0]; +- F->box[5] =3D P->Box[0]; ++ // Set box angles to parmtop default if not read in ++ if (numBoxCoords=3D=3D3) { ++ F->box[3] =3D P->Box[3]; ++ F->box[4] =3D P->Box[4]; ++ F->box[5] =3D P->Box[5]; ++ } + } + return 0; + } +@@ -138,20 +140,22 @@ + } +=20 + bufferPosition =3D F->FrameToBuffer(bufferPosition,"%8.3lf",8,10); +- if (isBox)=20 ++ if (BoxType!=3D0)=20 + bufferPosition =3D F->BoxToBuffer(bufferPosition,numBoxCoords,"%8.3= lf",8); +=20 + outFrameSize =3D (int) (bufferPosition - frameBuffer); + =20 + //if (seekable)=20 + // NOTE: Seek only needs to happen when traj file changes +- offset =3D (off_t) set; +- offset *=3D (off_t) outFrameSize; +- offset +=3D (off_t) titleSize; +- File->IO->Seek( offset); ++ //offset =3D (off_t) currentFrame; ++ //offset *=3D (off_t) outFrameSize; ++ //offset +=3D (off_t) titleSize; ++ //File->IO->Seek( offset); +=20 + if (File->IO->Write(frameBuffer,sizeof(char),outFrameSize)) return 1; +=20 ++ currentFrame++; ++=20 + return 0; + } +=20 +@@ -163,8 +167,10 @@ + int AmberTraj::SetupRead() { + char buffer[BUFFER_SIZE]; + int frame_lines; +- int lineSize; +- long long int file_size, frame_size; ++ int lineSize, maxi; ++ bool sizeFound; ++ long long int file_size, frame_size, title_size, tmpfsize; ++ double box[6]; // For checking box coordinates +=20 + // Attempt to open the file. open() sets the title and titleSize + if (open()) return 1; +@@ -219,7 +225,7 @@ +=20 + if (strncmp(buffer,"REMD",4)=3D=3D0 || strncmp(buffer,"HREMD",5)=3D= =3D0) { + // REMD header - no box coords +- isBox=3D0; ++ BoxType=3D0; + } else if (lineSize<80) { + /* Line is shorter than 80 chars, indicates box coords. + * Length of the line HAS to be a multiple of 8, and probably cou= ld be +@@ -228,53 +234,108 @@ + */ + if (debug>0) mprintf(" Box line is %i chars.\n",lineSize); + if ( ((lineSize-1)%24)!=3D0 ) { +- rprintf("Error in box coord line.\nExpect only 3 or 6 box coord= s.\n"); ++ mprintf("Error in box coord line. Expect only 3 or 6 box coords= .\n"); + return 1; + } + numBoxCoords=3D(lineSize-1) / 8; + if (debug>0) mprintf(" Detected %i box coords.\n",numBoxCoords= ); +- frameSize+=3DlineSize; +- // Reallocate frame buffer accordingly +- frameBuffer=3D(char*) realloc(frameBuffer,frameSize * sizeof(char= )); +- if (P->ifbox=3D=3D0) {=20 +- rprintf( "Warning: Box coords detected in trajectory but not de= fined in topology!\n"); +- rprintf(" Setting box type to rectangular.\n"); +- isBox=3D1; ++ // Determine box type based on angles. Angles are usually not pri= nted=20 ++ // for orthogonal and truncated octahedral boxes, but check here = just ++ // to be safe. If no angles present use parmtop Box Type. ++ if (numBoxCoords>3) { ++ sscanf(buffer, "%8lf%8lf%8lf%8lf%8lf%8lf",box,box+1,box+2,box+3= ,box+4,box+5); ++ CheckBoxType(box); + } else { +- isBox =3D P->ifbox; ++ BoxType =3D P->BoxType;=20 ++ // If box coords are present in traj but no box in parm, print = warning ++ if (BoxType =3D=3D 0) ++ mprintf("Warning: %s has box coordinates but no box info in %= s\n", ++ trajfilename,P->parmName); + } ++ // Reallocate frame buffer accordingly ++ frameSize+=3DlineSize; ++ frameBuffer=3D(char*) realloc(frameBuffer,frameSize * sizeof(char= )); + } + } +=20 +- /* Calculate number of frames. If not possible and this is not a +- * compressed file the trajectory is probably corrupted. Frames will +- * be read until EOF. +- * NOTE: It is necessary to use the stat command to get the file size +- * instead of fseek in case the file has been popen'd. +- * NOTE: Need the uncompressed file size! +- */ +- if (File->uncompressed_size>0) +- file_size =3D File->uncompressed_size; +- else +- file_size=3DFile->file_size; ++ // Calculate Frames and determine seekable. If not possible and this = is not a ++ // compressed file the trajectory is probably corrupted. Frames will ++ // be read until EOF (Frames =3D -1). + if (debug>0) +- rprintf("Title offset=3D%i FrameSize=3D%i UncompressedFileSize=3D%l= li\n", +- titleSize,frameSize,file_size); +- frame_size =3D (long long int) titleSize; +- file_size =3D file_size - frame_size; // Subtract title size from fil= e total size. ++ rprintf("Title offset=3D%i FrameSize=3D%i Size=3D%lu UncompressedFi= leSize=3D%lu\n", ++ titleSize,frameSize,File->file_size,File->uncompressed_size= ); ++ title_size =3D (long long int) titleSize; + frame_size =3D (long long int) frameSize; +- Frames =3D (int) (file_size / frame_size); +- +- if ( (file_size % frame_size) =3D=3D 0 ) { +- seekable =3D 1; +- stop =3D Frames; ++ // -----=3D=3D=3D=3D AMBER TRAJ COMPRESSED =3D=3D=3D=3D------ ++ if (File->compressType!=3DNONE) { ++ // If the uncompressed size of compressed file is reported as <=3D = 0, ++ // uncompressed size cannot be determined. Read coordinates until ++ // EOF. ++ if (File->uncompressed_size <=3D 0) { ++ mprintf("Warning: %s: Uncompressed size of trajectory could not b= e determined.\n", ++ File->filename); ++ if (File->compressType=3D=3DBZIP2) ++ mprintf(" (This is normal for bzipped files)\n"); ++ mprintf(" Number of frames could not be calculated.\n"); ++ mprintf(" Frames will be read until EOF.\n"); ++ Frames =3D -1; ++ seekable =3D false; ++ } else { ++ file_size =3D File->uncompressed_size; ++ file_size =3D file_size - title_size; ++ // Frame calculation for large gzip files ++ // If uncompressed size is less than compressed size, uncompresse= d ++ // size is likely > 4GB. ++ if (File->compressType =3D=3D GZIP && file_size < (long long int)= File->file_size) { ++ // Since this is gzip compressed, if the file_size % frame size= !=3D 0,=20 ++ // it could be that the uncompressed filesize > 4GB. Since=20 ++ // ISIZE =3D uncompressed % 2^32,=20 ++ // try ((file_size + (2^32 * i)) % frame_size) and see if any a= re 0. ++ if ( (file_size % frame_size) !=3D 0) { ++ // Determine the maximum number of iterations to try based on= the ++ // fact that Amber trajectories typically compress about 3x w= ith ++ // gzip. ++ tmpfsize =3D ((File->file_size * 4) - File->uncompressed_size= ) / 4294967296LL; ++ maxi =3D (int) tmpfsize; ++ maxi++; ++ if (debug>1) ++ mprintf("\tLooking for uncompressed gzip size > 4GB, %i ite= rations.\n",maxi); ++ tmpfsize =3D 0; ++ sizeFound=3Dfalse; ++ for (int i =3D 0; i < maxi; i++ ) { ++ tmpfsize =3D (4294967296LL * i) + file_size; ++ if ( (tmpfsize % frame_size) =3D=3D 0) {sizeFound=3Dtrue; b= reak;} ++ } ++ if (sizeFound) file_size =3D tmpfsize; ++ } ++ } ++ if ((file_size % frame_size) =3D=3D 0) { ++ Frames =3D (int) (file_size / frame_size); ++ seekable =3D true; ++ } else { ++ mprintf("Warning: %s: Number of frames in compressed traj could= not be determined.\n", ++ File->filename); ++ mprintf(" Frames will be read until EOF.\n"); ++ Frames=3D-1; ++ seekable=3Dfalse; ++ } ++ } ++ // ----=3D=3D=3D=3D AMBER TRAJ NOT COMPRESSED =3D=3D=3D=3D---- + } else { +- stop =3D -1; +- Frames =3D -1; +- seekable =3D 0; +- mprintf(" Error: Could not predict # frames in %s. This usually in= dicates \n",File->filename); +- mprintf(" a corrupted trajectory. Frames will be read until= EOF.\n"); ++ file_size =3D File->file_size; ++ file_size =3D file_size - title_size; ++ Frames =3D (int) (file_size / frame_size); ++ if ( (file_size % frame_size) =3D=3D 0 ) { ++ seekable =3D true; ++ } else { ++ mprintf("Warning: %s: Could not accurately predict # frames. This= usually \n", ++ File->filename); ++ mprintf(" indicates a corrupted trajectory. Will attempt = to read %i frames.\n", ++ Frames); ++ seekable=3Dfalse; ++ } + } ++ stop =3D Frames; +=20 + if (debug>0) + rprintf("Atoms: %i FrameSize: %i TitleSize: %i NumBox: %i Seekable:= %i Frames: %i\n\n",=20 +@@ -315,7 +376,9 @@ + frameSize +=3D hasREMD; +=20 + // If box coords are present, allocate extra space for them +- if (isBox>0) { ++ // NOTE: Currently only writing box lengths for all box types. This m= eans ++ // writing triclinic box type is currently not supported. ++ if (BoxType!=3D0) { + numBoxCoords=3D3; // Only write out box lengths for trajectories + frameSize+=3D((numBoxCoords*8)+1); + } +diff -urN amber11.orig/AmberTools/src/cpptraj/src/ArgList.cpp amber11/Am= berTools/src/cpptraj/src/ArgList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/ArgList.cpp 2011-04-14 15:30= :16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/ArgList.cpp 2011-10-25 15:01:28.1= 01288648 +0300 +@@ -146,8 +146,16 @@ + return argline; + } +=20 +-/* +- * ArgList::Command() ++/* ArgList::Arg() ++ * Return arg at specified position. ++ */ ++char *ArgList::Arg(int pos) { ++ if (pos>-1 && pos +=20 + //--------- PRIVATE ROUTINES --------------------------------------- + /* +@@ -463,21 +464,27 @@ + // Write atommap out as a mol2 file, useful for checking bond info + void atommap::WriteMol2(char *m2filename) { + Mol2File outfile; +- int *Selected; ++ AtomMask M1; + // Temporary parm to play with + AmberParm *tmpParm; ++ Frame *tmpFrame; +=20 + // Create mask containing all atoms +- Selected =3D (int*) malloc(natom*sizeof(int)); +- for (int atom=3D0; atommodifyStateByMask(Selected,natom); +- free(Selected); ++ //tmpParm =3D P->modifyStateByMask(Selected,natom); ++ //free(Selected); + // Modify the bonds array to include this info +- tmpParm->ResetBondInfo(); +- for (int atom=3D0; atomAddBond(atom, M[atom].bond[bond], 0); ++ //tmpParm->ResetBondInfo(); ++ //for (int atom=3D0; atomAddBond(atom, M[atom].bond[bond], 0); ++ // Create mask with all mapped atoms ++ for (int atom=3D0; atommodifyStateByMask(M1.Selected,M1.Nselected); ++ tmpFrame =3D new Frame(M1.Nselected,NULL); ++ tmpFrame->SetFrameFromMask(F, &M1); +=20 + // Trajectory Setup + outfile.File=3Dnew PtrajFile(); +@@ -485,13 +492,14 @@ + outfile.trajfilename =3D outfile.File->basefilename; + outfile.debug=3Ddebug; + outfile.SetTitle(m2filename); +- outfile.P=3DP; ++ outfile.P=3DtmpParm; + outfile.SetupWrite(); + outfile.open(); +- outfile.F=3DF; ++ outfile.F=3DtmpFrame; + outfile.writeFrame(0); + outfile.close(); + delete tmpParm; ++ delete tmpFrame; + } + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D +=20 +@@ -1032,6 +1040,13 @@ + int iterations=3D0; +=20 + numAtomsMapped=3DMapUniqueAtoms(Ref, Tgt); ++ // DEBUG ++ //char name[1024]; ++ //sprintf(name,"Ref.%i.mol2",iterations); ++ //Ref->WriteMol2(name); ++ //sprintf(name,"Tgt.%i.mol2",iterations); ++ //Tgt->WriteMol2(name); ++ // END DEBUG + if (debug>0) + mprintf("* MapUniqueAtoms: %i atoms mapped.\n",numAtomsMapp= ed); + if (numAtomsMapped=3D=3D0) return 1; +@@ -1045,17 +1060,35 @@ + iterations++; + // First assign based on bonds to unique (already mapped) atoms. + numAtomsMapped=3DmapBondsToUnique(Ref,Tgt); ++ // DEBUG ++ //sprintf(name,"Ref.%i.u.mol2",iterations); ++ //Ref->WriteMol2(name); ++ //sprintf(name,"Tgt.%i.u.mol2",iterations); ++ //Tgt->WriteMol2(name); ++ // END DEBUG + if (debug>0) + mprintf("* [%3i] mapBondsToUnique: %i atoms mapped.\n",iterations= ,numAtomsMapped); + if (numAtomsMapped<0) return 1; + // Next assign based on chirality + numAtomsMapped=3DmapChiral(Ref,Tgt); ++ // DEBUG ++ //sprintf(name,"Ref.%i.c.mol2",iterations); ++ //Ref->WriteMol2(name); ++ //sprintf(name,"Tgt.%i.c.mol2",iterations); ++ //Tgt->WriteMol2(name); ++ // END DEBUG + if (debug>0) + mprintf("* [%3i] mapChiral: %i atoms mapped.\n",iterations= ,numAtomsMapped); + if (numAtomsMapped<0) return 1; + if (numAtomsMapped>0) continue; + // Last assign based on index/element + numAtomsMapped=3DmapByIndex(Ref,Tgt); ++ // DEBUG ++ //sprintf(name,"Ref.%i.i.mol2",iterations); ++ //Ref->WriteMol2(name); ++ //sprintf(name,"Tgt.%i.i.mol2",iterations); ++ //Tgt->WriteMol2(name); ++ // END DEBUG + if (debug>0) + mprintf("* [%3i] mapByIndex: %i atoms mapped.\n",iterations= ,numAtomsMapped); + if (numAtomsMapped<0) return 1; +diff -urN amber11.orig/AmberTools/src/cpptraj/src/CoordFileList.cpp ambe= r11/AmberTools/src/cpptraj/src/CoordFileList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/CoordFileList.cpp 2011-04-14= 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/CoordFileList.cpp 2011-10-25 15:0= 1:28.201288557 +0300 +@@ -1,4 +1,5 @@ + // CoordFileList ++#include + #include // strcmp + #include "CoordFileList.h" + #include "CpptrajStdio.h" +diff -urN amber11.orig/AmberTools/src/cpptraj/src/cpptrajdepend amber11/= AmberTools/src/cpptraj/src/cpptrajdepend +--- amber11.orig/AmberTools/src/cpptraj/src/cpptrajdepend 2011-04-14 15:= 30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/cpptrajdepend 2011-10-25 15:01:28= .107288643 +0300 +@@ -2,7 +2,7 @@ + AmberNetcdf.o : AmberNetcdf.cpp AmberNetcdf.h AmberParm.h ArgList.h Ato= mMask.h BaseFileIO.h CpptrajStdio.h Frame.h NetcdfRoutines.h PtrajFile.h = Range.h TrajFile.h + AmberParm.o : AmberParm.cpp AmberParm.h BaseFileIO.h CpptrajStdio.h Mol= 2FileRoutines.h PDBfileRoutines.h PtrajFile.h + AmberTraj.o : AmberTraj.cpp AmberParm.h AmberTraj.h ArgList.h AtomMask.= h BaseFileIO.h CpptrajStdio.h Frame.h PtrajFile.h Range.h TrajFile.h +-TrajFile.o : TrajFile.cpp AmberParm.h ArgList.h AtomMask.h BaseFileIO.h= CpptrajStdio.h Frame.h PtrajFile.h PtrajMpi.h Range.h TrajFile.h ++TrajFile.o : TrajFile.cpp AmberParm.h ArgList.h AtomMask.h BaseFileIO.h= CpptrajStdio.h Frame.h PtrajFile.h Range.h TrajFile.h + Frame.o : Frame.cpp AmberParm.h AtomMask.h BaseFileIO.h CpptrajStdio.h = DistRoutines.h Frame.h PtrajFile.h TorsionRoutines.h vectormath.h + PtrajState.o : PtrajState.cpp Action.h AmberParm.h ArgList.h AtomMask.h= BaseFileIO.h CoordFileList.h CpptrajStdio.h DataFile.h DataFileList.h Da= taSet.h DataSetList.h Frame.h FrameList.h ParmFileList.h PtrajActionList.= h PtrajFile.h PtrajMpi.h PtrajState.h Range.h ReferenceList.h TrajFile.h = TrajinList.h TrajoutList.h + ArgList.o : ArgList.cpp ArgList.h CpptrajStdio.h +@@ -13,7 +13,7 @@ + TrajoutList.o : TrajoutList.cpp AmberParm.h ArgList.h AtomMask.h BaseFi= leIO.h CoordFileList.h CpptrajStdio.h Frame.h ParmFileList.h PtrajFile.h = Range.h TrajFile.h TrajoutList.h + ReferenceList.o : ReferenceList.cpp AmberParm.h ArgList.h AtomMask.h Ba= seFileIO.h CoordFileList.h CpptrajStdio.h Frame.h FrameList.h ParmFileLis= t.h PtrajFile.h Range.h ReferenceList.h TrajFile.h + CoordFileList.o : CoordFileList.cpp AmberNetcdf.h AmberParm.h AmberRest= art.h AmberRestartNC.h AmberTraj.h ArgList.h AtomMask.h BaseFileIO.h Conf= lib.h CoordFileList.h CpptrajStdio.h Frame.h Mol2File.h PDBfile.h ParmFil= eList.h PtrajFile.h Range.h RemdTraj.h TrajFile.h TrajinList.h +-PtrajActionList.o : PtrajActionList.cpp Action.h Action_Angle.h Action_= Center.h Action_Closest.h Action_DSSP.h Action_Dihedral.h Action_Distance= .h Action_Hbond.h Action_Image.h Action_Mask.h Action_NAstruct.h Action_O= uttraj.h Action_Pucker.h Action_Radgyr.h Action_Rmsd.h Action_Strip.h Act= ion_Surf.h AmberParm.h ArgList.h AtomMap.h AtomMask.h AxisType.h BaseFile= IO.h CoordFileList.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h D= ataSetList.h Frame.h FrameList.h ParmFileList.h PtrajActionList.h PtrajFi= le.h Range.h TrajFile.h TrajoutList.h ++PtrajActionList.o : PtrajActionList.cpp Action.h Action_Angle.h Action_= Center.h Action_Closest.h Action_DSSP.h Action_Dihedral.h Action_Distance= .h Action_Hbond.h Action_Image.h Action_Mask.h Action_NAstruct.h Action_O= uttraj.h Action_Pucker.h Action_Radgyr.h Action_Rms2d.h Action_Rmsd.h Act= ion_Strip.h Action_Surf.h AmberParm.h ArgList.h AtomMap.h AtomMask.h Axis= Type.h BaseFileIO.h CoordFileList.h CpptrajStdio.h DataFile.h DataFileLis= t.h DataSet.h DataSetList.h Frame.h FrameList.h ParmFileList.h PtrajActio= nList.h PtrajFile.h Range.h TrajFile.h TrajoutList.h + DataSet.o : DataSet.cpp CpptrajStdio.h DataSet.h + DataSetList.o : DataSetList.cpp CpptrajStdio.h DataSet.h DataSetList.h = intDataSet.h mapDataSet.h stringDataSet.h + vectormath.o : vectormath.cpp CpptrajStdio.h vectormath.h +@@ -23,9 +23,9 @@ + DataFile.o : DataFile.cpp BaseFileIO.h CpptrajStdio.h DataFile.h DataSe= t.h PtrajFile.h + DataFileList.o : DataFileList.cpp BaseFileIO.h CpptrajStdio.h DataFile.= h DataFileList.h DataSet.h PtrajFile.h + PDBfile.o : PDBfile.cpp AmberParm.h ArgList.h AtomMask.h BaseFileIO.h C= pptrajStdio.h Frame.h PDBfile.h PDBfileRoutines.h PtrajFile.h Range.h Tra= jFile.h +-PtrajFile.o : PtrajFile.cpp BaseFileIO.h Bzip2File.h CpptrajStdio.h Gzi= pFile.h MpiFile.h NetcdfRoutines.h PDBfileRoutines.h PtrajFile.h PtrajMpi= .h StdFile.h ++PtrajFile.o : PtrajFile.cpp BaseFileIO.h Bzip2File.h CpptrajStdio.h Gzi= pFile.h Mol2FileRoutines.h MpiFile.h NetcdfRoutines.h PDBfileRoutines.h P= trajFile.h PtrajMpi.h StdFile.h + PDBfileRoutines.o : PDBfileRoutines.cpp PDBfileRoutines.h +-AtomMap.o : AtomMap.cpp Action.h AmberParm.h ArgList.h AtomMap.h AtomMa= sk.h BaseFileIO.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h Data= SetList.h Frame.h FrameList.h PDBfileRoutines.h ParmFileList.h PtrajFile.= h TorsionRoutines.h ++AtomMap.o : AtomMap.cpp Action.h AmberParm.h ArgList.h AtomMap.h AtomMa= sk.h BaseFileIO.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h Data= SetList.h Frame.h FrameList.h Mol2File.h ParmFileList.h PtrajFile.h Range= .h TorsionRoutines.h TrajFile.h + BaseFileIO.o : BaseFileIO.cpp BaseFileIO.h PtrajMpi.h + StdFile.o : StdFile.cpp BaseFileIO.h StdFile.h + GzipFile.o : GzipFile.cpp BaseFileIO.h CpptrajStdio.h GzipFile.h +@@ -62,3 +62,4 @@ + Action_Pucker.o : Action_Pucker.cpp Action.h Action_Pucker.h AmberParm.= h ArgList.h AtomMask.h BaseFileIO.h CpptrajStdio.h DataFile.h DataFileLis= t.h DataSet.h DataSetList.h Frame.h FrameList.h ParmFileList.h PtrajFile.= h + Range.o : Range.cpp ArgList.h CpptrajStdio.h Range.h + Action_Outtraj.o : Action_Outtraj.cpp Action.h Action_Outtraj.h AmberPa= rm.h ArgList.h AtomMask.h BaseFileIO.h CoordFileList.h CpptrajStdio.h Dat= aFile.h DataFileList.h DataSet.h DataSetList.h Frame.h FrameList.h ParmFi= leList.h PtrajFile.h PtrajMpi.h Range.h TrajFile.h TrajoutList.h ++Action_Rms2d.o : Action_Rms2d.cpp Action.h Action_Rms2d.h AmberParm.h A= rgList.h AtomMask.h BaseFileIO.h CpptrajStdio.h DataFile.h DataFileList.h= DataSet.h DataSetList.h Frame.h FrameList.h ParmFileList.h PtrajFile.h +diff -urN amber11.orig/AmberTools/src/cpptraj/src/DataFile.cpp amber11/A= mberTools/src/cpptraj/src/DataFile.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/DataFile.cpp 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/DataFile.cpp 2011-10-25 15:01:28.= 098288651 +0300 +@@ -65,8 +65,49 @@ + isInverted=3Dtrue; + } +=20 +-/* +- * DataFile::AddSet() ++/* DataFile::SetPrecision() ++ * Set precision of the specified dataset to width.precision. If '*' sp= ecified=20 ++ * set for all datasets in file. ++ */ ++void DataFile::SetPrecision(char *dsetName, int widthIn, int precisionI= n) { ++ int precision, dset; ++ DataSet *Dset =3D NULL; ++ ++ if (dsetName=3D=3DNULL) { ++ mprintf("Error: SetPrecision must be called with dataset name or '*= '.\n"); ++ return; ++ } ++ if (widthIn<1) { ++ mprintf("Error: SetPrecision (%s): Cannot set width < 1.\n",filenam= e); ++ return; ++ } ++ precision=3DprecisionIn; ++ if (precisionIn<0) precision=3D0; ++ // If =3D=3D'*' specified set precision for all data sets ++ if (dsetName[0]=3D=3D'*') { ++ mprintf(" Setting width.precision for all sets in %s to %i.%i\n"= , ++ filename,widthIn,precision); ++ for (dset=3D0; dsetSetPrecision(widthIn,precision); ++ ++ // Otherwise find dataset and set precision ++ } else { ++ mprintf(" Setting width.precision for dataset %s to %i.%i\n", ++ dsetName,widthIn,precision); ++ for (dset=3D0; dsetName(), dsetName)=3D=3D0 ) { ++ Dset=3DSetList[dset]; ++ break; ++ } ++ } ++ if (Dset!=3DNULL) ++ Dset->SetPrecision(widthIn,precision); ++ else ++ mprintf("Error: Dataset %s not found in datafile %s\n",dsetName,f= ilename); ++ } ++} ++ ++/* DataFile::AddSet() + * Add given set to this datafile + */ + int DataFile::AddSet(DataSet *D) { +diff -urN amber11.orig/AmberTools/src/cpptraj/src/DataFile.h amber11/Amb= erTools/src/cpptraj/src/DataFile.h +--- amber11.orig/AmberTools/src/cpptraj/src/DataFile.h 2011-04-14 15:30:= 16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/DataFile.h 2011-10-25 15:01:28.09= 8288651 +0300 +@@ -30,6 +30,7 @@ + void SetXlabel(char*); + void SetInverted(); + void SetNoXcol(); ++ void SetPrecision(char *, int, int); + int AddSet(DataSet *); + int NameIs(char *); + void DataSetNames(); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/DataFileList.cpp amber= 11/AmberTools/src/cpptraj/src/DataFileList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/DataFileList.cpp 2011-04-14 = 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/DataFileList.cpp 2011-10-25 15:01= :28.201288557 +0300 +@@ -1,4 +1,5 @@ + // DataFileList ++#include + #include "DataFileList.h" + #include "CpptrajStdio.h" +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/DataSet.cpp amber11/Am= berTools/src/cpptraj/src/DataSet.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/DataSet.cpp 2011-04-14 15:30= :16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/DataSet.cpp 2011-10-25 15:01:28.0= 94288655 +0300 +@@ -1,6 +1,7 @@ + // DataSet + #include + #include ++#include // sprintf + #include "DataSet.h" + #include "CpptrajStdio.h" +=20 +@@ -11,12 +12,73 @@ + N=3D0; + isDynamic=3Dfalse; + current=3D0; ++ width =3D 0; ++ precision =3D 0; ++ format =3D NULL; ++ dType =3D UNKNOWN_DATA; + } +=20 + // DESTRUCTOR + DataSet::~DataSet() { + //fprintf(stderr,"DataSet Destructor\n"); + if (name!=3DNULL) free(name); ++ if (format!=3DNULL) free(format); ++} ++ ++/* ++ * DataSet::setFormatString() ++ * Set up the output format string for each data element based on the g= iven=20 ++ * dataType and the current width, and precision. ++ */ ++void DataSet::setFormatString() { ++ size_t stringWidth =3D 0; ++ int wWidth =3D 0; ++ int pWidth =3D 0; ++ ++ if (format!=3DNULL) {free(format); format=3DNULL;} ++ ++ // Calc num of chars necessary to hold width ++ wWidth =3D (width / 10) + 1; ++ ++ switch (dType) { ++ case DOUBLE : ++ // Calc num of chars necessary to hold precision ++ pWidth =3D (precision / 10) + 1; ++ // String fmt: " %w.plf\0" ++ stringWidth =3D pWidth + wWidth + 6; ++ format =3D (char*) malloc( stringWidth * sizeof(char) ); ++ sprintf(format, " %%%i.%ilf", width, precision); ++ break; ++ case STRING : ++ // String fmt: " %s" ++ format =3D (char*) malloc( 4 * sizeof(char) ); ++ strcpy(format, " %s"); ++ break; ++ case INT : ++ // String fmt: " %wi" ++ stringWidth =3D wWidth + 4; ++ format =3D (char*) malloc( stringWidth * sizeof(char) ); ++ sprintf(format, " %%%ii", width); ++ break; ++ case UNKNOWN_DATA : ++ mprintf("Internal Error: setFormatString called with unknown data= type.\n"); ++ } ++ ++ if (format=3D=3DNULL)=20 ++ mprintf("Error: setFormatString: Could not allocate memory for stri= ng.\n"); ++ // DEBUG ++ //else ++ // mprintf("DEBUG: Format string: [%s]\n",format); ++} =20 ++ ++/* ++ * DataSet::SetPrecision() ++ * Set dataset width and precision and recalc output format string. ++ */ ++void DataSet::SetPrecision(int widthIn, int precisionIn) { ++ width=3DwidthIn; ++ precision=3DprecisionIn; ++ setFormatString(); + } +=20 + /*=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/DataSet.h amber11/Ambe= rTools/src/cpptraj/src/DataSet.h +--- amber11.orig/AmberTools/src/cpptraj/src/DataSet.h 2011-04-14 15:30:1= 6.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/DataSet.h 2011-10-25 15:01:28.103= 288646 +0300 +@@ -36,12 +36,18 @@ + class DataSet { + protected: + char *name; // Name of the dataset ++ dataType dType; // The dataset type + int N; // Number of data elements + int current; // The current data element ++ int width; // The output width of a data element ++ int precision; // The output precision of a data element (if ap= plicable) ++ char *format; // Format of output ++ =20 + bool isDynamic; // True : N is not known, reallocate as N increa= ses + // False: N is known, allocate for N + // If not isDynamic, Allocate will reserve space for N data element= s=20 + virtual int Allocate( ) { return 0; } ++ void setFormatString(); +=20 + public: +=20 +@@ -51,13 +57,16 @@ + virtual int Xmax() { return 0; } + virtual int isEmpty(int) { return 0; } + virtual void Add( int, void * ) { return; } ++ virtual int Get( void *, int ) { return 1; } + virtual char *Write(char*, int) { return 0; } + virtual int Width() { return 0; } + virtual int Sync() { return 0; } +=20 ++ void SetPrecision(int,int); + int Setup(char*,int); + void Info(); + char *Name() { return name; } + int CheckSet(); ++ dataType Type() {return dType;} + }; + #endif=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Frame.cpp amber11/Ambe= rTools/src/cpptraj/src/Frame.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Frame.cpp 2011-04-14 15:30:1= 6.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Frame.cpp 2011-10-25 15:01:28.120= 288631 +0300 +@@ -60,8 +60,38 @@ + if (Mass!=3DNULL) free(Mass); + } +=20 +-/* +- * Frame::Copy() ++/* Frame::ZeroCoords() ++ * Set all coords to 0.0 ++ */ ++void Frame::ZeroCoords() { ++ for (int coord=3D0; coord < N; coord++) ++ X[coord]=3D0.0; ++} ++ ++/* Frame::AddCoord() ++ * Add the coord values from the input frame to the coord values of=20 ++ * this frame. ++ */ ++void Frame::AddCoord(Frame *FrameIn) { ++ if (FrameIn->N !=3D this->N) { ++ mprintf("Error: Frame::AddCoord: Attempting to add %i coords to %i = coords.\n", ++ FrameIn->N,this->N); ++ } else { ++ for (int coord=3D0; coord < N; coord++) ++ this->X[coord] +=3D FrameIn->X[coord]; ++ } ++} ++ ++/* Frame::Divide() ++ * Divide all coord values by input. Dont do it if the number is too sm= all. ++ */ ++void Frame::Divide(double divisor) { ++ if (divisor < SMALL) return; ++ for (int coord=3D0; coord < N; coord++) ++ X[coord] /=3D divisor; ++} ++ ++/* Frame::Copy() + * Return a copy of the frame + */ + Frame *Frame::Copy() { +@@ -423,21 +453,21 @@ + * Based on useMassIn, calculate geometric center (false) or center of = mass=20 + * (true) of the atoms in each mask. + */ +-double Frame::DIST2(AtomMask *Mask1, AtomMask *Mask2, bool useMassIn, i= nt ifbox, ++double Frame::DIST2(AtomMask *Mask1, AtomMask *Mask2, bool useMassIn, i= nt boxType, + double *ucell, double *recip) { + double a1[3], a2[3]; +=20 + COM(Mask1, a1, useMassIn); + COM(Mask2, a2, useMassIn); +=20 +- if (ifbox =3D=3D 0)=20 ++ if (boxType =3D=3D 0)=20 + return DIST2_NoImage(a1, a2); +- else if (ifbox =3D=3D 1)=20 ++ else if (boxType =3D=3D 1)=20 + return DIST2_ImageOrtho(a1, a2, this->box); +- else if (ifbox =3D=3D 2)=20 ++ else if (boxType =3D=3D 2)=20 + return DIST2_ImageNonOrtho(a1, a2, ucell, recip); +=20 +- mprintf(" Error: Frame::DIST: Unrecognized box type (%i)\n.", ifbo= x); ++ mprintf(" Error: Frame::DIST: Unrecognized box type (%i)\n.", boxT= ype); +=20 + return (-1.0); + } +@@ -445,8 +475,11 @@ + /* + * Frame::DIST2() + * Return the distance between atoms A1 and A2 with optional imaging. ++ * 0 =3D None ++ * 1 =3D Orthorhombic ++ * 2 =3D Non-orthorhombic + */ +-double Frame::DIST2(int A1, int A2, int ifbox, double *ucell, double *r= ecip) { ++double Frame::DIST2(int A1, int A2, int boxType, double *ucell, double = *recip) { + int atom3; + double a1[3], a2[3]; +=20 +@@ -459,14 +492,14 @@ + a2[1] =3D X[atom3+1]; + a2[2] =3D X[atom3+2]; +=20 +- if (ifbox =3D=3D 0) ++ if (boxType =3D=3D 0) + return DIST2_NoImage(a1, a2); +- else if (ifbox =3D=3D 1) ++ else if (boxType =3D=3D 1) + return DIST2_ImageOrtho(a1, a2, this->box); +- else if (ifbox =3D=3D 2)=20 ++ else if (boxType =3D=3D 2)=20 + return DIST2_ImageNonOrtho(a1, a2, ucell, recip); +=20 +- mprintf(" Error: Frame::DIST: Unrecognized box type (%i)\n.", ifbo= x); ++ mprintf(" Error: Frame::DIST: Unrecognized box type (%i)\n.", boxT= ype); +=20 + return (-1.0); + } +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Frame.h amber11/AmberT= ools/src/cpptraj/src/Frame.h +--- amber11.orig/AmberTools/src/cpptraj/src/Frame.h 2011-04-14 15:30:16.= 000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Frame.h 2011-10-25 15:01:28.09228= 8656 +0300 +@@ -22,6 +22,9 @@ + Frame(AtomMask *, double *); + virtual ~Frame(); // Destructor is virtual since this c= lass can be inherited +=20 ++ void ZeroCoords(); ++ void AddCoord(Frame*); ++ void Divide(double); + void printAtomCoord(int); + void GetCoord(double *, int); + void SetCoord(int, double *); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/FrameList.cpp amber11/= AmberTools/src/cpptraj/src/FrameList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/FrameList.cpp 2011-04-14 15:= 30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/FrameList.cpp 2011-10-25 15:01:28= .073288675 +0300 +@@ -13,7 +13,8 @@ + delete frameList[i]; + } +=20 +-/* FrameList::Add() ++/*=20 ++ * FrameList::Add() + * Add given Frame to the FrameList. Store trajectory name that this fr= ame + * came from in frameNames. Store the associated parm in FrameParm.=20 + */ +@@ -29,6 +30,18 @@ + FrameParm.Add(P); + Nframe++; + return 0; ++} ++ ++/* ++ * FrameList::Add() ++ * Add given Frame to the FrameList. Store the associated parm in Frame= Parm. ++ */ ++int FrameList::Add(Frame *F, AmberParm *P) { ++ if (F=3D=3DNULL || P=3D=3DNULL) return 1; ++ frameList.push_back(F); ++ FrameParm.Add(P); ++ Nframe++; ++ return 0; + } +=20 + /*=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/FrameList.h amber11/Am= berTools/src/cpptraj/src/FrameList.h +--- amber11.orig/AmberTools/src/cpptraj/src/FrameList.h 2011-04-14 15:30= :16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/FrameList.h 2011-10-25 15:01:28.0= 73288675 +0300 +@@ -18,6 +18,7 @@ + ~FrameList(); +=20 + int Add(Frame *, char *, AmberParm *,int); ++ int Add(Frame *, AmberParm *); + AmberParm *GetFrameParm(int); + int GetFrameIndex(char *); + Frame *GetFrame(int idx); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/GzipFile.cpp amber11/A= mberTools/src/cpptraj/src/GzipFile.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/GzipFile.cpp 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/GzipFile.cpp 2011-10-25 15:01:28.= 227288533 +0300 +@@ -77,18 +77,24 @@ +=20 + /* + * GzipFile::Read() ++ * NOTE: gzread returns 0 on EOF, -1 on error + */ + int GzipFile::Read(void *buffer, size_t size, size_t count) { + //size_t numread; + int numread; ++ int expectedread; ++ =20 ++ expectedread =3D (int)size; ++ expectedread *=3D (int)count; + // Should never be able to call Read when fp is NULL. + //if (fp=3D=3DNULL) { + // fprintf(stdout,"Error: GzipFile::Read: Attempted to read NULL fil= e pointer.\n"); + // return 1; + //} +- numread =3D gzread(fp, buffer, size * count); +- if (numread =3D=3D -1) return -1; +- ++ numread =3D gzread(fp, buffer, expectedread); ++ if (numread !=3D expectedread) return -1; ++ //if (numread < 1 ) return -1; ++ =20 + // NOTE: Check for errors here. + return numread; + } +diff -urN amber11.orig/AmberTools/src/cpptraj/src/intDataSet.cpp amber11= /AmberTools/src/cpptraj/src/intDataSet.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/intDataSet.cpp 2011-04-14 15= :30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/intDataSet.cpp 2011-10-25 15:01:2= 8.103288646 +0300 +@@ -5,6 +5,14 @@ + #include "PtrajMpi.h" + #include "CpptrajStdio.h" + using namespace std; ++ ++// CONSTRUCTOR ++intDataSet::intDataSet() { ++ width=3D12; ++ dType=3DINT; ++ setFormatString(); ++} ++ + /* + * intDataSet::Xmax(() + * Return the maximum X value added to this set. By convention this is=20 +@@ -33,8 +41,21 @@ + current++; + } +=20 +-/* +- * intDataSet::isEmpty() ++/* intDataSet::Get() ++ * Get data at frame, put into vOut. Return 1 if no data at frame. ++ */ ++int intDataSet::Get(void *vOut, int frame) { ++ int *value; ++ ++ if (vOut=3D=3DNULL) return 1; ++ value =3D (int*) vOut; ++ it=3DData.find( frame ); ++ if (it =3D=3D Data.end()) return 1; ++ *value =3D (*it).second; ++ return 0; ++} ++ ++/* intDataSet::isEmpty() + */ + int intDataSet::isEmpty(int frame) { + it =3D Data.find( frame ); +@@ -52,17 +73,17 @@ + it =3D Data.find( frame ); + if (it =3D=3D Data.end())=20 + //sprintf(buffer," %12s","NoData"); +- sprintf(buffer," %12i", 0); ++ sprintf(buffer, format, 0); + else=20 +- sprintf(buffer," %12i",(*it).second); +- return (buffer + 13); ++ sprintf(buffer, format, (*it).second); ++ return (buffer + width + 1); + } +=20 + /* + * intDataSet::Width() + */ + int intDataSet::Width() { +- return 13; ++ return (width + 1); + } +=20 + /* +diff -urN amber11.orig/AmberTools/src/cpptraj/src/intDataSet.h amber11/A= mberTools/src/cpptraj/src/intDataSet.h +--- amber11.orig/AmberTools/src/cpptraj/src/intDataSet.h 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/intDataSet.h 2011-10-25 15:01:28.= 104288645 +0300 +@@ -11,9 +11,12 @@ + std::map Data; + std::map::iterator it; + public: ++ intDataSet(); ++ + int Xmax(); + int isEmpty(int); + void Add( int, void * ); ++ int Get(void *, int); + char *Write(char *, int); + int Width(); + int Sync(); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/main.cpp amber11/Amber= Tools/src/cpptraj/src/main.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/main.cpp 2011-04-14 15:30:16= .000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/main.cpp 2011-10-25 15:01:28.2282= 88532 +0300 +@@ -6,7 +6,7 @@ + #include "PtrajMpi.h" + #include "CpptrajStdio.h" + #ifndef CPPTRAJ_VERSION_STRING +-#define CPPTRAJ_VERSION_STRING "V1.0.5" ++#define CPPTRAJ_VERSION_STRING "V1.1.1" + #endif +=20 + void Usage(char *programName) { +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Makefile amber11/Amber= Tools/src/cpptraj/src/Makefile +--- amber11.orig/AmberTools/src/cpptraj/src/Makefile 2011-04-14 15:30:16= .000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Makefile 2011-10-25 15:01:28.0752= 88673 +0300 +@@ -16,7 +16,8 @@ + Action_Radgyr.cpp Conflib.cpp Action_Mask.cpp Action_Closest.cpp= \ + NetcdfRoutines.cpp AmberRestartNC.cpp CpptrajStdio.cpp Mol2File.= cpp \ + Mol2FileRoutines.cpp Action_NAstruct.cpp DistRoutines.cpp AxisTy= pe.cpp \ +- TorsionRoutines.cpp Action_Pucker.cpp Range.cpp Action_Outtraj.c= pp ++ TorsionRoutines.cpp Action_Pucker.cpp Range.cpp Action_Outtraj.c= pp \ ++ Action_Rms2d.cpp +=20 + OBJECTS=3Dmain.o AmberNetcdf.o AmberParm.o AmberTraj.o TrajFile.o \ + Frame.o PtrajState.o ArgList.o ptrajmask.o Action_Distance.o \ +@@ -32,7 +33,8 @@ + Action_Radgyr.o Conflib.o Action_Mask.o Action_Closest.o \ + NetcdfRoutines.o AmberRestartNC.o CpptrajStdio.o Mol2File.o \ + Mol2FileRoutines.o Action_NAstruct.o DistRoutines.o AxisType.o = \ +- TorsionRoutines.o Action_Pucker.o Range.o Action_Outtraj.o ++ TorsionRoutines.o Action_Pucker.o Range.o Action_Outtraj.o \ ++ Action_Rms2d.o +=20 + HEADERS=3DAmberNetcdf.h AmberParm.h AmberTraj.h TrajFile.h \ + Frame.h PtrajState.h ArgList.h ptrajmask.h Action.h Action_Dist= ance.h \ +@@ -48,7 +50,8 @@ + Action_Radgyr.h Conflib.h Action_Mask.h Action_Closest.h \ + NetcdfRoutines.h AmberRestartNC.h CpptrajStdio.h Mol2File.h \ + Mol2FileRoutines.h Action_NAstruct.h DistRoutines.h AxisType.h = \ +- TorsionRoutines.h Action_Pucker.h Range.h Action_Outtraj.h ++ TorsionRoutines.h Action_Pucker.h Range.h Action_Outtraj.h \ ++ Action_Rms2d.h +=20 + all: cpptraj$(SFX) +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Makefile_at amber11/Am= berTools/src/cpptraj/src/Makefile_at +--- amber11.orig/AmberTools/src/cpptraj/src/Makefile_at 2011-04-14 15:30= :16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Makefile_at 2011-10-25 15:01:28.0= 76288672 +0300 +@@ -16,7 +16,8 @@ + Action_Radgyr.cpp Conflib.cpp Action_Mask.cpp Action_Closest.cpp= \ + NetcdfRoutines.cpp AmberRestartNC.cpp CpptrajStdio.cpp Mol2File.= cpp \ + Mol2FileRoutines.cpp Action_NAstruct.cpp DistRoutines.cpp AxisTy= pe.cpp \ +- TorsionRoutines.cpp Action_Pucker.cpp Range.cpp Action_Outtraj.c= pp ++ TorsionRoutines.cpp Action_Pucker.cpp Range.cpp Action_Outtraj.c= pp \ ++ Action_Rms2d.cpp +=20 + OBJECTS=3Dmain.o AmberNetcdf.o AmberParm.o AmberTraj.o TrajFile.o \ + Frame.o PtrajState.o ArgList.o ptrajmask.o Action_Distance.o \ +@@ -32,7 +33,8 @@ + Action_Radgyr.o Conflib.o Action_Mask.o Action_Closest.o \ + NetcdfRoutines.o AmberRestartNC.o CpptrajStdio.o Mol2File.o \ + Mol2FileRoutines.o Action_NAstruct.o DistRoutines.o AxisType.o = \ +- TorsionRoutines.o Action_Pucker.o Range.o Action_Outtraj.o ++ TorsionRoutines.o Action_Pucker.o Range.o Action_Outtraj.o \ ++ Action_Rms2d.o +=20 + HEADERS=3DAmberNetcdf.h AmberParm.h AmberTraj.h TrajFile.h \ + Frame.h PtrajState.h ArgList.h ptrajmask.h Action.h Action_Dist= ance.h \ +@@ -48,7 +50,8 @@ + Action_Radgyr.h Conflib.h Action_Mask.h Action_Closest.h \ + NetcdfRoutines.h AmberRestartNC.h CpptrajStdio.h Mol2File.h \ + Mol2FileRoutines.h Action_NAstruct.h DistRoutines.h AxisType.h = \ +- TorsionRoutines.h Action_Pucker.h Range.h Action_Outtraj.h ++ TorsionRoutines.h Action_Pucker.h Range.h Action_Outtraj.h \ ++ Action_Rms2d.h +=20 + all: cpptraj$(SFX) +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/mapDataSet.cpp amber11= /AmberTools/src/cpptraj/src/mapDataSet.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/mapDataSet.cpp 2011-04-14 15= :30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/mapDataSet.cpp 2011-10-25 15:01:2= 8.104288645 +0300 +@@ -6,6 +6,14 @@ + #include "CpptrajStdio.h" + using namespace std; +=20 ++// CONSTRUCTOR ++mapDataSet::mapDataSet() { ++ width =3D 12; ++ precision =3D 4; ++ dType=3DDOUBLE; ++ setFormatString(); ++} ++ + /* + * mapDataSet::Xmax(() + * Return the maximum X value added to this set. By convention this is=20 +@@ -34,8 +42,23 @@ + current++; + } +=20 +-/* +- * mapDataSet::isEmpty() ++/* mapDataSet::Get() ++ * Get data at frame, put into vOut. Return 1 if no data at frame. ++ */ ++int mapDataSet::Get(void *vOut, int frame) { ++ double *value; ++ =20 ++ if (vOut=3D=3DNULL) return 1; ++ //mprintf("DEBUG: Attempting to get double frame %i\n",frame); ++ value =3D (double*) vOut; ++ it=3DData.find( frame ); ++ if (it =3D=3D Data.end()) return 1; ++ //mprintf("DEBUG: Double frame %i is %lf\n",frame,(*it).second); ++ *value =3D (*it).second; ++ return 0; ++} ++ ++/* mapDataSet::isEmpty() + */ + int mapDataSet::isEmpty(int frame) { + it =3D Data.find( frame ); +@@ -53,17 +76,17 @@ + it =3D Data.find( frame ); + if (it =3D=3D Data.end())=20 + //sprintf(buffer," %12s","NoData"); +- sprintf(buffer," %12.4lf", 0.0); ++ sprintf(buffer, format, 0.0); + else=20 +- sprintf(buffer," %12.4lf",(*it).second); +- return (buffer + 13); ++ sprintf(buffer, format,(*it).second); ++ return (buffer + width + 1); + } +=20 + /* + * mapDataSet::Width() + */ + int mapDataSet::Width() { +- return 13; ++ return (width + 1); + } +=20 + /* +diff -urN amber11.orig/AmberTools/src/cpptraj/src/mapDataSet.h amber11/A= mberTools/src/cpptraj/src/mapDataSet.h +--- amber11.orig/AmberTools/src/cpptraj/src/mapDataSet.h 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/mapDataSet.h 2011-10-25 15:01:28.= 105288645 +0300 +@@ -7,14 +7,16 @@ + */ + #include + #include "DataSet.h" +-//using namespace std; + class mapDataSet : public DataSet { + std::map Data; + std::map::iterator it; + public: ++ mapDataSet(); ++ + int Xmax(); + int isEmpty(int); + void Add( int, void * ); ++ int Get(void *, int); + char *Write(char *, int); + int Width(); + int Sync(); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Mol2File.cpp amber11/A= mberTools/src/cpptraj/src/Mol2File.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/Mol2File.cpp 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Mol2File.cpp 2011-10-25 15:01:28.= 127288624 +0300 +@@ -239,6 +239,8 @@ + if (writeMode=3D=3D2) + File->IO->Close(); +=20 ++ currentFrame++; ++ + return 0; + } + =20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/PDBfile.cpp amber11/Am= berTools/src/cpptraj/src/PDBfile.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/PDBfile.cpp 2011-04-14 15:30= :16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/PDBfile.cpp 2011-10-25 15:01:28.1= 28288623 +0300 +@@ -207,6 +207,9 @@ + } else if (writeMode=3D=3D1) { + File->IO->Printf("ENDMDL\n"); + } ++ ++ currentFrame++; ++ + return 0; + } +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/PtrajActionList.cpp am= ber11/AmberTools/src/cpptraj/src/PtrajActionList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/PtrajActionList.cpp 2011-04-= 14 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/PtrajActionList.cpp 2011-10-25 15= :01:28.105288645 +0300 +@@ -20,6 +20,7 @@ + #include "Action_NAstruct.h" + #include "Action_Pucker.h" + #include "Action_Outtraj.h" ++#include "Action_Rms2d.h" +=20 + // Constructor + PtrajActionList::PtrajActionList() { +@@ -56,6 +57,7 @@ +=20 + // Decide what action this is based on the command. + if (A->CommandIs("distance")) {Act=3Dnew Distance;} ++ else if (A->CommandIs("rms2d")) {Act=3Dnew Rms2d; } + else if (A->CommandIs("rmsd",3)) {Act=3Dnew Rmsd; } + else if (A->CommandIs("dihedral")) {Act=3Dnew Dihedral;} + else if (A->CommandIs("atommap")) {Act=3Dnew AtomMap; } +@@ -166,6 +168,8 @@ + err =3D ActionList[act]->DoAction(FrameAddress, frameIn); + if (err=3D=3D1) { + // Treat actions that fail as if they could not be set up ++ mprintf("Warning: Action [%s] failed, frame %i.\n",ActionList[act= ]->CmdLine(), ++ frameIn); + ActionList[act]->noSetup=3D1; + } else if (err=3D=3D2) { + // Return value of 2 requests return to original frame +diff -urN amber11.orig/AmberTools/src/cpptraj/src/PtrajFile.cpp amber11/= AmberTools/src/cpptraj/src/PtrajFile.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/PtrajFile.cpp 2011-04-14 15:= 30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/PtrajFile.cpp 2011-10-25 15:01:28= .196288560 +0300 +@@ -113,6 +113,7 @@ + void PtrajFile::CloseFile() { + if (isOpen) { + IO->Close(); ++ if (debug>0) rprintf("Closed %s.\n",filename); + isOpen=3D0; + } + } +@@ -417,8 +418,8 @@ + // Standard file size is in the frame_stat struct + uncompressed_size =3D IO->Size(filename); +=20 +- // Determine format +- // Read first 3 bytes again to determine format by magic number ++ // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Determine format =3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D ++ // ---------- Read first 3 bytes again to determine format by magic n= umber ---------- + IO->Open(filename,"rb"); // NOTE: Err Check + memset(magic,0,3*sizeof(unsigned char)); + IO->Read(magic ,1,1); +@@ -454,7 +455,7 @@ + return 0; + } +=20 +- // ID by file characteristics; read the first two lines ++ // ---------- ID by file characteristics; read the first two lines --= -------- + // Initialize buffers to NULL + buffer1[0]=3D'\0'; + buffer2[0]=3D'\0'; +@@ -472,17 +473,6 @@ + } + } +=20 +- // Reopen and scan for Tripos mol2 molecule section +- // 0 indicates section found. +- IO->Open(filename,"r"); +- if (!Mol2ScanTo(this, MOLECULE)) { +- if (debug>0) mprintf(" TRIPOS MOL2 file\n"); +- fileFormat=3DMOL2FILE; +- IO->Close(); +- return 0; +- } +- IO->Close(); +- + // If both lines have PDB keywords, assume PDB + if (isPDBkeyword(buffer1) && isPDBkeyword(buffer2)) { + if (debug>0) mprintf(" PDB file\n"); +@@ -491,7 +481,8 @@ + } +=20 + // If either buffer contains a TRIPOS keyword assume Mol2 +- // NOTE: This will fail on tripos files with extensive header comment= s ++ // NOTE: This will fail on tripos files with extensive header comment= s. ++ // A more expensive check for mol2 files is below. + if (strncmp(buffer1,"@", 9)=3D=3D0 || + strncmp(buffer2,"@", 9)=3D=3D0) { + if (debug>0) mprintf(" TRIPOS MOL2 file\n"); +@@ -547,7 +538,19 @@ + } + } +=20 +- // NOTE: EXPERIMENTAL ++ // ---------- MORE EXPENSIVE CHECKS ---------- ++ // Reopen and scan for Tripos mol2 molecule section ++ // 0 indicates section found. ++ IO->Open(filename,"r"); ++ if (!Mol2ScanTo(this, MOLECULE)) { ++ if (debug>0) mprintf(" TRIPOS MOL2 file\n"); ++ fileFormat=3DMOL2FILE; ++ IO->Close(); ++ return 0; ++ } ++ IO->Close(); ++ ++ // ---------- EXPERIMENTAL ---------- + // If the file format is still undetermined and the file name is conf= lib.dat, + // assume this is a conflib.dat file from LMOD. Cant think of a bette= r way to + // detect this since there is no magic number but the file is binary. +diff -urN amber11.orig/AmberTools/src/cpptraj/src/PtrajMpi.c amber11/Amb= erTools/src/cpptraj/src/PtrajMpi.c +--- amber11.orig/AmberTools/src/cpptraj/src/PtrajMpi.c 2011-04-14 15:30:= 16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/PtrajMpi.c 2011-10-25 15:01:28.10= 0288649 +0300 +@@ -460,7 +460,10 @@ + } +=20 + err =3D MPI_Allreduce(input, Return, count, currentType, currentOp, M= PI_COMM_WORLD); +- if (err!=3DMPI_SUCCESS) printMPIerr(err, "Performing allreduce for %i= elements\n",count); ++ if (err!=3DMPI_SUCCESS) { ++ printMPIerr(err, "Performing allreduce.\n"); ++ rprintf("Error: allreduce failed for %i elements.\n",count); ++ } +=20 + if (parallel_check_error(err)!=3D0) return 1; + return 0; +diff -urN amber11.orig/AmberTools/src/cpptraj/src/PtrajState.cpp amber11= /AmberTools/src/cpptraj/src/PtrajState.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/PtrajState.cpp 2011-04-14 15= :30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/PtrajState.cpp 2011-10-25 15:01:2= 8.214288545 +0300 +@@ -7,7 +7,8 @@ + #include "CpptrajStdio.h" +=20 + // Constructor +-PtrajState::PtrajState() {=20 ++PtrajState::PtrajState() { ++ TotalErrors=3D0;=20 + debug=3D0; + showProgress=3D1; + } +@@ -291,6 +292,7 @@ + char *df_cmd =3D NULL; + char *name1 =3D NULL; + char *name2 =3D NULL; ++ int width,precision; + DataFile *df; +=20 + if (DF_Args.empty()) return; +@@ -349,6 +351,19 @@ + } + mprintf(" Not printing x column for datafile %s\n",name1); + df->SetNoXcol(); ++ =20 ++ // datafile precision ++ // Usage: datafile precision [] [] ++ // If width/precision not specified default to 12.4 ++ } else if ( strcmp(df_cmd,"precision")=3D=3D0 ) { ++ if (df=3D=3DNULL) { ++ mprintf("Error: datafile precision: DataFile %s does not exist.= \n",name1); ++ continue; ++ } ++ name2 =3D A->getNextString(); ++ width =3D A->getNextInteger(12); ++ precision =3D A->getNextInteger(4); ++ df->SetPrecision(name2,width,precision); + } +=20 + } // END loop over datafile args +@@ -374,7 +389,7 @@ +=20 + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D S E T U P P H A S E =3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=20 + // Calculate frame division among trajectories +- maxFrames=3DtrajFileList.SetupFrames(); ++ maxFrames=3DtrajFileList.SetupFrames(worldrank,worldsize); +=20 + // Parameter file information + parmFileList.Print(); +@@ -442,7 +457,7 @@ + // Perform Actions on Frame + ptrajActionList.DoActions(&CurrentFrame, actionSet); + // Do Output +- outFileList.Write(outputSet, CurrentFrame, CurrentParm); ++ outFileList.Write(actionSet, CurrentFrame, CurrentParm); + #ifdef DEBUG + dbgprintf("\tDEBUG: %30s: %4i\n",CurrentParm->parmName,CurrentPar= m->outFrame); + #endif +diff -urN amber11.orig/AmberTools/src/cpptraj/src/PtrajState.h amber11/A= mberTools/src/cpptraj/src/PtrajState.h +--- amber11.orig/AmberTools/src/cpptraj/src/PtrajState.h 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/PtrajState.h 2011-10-25 15:01:28.= 093288656 +0300 +@@ -20,6 +20,7 @@ + DataFileList DFL; // List of datafiles that data set= s will be written to + ArgList *A; // Current argument list + std::list DF_Args; // List of commands pertaining to = datafile creation etc ++ int TotalErrors; // Sum of all returned error statu= ses + int debug; +=20 + void SetGlobalDebug(int); // Set debug level for all compone= nts +diff -urN amber11.orig/AmberTools/src/cpptraj/src/ReferenceList.cpp ambe= r11/AmberTools/src/cpptraj/src/ReferenceList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/ReferenceList.cpp 2011-04-14= 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/ReferenceList.cpp 2011-10-25 15:0= 1:28.093288656 +0300 +@@ -20,11 +20,15 @@ + */ + int ReferenceList::Add(ArgList *A, ParmFileList *parmFileList, int worl= dsize) { + TrajFile *T; +- int startArg; ++ int startArg,stopArg,offsetArg; ++ bool average =3D false; +=20 + // Set up common arguments from arglist + if (this->ProcessArgList(A,parmFileList)) return 1; +=20 ++ // Check if we want to obtain the average structure ++ average =3D A->hasKey("average"); ++ + // Set up basic file to determine type and format + T =3D this->SetupTrajectory(trajfilename, fileAccess, UNKNOWN_FORMAT,= UNKNOWN_TYPE); +=20 +@@ -45,10 +49,18 @@ + // Get user-specified start arg + // NOTE: For compatibility with ptraj start from 1 + startArg=3DA->getNextInteger(1); +- T->SetArgs(startArg,startArg,1); ++ stopArg=3DstartArg; ++ offsetArg=3D1; ++ // Get user-specified stop and offset only if getting avg structure ++ if (average) { ++ stopArg=3DA->getNextInteger(-1); ++ offsetArg=3DA->getNextInteger(1); ++ } ++ T->SetArgs(startArg,stopArg,offsetArg); +=20 + // Add to trajectory file list +- this->push_back(T);=20 ++ this->push_back(T); ++ Average.push_back(average);=20 +=20 + return 0; + } +@@ -60,9 +72,11 @@ + * place that frame in refFrames. + */ + int ReferenceList::SetupRefFrames(FrameList *refFrames) { +- int trajFrames; +- Frame *F; ++ int trajFrames, global_set; ++ double Nframes; ++ Frame *F, *AvgFrame; + int skipValue; ++ int refTrajNum =3D 0; +=20 + mprintf("\nREFERENCE COORDS:\n"); + if (this->empty()) { +@@ -72,7 +86,13 @@ +=20 + for (it =3D this->begin(); it !=3D this->end(); it++) { + // Setup the reference traj for reading. Should only be 1 frame. +- trajFrames=3D(*it)->setupFrameInfo(-1); ++ // NOTE: For MPI, calling setupFrameInfo with worldrank 0, worldsiz= e 1 for=20 ++ // all ranks. This is to ensure each thread has a copy of the= ref=20 ++ // struct. ++ // Calling setupFrameInfo with -1 to ensure the Parm frame co= unt is ++ // not updated. ++ ++ trajFrames=3D(*it)->setupFrameInfo(-1,0,1); + if ((*it)->total_read_frames<1) { + rprintf("Error: No frames could be read for reference %s, skippin= g\n", + (*it)->trajfilename); +@@ -89,12 +109,34 @@ + skipValue=3D(*it)->skip; + (*it)->skip=3D0; + } +- (*it)->Begin(&trajFrames, 0); +- // Get and copy the 1 frame from Traj, then close +- // NOTE: What happens when not seekable? ++ // Start trajectory read ++ global_set=3D0; ++ (*it)->Begin(&global_set, 0); + (*it)->PrintInfo(1); +- (*it)->NextFrame(&trajFrames); +- F=3D(*it)->F->Copy(); ++ // If averaging requested, loop over specified frames and avg coord= s. ++ if (Average[refTrajNum++]) { ++ mprintf(" Averaging over %i frames.\n",trajFrames); ++ AvgFrame =3D new Frame((*it)->P->natom, (*it)->P->mass); ++ AvgFrame->ZeroCoords(); ++ global_set =3D 0; ++ Nframes =3D 0.0; ++ while ( (*it)->NextFrame(&global_set) ) { ++ AvgFrame->AddCoord( (*it)->F ); ++ Nframes++; ++ } ++ if (Nframes < 1.0) {=20 ++ mprintf("Error: reference average: # frames read is less than 1= .\n"); ++ F=3DNULL; ++ } else { ++ AvgFrame->Divide( Nframes ); ++ F=3DAvgFrame->Copy(); ++ } ++ delete AvgFrame;=20 ++ // If no averaging, get and copy the 1 frame from Traj, then close ++ } else { ++ (*it)->NextFrame(&trajFrames); ++ F=3D(*it)->F->Copy(); ++ } + // DEBUG + //fprintf(stdout,"DEBUG: Ref Coord Atom 0\n"); + //F->printAtomCoord(0); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/ReferenceList.h amber1= 1/AmberTools/src/cpptraj/src/ReferenceList.h +--- amber11.orig/AmberTools/src/cpptraj/src/ReferenceList.h 2011-04-14 1= 5:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/ReferenceList.h 2011-10-25 15:01:= 28.094288655 +0300 +@@ -5,7 +5,7 @@ + #include "FrameList.h" +=20 + class ReferenceList : public CoordFileList { +- ++ std::vector Average; + public: + =20 + ReferenceList(); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/RemdTraj.cpp amber11/A= mberTools/src/cpptraj/src/RemdTraj.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/RemdTraj.cpp 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/RemdTraj.cpp 2011-10-25 15:01:28.= 122288629 +0300 +@@ -88,7 +88,7 @@ + // NOTE: Should check that this is the case for ALL frames. + stop =3D T->Frames; + Frames =3D T->Frames; +- isBox =3D T->isBox; ++ BoxType =3D T->BoxType; + trajfilename =3D T->File->basefilename; + // Add it to the list + REMDtraj.push_back(T); +@@ -190,12 +190,12 @@ + return 1; + } + // Check that #Frames and box info matches +- if ( Frames!=3DT->Frames || isBox!=3DT->isBox ) { ++ if ( Frames!=3DT->Frames || BoxType!=3DT->BoxType ) { + mprintf( +- " ERROR: REMDTRAJ: #Frames (%i) or box info (%i) in re= plica does not match\n", +- T->Frames, T->isBox); +- mprintf(" values in lowest replica (Frames=3D= %i, box=3D%i)\n", +- Frames,isBox); ++ " ERROR: REMDTRAJ: #Frames (%i) or box type (%i) in re= plica does not match\n", ++ T->Frames, T->BoxType); ++ mprintf(" values in lowest replica (Frames=3D= %i, boxtype=3D%i)\n", ++ Frames,BoxType); + delete T; + free(repFilename); + free(Prefix); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/stringDataSet.cpp ambe= r11/AmberTools/src/cpptraj/src/stringDataSet.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/stringDataSet.cpp 2011-04-14= 15:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/stringDataSet.cpp 2011-10-25 15:0= 1:28.097288652 +0300 +@@ -6,6 +6,13 @@ + #include "PtrajMpi.h" + #include "CpptrajStdio.h" + using namespace std; ++ ++// CONSTRUCTOR ++stringDataSet::stringDataSet() { ++ dType=3DSTRING; ++ setFormatString(); ++} ++ + /* + * stringDataSet::Xmax(() + * Return the maximum X value added to this set. By convention this is=20 +@@ -54,10 +61,10 @@ +=20 + it =3D Data.find( frame ); + if (it =3D=3D Data.end()) {=20 +- sprintf(buffer," %s", "NoData"); ++ sprintf(buffer, format, "NoData"); + return (buffer + 7); + } else=20 +- sprintf(buffer," %s",(*it).second.c_str()); ++ sprintf(buffer, format, (*it).second.c_str()); +=20 + return (buffer + (*it).second.size() + 1); + } +diff -urN amber11.orig/AmberTools/src/cpptraj/src/stringDataSet.h amber1= 1/AmberTools/src/cpptraj/src/stringDataSet.h +--- amber11.orig/AmberTools/src/cpptraj/src/stringDataSet.h 2011-04-14 1= 5:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/stringDataSet.h 2011-10-25 15:01:= 28.097288652 +0300 +@@ -12,6 +12,8 @@ + std::map Data; + std::map::iterator it; + public: ++ stringDataSet(); ++ + int Xmax(); + int isEmpty(int); + void Add( int, void * ); +diff -urN amber11.orig/AmberTools/src/cpptraj/src/TrajFile.cpp amber11/A= mberTools/src/cpptraj/src/TrajFile.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/TrajFile.cpp 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/TrajFile.cpp 2011-10-25 15:01:28.= 122288629 +0300 +@@ -2,7 +2,6 @@ + #include + #include + #include "TrajFile.h" +-#include "PtrajMpi.h" // worldrank and worldsize needed to calc frame d= ivision + #include "CpptrajStdio.h" +=20 + // CONSTRUCTOR +@@ -18,7 +17,7 @@ + start=3D0; + stop=3D-1; + offset=3D1; +- isBox=3D0; ++ BoxType=3D0; + title=3DNULL; + P=3DNULL; + frameskip=3D0; +@@ -45,12 +44,17 @@ + void TrajFile::SetTitle(char *titleIn) { + size_t titleSize; +=20 ++ //mprintf("DEBUG: Attempting to set title for %s: [%s]\n",trajfilenam= e,titleIn); + if (titleIn=3D=3DNULL) return; + titleSize =3D strlen(titleIn); +- if (titleSize=3D=3D0) return; ++ //mprintf(" Title size is %i\n",titleSize); ++ if (titleSize=3D=3D0) { ++ mprintf("Warning: TrajFile::SetTitle(): Title for %s is 0 length.\n= ",trajfilename); ++ return; ++ } + this->title =3D (char*) malloc( (titleSize+1) * sizeof(char)); + if (this->title=3D=3DNULL) { +- mprintf("Error: TrajFile::SetTitle(): Could not allocate memory for= title.\n"); ++ mprintf("Error: SetTitle: Could not allocate memory for title of %s= .\n",trajfilename); + return; + } + strcpy(this->title, titleIn); +@@ -59,6 +63,30 @@ + } +=20 + /* ++ * TrajFile::CheckBoxType() ++ * Set the trajectory box type (ortho/nonortho) based on box angles. ++ * Check the current box type against the associated parmfile box type. ++ * Print a warning if they are different. ++ */ ++void TrajFile::CheckBoxType(double *box) { ++ // Determine orthogonal / non-orthogonal from angles ++ if (box[3]=3D=3D0.0 || box[4]=3D=3D0.0 || box[5]=3D=3D0.0) ++ BoxType=3D0; ++ else if (box[3]=3D=3D90.0 && box[4]=3D=3D90.0 && box[5]=3D=3D90.0) ++ BoxType=3D1; ++ else ++ BoxType=3D2; ++ if (P->BoxType !=3D BoxType) { ++ mprintf("Warning: %s contains box info of type %i (beta %lf)\n",tra= jfilename, ++ BoxType,box[4]); ++ mprintf(" but associated parmfile %s has box type %i (beta = %lf)\n",P->parmName,=20 ++ P->BoxType,P->Box[4]); ++ //mprintf(" Box information from trajectory will be used.\n= "); ++ } ++ if (debug>0) mprintf(" %s: Box type is %i (beta=3D%lf)\n",trajfile= name,BoxType,box[4]); ++} ++ ++/* + * TrajFile::PrintInfo() + * Print general trajectory information. Call TrajFile->Info for specif= ic information. + */ +@@ -68,7 +96,7 @@ +=20 + mprintf(", Parm %i",P->pindex); +=20 +- if (isBox) mprintf(" (with box info)"); ++ if (BoxType>0) mprintf(" (with box info)"); +=20 + if (showExtended=3D=3D0) { + mprintf("\n"); +@@ -85,7 +113,7 @@ + mprintf(": Writing %i frames", P->parmFrames); + if (File->access=3D=3DAPPEND) mprintf(", appended"); // NOTE: Dange= rous if REMD + } +- if (debug>0) mprintf(", %i atoms, Box %i, seekable %i",P->natom,isBox= ,seekable); ++ if (debug>0) mprintf(", %i atoms, Box %i, seekable %i",P->natom,BoxTy= pe,seekable); + mprintf("\n"); + } +=20 +@@ -164,7 +192,7 @@ + * Note that the input frames start counting from 1, output starts coun= ting from 0! + * If called with maxFrames=3D-1 dont update the frame in parm file. + */ +-int TrajFile::setupFrameInfo(int maxFrames) { ++int TrajFile::setupFrameInfo(int maxFrames, int worldrank, int worldsiz= e) { + int Nframes; + int ptraj_start_frame, ptraj_end_frame; + int traj_start_frame, traj_end_frame; +diff -urN amber11.orig/AmberTools/src/cpptraj/src/TrajFile.h amber11/Amb= erTools/src/cpptraj/src/TrajFile.h +--- amber11.orig/AmberTools/src/cpptraj/src/TrajFile.h 2011-04-14 15:30:= 16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/TrajFile.h 2011-10-25 15:01:28.12= 8288623 +0300 +@@ -25,44 +25,44 @@ + int offset; // Number of frames to skip while processing +=20 + // --=3D=3D Inherited by child classes =3D=3D-- +- virtual int open() { return 0; } // Open the file, prepare f= or coord read/write +- virtual void close() {} // Close the file ++ virtual int open() { return 0; } // Open the file, prepare for coor= d read/write ++ virtual void close() {} // Close the file ++ ++ void CheckBoxType(double *); // Check that traj boxtype matches= parm +=20 + public: + int debug; // Level of debug information to print + char *trajfilename; // The base trajectory filename +- // NOTE: I hate that the following are public. Only necessary for R= EMD processing!! ++ // NOTE: I hate that the 2 following are public. Only necessary for= REMD processing!! + int Frames; // Total number of frames in trajectory + int total_read_frames; // Total number of frames that will be read +- int isBox; // >0 means trajectory has box information +- ++ int BoxType; // 0: None, 1: Ortho, 2: NonOrtho=20 + Range *FrameRange; // list of frames to be written out + int hasTemperature; // 1 means trajectory has temperature inform= ation + PtrajFile *File; // Class that handles basic file IO + AmberParm *P; // Memory address of the associated parmfile + Frame *F; // Hold coordinates of the current frame +- int skip; /* READ: If =3D1 do not process this input t= rajectory=20 +- WRITE: If =3D1 this traj has been set up = for write */ ++ int skip; // READ: If =3D1 do not process this input t= rajectory=20 ++ // WRITE: If =3D1 this traj has been set up = for write +=20 + TrajFile(); // Constructor + virtual ~TrajFile(); // Destructor - virtual since this class is = inherited. +=20 +- int Start() { return start; } ++ int Start() { return start; } ++ int CurrentFrame() { return currentFrame; } + void SetTitle(char *); // Set trajectory title. + void PrintInfo(int); // Print trajectory Information +- int setupFrameInfo(int); // Set actual start/stop based on total #f= rames and #threads=20 +- int Begin(int *, int); /* Prepare traj for processing. Set output= start value, calcd in=20 +- * setupFrameInfo. Allocate memory for F.=20 +- */ +- int Begin(); // Prepare trajectory for output +- int NextFrame(int*); // Put the next target frame into F. +- void End(); // Close trajectory and free F memory +- void progressBar(); // Display trajectory progress to scre= en +-// void progressBar2(); // Display trajectory progress to sc= reen +- =20 +- void SetArgs(int,int,int); // Set the stop, start, and offset arg= s from user input ++ int Begin(int *, int); // Prepare traj for processing. Set output= start value, calcd in=20 ++ // setupFrameInfo. Allocate memory for F.=20 ++ int Begin(); // Prepare trajectory for output ++ int NextFrame(int*); // Put the next target frame into F. ++ void End(); // Close trajectory and free F memory ++ void progressBar(); // Display trajectory progress to screen ++// void progressBar2(); // Display trajectory progress to screen ++ int setupFrameInfo(int,int,int); // Set actual start/stop based on = total #frames and #threads=20 ++ void SetArgs(int,int,int); // Set the stop, start, and offset= args from user input + // --=3D=3D Inherited by child classes =3D=3D-- +- virtual int getFrame(int) { return 1; } // Read the next coord= frame into F ++ virtual int getFrame(int) { return 1; } // Read specified fram= e into F + virtual int SetupRead() { return 1; } // Set file up for rea= ding + virtual int WriteArgs(ArgList*){ return 0; } // (Opt.) Process any = args related to writing + virtual int SetupWrite() { return 1; } // Set file up for wri= ting +diff -urN amber11.orig/AmberTools/src/cpptraj/src/TrajinList.cpp amber11= /AmberTools/src/cpptraj/src/TrajinList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/TrajinList.cpp 2011-04-14 15= :30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/TrajinList.cpp 2011-10-25 15:01:2= 8.201288557 +0300 +@@ -1,4 +1,5 @@ + // TrajinList ++#include + #include "TrajinList.h" + #include "RemdTraj.h" + #include "CpptrajStdio.h" +@@ -70,7 +71,7 @@ + * actual start and stop and how many frames total will be processed. + * Return the number of frames to be processed. + */ +-int TrajinList::SetupFrames() { ++int TrajinList::SetupFrames(int worldrank, int worldsize) { + int maxFrames, trajFrames; +=20 + mprintf("\nTRAJECTORIES:\n"); +@@ -78,7 +79,7 @@ + maxFrames=3D0; +=20 + for (it =3D this->begin(); it !=3D this->end(); it++) { +- trajFrames =3D (*it)->setupFrameInfo(maxFrames); ++ trajFrames =3D (*it)->setupFrameInfo(maxFrames,worldrank,worldsize)= ; + if (trajFrames=3D=3D-1) { + maxFrames=3D-1; + } +diff -urN amber11.orig/AmberTools/src/cpptraj/src/TrajinList.h amber11/A= mberTools/src/cpptraj/src/TrajinList.h +--- amber11.orig/AmberTools/src/cpptraj/src/TrajinList.h 2011-04-14 15:3= 0:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/TrajinList.h 2011-10-25 15:01:28.= 090288658 +0300 +@@ -13,7 +13,7 @@ + // NOTE: worldsize is passed in as last arg to avoid include of Ptr= ajMpi + int Add(ArgList *A, ParmFileList *, int); + // TRAJIN: Set up frames to be processed=20 +- int SetupFrames(); ++ int SetupFrames(int,int); + }; + #endif +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/TrajoutList.cpp amber1= 1/AmberTools/src/cpptraj/src/TrajoutList.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/TrajoutList.cpp 2011-04-14 1= 5:30:16.000000000 +0300 ++++ amber11/AmberTools/src/cpptraj/src/TrajoutList.cpp 2011-10-25 15:01:= 28.202288556 +0300 +@@ -1,4 +1,5 @@ + // TrajoutList ++#include + #include "TrajoutList.h" + #include "CpptrajStdio.h" +=20 +@@ -20,7 +21,6 @@ + */ + int TrajoutList::Add(ArgList *A, ParmFileList *parmFileList, int worlds= ize) { + TrajFile *T; +- int boxInfo; + FileFormat writeFormat; + FileType writeType; + char *onlyframes;=20 +@@ -29,7 +29,6 @@ + if (this->ProcessArgList(A,parmFileList)) return 1; +=20 + // Init variables +- boxInfo=3D0; + writeFormat=3DAMBERTRAJ;=20 + writeType=3DUNKNOWN_TYPE; + =20 +@@ -56,10 +55,6 @@ + if (worldsize>1 && writeFormat!=3DAMBERRESTART)=20 + writeType=3DMPIFILE; +=20 +- // Set box info from parm file unless nobox is set. +- boxInfo=3DP->ifbox; +- if (A->hasKey("nobox")) boxInfo=3D0; +- + // Set up basic file for given type and format + // If type is unknown it will be determined from extension or will be= standard (default) + T =3D this->SetupTrajectory(trajfilename, fileAccess, writeFormat, wr= iteType); +@@ -90,10 +85,11 @@ + // Set parameter file + T->P=3DP; +=20 +- // Set box information (only needed for write) +- T->isBox=3DboxInfo; ++ // Set box type from parm file unless "nobox" specified =20 ++ T->BoxType=3DP->BoxType; ++ if (A->hasKey("nobox")) T->BoxType=3D0; +=20 +- // No setup here; Write is set up after first frame read in PtrajStat= e::Run ++ // No more setup here; Write is set up when first frame written. + // Add to trajectory file list + this->push_back(T);=20 +=20 +diff -urN amber11.orig/AmberTools/src/etc/chemistry/amber/readparm.py am= ber11/AmberTools/src/etc/chemistry/amber/readparm.py +--- amber11.orig/AmberTools/src/etc/chemistry/amber/readparm.py 2011-04-= 14 15:30:17.000000000 +0300 ++++ amber11/AmberTools/src/etc/chemistry/amber/readparm.py 2011-10-25 15= :01:28.200288558 +0300 +@@ -118,22 +118,44 @@ + """ Parses the fortran format statement. Recognizes ints, exponents,= and strings. + Returns the number of items/line, size of each item, and type of= data """ +=20 ++ # Get rid of ( and ) specifiers in Fortran format strings. This is a= hack, but ++ # should work for existing chamber prmtop files ++ ++ format_string =3D format_string.replace('(','').replace(')','') ++ ++ # Fix case for E, I, and F ++ ++ format_string =3D format_string.replace('e','E') ++ format_string =3D format_string.replace('i','I') ++ format_string =3D format_string.replace('f','F') ++ + if 'a' in format_string: # this is a string + format_parts =3D format_string.split('a') +- return int(format_parts[0]), int(format_parts[1]), 'str' ++ try: ++ return int(format_parts[0]), int(format_parts[1]), 'str', None ++ except: ++ return 1, 80, 'str', None +=20 + elif 'I' in format_string: # this is an integer + format_parts =3D format_string.split('I') +- return int(format_parts[0]), int(format_parts[1]), 'int' ++ if len(format_parts[0].strip()) =3D=3D 0: format_parts[0] =3D 1 ++ return int(format_parts[0]), int(format_parts[1]), 'int', None +=20 + elif 'E' in format_string: # this is a floating point decimal + format_parts =3D format_string.split('E') + decimal_parts =3D format_parts[1].split('.') +- return int(format_parts[0]), int(decimal_parts[0]), 'dec' ++ if len(format_parts[0].strip()) =3D=3D 0: format_parts[0] =3D 1 ++ return int(format_parts[0]), int(decimal_parts[0]), 'dec', int(de= cimal_parts[1]) ++ =20 ++ elif 'F' in format_string: # this is also a floating point decimal ++ format_parts =3D format_string.split('F') ++ decimal_parts =3D format_parts[1].split('.') ++ if len(format_parts[0].strip()) =3D=3D 0: format_parts[0] =3D 1 ++ return int(format_parts[0]), int(decimal_parts[0]), 'dec', int(de= cimal_parts[1]) +=20 + else: + print >> stderr, 'Error: Unrecognized format "%s"!' % format_stri= ng +- return 1, 80, 'str' ++ return 1, 80, 'str', None +=20 + # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++ +=20 +@@ -275,7 +297,7 @@ +=20 + elif prmlines[i][0:7] =3D=3D '%FORMAT': + self.formats[current_flag] =3D prmlines[i][8:len(prmlines[i= ].strip())-1] +- number_items_perline, size_item, dat_type =3D _parseFormat(= self.formats[current_flag]) ++ number_items_perline, size_item, dat_type, junk =3D _parseF= ormat(self.formats[current_flag]) + gathering_data =3D True +=20 + elif gathering_data: +@@ -339,17 +361,17 @@ + flag =3D self.flag_list[i] + new_prm.write('%%FLAG %s\n' % flag) + new_prm.write('%%FORMAT(%s)\n' % self.formats[flag]) +- number_items_perline, size_item, dat_type =3D _parseFormat(sel= f.formats[flag]) +- if dat_type =3D=3D 'dec': +- decnum =3D int(self.formats[flag].split('E')[1].split('.')[= 1]) ++ number_items_perline, size_item, dat_type, decnum =3D _parseFo= rmat(self.formats[flag]) + line =3D '' + num_items =3D 0 + if len(self.parm_data[flag]) =3D=3D 0: # empty field... + new_prm.write('\n') + continue + for j in range(len(self.parm_data[flag])): # write data in new= _prm +- if dat_type =3D=3D 'dec': ++ if dat_type =3D=3D 'dec' and 'E' in self.formats[flag].uppe= r(): + line +=3D ('%%%s.%sE' % (size_item, decnum)) % self.parm= _data[flag][j]=20 ++ elif dat_type =3D=3D 'dec' and 'F' in self.formats[flag].up= per(): ++ line +=3D ('%%%s.%sF' % (size_item, decnum)) % self.parm= _data[flag][j]=20 + elif dat_type =3D=3D 'int': + line +=3D ('%%%sd' % size_item) % self.parm_data[flag][j= ]=20 + else: +@@ -764,7 +786,8 @@ + self.LJ_types[self.parm_data["AMBER_ATOM_TYPE"][i]] =3D self.p= arm_data["ATOM_TYPE_INDEX"][i] + =20 + for i in range(self.pointers["NTYPES"]): +- lj_index =3D (i + 1) * (i + 2) / 2 - 1 # n(n+1)/2 th position = adjusted for indexing from 0 ++ lj_index =3D self.parm_data["NONBONDED_PARM_INDEX"][ ++ self.pointers["NTYPES"] * i + i - 1] - 1 + if self.parm_data["LENNARD_JONES_BCOEF"][lj_index] < 1.0e-6: + self.LJ_radius.append(0) + self.LJ_depth.append(0) +diff -urN amber11.orig/AmberTools/src/leap/src/leap/amber.c amber11/Ambe= rTools/src/leap/src/leap/amber.c +--- amber11.orig/AmberTools/src/leap/src/leap/amber.c 2011-03-10 20:12:0= 6.000000000 +0200 ++++ amber11/AmberTools/src/leap/src/leap/amber.c 2011-10-25 15:01:28.139= 288613 +0300 +@@ -36,6 +36,10 @@ + * UNITs and PARMSETs. + */ +=20 ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ ++ + #include "basics.h" + #include "vector.h" + #include "classes.h" +@@ -240,23 +244,47 @@ + * + * Read the proper torsion parameter terms. + */ ++ ++/* Arunima Singh added reading in of scee and scnb fields for proper to= rsions 20110420 */ + static void + zAmberReadParmSetPropers( PARMSET psParms, FILE *fIn ) + { + STRING sLine; +-int iRead, iN; ++int iRead, iN, iRead2, iRead3; + STRING saStr[10]; +-double dDivisions, dKp, dP0, dN; ++double dDivisions, dKp, dP0, dN, dScee, dScnb; ++char *cScee, *cScnb; +=20 + memset(saStr, 0, sizeof(saStr)); /* for Purify *= / + while (1) { + FGETS( sLine, fIn ); + NODASHES(sLine); +- iRead =3D sscanf( sLine, "%s %s %s %s %lf %lf %lf %lf",=20 ++ ++ iRead =3D sscanf( sLine, "%s %s %s %s %lf %lf %lf %lf ",=20 + saStr[0], saStr[1], saStr[2], saStr[3],= =20 + &dDivisions, &dKp, &dP0, &dN ); +- if ( iRead <=3D 0 )=20 ++ ++ cScee =3D strstr(sLine, "SCEE"); ++ if(cScee!=3DNULL) { ++ iRead2 =3D sscanf( cScee, "SCEE=3D%lf", &dScee); ++ iRead++; ++ } ++ ++ cScnb =3D strstr(sLine, "SCNB");=09 ++ if(cScnb!=3DNULL) { ++ iRead3 =3D sscanf( cScnb, "SCNB=3D%lf", &dScnb); ++ iRead++; ++ } ++ ++ if ( iRead <=3D 0 )=20 + break; ++ ++ if ( iRead =3D=3D 8 ) /*Arunima Singh*/ ++ { ++ dScee =3D 1.2; ++ dScnb =3D 2.0; ++ } ++=09 + MESSAGE(( "Read: %s\n", sLine )); +=20 + if ( sLine[0] =3D=3D ' ' && sLine[1] =3D=3D ' ') { +@@ -277,14 +305,37 @@ + zAmberConvertWildCard( saStr[3] ); + iParmSetAddProperTerm( psParms,=20 + saStr[0], saStr[1], saStr[2], saStr[3], +- abs(iN), dKp, dP0*DEGTORAD, "" ); ++ abs(iN), dKp, dP0*DEGTORAD, dScee, dScn= b, "" ); ++ ++ + while( iN < 0 ) { + FGETS( sLine, fIn ); + NODASHES(sLine); + MESSAGE(( "Read extra term: %s\n", sLine )); +- iRead =3D sscanf( &sLine[11], "%lf %lf %lf %lf", ++ iRead =3D sscanf( &sLine[11], "%lf %lf %lf %lf ", + &dDivisions, &dKp, &dP0, &dN ); +- if ( iRead<=3D0 ) break; ++ =20 ++ cScee =3D strstr(sLine, "SCEE"); ++ if(cScee!=3DNULL) { ++ iRead2 =3D sscanf( cScee, "SCEE=3D%lf", &dScee); ++ iRead++; ++ } ++ ++ cScnb =3D strstr(sLine, "SCNB"); ++ if(cScnb!=3DNULL) { ++ iRead3 =3D sscanf( cScnb, "SCNB=3D%lf", &dScnb); ++ iRead++; ++ } ++=20 ++ ++ if ( iRead =3D=3D 4 ) /*Arunima Singh*/ ++ { ++ dScee =3D 1.2; ++ dScnb =3D 2.0; ++ } ++ ++ ++ if ( iRead<=3D0 ) break; +=20 + if ( dDivisions =3D=3D 0.0 )=20 + dDivisions =3D 1.0; +@@ -292,7 +343,7 @@ + iN =3D (int)floor(dN+0.5); + iParmSetAddProperTerm( psParms, + saStr[0], saStr[1], saStr[2], saStr[3], +- abs(iN), dKp, dP0*DEGTORAD, "" ); ++ abs(iN), dKp, dP0*DEGTORAD, dScee, dScn= b, "" ); + } + if ( iRead <=3D 0 ) + break; +@@ -311,7 +362,7 @@ + STRING sLine; + int iRead, iN; + STRING saStr[10]; +-double dKp, dP0, dN; ++double dKp, dP0, dN, dScee, dScnb; + BOOL bPrintLine; +=20 + memset(saStr, 0, sizeof(saStr)); /* for Purify *= / +@@ -335,6 +386,8 @@ + zAmberConvertWildCard( saStr[2] ); + zAmberConvertWildCard( saStr[3] ); + iN =3D (int)dN; ++ dScee =3D 0.0; ++ dScnb =3D 0.0; +=20 + /* + * check everything in case a format or other user error +@@ -362,7 +415,7 @@ +=20 + iParmSetAddImproperTerm( psParms,=20 + saStr[0], saStr[1], saStr[2], saStr[3], +- iN, dKp, dP0*DEGTORAD, "" ); ++ iN, dKp, dP0*DEGTORAD, dScee, dScnb, ""= ); + } + if ( iRead > 0 ) + VP0(( "WARNING: incomplete Improper Torsion line:\n%s", sLine )= ); +diff -urN amber11.orig/AmberTools/src/leap/src/leap/build.c amber11/Ambe= rTools/src/leap/src/leap/build.c +--- amber11.orig/AmberTools/src/leap/src/leap/build.c 2011-03-10 20:12:0= 6.000000000 +0200 ++++ amber11/AmberTools/src/leap/src/leap/build.c 2011-10-25 15:01:28.140= 288613 +0300 +@@ -42,8 +42,9 @@ + * =09 + */ +=20 +- +- ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ +=20 + #include "basics.h" +=20 +@@ -1567,7 +1568,7 @@ + LOOP lAtoms, lTemp; + ATOM aAtom, aAtom1, aAtom2, aAtom3, aAtom4; + BOOL bM1, bM2, bM3, bM4, bOneMinimizedAtom; +-double dKb, dR0, dKt, dT0, dTkub, dRkub, dKp, dP0; ++double dKb, dR0, dKt, dT0, dTkub, dRkub, dKp, dP0, dScee, dScn= b; + STRING sAtom1, sAtom2, sAtom3, sAtom4, sDesc; + PARMSET psTemp; + TORSION tTorsion; +@@ -1757,7 +1758,7 @@ + ParmSetTORSIONTerm( tTorsion, i, + &iIndex, + sAtom1, sAtom2, sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc ); ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc ); + if ( !bMinimizerAddTorsion( mStrain,=20 + aAtom1, aAtom2, aAtom3, aAtom4, + (double)iN, dKp, dP0 )) { +diff -urN amber11.orig/AmberTools/src/leap/src/leap/model.c amber11/Ambe= rTools/src/leap/src/leap/model.c +--- amber11.orig/AmberTools/src/leap/src/leap/model.c 2011-04-14 15:30:1= 7.000000000 +0300 ++++ amber11/AmberTools/src/leap/src/leap/model.c 2011-10-25 15:01:28.141= 288612 +0300 +@@ -39,7 +39,9 @@ + * are determined from atom types. + */ +=20 +- ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ +=20 +=20 + #include "basics.h" +@@ -781,16 +783,6 @@ + maPAtom++; + } + } +- if ( iAtomCoordination(aX) !=3D=20 +- 1 + maPAtom - &(mtTorsions.maaXBonds[0]) ) { +- VP0(( "Error: Atom %s has force field coordination %i\n" +- " but only %i bonded neighbors.\n" +- " The cause may be an incorrect atom type, and\n" +- " the effect may be a crash very soon.\n", +- sContainerFullDescriptor((CONTAINER)aX,s1), +- iAtomCoordination(aX), +- 1 + maPAtom - &(mtTorsions.maaXBonds[0]) )); +- } + for ( i=3DiAtomCoordination(aX); iaAtom =3D NULL; + maPAtom++; +@@ -824,16 +816,6 @@ + maPAtom++; + } + } +- if ( iAtomCoordination(aY) !=3D=20 +- 1 + maPAtom - &(mtTorsions.maaYBonds[0]) ) { +- VP0(( "Error: Atom %s has force field coordination %i\n" +- " but only %i bonded neighbors.\n" +- " The cause may be an incorrect atom type, and\n" +- " the effect may be a crash very soon.\n", +- sContainerFullDescriptor((CONTAINER)aY,s1), +- iAtomCoordination(aY), +- 1 + maPAtom - &(mtTorsions.maaYBonds[0]) )); +- } + for ( i=3DiAtomCoordination(aY); iaAtom =3D NULL; + maPAtom++; +@@ -1205,6 +1187,8 @@ + int iN; + double dK; + double dE; ++ double dSce; /*Arunima Singh*/ ++ double dScn; /*Arunima Singh*/ + } H_PROPERPARMt; +=20 + typedef struct { +@@ -1222,12 +1206,13 @@ +=20 + /* Keep iHybrid2 <=3D iHybrid3 */ +=20 ++/* Arunima Singh 20110413. Added Scee and Scnb AMBER defaults of 1.2 an= d 2.0 */ + #define TFORCE 20.0 + static H_PROPERPARMt SppaPropers[] =3D { +-{ HSP3, HSP3, 3, 1.0, 0.0 }, /* Non bond */ +-{ HSP2, HSP3, 6, -2.0, 0.0 }, /* Non bond */ +-{ HSP2, HSP2, 2, -4.0, 0.0 }, /* Pi bond overlap */ +-{ HSP1, HSP1, 1, 0.0, 0.0 } /* Not interesting */ ++{ HSP3, HSP3, 3, 1.0, 0.0, 1.2, 2.0 }, /* Non bond */ ++{ HSP2, HSP3, 6, -2.0, 0.0, 1.2, 2.0 }, /* Non bond */ ++{ HSP2, HSP2, 2, -4.0, 0.0, 1.2, 2.0 }, /* Pi bond overlap */ ++{ HSP1, HSP1, 1, 0.0, 0.0, 1.2, 2.0 } /* Not interesting */ + }; +=20 + #define AFORCE 100.0 +@@ -1290,6 +1275,8 @@ + SppaPropers[i].iN, + SppaPropers[i].dK, + SppaPropers[i].dE, ++ SppaPropers[i].dSce, ++ SppaPropers[i].dScn, + sDesc ); + } + } +diff -urN amber11.orig/AmberTools/src/leap/src/leap/parmSet.c amber11/Am= berTools/src/leap/src/leap/parmSet.c +--- amber11.orig/AmberTools/src/leap/src/leap/parmSet.c 2011-03-10 20:12= :06.000000000 +0200 ++++ amber11/AmberTools/src/leap/src/leap/parmSet.c 2011-10-25 15:01:28.1= 43288610 +0300 +@@ -54,7 +54,9 @@ + * search routines REQUIRE pre-ordering. + */ +=20 +- ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ +=20 + #include "basics.h" +=20 +@@ -965,6 +967,8 @@ + /* + * copy into 1 vararray & set iType + */ ++=09 ++ /*Arunima Singh added scee and scnb into the database */ + vaTorsTypes =3D vaVarArrayCopy2( psLib->vaTorsions, psLib->vaImpropers= ); + tP =3D PVAI(vaTorsTypes,TORSIONPARMt,0); + for (i=3D0; ivaTorsions); i++, tP++) +@@ -980,8 +984,12 @@ + 7, "n", + (char *)&(PVAI(vaTorsTypes,TORSIONPARMt,0)->iN), + iVarArrayElementSize(vaTorsTypes), +- 0, NULL, NULL, 0, +- 0, NULL, NULL, 0, ++ 9, "scee",=20 ++ (char *)&(PVAI(vaTorsTypes,TORSIONPARMt,0)->dScee),=20 ++ iVarArrayElementSize(vaTorsTypes), ++ 10, "scnb",=20 ++ (char *)&(PVAI(vaTorsTypes,TORSIONPARMt,0)->dScnb),=20 ++ iVarArrayElementSize(vaTorsTypes), + 0, NULL, NULL, 0, + 0, NULL, NULL, 0, + 0, NULL, NULL, 0, +@@ -1008,7 +1016,7 @@ + 4, "type4", + (char *)&(PVAI(vaTorsTypes,TORSIONPARMt,0)->sType4), + iVarArrayElementSize(vaTorsTypes), +- 9, "desc", ++ 11, "desc", + (char *)&(PVAI(vaTorsTypes,TORSIONPARMt,0)->sDesc), + iVarArrayElementSize(vaTorsTypes) + ); +@@ -1586,10 +1594,15 @@ + * Add a torsion parameter to the PARMSET. + * Return the index.=20 + */ ++ ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ ++ + int + iParmSetAddProperTerm( PARMSET psLib,=20 + char *sType1, char *sType2, char *sType3, char *sType4,=20 +- int iN, double dKp, double dP0, char *sDesc ) ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sDes= c ) + { + TORSIONPARMt tpTorsion; +=20 +@@ -1605,6 +1618,8 @@ + tpTorsion.dKp =3D dKp; + tpTorsion.iN =3D iN; + tpTorsion.dP0 =3D dP0; ++ tpTorsion.dScee =3D dScee; ++ tpTorsion.dScnb =3D dScnb; + strcpy( tpTorsion.sOrder, "0123" ); + if ( sDesc !=3D NULL ) + strcpy( tpTorsion.sDesc, sDesc ); +@@ -1633,7 +1648,7 @@ + int + iParmSetAddImproperTerm( PARMSET psLib,=20 + char *sType1, char *sType2, char *sType3, char *sType4,=20 +- int iN, double dKp, double dP0, char *sDesc ) ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sDes= c ) + { + TORSIONPARMt tpImproper; + orderStr sOrder; +@@ -2022,7 +2037,7 @@ + void + ParmSetTORSIONTerm( TORSION tTorsion, int iTorsionIndex, int *iPParmSet= Index, + char *cPType1, char *cPType2, char *cPType3, char *cPType4, +- int *iPN, double *dPKp, double *dPP0, char *sDesc ) ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPSc= nb, char *sDesc ) + { + TORSION_MATCHt *tmPCur; +=20 +@@ -2035,6 +2050,8 @@ + *iPN =3D tmPCur->tpTorsion.iN; + *dPKp =3D tmPCur->tpTorsion.dKp; + *dPP0 =3D tmPCur->tpTorsion.dP0; ++ *dPScee =3D tmPCur->tpTorsion.dScee; ++ *dPScnb =3D tmPCur->tpTorsion.dScnb; + strcpy(sDesc, tmPCur->tpTorsion.sDesc); + } +=20 +@@ -2050,7 +2067,7 @@ + BOOL + bParmSetTORSIONAddProperTerm( TORSION tTorsion, + char *cPType1, char *cPType2, char *cPType3, char *cPType4, +- int iN, double dKp, double dP0, char *sDesc ) ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sDes= c ) + { + TORSIONPARMt tpTorsion; +=20 +@@ -2066,6 +2083,8 @@ + tpTorsion.iN =3D iN; + tpTorsion.dKp =3D dKp; + tpTorsion.dP0 =3D dP0; ++ tpTorsion.dScee =3D dScee; ++ tpTorsion.dScnb =3D dScnb; + strcpy(tpTorsion.sDesc, sDesc); + strcpy( tpTorsion.sOrder, "0123" ); + =20 +@@ -2087,7 +2106,7 @@ + BOOL + bParmSetTORSIONAddImproperTerm( TORSION tTorsion, + char *cPType1, char *cPType2, char *cPType3, char *cPType4, +- int iN, double dKp, double dP0, char *sDesc ) ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sDes= c ) + { + TORSIONPARMt tpTorsion; + orderStr sOrder; +@@ -2104,6 +2123,8 @@ + tpTorsion.iN =3D iN; + tpTorsion.dKp =3D dKp; + tpTorsion.dP0 =3D dP0; ++ tpTorsion.dScee =3D dScee; ++ tpTorsion.dScnb =3D dScnb; + strcpy(tpTorsion.sDesc, sDesc); + strcpy( tpTorsion.sOrder, sOrder ); + =20 +@@ -2516,7 +2537,7 @@ + void + ParmSetTorsion( PARMSET psLib, int i,=20 + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0, char *sDesc) ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb, = char *sDesc) + { + TORSIONPARMt *tpPTorsion; +=20 +@@ -2531,6 +2552,8 @@ + strcpy( sType4, WILD_CARD_TYPE ); + *iPN =3D 0; + *dPKp =3D 0; ++ *dPScee =3D 0; ++ *dPScnb =3D 0; + *dPP0 =3D 0; + strcpy( sDesc, "??" ); + return; +@@ -2543,7 +2566,10 @@ + *iPN =3D tpPTorsion->iN; + *dPKp =3D tpPTorsion->dKp; + *dPP0 =3D tpPTorsion->dP0; ++ *dPScee =3D tpPTorsion->dScee; ++ *dPScnb =3D tpPTorsion->dScnb;=20 + strcpy( sDesc, tpPTorsion->sDesc ); ++ + } +=20 +=20 +@@ -2557,7 +2583,7 @@ + void =20 + ParmSetImproper( PARMSET psLib, int i,=20 + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0, char *sDesc) ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb, = char *sDesc) + { + TORSIONPARMt *tpPImproper; +=20 +@@ -2573,6 +2599,8 @@ + *iPN =3D 0; + *dPKp =3D 0; + *dPP0 =3D 0; ++ *dPScee =3D 0; ++ *dPScnb =3D 0; + strcpy( sDesc, "??" ); + return; + } +@@ -2584,6 +2612,8 @@ + *iPN =3D tpPImproper->iN; + *dPKp =3D tpPImproper->dKp; + *dPP0 =3D tpPImproper->dP0; ++ *dPScee =3D tpPImproper->dScee; ++ *dPScnb =3D tpPImproper->dScnb; + strcpy( sDesc, tpPImproper->sDesc ); + } +=20 +@@ -2740,7 +2770,7 @@ + void + ParmSetUpdateTorsion( PARMSET psLib, int i,=20 + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0, char *sDescription) ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb, = char *sDescription) + { + TORSIONPARMt *tpPTorsion; + orderStr sOrder; +@@ -2754,6 +2784,8 @@ + if ( iPN !=3D (int*)NULL ) tpPTorsion->iN =3D *iPN; + if ( dPKp !=3D (double*)NULL) tpPTorsion->dKp =3D *dPKp; + if ( dPP0 !=3D (double*)NULL) tpPTorsion->dP0 =3D *dPP0; ++ if ( dPScee !=3D (double*)NULL) tpPTorsion->dScee =3D *dPScee; ++ if ( dPScnb !=3D (double*)NULL) tpPTorsion->dScnb =3D *dPScnb; + if (sDescription !=3D (char*)NULL ) strcpy(tpPTorsion->sDesc, sDes= cription); +=20 + strcpy( sOrder, "0123" ); +@@ -2777,7 +2809,7 @@ + void + ParmSetUpdateImproper( PARMSET psLib, int i,=20 + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0, char *sDescription) ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb, = char *sDescription) + { + TORSIONPARMt *tpPTorsion; + orderStr sOrder; +@@ -2790,6 +2822,8 @@ + if ( iPN !=3D (int*)NULL ) tpPTorsion->iN =3D *iPN; + if ( dPKp !=3D (double*)NULL) tpPTorsion->dKp =3D *dPKp; + if ( dPP0 !=3D (double*)NULL) tpPTorsion->dP0 =3D *dPP0; ++ if ( dPScee !=3D (double*)NULL) tpPTorsion->dScee =3D *dPScee; ++ if ( dPScnb !=3D (double*)NULL) tpPTorsion->dScnb =3D *dPScnb; + if (sDescription !=3D (char*)NULL ) strcpy(tpPTorsion->sDesc, sDes= cription); +=20 + strcpy( sOrder, "0123" ); +@@ -2979,6 +3013,7 @@ + tpPCur->sType1, tpPCur->sType2,=20 + tpPCur->sType3, tpPCur->sType4, + tpPCur->iN, tpPCur->dKp, tpPCur->dP0/DEGTORAD, ++ tpPCur->dScee, tpPCur->dScnb, + tpPCur->sOrder, tpPCur->sDesc ); + } + } +@@ -2996,6 +3031,7 @@ + tpPCur->sType1, tpPCur->sType2,=20 + tpPCur->sType3, tpPCur->sType4, + tpPCur->iN, tpPCur->dKp, tpPCur->dP0/DEGTORAD,=20 ++ tpPCur->dScee, tpPCur->dScnb, + tpPCur->sDesc ); + } + } +diff -urN amber11.orig/AmberTools/src/leap/src/leap/parmSet.h amber11/Am= berTools/src/leap/src/leap/parmSet.h +--- amber11.orig/AmberTools/src/leap/src/leap/parmSet.h 2011-03-10 20:12= :06.000000000 +0200 ++++ amber11/AmberTools/src/leap/src/leap/parmSet.h 2011-10-25 15:01:28.1= 44288609 +0300 +@@ -42,6 +42,9 @@ + * + * + */ ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ + =20 + #ifndef PARMSET_H + #define PARMSET_H +@@ -96,6 +99,8 @@ + int iN; + double dKp; + double dP0; ++ double dScee; /* for propers */ /* Arunima Singh */=20 ++ double dScnb; /* for propers */ /* Arunima Singh */ + orderStr sOrder; /* for impropers */ + DESCRIPTION sDesc; + } TORSIONPARMt; +@@ -158,10 +163,10 @@ + double dKt, double dT0, double dTkub, double dRkub, char *sDesc); + extern int iParmSetAddProperTerm(PARMSET psLib, + char *sType1, char *sType2, char *sType3, char *sType4, +- int iN, double dKp, double dP0, char *sDesc); ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sD= esc); /* for proper dihedrals */ /* Arunima Singh */ + extern int iParmSetAddImproperTerm(PARMSET psLib, + char *sType1, char *sType2, char *sType3, char *sType4, +- int iN, double dKp, double dP0, char *sDesc); ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sD= esc); /* Arunima Singh : added for proper dihedrals, but has to be includ= ed in impropers to maintain common data structure usage */=20 + extern int iParmSetAddHBond(PARMSET psLib, char *sType1, char *sType2, + double dA, double dB, char *sDesc); +=20 +@@ -216,15 +221,15 @@ + extern void ParmSetTORSIONTerm(TORSION tTorsion, int iTorsionIndex,=20 + int *iPParmSetIndex, + char *cPTyp1, char *cPTyp2, char *cPTyp3, char *cPTyp4, +- int *iPN, double *dPKp, double *dPP0, char *sDesc ); ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb= , char *sDesc ); + extern BOOL bParmSetTORSIONAddProperTerm(TORSION tTorsion, + char *cPType1, char *cPType2,=20 + char *cPType3, char *cPType4, +- int iN, double dKp, double dP0, char *sDesc); ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sD= esc); + extern BOOL bParmSetTORSIONAddImproperTerm(TORSION tTorsion, + char *cPType1, char *cPType2,=20 + char *cPType3, char *cPType4, +- int iN, double dKp, double dP0, char *sDesc); ++ int iN, double dKp, double dP0, double dScee, double dScnb, char *sD= esc); + extern void ParmSetTORSIONOrderAtoms();=09 + extern void ParmSetImproperOrderAtoms( TORSION tTorsion, int iTorsionIn= dex, + char *cPaTypes[4], int iaIndexes[4] ); +@@ -268,10 +273,10 @@ + char *sDesc); + extern void ParmSetTorsion(PARMSET psLib, int i, + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0, char *sDesc); ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb= , char *sDesc); + extern void ParmSetImproper(PARMSET psLib, int i, + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0, char *sDesc); ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb= , char *sDesc); + extern void ParmSetHBond(PARMSET psLib, int i, char *sType1, char *sTyp= e2, + double *dPA, double *dPB, char *sDesc); +=20 +@@ -296,11 +301,11 @@ + double *dPKt, double *dPT0, char *sDescription); + extern void ParmSetUpdateTorsion(PARMSET psLib, int i, + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0,=20 ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb= , + char *sDescription); + extern void ParmSetUpdateImproper(PARMSET psLib, int i, + char *sType1, char *sType2, char *sType3, char *sType4, +- int *iPN, double *dPKp, double *dPP0,=20 ++ int *iPN, double *dPKp, double *dPP0, double *dPScee, double *dPScnb= , + char *sDescription); + extern void ParmSetUpdateHBond(PARMSET psLib, int i,=20 + char *sType1, char *sType2, +diff -urN amber11.orig/AmberTools/src/leap/src/leap/unitio.c amber11/Amb= erTools/src/leap/src/leap/unitio.c +--- amber11.orig/AmberTools/src/leap/src/leap/unitio.c 2011-03-10 20:12:= 06.000000000 +0200 ++++ amber11/AmberTools/src/leap/src/leap/unitio.c 2011-10-25 15:01:28.19= 2288568 +0300 +@@ -70,6 +70,10 @@ + * zbUnitIOIndexBondParameters and zUnitDoAtoms are now "extern fu= nctions"=20 + */=20 +=20 ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ ++ + #include +=20 + #include "basics.h" +@@ -1585,7 +1589,9 @@ + tC.dKp =3D tpA->dKp; + tC.iN =3D tpA->iN; + tC.dP0 =3D tpA->dP0; +- VarArrayAdd(vaB, (GENP) & tC); ++ tC.dScee =3D tpA->dScee; ++ tC.dScnb =3D tpA->dScnb; ++ VarArrayAdd(vaB, (GENP) & tC); + iIndex++; + iOldIndex =3D iParmOffset + iA + 1; +=20 +@@ -1615,6 +1621,10 @@ + continue; + if (tpB->dP0 !=3D tpA->dP0) + continue; ++ if (tpB->dScee !=3D tpA->dScee) ++ continue; ++ if (tpB->dScnb !=3D tpA->dScnb) ++ continue; +=20 + /* + * B is a duplicate of A +@@ -1698,12 +1708,12 @@ + int iTerm, iPertTerm; + BOOL bDone, bUse, bUsePert, bCopy, bCopyPert, bEnd, bPertEnd; + int iN, iPertIndex, iPertN, iLastN, iLastPertN; +- double dKp, dP0, dPertKp, dPertP0; ++ double dKp, dP0, dScee, dScnb, dPertKp, dPertP0, dPertScee, dPertSc= nb; + BOOL bCalc14, bCalcPert14; + #ifdef DEBUG2 + STRING s1, s2, s3, s4; + int iTParm, iTmp; +- double dTK, dTP; ++ double dTK, dTP, dTScee, dTScnb; + STRING sT1, sT2, sT3, sT4, sTemp; + #endif + STRING sDesc; +@@ -2016,9 +2026,9 @@ + ParmSetTORSIONTerm(tTorsion, i, + &iTParm, + sT1, sT2, sT3, sT4, +- &iTmp, &dTK, &dTP, sTemp); +- MESSAGE(("Term %3d %d %s-%s-%s-%s %d %lf %lf\n", +- i, iTParm, sT1, sT2, sT3, sT4, iTmp, dTK, dTP)); ++ &iTmp, &dTK, &dTP, &dTScee, &dTScnb, sTe= mp); ++ MESSAGE(("Term %3d %d %s-%s-%s-%s %d %lf %lf %lf %lf\n"= , ++ i, iTParm, sT1, sT2, sT3, sT4, iTmp, dTK, dTP, dTS= cee, dTScnb)); + } + if (bPerturbTorsion) { + MESSAGE(("Pert%s %s-%s-%s-%s found %d terms\n", +@@ -2029,9 +2039,9 @@ + ParmSetTORSIONTerm(tPertTorsion, i, + &iTParm, + sT1, sT2, sT3, sT4, +- &iTmp, &dTK, &dTP, sTemp); +- MESSAGE(("Term %3d %d %s-%s-%s-%s %d %lf %lf\n", +- i, iTParm, sT1, sT2, sT3, sT4, iTmp, dTK, dTP)= ); ++ &iTmp, &dTK, &dTP, &dTScee, &dTScnb,= sTemp); ++ MESSAGE(("Term %3d %d %s-%s-%s-%s %d %lf %lf %lf %l= f\n", ++ i, iTParm, sT1, sT2, sT3, sT4, iTmp, dTK, dTP = dTScee, dTScnb)); + } + } + #endif +@@ -2061,7 +2071,7 @@ + ParmSetTORSIONTerm(tTorsion, iTerm, + &iIndex, + sAtom1, sAtom2, sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc); ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc); + MESSAGE(("First non-perturbed multiplicity: %d\n", iN)); + } else { + if (bProper) { +@@ -2082,7 +2092,7 @@ + ParmSetTORSIONTerm(tPertTorsion, iPertTerm, + &iPertIndex, + sPert1, sPert2, sPert3, sPert4, +- &iPertN, &dPertKp, &dPertP0, sDesc); ++ &iPertN, &dPertKp, &dPertP0, &dPertS= cee, &dPertScnb, sDesc); + MESSAGE(("First perturbed multiplicity: %d\n", iPertN))= ; + } else + bPertEnd =3D TRUE; +@@ -2175,14 +2185,14 @@ + if (bProper) + iIndex =3D iParmSetAddProperTerm(uUnit->psParameter= s, + sAtom1, sAtom2, sAto= m3, +- sAtom4, iN, dKp, dP0= , +- sDesc); ++ sAtom4, iN, dKp, dP0= ,=20 ++ dScee, dScnb, sDesc)= ; + /* else if ( !GDefaults.iCharmm ) ???---should I do t= his???? */ + else + iIndex =3D iParmSetAddImproperTerm(uUnit->psParamet= ers, + sAtom1, sAtom2, + sAtom3, sAtom4, iN= , +- dKp, dP0, sDesc); ++ dKp, dP0, dScee, d= Scnb, sDesc); + } + if (bCopyPert) { + if (bProper) { +@@ -2190,13 +2200,13 @@ + sPert1, sPert2, + sPert3, sPert4, + iPertN, dPertKp, +- dPertP0, sDesc); ++ dPertP0, dScee, = dScnb, sDesc); + } else { + iPertIndex =3D + iParmSetAddImproperTerm(uUnit->psParameters, + sPert1, sPert2, sPert3, + sPert4, iPertN, dPertKp= , +- dPertP0, sDesc); ++ dPertP0, dScee, dScnb, = sDesc); + } + MESSAGE(("iPertIndex =3D %d\n", iPertIndex)); + } +@@ -2215,7 +2225,7 @@ + ParmSetTORSIONTerm(tTorsion, iTerm, + &iIndex, + sAtom1, sAtom2, sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc); ++ &iN, &dKp, &dP0, &dScee, &dScnb,= sDesc); + } + MESSAGE( + ("Advancing non-perturbed multiplicity to %d\n"= , +@@ -2231,7 +2241,7 @@ + ParmSetTORSIONTerm(tPertTorsion, iPertTerm, + &iPertIndex, + sPert1, sPert2, sPert3, sPert4, +- &iPertN, &dPertKp, &dPertP0, sDe= sc); ++ &iPertN, &dPertKp, &dPertP0, &dP= ertScee, &dPertScnb, sDesc); + } + MESSAGE( + ("Advancing perturbed multiplicity to %d\n", +@@ -3988,7 +3998,7 @@ + SAVEATOMt *saPAtom; + SAVETORSIONt *stPTorsion; + SAVERESTRAINTt *srPRestraint; +- double dMass, dPolar, dR, dKb, dR0, dKt, dT0, dTkub, dRkub, dKp, dP= 0, ++ double dMass, dPolar, dR, dKb, dR0, dKt, dT0, dTkub, dRkub, dKp, dP= 0, dScee, dScnb, + dC, dD, dTemp; + STRING sAtom1, sAtom2, sAtom3, sAtom4, sType1, sType2; + int iN, iAtoms, iMaxAtoms, iTemp, iAtom, iCalc14, iProper; +@@ -4585,16 +4595,16 @@ + iParmSetTotalImproperParms(uUnit->psParameters))); + for (i =3D 0; i < iParmSetTotalTorsionParms(uUnit->psParameters); i= ++) { + ParmSetTorsion(uUnit->psParameters, i, sAtom1, sAtom2, +- sAtom3, sAtom4, &iN, &dKp, &dP0, sDesc); +- MESSAGE(("Torsion %d %s-%s-%s-%s %d %lf %lf\n", +- i, sAtom1, sAtom2, sAtom3, sAtom4, iN, dKp, dP0)); ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb,= sDesc); ++ MESSAGE(("Torsion %d %s-%s-%s-%s %d %lf %lf %lf %lf\n", ++ i, sAtom1, sAtom2, sAtom3, sAtom4, iN, dKp, dP0, dScee= , dScnb)); + FortranWriteDouble(dKp); + } + for (i =3D 0; i < iParmSetTotalImproperParms(uUnit->psParameters); = i++) { + ParmSetImproper(uUnit->psParameters, i, sAtom1, sAtom2, +- sAtom3, sAtom4, &iN, &dKp, &dP0, sDesc); +- MESSAGE(("Improper %d %s-%s-%s-%s %d %lf %lf\n", +- i, sAtom1, sAtom2, sAtom3, sAtom4, iN, dKp, dP0)); ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb= , sDesc); ++ MESSAGE(("Improper %d %s-%s-%s-%s %d %lf %lf %lf %lf\n", ++ i, sAtom1, sAtom2, sAtom3, sAtom4, iN, dKp, dP0, dScee= , dScnb)); + FortranWriteDouble(dKp); + } + /* Write the torsion RESTRAINT constants AND set the index */ +@@ -4612,13 +4622,13 @@ + FortranFormat(5, DBLFORMAT); + for (i =3D 0; i < iParmSetTotalTorsionParms(uUnit->psParameters); i= ++) { + ParmSetTorsion(uUnit->psParameters, i, sAtom1, sAtom2, +- sAtom3, sAtom4, &iN, &dKp, &dP0, sDesc); ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb,= sDesc); + dTemp =3D iN; + FortranWriteDouble(dTemp); + } + for (i =3D 0; i < iParmSetTotalImproperParms(uUnit->psParameters); = i++) { + ParmSetImproper(uUnit->psParameters, i, sAtom1, sAtom2, +- sAtom3, sAtom4, &iN, &dKp, &dP0, sDesc); ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb= , sDesc); + dTemp =3D iN; + FortranWriteDouble(dTemp); + } +@@ -4637,12 +4647,12 @@ + FortranFormat(5, DBLFORMAT); + for (i =3D 0; i < iParmSetTotalTorsionParms(uUnit->psParameters); i= ++) { + ParmSetTorsion(uUnit->psParameters, i, sAtom1, sAtom2, +- sAtom3, sAtom4, &iN, &dKp, &dP0, sDesc); ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb,= sDesc); + FortranWriteDouble(dP0); + } + for (i =3D 0; i < iParmSetTotalImproperParms(uUnit->psParameters); = i++) { + ParmSetImproper(uUnit->psParameters, i, sAtom1, sAtom2, +- sAtom3, sAtom4, &iN, &dKp, &dP0, sDesc); ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb= , sDesc); + FortranWriteDouble(dP0); + } + /* Write the torsion RESTRAINT constants AND set the index */ +@@ -4650,6 +4660,60 @@ + RESTRAINTLOOP(RESTRAINTTORSION, dN, i + 1); + FortranEndLine(); +=20 ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added Printing SCEE/SCNB */ ++ ++ ++ /* -17.5A- SCEE for torsions */ ++ FortranDebug("-17.5A-"); ++ =20 ++ MESSAGE(("Writing SCEE scale factor for torsion interaction\n")); ++ FortranFormat(1, "%-80s"); ++ FortranWriteString("%FLAG SCEE_SCALE_FACTOR"); ++ FortranWriteString("%FORMAT(5E16.8)"); ++ FortranFormat(5, DBLFORMAT); ++ for (i =3D 0; i < iParmSetTotalTorsionParms(uUnit->psParameters); i= ++) { ++ ParmSetTorsion(uUnit->psParameters, i, sAtom1, sAtom2, ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb,= sDesc); ++ FortranWriteDouble(dScee); ++ } ++ for (i =3D 0; i < iParmSetTotalImproperParms(uUnit->psParameters); = i++) { ++ ParmSetImproper(uUnit->psParameters, i, sAtom1, sAtom2, ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb= , sDesc); ++ FortranWriteDouble(dScee); ++ } ++ /* Write the torsion RESTRAINT constants AND set the index */ ++ /* for where the interaction can find its constants */ ++ RESTRAINTLOOP(RESTRAINTTORSION, dX0, i + 1); ++ FortranEndLine(); ++ ++ /* -17.5B- SCNB for torsions */ ++ FortranDebug("-17.5B-"); ++ ++ MESSAGE(("Writing SCNB scale factor for torsion interaction\n")); ++ FortranFormat(1, "%-80s"); ++ FortranWriteString("%FLAG SCNB_SCALE_FACTOR"); ++ FortranWriteString("%FORMAT(5E16.8)"); ++ FortranFormat(5, DBLFORMAT); ++ for (i =3D 0; i < iParmSetTotalTorsionParms(uUnit->psParameters); i= ++) { ++ ParmSetTorsion(uUnit->psParameters, i, sAtom1, sAtom2, ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb,= sDesc); ++ FortranWriteDouble(dScnb); ++ } ++ for (i =3D 0; i < iParmSetTotalImproperParms(uUnit->psParameters); = i++) { ++ ParmSetImproper(uUnit->psParameters, i, sAtom1, sAtom2, ++ sAtom3, sAtom4, &iN, &dKp, &dP0, &dScee, &dScnb= , sDesc); ++ FortranWriteDouble(dScnb); ++ } ++ /* Write the torsion RESTRAINT constants AND set the index */ ++ /* for where the interaction can find its constants */ ++ RESTRAINTLOOP(RESTRAINTTORSION, dX0, i + 1); ++ FortranEndLine(); ++=09 ++ /* Arunima Singh */ ++ /* End of adding SCEE/SCNB */ ++ + /* -18- Not used, reserved for future use, uses NATYP */ + /* Corresponds to the AMBER SOLTY array */ + FortranDebug("-18-"); +@@ -6009,7 +6073,7 @@ + SAVEATOMt *saPAtom; + SAVETORSIONt *stPTorsion; + SAVERESTRAINTt *srPRestraint; +-double dMass, dPolar, dR, dKb, dR0, dKt, dT0, dTkub, dRkub, dK= p, dP0, dC, dD, dTemp; ++double dMass, dPolar, dR, dKb, dR0, dKt, dT0, dTkub, dRkub, dK= p, dP0, dScee, dScnb, dC, dD, dTemp; + STRING sAtom1, sAtom2, sAtom3, sAtom4, sType1, sType2; + int iN, iAtoms, iMaxAtoms, iTemp, iAtom, iCalc14, iProper; + int iElement, iHybridization, iStart, iFirstSolvent; +@@ -6547,19 +6611,19 @@ + for ( i=3D0; ipsParameters); i++ = ) { + ParmSetTorsion( uUnit->psParameters, i, sAtom1, sAtom2,=20 + sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc ); +- MESSAGE(( "Torsion %d %s-%s-%s-%s %d %lf %lf\n", ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc ); ++ MESSAGE(( "Torsion %d %s-%s-%s-%s %d %lf %lf %lf %lf\n", + i, sAtom1, sAtom2, sAtom3, sAtom4, +- iN, dKp, dP0 )); ++ iN, dKp, dP0, dScee, dScnb )); + FortranWriteDouble( dKp ); + } + for ( i=3D0; ipsParameters); i++= ) { + ParmSetImproper( uUnit->psParameters, i, sAtom1, sAtom2,=20 + sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc ); +- MESSAGE(( "Improper %d %s-%s-%s-%s %d %lf %lf\n", ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc ); ++ MESSAGE(( "Improper %d %s-%s-%s-%s %d %lf %lf %lf %lf\n", + i, sAtom1, sAtom2, sAtom3, sAtom4, +- iN, dKp, dP0 )); ++ iN, dKp, dP0, dScee, dScnb )); + FortranWriteDouble( dKp ); + } + /* Write the torsion RESTRAINT constants AND set the in= dex */ +@@ -6575,14 +6639,14 @@ + for ( i=3D0; ipsParameters); i++ = ) { + ParmSetTorsion( uUnit->psParameters, i, sAtom1, sAtom2,=20 + sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc ); ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc ); + dTemp =3D iN; + FortranWriteDouble( dTemp ); + } + for ( i=3D0; ipsParameters); i++= ) { + ParmSetImproper( uUnit->psParameters, i, sAtom1, sAtom2,=20 + sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc ); ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc ); + dTemp =3D iN; + FortranWriteDouble( dTemp ); + } +@@ -6599,13 +6663,13 @@ + for ( i=3D0; ipsParameters); i++ = ) { + ParmSetTorsion( uUnit->psParameters, i, sAtom1, sAtom2,=20 + sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc ); ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc ); + FortranWriteDouble( dP0 ); + } + for ( i=3D0; ipsParameters); i++= ) { + ParmSetImproper( uUnit->psParameters, i, sAtom1, sAtom2,=20 + sAtom3, sAtom4, +- &iN, &dKp, &dP0, sDesc ); ++ &iN, &dKp, &dP0, &dScee, &dScnb, sDesc ); + FortranWriteDouble( dP0 ); + } + /* Write the torsion RESTRAINT constants AND set the in= dex */ +diff -urN amber11.orig/AmberTools/src/leap/src/leap/xaImproperParmTable.= c amber11/AmberTools/src/leap/src/leap/xaImproperParmTable.c +--- amber11.orig/AmberTools/src/leap/src/leap/xaImproperParmTable.c 2011= -03-10 20:12:06.000000000 +0200 ++++ amber11/AmberTools/src/leap/src/leap/xaImproperParmTable.c 2011-10-2= 5 15:01:28.193288566 +0300 +@@ -37,7 +37,9 @@ + * Handle editing of parameters in a table format. + */ +=20 +- ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ +=20 + #include + #include +@@ -59,7 +61,10 @@ + #define NC 4 + #define KPC 5 + #define P0C 6 +-#define DESCC 7 ++#define SCEE 7 /*Arunima Singh*/ ++#define SCNB 8 /*Arunima Singh*/ ++#define DESCC 9 /*Arunima Singh: Changed value from 7 t= o 9 to include scee and scnb*/ ++=20 +=20 + #define MAXTYPELEN 5 + #define DESCLEN 32 +@@ -129,13 +134,15 @@ + int iN; + double dKp; + double dP0; ++double dScee; ++double dScnb; + char sDesc[DESCLEN]; +=20 +=20 + iptPCur =3D (IMPROPERPARMTABLEt*)PXATClientPointer(tTable); + =20 + ParmSetImproper( iptPCur->psParmSet, iRow,=20 +- sType1, sType2, sType3, sType4, &iN, &dKp, &dP0, sDesc ); ++ sType1, sType2, sType3, sType4, &iN, &dKp, &dP0, &dScee, &dScnb, s= Desc ); +=20 + switch ( iCol ) { + case TYPE1C: +@@ -171,6 +178,14 @@ + } + return(SsBuffer); + break; ++ case SCEE: ++ sprintf( SsBuffer, DBLFMT, dScee ); ++ return(SsBuffer); ++ break; ++ case SCNB: ++ sprintf( SsBuffer, DBLFMT, dScnb ); ++ return(SsBuffer); ++ break; + case DESCC: + strcpy( SsBuffer, sDesc ); + return( SsBuffer ); +@@ -259,6 +274,16 @@ + if ( !strcmp( cPData, "0" )) break; + return("P0 field must be '0' or 'Pi'."); + break; ++ case SCEE: ++ if ( !bStringToDouble( cPData, &dValue ) ) { ++ return("Invalid character in Scee field."); ++ } ++ break; ++ case SCNB: ++ if ( !bStringToDouble( cPData, &dValue ) ) { ++ return("Invalid character in Scnb field."); ++ } ++ break; + case DESCC: + if ( strlen(cPData)>DESCLEN-1 ) { + sprintf( SsError, "%s %d characters.", +@@ -384,11 +409,33 @@ + return("P0 field must be '0' or 'Pi'."); + } +=20 ++ /* ++ * Scee ++ */ ++ *iPErrCol =3D 7; ++ cPData =3D col[7]; ++ if ( !bStringToDouble( cPData, &dValue ) ) { ++ return("Invalid character in Scee field."); ++ } else if ( dValue < 0.0 ) { ++ return("Scee cannot be negative."); ++ } ++ ++ /* ++ * Scnb ++ */ ++ *iPErrCol =3D 8; ++ cPData =3D col[8]; ++ if ( !bStringToInt( cPData, &iValue ) ) { ++ return("Invalid character in Scnb field."); ++ } else if ( dValue < 0.0 ) { ++ return("Scnb cannot be negative."); ++ } ++ + /* + * Desc + */ +- *iPErrCol =3D 7; +- cPData =3D col[7]; ++ *iPErrCol =3D 9; ++ cPData =3D col[9]; + if ( strlen(cPData) > DESCLEN-1 ) { + sprintf( SsError, "%s %d characters.", + "Parameter Description cannot be longer than", +@@ -413,7 +460,8 @@ + int iN; + double dKp; + double dP0; +- ++double dScee; ++double dScnb; +=20 + iptPCur =3D (IMPROPERPARMTABLEt*) PXATClientPointer(tTable); + psParmSet =3D iptPCur->psParmSet; +@@ -444,7 +492,7 @@ + col[0], col[1], col[2], col[3] )); + if ( iRow !=3D iParmSetAddImproperTerm( psParmSet, + col[0], col[1], col[2], col[3], +- iN, dKp, dP0, col[7] ) ) ++ iN, dKp, dP0, dScee, dScnb, col[9] ) ) + DFATAL(( "programming err 2 in zXAIPTAcceptRow\n" )); + } else { + /* +@@ -452,7 +500,7 @@ + */ + ParmSetUpdateImproper( psParmSet, iRow,=20 + col[0], col[1], col[2], col[3], +- &iN, &dKp, &dP0, col[7] ); ++ &iN, &dKp, &dP0, &dScee, &dScnb, col[9] ); + } + } +=20 +diff -urN amber11.orig/AmberTools/src/leap/src/leap/xaTorsionParmTable.c= amber11/AmberTools/src/leap/src/leap/xaTorsionParmTable.c +--- amber11.orig/AmberTools/src/leap/src/leap/xaTorsionParmTable.c 2011-= 03-10 20:12:06.000000000 +0200 ++++ amber11/AmberTools/src/leap/src/leap/xaTorsionParmTable.c 2011-10-25= 15:01:28.194288563 +0300 +@@ -37,6 +37,9 @@ + * Handle editing of parameters in a table format. + */ +=20 ++ /* Arunima Singh (UGA) */ ++ /* 20110420 */ ++ /* Added SCEE/SCNB */ +=20 + #include + #include +@@ -58,7 +61,9 @@ + #define NC 4 + #define KPC 5 + #define P0C 6 +-#define DESCC 7 ++#define SCEE 7 /*Arunima Singh*/ ++#define SCNB 8 /*Arunima Singh*/ ++#define DESCC 9 /*Arunima Singh: Changed value from 7 to 9 to include = scee and scnb*/ +=20 + #define MAXTYPELEN 5 + #define DESCLEN 32 +@@ -112,7 +117,7 @@ + * zcPXATPTGetElement + * + * Get the values for the elements of the TABLE from the +- * particular Torsion Parmeter Entry. ++ * particular Torsion Parameter Entry. + */ + static char * + zcPXATPTGetElement( TABLE tTable, int iCol, int iRow ) +@@ -126,13 +131,15 @@ + int iN; + double dKp; + double dP0; ++double dScee; ++double dScnb; + char sDesc[DESCLEN]; +=20 +=20 + tptPCur =3D (TORSIONPARMTABLEt*)PXATClientPointer(tTable); + =20 + ParmSetTorsion( tptPCur->psParmSet, iRow,=20 +- sType1, sType2, sType3, sType4, &iN, &dKp, &dP0, sDesc ); ++ sType1, sType2, sType3, sType4, &iN, &dKp, &dP0, &dScee, &dScnb, s= Desc ); + =20 + switch ( iCol ) { + case TYPE1C: +@@ -168,6 +175,14 @@ + } + return(SsBuffer); + break; ++ case SCEE: ++ sprintf( SsBuffer, DBLFMT, dScee ); ++ return(SsBuffer); ++ break; ++ case SCNB: ++ sprintf( SsBuffer, DBLFMT, dScnb ); ++ return(SsBuffer); ++ break;=20 + case DESCC: + strcpy( SsBuffer, sDesc ); + return( SsBuffer ); +@@ -256,6 +271,16 @@ + if ( !strcmp( cPData, "0" )) break; + return("P0 field must be '0' or 'Pi'."); + break; ++ case SCEE: ++ if ( !bStringToDouble( cPData, &dValue ) ) { ++ return("Invalid character in Scee field."); ++ } ++ break; ++ case SCNB: ++ if ( !bStringToDouble( cPData, &dValue ) ) { ++ return("Invalid character in Scnb field."); ++ } ++ break; + case DESCC: + if ( strlen(cPData)>DESCLEN-1 ) { + sprintf( SsError, "%s %d characters.", +@@ -379,11 +404,33 @@ + return("P0 field must be '0' or 'Pi'."); + } +=20 ++ /* ++ * Scee ++ */ ++ *iPErrCol =3D 7; ++ cPData =3D col[7]; ++ if ( !bStringToDouble( cPData, &dValue ) ) { ++ return("Invalid character in Scee field."); ++ } else if ( dValue < 0.0 ) { ++ return("Scee cannot be negative."); ++ } ++ ++ /* ++ * Scnb ++ */ ++ *iPErrCol =3D 8; ++ cPData =3D col[8]; ++ if ( !bStringToInt( cPData, &iValue ) ) { ++ return("Invalid character in Scnb field."); ++ } else if ( dValue < 0.0 ) { ++ return("Scnb cannot be negative."); ++ } ++ + /* + * Desc + */ +- *iPErrCol =3D 7; +- cPData =3D col[7]; ++ *iPErrCol =3D 9; ++ cPData =3D col[9]; + if ( strlen(cPData) > DESCLEN-1 ) { + sprintf( SsError, "%s %d characters.", + "Parameter Description cannot be longer than", +@@ -408,6 +455,8 @@ + int iN; + double dKp; + double dP0; ++double dScee; ++double dScnb; +=20 + tptPCur =3D (TORSIONPARMTABLEt*) PXATClientPointer(tTable); + psParmSet =3D tptPCur->psParmSet; +@@ -438,15 +487,15 @@ + col[0], col[1], col[2], col[3] )); + if ( iRow !=3D iParmSetAddProperTerm( psParmSet, + col[0], col[1], col[2], col[3], +- iN, dKp, dP0, col[7] ) ) +- DFATAL(( "programming err 2 in zXATPTAcceptRow\n" )); ++ iN, dKp, dP0, dScee, dScnb, col[9] ) ) /*Arunima singh*/ ++ DFATAL(( "programming err 2 in zXATPTAcceptRow\n" ));=09 + } else { + /* + * update row in place + */ + ParmSetUpdateTorsion( psParmSet, iRow,=20 + col[0], col[1], col[2], col[3], +- &iN, &dKp, &dP0, col[7] ); ++ &iN, &dKp, &dP0, &dScee, &dScnb, col[9] ); /*Arunima singh*/ + } + } +=20 +diff -urN amber11.orig/AmberTools/src/mmpbsa_py/MMPBSA_mods/alamdcrd.py = amber11/AmberTools/src/mmpbsa_py/MMPBSA_mods/alamdcrd.py +--- amber11.orig/AmberTools/src/mmpbsa_py/MMPBSA_mods/alamdcrd.py 2011-0= 4-14 15:30:17.000000000 +0300 ++++ amber11/AmberTools/src/mmpbsa_py/MMPBSA_mods/alamdcrd.py 2011-10-25 = 15:01:28.132288620 +0300 +@@ -371,7 +371,7 @@ + coords_received =3D _scaledistance(coords_tosend, chdist) +=20 + for i in range(3): +- new_coords.append(coords_received[x+3]) ++ new_coords.append(coords_received[i+3]) +=20 + coords_tosend =3D [] + coords_received =3D [] +diff -urN amber11.orig/AmberTools/src/mmpbsa_py/MMPBSA.pypp amber11/Ambe= rTools/src/mmpbsa_py/MMPBSA.pypp +--- amber11.orig/AmberTools/src/mmpbsa_py/MMPBSA.pypp 2011-04-14 15:30:1= 7.000000000 +0300 ++++ amber11/AmberTools/src/mmpbsa_py/MMPBSA.pypp 2011-10-25 15:01:28.238= 288523 +0300 +@@ -412,6 +412,7 @@ + INPUT['solvcut'] =3D float(INPUT['solvcut']) + INPUT['tolerance'] =3D float(INPUT['tolerance']) + INPUT['rism_verbose'] =3D int(INPUT['rism_verbose']) ++ INPUT['inp'] =3D int(INPUT['inp']) + except ValueError, err: + print >> sys.stderr, 'Error: Invalid input data types! Check input f= ile for proper float/int/string arguments.' + print >> sys.stderr, ' %s' % err +@@ -998,7 +999,7 @@ + if master: MMPBSA_timer.StartTimer('ptraj') +=20 + # create the dummy inpcrd files +- if isinerr !=3D 1 and (INPUT['gbrun'] or INPUT['pbrun']): ++ if isinerr !=3D 1 and (INPUT['gbrun'] or INPUT['pbrun'] or INP= UT['rismrun']): + os.system('%s %s _MMPBSA_mutant_complexinpcrd.in > _MMPBSA_= ptraj9.out 2>&1' % (ptraj, FILES['mutant_complex_prmtop'])) + if not stability and FILES['mutant_receptor_prmtop'] =3D=3D= FILES['receptor_prmtop']: + os.system('%s %s _MMPBSA_mutant_ligandinpcrd.in > _MMPBS= A_ptraj11.out 2>&1' % (ptraj, FILES['mutant_ligand_prmtop'])) +diff -urN amber11.orig/AmberTools/src/mmpbsa_py/setup.sh amber11/AmberTo= ols/src/mmpbsa_py/setup.sh +--- amber11.orig/AmberTools/src/mmpbsa_py/setup.sh 2011-04-14 15:30:18.0= 00000000 +0300 ++++ amber11/AmberTools/src/mmpbsa_py/setup.sh 2011-10-25 15:01:28.133288= 619 +0300 +@@ -10,7 +10,8 @@ +=20 + # require AMBERHOME + if [ -z $AMBERHOME ]; then +- export AMBERHOME=3D`dirname \`dirname $PWD\`` ++ AMBERHOME=3D`dirname \`dirname $PWD\`` ++ export AMBERHOME=3D`dirname $AMBERHOME` + echo "AMBERHOME is not set. Assuming it is $AMBERHOME" + fi +=20 +diff -urN amber11.orig/AmberTools/src/pbsa/amg1r5.f amber11/AmberTools/s= rc/pbsa/amg1r5.f +--- amber11.orig/AmberTools/src/pbsa/amg1r5.f 2011-04-14 15:30:19.000000= 000 +0300 ++++ amber11/AmberTools/src/pbsa/amg1r5.f 2011-10-25 15:01:28.203288555 += 0300 +@@ -3707,7 +3707,7 @@ +=20 + !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= + + !+ [Enter a one-line description of real function cgeps here] +-real function cgeps(k,s2,a,u,f,ia,ja,iw, & ++_REAL_ function cgeps(k,s2,a,u,f,ia,ja,iw, & + imin,imax,iminw,m,ierr,ium) + =20 + implicit _REAL_ (a-h,o-z) +@@ -3753,7 +3753,7 @@ +=20 + !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= + + !+ [Enter a one-line description of real function cgalf here] +-real function cgalf(k,s2,a,u,f,ia,ja,iw, & ++_REAL_ function cgalf(k,s2,a,u,f,ia,ja,iw, & + imin,imax,iminw,m) + =20 + implicit _REAL_ (a-h,o-z) +@@ -3971,7 +3971,7 @@ +=20 + !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= + + !+ [Enter a one-line description of real function random here] +-real function random(s) ++_REAL_ function random(s) + =20 + ! FUNCTION TO CREATE "RANDOM" SEQUENCE OF NUMBERS BETWEEN 0 AND = 0.1 + =20 +diff -urN amber11.orig/AmberTools/src/pbsa/Makefile amber11/AmberTools/s= rc/pbsa/Makefile +--- amber11.orig/AmberTools/src/pbsa/Makefile 2011-04-14 15:30:19.000000= 000 +0300 ++++ amber11/AmberTools/src/pbsa/Makefile 2011-10-25 15:01:28.228288532 += 0300 +@@ -204,6 +204,14 @@ + cd ../c9x-complex && $(MAKE) libmc.a; \ + fi +=20 ++pb_init.o: pb_init.f ++ $(FPP) $(FPPFLAGS) $(AMBERFPPFLAGS) $< > _$< ++ $(FC) -c -O0 $(FFLAGS) $(AMBERFFLAGS) -o $@ _$< ++ ++pb_init.SANDER.o: pb_init.f ++ $(FPP) $(FPPFLAGS) $(AMBERFPPFLAGS) -DSANDER $< > _$< ++ $(FC) -c -O0 $(FFLAGS) $(AMBERFFLAGS) -o $@ _$< ++ + %.LIBPBSA.o: %.f + $(FPP) $(FPPFLAGS) $(AMBERFPPFLAGS) -DLIBPBSA $< > _$< + $(FC) -c $(FOPTFLAGS) $(FFLAGS) $(AMBERFFLAGS) -o $@ _$< +diff -urN amber11.orig/AmberTools/src/ptraj/actions.c amber11/AmberTools= /src/ptraj/actions.c +--- amber11.orig/AmberTools/src/ptraj/actions.c 2011-04-14 15:30:19.0000= 00000 +0300 ++++ amber11/AmberTools/src/ptraj/actions.c 2011-10-25 15:01:28.235288526= +0300 +@@ -46,6 +46,7 @@ + #include "ptraj.h" + #include + #include ++#include +=20 + /* + * The code in this file implements the various "actions" of ptraj to +@@ -4809,8 +4810,14 @@ + * set the minimum distance to the solute to be larger than=20 + * any possible (imaged!!!) distance + */ +- min =3D box[0] + box[1] + box[2]; +- min =3D min * min; ++ if (box[0]!=3D0.0 && box[1]!=3D0.0 && box[2]!=3D0.0) { ++ min =3D box[0] + box[1] + box[2]; ++ min =3D min * min; ++ } else { ++ // No box information, set to arbitrarily large max ++ min=3DDBL_MAX; ++ } ++ + for (i=3D0; i < oldstate->solventMolecules; i++) { + minDistance[i] =3D min; + sortindex[i] =3D i; +@@ -16752,9 +16759,12 @@ + */ +=20 + structInfo =3D (transformSecondaryStructInfo *) action->carg1; +- if (structInfo->filename !=3D NULL) ++ if (structInfo->filename !=3D NULL) { ++ i =3D (int) strlen(structInfo->filename); ++ i+=3D5; ++ structInfo->filename =3D (char*) realloc(structInfo->filename, i*= sizeof(char)); + outFile =3D safe_fopen(strcat(structInfo->filename, ".sum"), "w")= ; +- else ++ } else + outFile =3D stdout; +=20 + fprintf(outFile, "#ResNum\t3-10-Helix\talpha-helix\tPI-Helix\tparal= lel-Sheet\tantip.-Sheet\tTurn\n"); +@@ -18123,17 +18133,26 @@ + /* + * process the remaining arguments + */ +- if ( (buffer =3D argumentStackKeyToString(argumentStackPointer, "pr= incipal", NULL)) !=3D NULL ) { ++ if ( argumentStackContains(argumentStackPointer, "principal") ) { + vectorInfo->mode =3D VECTOR_PRINCIPAL_X; +- if (strcmp(buffer, "x") =3D=3D 0)=20 +- vectorInfo->mode =3D VECTOR_PRINCIPAL_X; +- else if (strcmp(buffer, "y") =3D=3D 0)=20 +- vectorInfo->mode =3D VECTOR_PRINCIPAL_Y; +- else if (strcmp(buffer, "z") =3D=3D 0)=20 +- vectorInfo->mode =3D VECTOR_PRINCIPAL_Z; +- safe_free(buffer); +- }=20 +- else if (argumentStackContains(argumentStackPointer, "dipole"))=20 ++ /* DRR - Check the next argument for x, y, or z. If none of these= =20 ++ * are present, put the argument back on the stack. ++ */ ++ buffer =3D getArgumentString(argumentStackPointer, NULL); ++ if (buffer!=3DNULL) { ++ if (strcmp(buffer, "x") =3D=3D 0) {=20 ++ vectorInfo->mode =3D VECTOR_PRINCIPAL_X;=20 ++ safe_free(buffer); ++ } else if (strcmp(buffer, "y") =3D=3D 0) { ++ vectorInfo->mode =3D VECTOR_PRINCIPAL_Y; ++ safe_free(buffer); ++ } else if (strcmp(buffer, "z") =3D=3D 0) { ++ vectorInfo->mode =3D VECTOR_PRINCIPAL_Z; ++ safe_free(buffer); ++ } else ++ pushBottomStack(argumentStackPointer, buffer);=20 ++ } ++ } else if (argumentStackContains(argumentStackPointer, "dipole"))=20 + vectorInfo->mode =3D VECTOR_DIPOLE; + else if (argumentStackContains(argumentStackPointer, "box"))=20 + vectorInfo->mode =3D VECTOR_BOX; +@@ -18263,6 +18282,11 @@ + vectorInfo->mode =3D=3D VECTOR_CORRIRED || + vectorInfo->mode =3D=3D VECTOR_MASK){ + buffer =3D getArgumentString(argumentStackPointer, NULL); ++ if (buffer=3D=3DNULL) { ++ fprintf(stdout,"Error: vector: specified vector mode requires a= second mask.\n"); ++ freeTransformVectorMemory(action); ++ return -1; ++ } + vectorInfo->mask2 =3D processAtomMask(buffer, action->state); + safe_free(buffer); + } +@@ -18885,7 +18909,7 @@ + /* + * USAGE: + * +- * watershell mask [lower ] [upper ] [noimag= e] ++ * watershell mask filename [lower ] [upper = ] [noimage] + * + * action argument usage: + * +@@ -18917,11 +18941,25 @@ + action->iarg1 =3D argumentStackContains(argumentStackPointer, "noim= age"); +=20 + buffer =3D getArgumentString(argumentStackPointer, NULL); ++ if (buffer=3D=3DNULL) { ++ fprintf(stdout,"ERROR: WATERSHELL: Solute mask must be specified.= \n"); ++ return -1; ++ } ++ + info->soluteMask =3D processAtomMask(buffer, action->state); ++ if (info->soluteMask=3D=3DNULL) { ++ fprintf(stdout,"ERROR: WATERSHELL: Solute mask %s corresponds to = 0 atoms.\n",buffer); ++ safe_free(buffer); ++ return -1; ++ } + safe_free(buffer); +=20 + info->filename =3D getArgumentString(argumentStackPointer, NULL); +- =20 ++ if (info->filename=3D=3DNULL) { ++ fprintf(stdout,"ERROR: WATERSHELL: Output filename must be specif= ied.\n"); ++ return -1; ++ } ++ + info->lowerCutoff =3D=20 + argumentStackKeyToDouble(argumentStackPointer, "lower", info->low= erCutoff); + info->upperCutoff =3D=20 +@@ -18932,6 +18970,17 @@ + info->solventMask =3D processAtomMask(buffer, action->state); + else + info->solventMask =3D processAtomMask(":WAT", action->state); ++ if (info->solventMask=3D=3DNULL) { ++ if (buffer!=3DNULL) ++ fprintf(stdout,"ERROR: WATERSHELL: Solvent mask %s corresponds = to 0 atoms.\n",buffer); ++ else { ++ fprintf(stdout,"ERROR: WATERSHELL: Default solvent mask :WAT co= rresponds to 0 atoms.\n"); ++ fprintf(stdout, ++ " Solvent mask can be specified as the thir= d argument.\n"); ++ } ++ safe_free(buffer); ++ return -1; ++ } + safe_free(buffer); +=20 + action->carg1 =3D (void *) info; +diff -urN amber11.orig/AmberTools/src/ptraj/ptraj.c amber11/AmberTools/s= rc/ptraj/ptraj.c +--- amber11.orig/AmberTools/src/ptraj/ptraj.c 2011-04-14 15:30:19.000000= 000 +0300 ++++ amber11/AmberTools/src/ptraj/ptraj.c 2011-10-25 15:01:28.224288536 += 0300 +@@ -2059,7 +2059,8 @@ + int start =3D 1; + int stop =3D 1; + int frame_lines, title_size, seekable; +- long long int file_size, frame_size; ++ int maxi, sizeFound; // For large gzip file calc, Amber Traj ++ long long int file_size, frame_size, tmpfsize; + long int endoffset; + float *binposScratch; + FILE *fp; +@@ -2439,16 +2440,54 @@ + file_size =3D file_size - frame_size; // Subtract title size from= file total size. + frame_size =3D (long long int) trajInfo->frameSize; + trajInfo->Nframes =3D (int) (file_size / frame_size); ++ ++ // Frame calculation for large gzip files ++ // If uncompressed size is less than compressed size, uncompresse= d ++ // size is likely > 4GB. ++ if (trajInfo->compressType =3D=3D 1 && file_size < (long long int= )frame_stat.st_size) { ++ // Since this is gzip compressed, if the file_size % frame size= !=3D 0,=20 ++ // it could be that the uncompressed filesize > 4GB. Since=20 ++ // ISIZE =3D uncompressed % 2^32,=20 ++ // try ((file_size + (2^32 * i)) % frame_size) and see if any a= re 0. ++ if ( (file_size % frame_size) !=3D 0) { ++ // Determine the maximum number of iterations to try based on= the ++ // fact that Amber trajectories typically compress about 3x w= ith ++ // gzip. If the number of frames cannot accurately be calcula= ted=20 ++ // use the max estimated file size to estimate # frames so th= at ++ // ptraj actions allocate enough memory. ++ tmpfsize =3D (long long int) frame_stat.st_size; ++ tmpfsize *=3D 4; ++ tmpfsize =3D (tmpfsize - file_size) / 4294967296LL; ++ maxi =3D (int) tmpfsize; ++ maxi++; ++ if (prnlev>1) ++ printf("\tLooking for uncompressed gzip size > 4GB, %i iter= ations.\n",maxi); ++ tmpfsize =3D 0; ++ sizeFound=3D0; ++ for (i =3D 0; i < maxi; i++ ) { ++ tmpfsize =3D (4294967296LL * i) + file_size; ++ if ( (tmpfsize % frame_size) =3D=3D 0) {sizeFound=3D1; brea= k;} ++ } ++ if (sizeFound) { ++ printf("Warning: Cannot accurately determine # of frames in= gzipped trajectory %s.\n", ++ filename); ++ printf(" This usually indicates the trajectory is c= orrupted.\n"); ++ printf(" Ptraj will attempt to estimate the correct= number of frames.\n"); ++ } ++ file_size =3D tmpfsize;=20 ++ trajInfo->Nframes =3D (int) (file_size / frame_size); ++ } ++ } ++ + if (prnlev>0) fprintf(stdout," File has %i frames.\n",trajInfo= ->Nframes); + if ( (file_size % frame_size) =3D=3D 0 ) { + seekable =3D 1; +- stop =3D trajInfo->Nframes; + } else { +- stop =3D -1; + seekable =3D 0; + fprintf(stderr, "%s: Could not predict number of frames for AMBER traj= ectory file: %s\n", ROUTINE, filename); + fprintf(stderr, "\tIf this is not a compressed file then there is a pr= oblem\n"); + } ++ stop =3D trajInfo->Nframes; +=20 + actualAtoms =3D totalAtoms; + //trajInfo->frameSize =3D frame_size; +@@ -2569,6 +2608,8 @@ + trajInfo->isBox =3D isBox; + trajInfo->isVelocity =3D isVelocity; + trajInfo->type =3D type; ++ // If compressed, no seek possible ++ if (trajInfo->compressType > 0) trajInfo->seekable=3D0; +=20 + // This should eventually get its own structure + if (type=3D=3DCOORD_CHARMM_TRAJECTORY)=20 +diff -urN amber11.orig/AmberTools/src/rism/amber_rism_interface.f amber1= 1/AmberTools/src/rism/amber_rism_interface.f +--- amber11.orig/AmberTools/src/rism/amber_rism_interface.f 2011-04-14 1= 5:30:19.000000000 +0300 ++++ amber11/AmberTools/src/rism/amber_rism_interface.f 2011-10-25 15:01:= 28.241288520 +0300 +@@ -815,7 +815,6 @@ + !redo calculation with charges off + call rism3d_unsetCharges(rism_3d) + call rism3d_solve(rism_3d,rismprm%saveprogress,rismprm%progress= ,rismprm%maxstep,rismprm%tolerance) +- call rism3d_resetCharges(rism_3d) +=20 + !setup memory space + apol_exchem =3D> apol_mpi_buffer(1:rism_3d%solv%natom)=20 +@@ -825,6 +824,7 @@ + apol_exchem =3D rism3d_exchem(rism_3d,rismprm%asympCorr)*KB*ris= m_3d%solv%temperature + apol_exchemGF =3D rism3d_exchemGF(rism_3d,rismprm%asympCorr)*KB= *rism_3d%solv%temperature + =20 ++ call rism3d_resetCharges(rism_3d) + !parallel communication + #ifdef MPI + # ifdef USE_MPI_IN_PLACE +diff -urN amber11.orig/AmberTools/src/rism/rism1d_potential_c.f amber11/= AmberTools/src/rism/rism1d_potential_c.f +--- amber11.orig/AmberTools/src/rism/rism1d_potential_c.f 2011-04-14 15:= 30:19.000000000 +0300 ++++ amber11/AmberTools/src/rism/rism1d_potential_c.f 2011-10-25 15:01:28= .242288519 +0300 +@@ -124,7 +124,7 @@ + type(solvMDL), intent(in) :: mdl + _REAL_, intent(in) :: density + integer :: oldnv +- integer :: iv1, iv2, ivv, iv, iat, imlt ++ integer :: iv1, iv2, ivv, iv, iat, imlt, isp +=20 + !increment scalar variables + oldnv =3D this%nv +@@ -139,7 +139,10 @@ + this%nat(this%nsp) =3D mdl%ntype + this%mta =3D> safemem_realloc(this%mta, max(ubound(this%mta,1),mdl%= ntype), this%nsp) + this%mta(1:mdl%ntype,this%nsp) =3D mdl%multi=20 +- ++ !zero out multiplicity for unused indicies in previously add specie= s ++ do isp=3D1, this%nsp ++ this%mta(this%nat(isp)+1:,isp)=3D0 ++ end do + this%mtv =3D> safemem_realloc(this%mtv,this%nv) + this%mtv(oldnv+1:this%nv) =3D mdl%multi +=20 +@@ -178,7 +181,7 @@ + this%rminv =3D> safemem_realloc(this%rminv,this%nv) + this%rminv(oldnv+1:this%nv) =3D mdl%rmin/2d0 +=20 +- this%rma =3D> safemem_realloc(this%rma,3,ubound(this%mta,1),maxval(= this%nat),this%nsp) ++ this%rma =3D> safemem_realloc(this%rma,3,maxval(this%mta),maxval(th= is%nat),this%nsp,.true.,.false.) + iv =3D 0 + do iat=3D1,this%nat(this%nsp) + do imlt =3D 1, this%mta(iat,this%nsp) +@@ -186,7 +189,7 @@ + this%rma(:,imlt,iat,this%nsp) =3D mdl%coord(:,iv) + end do + end do +- this%wlmvv =3D> safemem_realloc(this%wlmvv,ubound(this%mta,1),this%= nv,this%nv) ++ this%wlmvv =3D> safemem_realloc(this%wlmvv,maxval(this%mta),this%nv= ,this%nv) + call intramolecular_dist(this) +=20 + !data arrays in the original 1D-RISM code had an offset of 0 in the= first index (like C). +@@ -269,7 +272,7 @@ + r,rs, rs6,ri6, usr,usra +=20 + _REAL_ :: d0x(this%nv), d0y(this%nv), d1z(this%nv), & +- wkvv(this%nv,this%nv) ++ wkvv(this%nv,this%nv), erfc_test + _REAL_, external :: erfc +=20 +=20 +@@ -478,10 +481,21 @@ + r =3D (ir-1)*this%dr + k =3D (ir-1)*this%dk + qvv =3D charge*this%qspv(iv1)*this%qspv(iv2) +- this%hlrvv(ir,ivv) =3D -qvv/this%dielconst & +- * 0.5d0 * exp((this%smear*this%kappa/2.d0)**2) & +- * ( exp(-this%kappa*r)*erfc(this%kappa*this%smear/2.d= 0 - r/this%smear) & +- - exp(this%kappa*r)*erfc(this%kappa*this%smear/2.d0 += r/this%smear) ) ++ !for large grids with short Debye lengths the positive ++ !exponent can overflow. erfc is already zero at this ++ !point. So we test erfc to see if we can avoid the ++ !exponent ++ erfc_test =3D erfc(this%kappa*this%smear/2.d0 + r/this%sme= ar) ++ if(erfc_test > sqrt(tiny(1d0)))then ++ this%hlrvv(ir,ivv) =3D -qvv/this%dielconst & ++ * 0.5d0 * exp((this%smear*this%kappa/2.d0)**2) & ++ * ( exp(-this%kappa*r)*erfc(this%kappa*this%smear/= 2.d0 - r/this%smear) & ++ - exp(this%kappa*r)*erfc_test ) ++ else ++ this%hlrvv(ir,ivv) =3D -qvv/this%dielconst & ++ * 0.5d0 * exp((this%smear*this%kappa/2.d0)**2) & ++ * ( exp(-this%kappa*r)*erfc(this%kappa*this%smear/= 2.d0 - r/this%smear)) ++ end if + this%hlkvv(ir,ivv) =3D -qvv/this%dielconst & + * 4.d0*pi*exp(-(0.5d0*this%smear*k)**2) * k/(k**2+thi= s%kappa**2) + enddo +diff -urN amber11.orig/AmberTools/src/rism/rism3d_c.f amber11/AmberTools= /src/rism/rism3d_c.f +--- amber11.orig/AmberTools/src/rism/rism3d_c.f 2011-04-14 15:30:19.0000= 00000 +0300 ++++ amber11/AmberTools/src/rism/rism3d_c.f 2011-10-25 15:01:28.245288516= +0300 +@@ -1086,26 +1086,26 @@ + !reallocate arrays that require preservation of their contents + #if defined(MPI) + this%cuvWRK =3D> safemem_realloc(this%cuvWRK,this%grid%nr(1),this%gri= d%nr(2),this%grid%nr(3),& +- this%solv%natom,this%NVec,.true.) ++ this%solv%natom,this%NVec,.true.,.true.) + if(rism3d_solu_charged(this%solu))then + this%oldcuvChg =3D> safemem_realloc(this%oldcuvChg,this%grid%nr(1)= ,this%grid%nr(2),& +- this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.) ++ this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.,.true.) + this%oldcuv =3D> this%oldcuvChg + else + this%oldcuvNoChg =3D> safemem_realloc(this%oldcuvNoChg,this%grid%n= r(1),this%grid%nr(2),& +- this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.) ++ this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.,.true.) + this%oldcuv =3D> this%oldcuvNoChg + end if + #else + this%cuvWRK =3D> safemem_realloc(this%cuvWRK,this%grid%nr(1),this%gri= d%nr(2),this%grid%nr(3),& +- this%solv%natom,this%NVec,.true.) ++ this%solv%natom,this%NVec,.true.,.true.) + if(rism3d_solu_charged(this%solu))then + this%oldcuvChg =3D> safemem_realloc(this%oldcuvChg,this%grid%nr(1)= ,this%grid%nr(2),& +- this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.) ++ this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.,.true.) + this%oldcuv =3D> this%oldcuvChg + else + this%oldcuvNoChg =3D> safemem_realloc(this%oldcuvNoChg,this%grid%n= r(1),this%grid%nr(2),& +- this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.) ++ this%grid%nr(3),this%solv%natom,this%ncuvsteps,.true.,.true.) + this%oldcuv =3D> this%oldcuvNoChg + end if + !!$ this%oldcuv =3D> safemem_realloc(this%oldcuv,this%grid%nr(1),this%= grid%nr(2),& +diff -urN amber11.orig/AmberTools/src/rism/rism3d_opendx.f amber11/Amber= Tools/src/rism/rism3d_opendx.f +--- amber11.orig/AmberTools/src/rism/rism3d_opendx.f 2011-04-14 15:30:19= .000000000 +0300 ++++ amber11/AmberTools/src/rism/rism3d_opendx.f 2011-10-25 15:01:28.2052= 88553 +0300 +@@ -49,9 +49,11 @@ + module procedure readDXHeader_file, readDXHeader_unit + end interface readDXHeader +=20 ++#if 0 + interface readDX + module procedure readDX_3D,readDX_3D_data, readDX_1D, readDX_1D_da= ta + end interface readDX ++#endif + contains + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!= !!!!!!!!! + !!!Reads in a OpenDX file header. Expects +@@ -160,6 +162,7 @@ + end if + end subroutine readDXHeader_unit +=20 ++#if 0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!= !!!!!!!!! + !!!Reads in a OpenDX file, returning data in a pointer, allocating nece= ssary memory. Expects + !!!a 3D, regularly spaced grid in ASCII format. +@@ -311,6 +314,7 @@ + call readDX_data(unit,data,ndata,npos) + close(unit) + end subroutine readDX_1D_data ++#endif +=20 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!= !!!!!!!!! + !!!write to file in open DX format for use in VMD. When writing in +diff -urN amber11.orig/AmberTools/src/rism/rism3d.snglpnt.nab amber11/Am= berTools/src/rism/rism3d.snglpnt.nab +--- amber11.orig/AmberTools/src/rism/rism3d.snglpnt.nab 2011-04-14 15:30= :19.000000000 +0300 ++++ amber11/AmberTools/src/rism/rism3d.snglpnt.nab 2011-10-25 15:01:28.2= 43288518 +0300 +@@ -632,6 +632,7 @@ + mm_options(sprintf("centering=3D%d, zerofrc=3D%d, apply_rism_force=3D%d= ",rismOpt.centering,rismOpt.zerofrc,rismOpt.apply_rism_force)); + mm_options(sprintf("polarDecomp=3D%d",rismOpt.polarDecomp)); + mm_options(sprintf("ntwrism=3D%d, verbose=3D%d, progress=3D%d",rismOpt.= ntwrism,rismOpt.verbose,rismOpt.progress)); ++mm_options(sprintf("asympCorr=3D%d",rismOpt.asympcorr)); + mm_options(sprintf("saveprogress=3D%d",rismOpt.saveprogress)); + mme_init( m, NULL, "::Z", p_xyz, NULL); +=20 +diff -urN amber11.orig/AmberTools/src/rism/safemem.f amber11/AmberTools/= src/rism/safemem.f +--- amber11.orig/AmberTools/src/rism/safemem.f 2011-04-14 15:30:19.00000= 0000 +0300 ++++ amber11/AmberTools/src/rism/safemem.f 2011-10-25 15:01:28.247288515 = +0300 +@@ -46,13 +46,13 @@ + !logical :: Current number of bytes of logical memory allocated + !char :: Current number of bytes of character memory allocate= d + !total :: Current number of bytes of total memory allocated +- integer*8 :: int,real,logical,char,total ++ integer*8 :: int=3D0,real=3D0,logical=3D0,char=3D0,total=3D0 + !maxint :: Current number of bytes of integer memory allocat= ed + !maxreal :: Current number of bytes of real memory allocated + !maxlogical :: Current number of bytes of logical memory allocat= ed + !maxchar :: Current number of bytes of character memory alloc= ated + !max :: Current number of bytes of total memory allocated +- integer*8 :: maxint,maxreal,maxlogical,maxchar,max ++ integer*8 :: maxint=3D0,maxreal=3D0,maxlogical=3D0,maxchar=3D0,m= ax=3D0 + end type memTracker +=20 + !BYTES_PER_GIGABYTES :: used to convert between bytes and GB +@@ -352,6 +352,9 @@ + !!! n4 :: size of the fourth dimension + !!! preserve :: boolean indicating whether or not to preserve the con= tents of=20 + !!! the array (optional) ++!!! center :: when preserving the contents of the array, center the=20 ++!!! data in the array instead of preserving the value at ea= ch ++!!! index=20 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!= !!! + FUNCTION safemem_realloc_4d_real(p, n1, n2, n3, n4, preserve, cente= r) + implicit none +@@ -369,7 +372,7 @@ + #endif /*RISM_DEBUG*/ + prsrv =3D .true. + if(present(preserve)) prsrv=3Dpreserve +- cntr =3D .true. ++ cntr =3D .false. + if(present(center)) cntr=3Dcenter +=20 + if(.not.prsrv .and. associated(p)) then +@@ -499,6 +502,9 @@ + !!! n5 :: size of the fifth dimension + !!! preserve :: boolean indicating whether or not to preserve the con= tents of=20 + !!! the array (optional) ++!!! center :: when preserving the contents of the array, center the=20 ++!!! data in the array instead of preserving the value at ea= ch ++!!! index=20 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!= !!! + FUNCTION safemem_realloc_5d_real(p, n1, n2, n3, n4, n5, preserve, c= enter) + implicit none +@@ -516,7 +522,7 @@ + #endif /*RISM_DEBUG*/ + prsrv =3D .true. + if(present(preserve)) prsrv =3D preserve +- cntr=3D.true. ++ cntr=3D.false. + if(present(center)) cntr =3D center +=20 + if(.not.prsrv .and. associated(p)) then +@@ -1006,7 +1012,7 @@ + !work around for old gfortran bug + ! if(associated(p)) deallocate(p,STAT=3Dsafemem_dealloc_pointer_= 1d_logical) + if(associated(p))then +- call memadd_c(totalmem,-product(ubound(p))*kind(p)) ++ call memadd_l(totalmem,-product(ubound(p))*kind(p)) + deallocate(p,STAT=3Dtemp) + end if + safemem_dealloc_pointer_1d_logical =3D temp +diff -urN amber11.orig/AmberTools/src/sqm/qm2_energy.f amber11/AmberTool= s/src/sqm/qm2_energy.f +--- amber11.orig/AmberTools/src/sqm/qm2_energy.f 2011-03-11 20:43:13.000= 000000 +0200 ++++ amber11/AmberTools/src/sqm/qm2_energy.f 2011-10-25 15:01:28.20628855= 2 +0300 +@@ -277,7 +277,7 @@ +=20 + ! Add PM6 corrections to Heat of Formation + if (qmmm_nml%qmtheory%PM6) then +- escf =3D escf + pm6_correction() ++ escf =3D escf + hofCorrection() + end if +=20 + call timer_stop(TIME_QMMMENERGYSCF) +diff -urN amber11.orig/AmberTools/src/sqm/qm2_get_qm_forces.f amber11/Am= berTools/src/sqm/qm2_get_qm_forces.f +--- amber11.orig/AmberTools/src/sqm/qm2_get_qm_forces.f 2011-03-11 20:43= :13.000000000 +0200 ++++ amber11/AmberTools/src/sqm/qm2_get_qm_forces.f 2011-10-25 15:01:28.2= 08288550 +0300 +@@ -250,7 +250,7 @@ + ! -------------------------------------------- + if (qmmm_nml%qmtheory%PM6) then + natom =3D qmmm_struct%nquant_nlink +- call pm6_correction(natom, dxyzqm) ++ call hofCorrectionGradient(natom, dxyzqm) + end if +=20 + if(qmmm_nml%peptide_corr) then +diff -urN amber11.orig/AmberTools/src/sqm/qm2_pm6_hof_module.f amber11/A= mberTools/src/sqm/qm2_pm6_hof_module.f +--- amber11.orig/AmberTools/src/sqm/qm2_pm6_hof_module.f 2011-03-11 20:4= 3:13.000000000 +0200 ++++ amber11/AmberTools/src/sqm/qm2_pm6_hof_module.f 2011-10-25 15:01:28.= 209288549 +0300 +@@ -21,8 +21,7 @@ + implicit none +=20 + private +- public :: pm6_correction +- public :: corInfoType, print ++ public :: corInfoType, print, hofCorrection, hofCorrectionGradient + public :: cct, nsp2 + public :: strlen +=20 +@@ -30,11 +29,6 @@ + module procedure printCorInfoType + end interface +=20 +- interface pm6_correction +- module procedure hofCorrection +- module procedure hofCorrectionGradient +- end interface +- + ! Data type collecting information on PM6 HOF corrections + type corInfoType + logical :: inUse ! correction in use ? +diff -urN amber11.orig/AmberTools/test/cpptraj/Test_General/RunTest.sh a= mber11/AmberTools/test/cpptraj/Test_General/RunTest.sh +--- amber11.orig/AmberTools/test/cpptraj/Test_General/RunTest.sh 2011-04= -14 15:30:21.000000000 +0300 ++++ amber11/AmberTools/test/cpptraj/Test_General/RunTest.sh 2011-10-25 1= 5:01:28.215288544 +0300 +@@ -25,7 +25,7 @@ + DoTest PhiPsi.dat.save PhiPsi.dat + DoTest test.crd.save test.crd + DoTest a1.dat.save a1.dat +-DoTest test.rst7.103.save Restart/test.rst7.103 ++DoTest test.rst7.103.save Restart/test.rst7.123 + DoTest test.nc.save test.nc + DoTest r4.dat.save r4.dat + DoTest a2.dat.gz.save a2.dat.gz +diff -urN amber11.orig/AmberTools/test/mmpbsa_py/11_3D-RISM/FINAL_RESULT= S_MMPBSA.dat.save amber11/AmberTools/test/mmpbsa_py/11_3D-RISM/FINAL_RESU= LTS_MMPBSA.dat.save +--- amber11.orig/AmberTools/test/mmpbsa_py/11_3D-RISM/FINAL_RESULTS_MMPB= SA.dat.save 2011-04-14 15:30:22.000000000 +0300 ++++ amber11/AmberTools/test/mmpbsa_py/11_3D-RISM/FINAL_RESULTS_MMPBSA.da= t.save 2011-10-25 15:01:28.247288515 +0300 +@@ -1,4 +1,4 @@ +-| Run on Tue Mar 8 15:33:18 PST 2011 ++| Run on Fri Oct 7 17:12:46 EDT 2011 +=20 + |Input file: + |-------------------------------------------------------------- +@@ -32,14 +32,14 @@ + -----------------------------------------------------------------------= -------- + VDWAALS -4.6380 0.3291 = 0.2327 + EEL -425.3449 4.5554 = 3.2212 +-ERISM -164.0501 3.9611 = 2.8009 +- POLAR -219.8772 4.0588 = 2.8700 +- APOLAR 55.8271 0.0977 = 0.0691 ++ERISM -164.0499 3.9609 = 2.8008 ++ POLAR -235.0781 4.4994 = 3.1816 ++ APOLAR 71.0282 0.5386 = 0.3808 +=20 + G gas -429.9829 4.2263 = 2.9885 +-G solv -164.0501 3.9611 = 2.8009 ++G solv -164.0499 3.9609 = 2.8008 +=20 +-TOTAL -594.0331 0.2653 = 0.1876 ++TOTAL -594.0329 0.2655 = 0.1877 +=20 +=20 + Receptor: +@@ -48,8 +48,8 @@ + VDWAALS -3.9302 0.2702 = 0.1910 + EEL -254.1833 4.5196 = 3.1959 + ERISM -79.2939 3.0131 = 2.1306 +- POLAR -118.9799 3.1556 = 2.2314 +- APOLAR 39.6860 0.1425 = 0.1008 ++ POLAR -126.9784 3.4713 = 2.4546 ++ APOLAR 47.6845 0.4582 = 0.3240 +=20 + G gas -258.1136 4.2494 = 3.0048 + G solv -79.2939 3.0131 = 2.1306 +@@ -62,12 +62,12 @@ + -----------------------------------------------------------------------= -------- + VDWAALS -0.7056 0.0606 = 0.0428 + EEL -170.5448 1.1864 = 0.8389 +-ERISM -85.2510 0.0719 = 0.0509 +- POLAR -101.3724 0.0489 = 0.0346 +- APOLAR 16.1214 0.0230 = 0.0163 ++ERISM -85.2510 0.0719 = 0.0508 ++ POLAR -108.6574 0.0351 = 0.0249 ++ APOLAR 23.4064 0.1070 = 0.0757 +=20 + G gas -171.2505 1.2470 = 0.8818 +-G solv -85.2510 0.0719 = 0.0509 ++G solv -85.2510 0.0719 = 0.0508 +=20 + TOTAL -256.5015 1.1751 = 0.8309 +=20 +@@ -77,15 +77,15 @@ + -----------------------------------------------------------------------= -------- + VDWAALS -0.0021 0.0017 = 0.0012 + EEL -0.6167 1.2222 = 0.8642 +-ERISM 0.4947 1.0198 = 0.7211 +- POLAR 0.4750 0.9520 = 0.6732 +- APOLAR 0.0198 0.0678 = 0.0480 ++ERISM 0.4950 1.0196 = 0.7210 ++ POLAR 0.5577 0.9929 = 0.7021 ++ APOLAR -0.0627 0.0267 = 0.0189 +=20 + DELTA G gas -0.6189 1.2239 = 0.8654 +-DELTA G solv 0.4947 1.0198 = 0.7211 ++DELTA G solv 0.4950 1.0196 = 0.7210 +=20 +=20 +- DELTA G binding =3D -0.1241 +/- 0.2041 = 0.1443 ++ DELTA G binding =3D -0.1239 +/- 0.2043 = 0.1445 +=20 +=20 + -----------------------------------------------------------------------= -------- +@@ -99,8 +99,8 @@ + VDWAALS -4.6380 0.3291 = 0.2327 + EEL -425.3449 4.5554 = 3.2212 + ERISM -187.9280 4.0576 = 2.8691 +- POLAR -221.3631 4.0723 = 2.8795 +- APOLAR 33.4351 0.0147 = 0.0104 ++ POLAR -236.5648 4.5137 = 3.1916 ++ APOLAR 48.6367 0.4561 = 0.3225 +=20 + G gas -429.9829 4.2263 = 2.9885 + G solv -187.9280 4.0576 = 2.8691 +@@ -113,12 +113,12 @@ + -----------------------------------------------------------------------= -------- + VDWAALS -3.9302 0.2702 = 0.1910 + EEL -254.1833 4.5196 = 3.1959 +-ERISM -94.4232 3.0803 = 2.1781 +- POLAR -119.8020 3.1352 = 2.2169 +- APOLAR 25.3788 0.0549 = 0.0388 ++ERISM -94.4233 3.0804 = 2.1781 ++ POLAR -127.8003 3.4511 = 2.4403 ++ APOLAR 33.3771 0.3707 = 0.2621 +=20 + G gas -258.1136 4.2494 = 3.0048 +-G solv -94.4232 3.0803 = 2.1781 ++G solv -94.4233 3.0804 = 2.1781 +=20 + TOTAL -352.5368 1.1691 = 0.8267 +=20 +@@ -128,14 +128,14 @@ + -----------------------------------------------------------------------= -------- + VDWAALS -0.7056 0.0606 = 0.0428 + EEL -170.5448 1.1864 = 0.8389 +-ERISM -94.0188 0.0538 = 0.0381 +- POLAR -102.0695 0.0274 = 0.0194 +- APOLAR 8.0506 0.0264 = 0.0187 ++ERISM -94.0185 0.0541 = 0.0383 ++ POLAR -109.3544 0.0565 = 0.0399 ++ APOLAR 15.3358 0.1106 = 0.0782 +=20 + G gas -171.2505 1.2470 = 0.8818 +-G solv -94.0188 0.0538 = 0.0381 ++G solv -94.0185 0.0541 = 0.0383 +=20 +-TOTAL -265.2693 1.1932 = 0.8437 ++TOTAL -265.2690 1.1929 = 0.8435 +=20 +=20 + Differences (Complex - Receptor - Ligand): +@@ -143,15 +143,15 @@ + -----------------------------------------------------------------------= -------- + VDWAALS -0.0021 0.0017 = 0.0012 + EEL -0.6167 1.2222 = 0.8642 +-ERISM 0.5140 1.0311 = 0.7291 +- POLAR 0.5083 0.9645 = 0.6820 +- APOLAR 0.0057 0.0666 = 0.0471 ++ERISM 0.5137 1.0314 = 0.7293 ++ POLAR 0.5900 1.0061 = 0.7114 ++ APOLAR -0.0762 0.0253 = 0.0179 +=20 + DELTA G gas -0.6189 1.2239 = 0.8654 +-DELTA G solv 0.5140 1.0311 = 0.7291 ++DELTA G solv 0.5137 1.0314 = 0.7293 +=20 +=20 +- DELTA G binding =3D -0.1049 +/- 0.1928 = 0.1363 ++ DELTA G binding =3D -0.1051 +/- 0.1926 = 0.1362 +=20 +=20 + -----------------------------------------------------------------------= -------- +diff -urN amber11.orig/AmberTools/test/nab/rism3d.snglpnt.2.out.check am= ber11/AmberTools/test/nab/rism3d.snglpnt.2.out.check +--- amber11.orig/AmberTools/test/nab/rism3d.snglpnt.2.out.check 2011-04-= 14 15:30:23.000000000 +0300 ++++ amber11/AmberTools/test/nab/rism3d.snglpnt.2.out.check 2011-10-25 15= :01:28.248288514 +0300 +@@ -32,6 +32,7 @@ + mm_options: ntwrism=3D1 + mm_options: verbose=3D0 + mm_options: progress=3D0 ++ mm_options: asympCorr=3D1 + mm_options: saveprogress=3D0 + |3D-RISM thermodynamic data key + |solute_epot [kcal/mol] : Total LJ Co= ulomb Bond Angle Dihedral H-Bond= LJ-14 Coulomb-14 Restraints 3D-RISM +@@ -74,13 +75,13 @@ + 3D-RISM processing complete. +=20 + |Timing summary: +-| Initialize 0.042 ++| Initialize 0.046 + | Molec. Dyn. 0.000 + | Normal Mode 0.000 + | Conj. Grad. 0.000 + | Newton 0.000 + |------------------------- +-| Total 0.042 ++| Total 0.046 +=20 + |1st derivative timing summary: + | constraints 0.000 +@@ -91,7 +92,7 @@ + | nonbond 0.000 + | gen. Born 0.000 + | Poisson Boltzmann 0.000 +-| 3D-RISM 10.167 ++| 3D-RISM 8.211 + | Other 0.000 + |------------------------- +-| Total 10.167 ++| Total 8.212 +diff -urN amber11.orig/AmberTools/test/nab/rism3d.snglpnt.out.check ambe= r11/AmberTools/test/nab/rism3d.snglpnt.out.check +--- amber11.orig/AmberTools/test/nab/rism3d.snglpnt.out.check 2011-04-14= 15:30:23.000000000 +0300 ++++ amber11/AmberTools/test/nab/rism3d.snglpnt.out.check 2011-10-25 15:0= 1:28.248288514 +0300 +@@ -31,6 +31,7 @@ + mm_options: ntwrism=3D0 + mm_options: verbose=3D0 + mm_options: progress=3D0 ++ mm_options: asympCorr=3D1 + mm_options: saveprogress=3D0 + |3D-RISM thermodynamic data key + |solute_epot [kcal/mol] : Total LJ Co= ulomb Bond Angle Dihedral H-Bond= LJ-14 Coulomb-14 Restraints 3D-RISM +@@ -55,10 +56,10 @@ + rism_volume: 1.93595981E+002 + rism_exNumb: -6.38184158E+000 -1.27637588E+001 + rism_exChrg: -3.20562831E-005 5.40924893E+000 -5.40928099E+000 +-rism_polar_: -1.31661477E+001 -4.40204657E+001 3.08543179E+001 +-rism_apolar: 2.96543934E+001 7.56776450E+001 -4.60232516E+001 +-rism_polGF_: -1.34197324E+001 -4.39508092E+001 3.05310768E+001 +-rism_apolGF: 1.97398606E+001 7.11960080E+001 -5.14561474E+001 ++rism_polar_: -1.47850626E+001 -1.09412958E+001 -3.84376682E+000 ++rism_apolar: 3.12733083E+001 4.25984751E+001 -1.13251668E+001 ++rism_polGF_: -1.50386472E+001 -1.08716393E+001 -4.16700794E+000 ++rism_apolGF: 2.13587755E+001 3.81168382E+001 -1.67580627E+001 +=20 + Frame: 2 of 3 + solute_epot: -3.41386230E-001 2.56854615E+000 -8.23476129E+001 3.3871= 7466E-002 3.59735615E-001 7.49048012E+000 0.00000000E+000 4.97044290E= +000 5.01391318E+001 0.00000000E+000 1.64440184E+001 +@@ -68,10 +69,10 @@ + rism_volume: 1.93535504E+002 + rism_exNumb: -6.37993323E+000 -1.27596468E+001 + rism_exChrg: 9.31177385E-005 5.40763142E+000 -5.40753830E+000 +-rism_polar_: -1.31967073E+001 -4.40467251E+001 3.08500178E+001 +-rism_apolar: 2.96407256E+001 7.56851573E+001 -4.60444317E+001 +-rism_polGF_: -1.34505678E+001 -4.39769309E+001 3.05263631E+001 +-rism_apolGF: 1.97272712E+001 7.12038497E+001 -5.14765785E+001 ++rism_polar_: -1.48191496E+001 -1.09491800E+001 -3.86996959E+000 ++rism_apolar: 3.12631679E+001 4.25876122E+001 -1.13244443E+001 ++rism_polGF_: -1.50730101E+001 -1.08793858E+001 -4.19362428E+000 ++rism_apolGF: 2.13497135E+001 3.81063046E+001 -1.67565911E+001 +=20 + Frame: 3 of 3 + solute_epot: -6.77945271E-001 2.31243593E+000 -8.22812685E+001 9.0898= 0189E-002 3.84286510E-001 7.48894041E+000 0.00000000E+000 4.91668330E= +000 5.00274224E+001 0.00000000E+000 1.63826567E+001 +@@ -81,21 +82,21 @@ + rism_volume: 1.93468855E+002 + rism_exNumb: -6.37771162E+000 -1.27552065E+001 + rism_exChrg: 9.18518609E-005 5.40574837E+000 -5.40565652E+000 +-rism_polar_: -1.32423609E+001 -4.40992117E+001 3.08568508E+001 +-rism_apolar: 2.96250176E+001 7.57232232E+001 -4.60982056E+001 +-rism_polGF_: -1.34968274E+001 -4.40292606E+001 3.05324332E+001 +-rism_apolGF: 1.97126459E+001 7.12421943E+001 -5.15295484E+001 ++rism_polar_: -1.48691739E+001 -1.09507135E+001 -3.91846037E+000 ++rism_apolar: 3.12518306E+001 4.25747250E+001 -1.13228944E+001 ++rism_polGF_: -1.51236404E+001 -1.08807624E+001 -4.24287800E+000 ++rism_apolGF: 2.13394589E+001 3.80936961E+001 -1.67542372E+001 +=20 + 3D-RISM processing complete. +=20 + |Timing summary: +-| Initialize 0.043 ++| Initialize 0.047 + | Molec. Dyn. 0.000 + | Normal Mode 0.000 + | Conj. Grad. 0.000 + | Newton 0.000 + |------------------------- +-| Total 0.043 ++| Total 0.047 +=20 + |1st derivative timing summary: + | constraints 0.000 +@@ -106,7 +107,7 @@ + | nonbond 0.000 + | gen. Born 0.000 + | Poisson Boltzmann 0.000 +-| 3D-RISM 32.639 ++| 3D-RISM 30.135 + | Other 0.000 + |------------------------- +-| Total 32.639 ++| Total 30.135 +diff -urN amber11.orig/AmberTools/test/nab/Run.prm amber11/AmberTools/te= st/nab/Run.prm +--- amber11.orig/AmberTools/test/nab/Run.prm 2011-04-14 15:30:23.0000000= 00 +0300 ++++ amber11/AmberTools/test/nab/Run.prm 2011-10-25 15:01:28.133288619 +0= 300 +@@ -17,7 +17,7 @@ +=20 + echo "checking the prmtop file:" + echo "" +-tail -3209 tprmtop > tprmtop1 ++tail -3228 tprmtop > tprmtop1 + ../dacdif tprmtop.check tprmtop1 +=20 + rm -f prm prm.c tleap.out leap.log tprmcrd prm.out1 tprmtop +diff -urN amber11.orig/AmberTools/test/nab/tprmtop.check amber11/AmberTo= ols/test/nab/tprmtop.check +--- amber11.orig/AmberTools/test/nab/tprmtop.check 2011-03-10 20:12:18.0= 00000000 +0200 ++++ amber11/AmberTools/test/nab/tprmtop.check 2011-10-25 15:01:28.135288= 617 +0300 +@@ -1,3 +1,4 @@ ++%VERSION VERSION_STAMP =3D V0001.000 DATE =3D 05/09/11 12:59:19 = =20 + %FLAG TITLE = =20 + %FORMAT(20a4) = =20 + = =20 +@@ -541,6 +542,24 @@ + 3.14159400E+00 3.14159400E+00 3.14159400E+00 3.14159400E+00 3.141= 59400E+00 + 3.14159400E+00 3.14159400E+00 3.14159400E+00 3.14159400E+00 3.141= 59400E+00 + 3.14159400E+00 3.14159400E+00 3.14159400E+00 ++%FLAG SCEE_SCALE_FACTOR = =20 ++%FORMAT(5E16.8) = =20 ++ 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.200= 00000E+00 ++ 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.200= 00000E+00 ++ 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.200= 00000E+00 ++ 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.200= 00000E+00 ++ 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.200= 00000E+00 ++ 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.20000000E+00 1.200= 00000E+00 ++ 0.00000000E+00 0.00000000E+00 0.00000000E+00 ++%FLAG SCNB_SCALE_FACTOR = =20 ++%FORMAT(5E16.8) = =20 ++ 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.000= 00000E+00 ++ 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.000= 00000E+00 ++ 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.000= 00000E+00 ++ 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.000= 00000E+00 ++ 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.000= 00000E+00 ++ 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.00000000E+00 2.000= 00000E+00 ++ 0.00000000E+00 0.00000000E+00 0.00000000E+00 + %FLAG SOLTY = =20 + %FORMAT(5E16.8) = =20 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.000= 00000E+00 +diff -urN amber11.orig/AmberTools/test/rism1d/check1d amber11/AmberTools= /test/rism1d/check1d +--- amber11.orig/AmberTools/test/rism1d/check1d 2011-04-14 15:30:29.0000= 00000 +0300 ++++ amber11/AmberTools/test/rism1d/check1d 2011-10-25 15:01:28.249288513= +0300 +@@ -85,7 +85,7 @@ + #It is unrealistic to achieve low relative error for these very small n= umber so we only=20 + #use the abolute error + if [ -s $1.bvv.save ]; then +- $AMBERHOME/AmberTools/test/dacdif -a 1.e-7 $1.bvv.save $1.bvv ++ $AMBERHOME/AmberTools/test/dacdif -a 2.e-7 $1.bvv.save $1.bvv + fi +=20 + /bin/rm -f $1.xvv.delhv0 $1.xvv.delhv0.save $1.xvv.xvv $1.xvv.xvv.save\ +diff -urN amber11.orig/AT15_Amber11.py amber11/AT15_Amber11.py +--- amber11.orig/AT15_Amber11.py 2011-04-14 15:30:11.000000000 +0300 ++++ amber11/AT15_Amber11.py 2011-10-25 15:01:28.221288538 +0300 +@@ -145,4 +145,29 @@ + makefile.close() + =20 + # Now we are done +-print "\nAmber 11 patched for AmberTools 1.5. Run\nmake %s\nto build am= ber11\n" % buildtype ++print "\nAmber 11 patched for AmberTools 1.5. Run\ncd src; make %s\nto = build amber11\n" % buildtype ++ ++# Now print out details about expected test FAILUREs and ++# errors: ++ ++warning =3D """NOTE: Because PBSA has changed since Amber 11 was releas= ed, some ++tests are known to fail and others are known to quit in error. These ++can be safely ignored. ++ ++Tests that error: Tests in $AMBERHOME/test/sander_pbsa_frc ++ Run.argasp.min Run.dadt.min Run.dgdc.min ++ Run.lysasp.min Run.polyALA.min Run.polyAT.min ++ Run.argasp.min Run.dadt.min Run.dgdc.min ++ Run.lysasp.min Run.polyALA.min Run.polyAT.min ++ Run.argasp.min Run.dadt.min Run.dgdc.min ++ Run.lysasp.min Run.polyALA.min Run.polyAT.min ++ ++Tests that produce possible FAILUREs: ++ cd sander_pbsa_ipb2 && ./Run.110D.min ++ cd sander_pbsa_lpb && ./Run.lsolver.min (only some of them fail h= ere) ++ cd sander_pbsa_tsr && ./Run.tsrb.min ++ cd sander_pbsa_decres && ./Run.pbsa_decres ++ mm_pbsa.pl tests 02, 03, and 05 ++""" ++ ++print warning +diff -urN amber11.orig/dat/antechamber/ATOMTYPE_AMBER.DEF amber11/dat/an= techamber/ATOMTYPE_AMBER.DEF +--- amber11.orig/dat/antechamber/ATOMTYPE_AMBER.DEF 2011-04-14 15:30:40.= 000000000 +0300 ++++ amber11/dat/antechamber/ATOMTYPE_AMBER.DEF 2011-10-25 15:01:28.19828= 8560 +0300 +@@ -49,7 +49,7 @@ + ATD F * 9 1 & + ATD Cl * 17 1 & + ATD Br * 35 1 & +-ATD F * 53 1 & ++ATD I * 53 1 & + ATD P * 15 & + ATD N1 * 7 1 & =20 + ATD NB * 7 2 * * [RG5,AR1.AR2.AR3] &=20 +diff -urN amber11.orig/dat/leap/cmd/leaprc.ff99SBnmr amber11/dat/leap/cm= d/leaprc.ff99SBnmr +--- amber11.orig/dat/leap/cmd/leaprc.ff99SBnmr 2011-04-14 15:30:40.00000= 0000 +0300 ++++ amber11/dat/leap/cmd/leaprc.ff99SBnmr 2011-10-25 15:01:28.239288522 = +0300 +@@ -74,13 +74,6 @@ + { "OL" "O" "sp3" } + { "AC" "C" "sp3" } + { "EC" "C" "sp3" } +-#ildn +- { "C3" "C" "sp3" } +- { "C4" "C" "sp3" } +- { "C5" "C" "sp2" } +- { "C6" "C" "sp2" } +- { "NP" "N" "sp2" } +- { "OM" "O" "sp2" } # guess!!! + } + # + # Load the main parameter set. +@@ -95,9 +88,9 @@ + # Load main chain and terminating=20 + # amino acid libraries (i.e. ff94 libs) + # +-loadOff all_amino94ildn.lib +-loadOff all_aminoct94ildn.lib +-loadOff all_aminont94ildn.lib ++loadOff all_amino94.lib ++loadOff all_aminoct94.lib ++loadOff all_aminont94.lib + # + # Load water and ions + #=20 +diff -urN amber11.orig/dat/leap/parm/parm10.dat amber11/dat/leap/parm/pa= rm10.dat +--- amber11.orig/dat/leap/parm/parm10.dat 2011-04-14 15:30:40.000000000 = +0300 ++++ amber11/dat/leap/parm/parm10.dat 2011-10-25 15:01:28.218288541 +0300 +@@ -783,8 +783,10 @@ + OS-P -OS-CT 1 0.25 0.0 -3. JCC,7,(1986= ),230 + OS-P -OS-CT 1 1.20 0.0 2. gg> ene.6= 31g*/mp2 + H1-CT-C -O 1 0.80 0.0 -1. Junmei et a= l, 1999 ++H1-CT-C -O 1 0.00 0.0 -2. Explicit of= wild card X-C-CT-X + H1-CT-C -O 1 0.08 180.0 3. Junmei et a= l, 1999 + H1-CX-C -O 1 0.80 0.0 -1. Junmei et a= l, 1999 (was H1-CT-C -O ) ++H1-CX-C -O 1 0.00 0.0 -2. Explicit of= wild card X-C-CT-X + H1-CX-C -O 1 0.08 180.0 3. Junmei et a= l, 1999 (was H1-CT-C -O ) + HC-CT-C -O 1 0.80 0.0 -1. Junmei et a= l, 1999 + HC-CT-C -O 1 0.00 0.0 -2. Explicit of= wild card X-C-CT-X +diff -urN amber11.orig/dat/leap/parm/parm99.dat amber11/dat/leap/parm/pa= rm99.dat +--- amber11.orig/dat/leap/parm/parm99.dat 2011-04-14 15:30:40.000000000 = +0300 ++++ amber11/dat/leap/parm/parm99.dat 2011-10-25 15:01:28.221288538 +0300 +@@ -546,7 +546,7 @@ + OS-P -OS-CT 1 0.25 0.0 -3. JCC,7,(1986= ),230 + OS-P -OS-CT 1 1.20 0.0 2. gg> ene.6= 31g*/mp2 + H1-CT-C -O 1 0.80 0.0 -1. Junmei et a= l, 1999 +-HC-CT-C -O 1 0.00 0.0 -2. Explicit of= wild card X-C-CT-X ++H1-CT-C -O 1 0.00 0.0 -2. Explicit of= wild card X-C-CT-X + H1-CT-C -O 1 0.08 180.0 3. Junmei et a= l, 1999 + HC-CT-C -O 1 0.80 0.0 -1. Junmei et a= l, 1999 + HC-CT-C -O 1 0.00 0.0 -2. Explicit of= wild card X-C-CT-X diff --git a/sci-chemistry/ambertools/files/ambertools-1.5-gentoo2.patch = b/sci-chemistry/ambertools/files/ambertools-1.5-gentoo2.patch new file mode 100644 index 0000000..3d82bbf --- /dev/null +++ b/sci-chemistry/ambertools/files/ambertools-1.5-gentoo2.patch @@ -0,0 +1,1056 @@ +diff -urN amber11.orig/AmberTools/src/configure amber11/AmberTools/src/c= onfigure +--- amber11.orig/AmberTools/src/configure 2011-10-25 15:01:28.222288537 = +0300 ++++ amber11/AmberTools/src/configure 2011-10-25 23:57:37.732371794 +0300 +@@ -293,7 +293,7 @@ + echo "Your AMBERHOME environment variable is not set! It should be s= et to" + echo "$ambhome NOT doing so may cause errors when you compile. Cont= inue" + echo "anyway? (yes or no)" +- read answer ++ answer=3D'yes' + if [ "$answer" =3D 'yes' -o "$answer" =3D 'Yes' -o "$answer" =3D 'YE= S' -o "$answer" =3D 'y' -o "$answer" =3D 'Y' ]; then + echo "" + echo "Continuing anyway... Setting AMBERHOME to $ambhome temporar= ily" +@@ -356,11 +356,11 @@ + mpi_flag=3D + lex=3Dflex + flibs_mkl=3D +-lapack=3Dinstall +-blas=3Dinstall ++lapack=3Dskip ++blas=3Dskip + f2c=3Dskip +-ucpp=3Dinstall +-cpp=3D"\$(BINDIR)/ucpp -l" ++ucpp=3Dskip ++cpp=3D"\$(EPREFIX)/usr/bin/ucpp -l" +=20 + #----------------------------------- + # skip building of sleap? +@@ -548,13 +548,14 @@ + flibs_arch=3D-lgfortran + flibsf_arch=3D + cc=3Dgcc +- cflags=3D ++ cflags=3D"GENTOO_CFLAGS" + # ambercflags=3D"-Wall" + cplusplus=3Dg++ +- cxxflags=3D ++ cxxflags=3D"GENTOO_CXXFLAGS" + # ambercxxflags=3D"-Wall" + fc=3Dgfortran +- fflags=3D ++ fflags=3D"GENTOO_FFLAGS" ++ ldflags=3D"GENTOO_LDFLAGS" + staticflag=3D'-static' + =20 + # If -noopt has been requested, force lack of optimisation; +@@ -575,11 +576,11 @@ + foptflags=3D"" + else + cnooptflags=3D +- coptflags=3D"-O3" ++ coptflags=3D"GENTOO_CFLAGS" + cxxnooptflags=3D +- cxxoptflags=3D"-O3" ++ cxxoptflags=3D"GENTOO_CXXFLAGS" + fnooptflags=3D"-O0" +- foptflags=3D"-O3" ++ foptflags=3D"GENTOO_FFLAGS" + fi + =20 + # Debugging options +@@ -1653,28 +1654,6 @@ + /bin/rm -f testp.c testp$objsuffix testp$suffix +=20 + #--------------------------------------------------------------------= ------ +- # Configure fftw-3.2.2: +- #--------------------------------------------------------------------= ------ +- if [ "$mdgx" =3D 'yes' ]; then +- mdgxflag=3D"--prefix=3D$AMBERHOME --disable-fortran"=20 +- echo +- echo "Configuring fftw-3.2.2 (may be time-consuming)..." +- echo +- cd fftw-3.2.2 && \ +- env CC=3D"$cc" CFLAGS=3D"$cflags $cnooptflags" \ +- ./configure $mdgxflag > ../fftw3_config.log 2>&1 +- ncerror=3D$? +- if [ $ncerror -gt 0 ]; then +- echo " Error: FFTW configure returned $ncerror" +- echo " FFTW configure failed! Check the fftw3_config.log f= ile." +- exit 1 +- else +- echo " fftw-3.2.2 configure succeeded." +- fi +- cd .. +- fi +- +- #--------------------------------------------------------------------= ------ + # Configure python + #--------------------------------------------------------------------= ------ + if [ "$pyinstall" =3D 'python' ]; then +@@ -1792,27 +1771,6 @@ + echo + echo "Configuring fftw-2.1.5 (may be time-consuming)..." + echo +- cd fftw-2.1.5 +- if [ "$mpi" =3D 'yes' ]; then +- ./configure $rismflag --enable-mpi \ +- CC=3D"$cc" CFLAGS=3D"$cflags $coptflags" \ +- F77=3D"$fc" FFLAGS=3D"$fflags $foptflags" \ +- FLIBS=3D"$flibs_arch" > ../fftw2_config.log 2>&1 +- else +- ./configure $rismflag \ +- CC=3D"$cc" CFLAGS=3D"$cflags $coptflags" \ +- F77=3D"$fc" FFLAGS=3D"$fflags $foptflags" \ +- FLIBS=3D"$flibs_arch" > ../fftw2_config.log 2>&1 +- fi +- ncerror=3D$? +- if [ $ncerror -gt 0 ]; then +- echo " Error: fftw configure returned $ncerror" +- echo " fftw configure failed! Check the fftw2_config.= log file." +- exit 1 +- else +- echo " fftw-2.1.5 configure succeeded." +- fi +- cd .. + flibs_fftw2=3D"-ldrfftw -ldfftw" + if [ "$mpi" =3D 'yes' ]; then + flibs_fftw2=3D"-ldrfftw_mpi -ldfftw_mpi $flibs_fftw2" +@@ -2004,7 +1962,7 @@ + AMBERLDFLAGS=3D\$(AMBERBUILDFLAGS) +=20 + LEX=3D $lex +-YACC=3D \$(BINDIR)/yacc ++YACC=3D byacc + AR=3D ar rv + M4=3D $m4 + RANLIB=3D$ranlib +diff -urN amber11.orig/AmberTools/src/cpptraj/src/Makefile_at amber11/Am= berTools/src/cpptraj/src/Makefile_at +--- amber11.orig/AmberTools/src/cpptraj/src/Makefile_at 2011-10-25 15:01= :28.076288672 +0300 ++++ amber11/AmberTools/src/cpptraj/src/Makefile_at 2011-10-25 17:57:48.5= 53749686 +0300 +@@ -68,11 +68,8 @@ + -/bin/rm FindDepend.o + -/bin/rm findDepend +=20 +-cpptraj$(SFX): $(NETCDFLIB) $(OBJECTS) +- $(CXX) $(LDFLAGS) -o cpptraj$(SFX) $(OBJECTS) $(NETCDFLIB) $(ZLIB) $(B= ZLIB) +- +-$(NETCDFLIB): ../../netcdf_config.log +- cd ../../netcdf/src && $(MAKE) install ++cpptraj$(SFX): $(OBJECTS) ++ $(CXX) $(LDFLAGS) -o cpptraj$(SFX) $(OBJECTS) $(NETCDFLIB) $(ZLIB) $(B= ZLIB) -lgomp +=20 + .c.o: + $(CC) -c $(CPPTRAJ_FLAGS) -o $@ $< +diff -urN amber11.orig/AmberTools/src/Makefile amber11/AmberTools/src/Ma= kefile +--- amber11.orig/AmberTools/src/Makefile 2011-04-14 15:30:12.000000000 += 0300 ++++ amber11/AmberTools/src/Makefile 2011-10-26 00:07:12.902565336 +0300 +@@ -8,15 +8,9 @@ +=20 + install: $(INSTALLTYPE) +=20 +-serial: configured_serial $(NETCDFLIB) $(PYINSTALL) $(MTKPP) ++serial: configured_serial + @echo "Starting installation of ${AMBERTOOLS} serial at `date`". + # utility routines and libraries: +- (cd ucpp-1.3 && $(MAKE) $(UCPP) ) +- (cd byacc && $(MAKE) install ) +- (cd arpack && $(MAKE) install ); +- (cd lapack && $(MAKE) $(LAPACK) ) +- (cd blas && $(MAKE) $(BLAS) ) +- (cd c9x-complex && $(MAKE) $(C9XCOMPLEX) ) + (cd etc && $(MAKE) install ) + (cd chamber && $(MAKE) install ) + (cd pbsa && $(MAKE) install ) +@@ -32,7 +26,6 @@ + (cd cpptraj && $(MAKE) $(CPPTRAJ)) +=20 + # miscellaneous: +- (cd reduce && $(MAKE) install ) +=20 + # leap and gleap: + (cd leap && $(MAKE) install ) +@@ -42,7 +35,6 @@ + (cd rism && $(MAKE) install ) +=20 + # nab: +- (cd cifparse && $(MAKE) install ) + (cd sff && $(MAKE) install ) + (cd pbsa && $(MAKE) libinstall ) + (cd nab && $(MAKE) install ) +@@ -63,19 +55,12 @@ + @echo "Installation of ${AMBERTOOLS} serial is complete at `date`." + @echo "" +=20 +-nabonly: $(NETCDFLIB)=20 ++nabonly: + # utility routines and libraries: +- (cd ucpp-1.3 && $(MAKE) $(UCPP) ) +- (cd byacc && $(MAKE) install ) +- (cd arpack && $(MAKE) install ); +- (cd lapack && $(MAKE) $(LAPACK) ) +- (cd blas && $(MAKE) $(BLAS) ) +- (cd c9x-complex && $(MAKE) $(C9XCOMPLEX) ) + (cd pbsa && $(MAKE) libinstall ) + (cd rism && $(MAKE) install ) +=20 + # nab: +- (cd cifparse && $(MAKE) install ) + (cd sff && $(MAKE) install ) + (cd nab && $(MAKE) install ) + (cd nss && $(MAKE) install ) +diff -urN amber11.orig/AmberTools/src/mdgx/Makefile amber11/AmberTools/s= rc/mdgx/Makefile +--- amber11.orig/AmberTools/src/mdgx/Makefile 2011-04-14 15:30:17.000000= 000 +0300 ++++ amber11/AmberTools/src/mdgx/Makefile 2011-10-25 15:32:04.007129323 += 0300 +@@ -109,7 +109,7 @@ +=20 + FFTW_LIBS =3D $(LIBDIR)/libfftw3.a +=20 +-mdgx$(SFX) : $(MDGX_OBJS) $(FFTW_LIBS) $(NETCDFLIB) ++mdgx$(SFX) : $(MDGX_OBJS) + $(CC) $(COPTFLAGS) $(CFLAGS) $(AMBERCFLAGS) \ + -o $@ $(MDGX_OBJS) $(FFTW_LIBS) $(NETCDFLIB) $(LM) +=20 +diff -urN amber11.orig/AmberTools/src/pbsa/Makefile amber11/AmberTools/s= rc/pbsa/Makefile +--- amber11.orig/AmberTools/src/pbsa/Makefile 2011-10-25 15:01:28.228288= 532 +0300 ++++ amber11/AmberTools/src/pbsa/Makefile 2011-10-25 22:15:38.721245308 += 0300 +@@ -148,7 +148,7 @@ + ) +=20 + #----------------------------------------------------------------------= ----- +-pbsa$(SFX): $(OBJ) syslib netlib c9x-complex configured_serial ++pbsa$(SFX): $(OBJ) syslib configured_serial + $(FC) $(FFLAGS) $(AMBERFFLAGS) -o pbsa$(SFX) $(OBJ) \ + ../lib/nxtsec.o ../lib/random.o \ + $(FLIBSF) $(LDFLAGS) $(AMBERLDFLAGS) +@@ -158,7 +158,7 @@ + ../lib/nxtsec.o ../lib/random.o \ + $(FLIBSF) $(LDFLAGS) $(AMBERLDFLAGS) +=20 +-simplepbsa$(SFX): simplepbsa.o gopt.o libpbsa.a sfflib syslib netlib c9= x-complex ++simplepbsa$(SFX): simplepbsa.o gopt.o libpbsa.a sfflib syslib + $(FC) $(FFLAGS) $(AMBERFFLAGS) -o simplepbsa$(SFX) simplepbsa.o gopt.o= \ + libpbsa.a $(LIBDIR)/libsff.a ../lib/nxtsec.o $(FLIBSF) \ + $(LDFLAGS) $(AMBERLDFLAGS) +@@ -194,16 +194,6 @@ + sfflib: + cd ../sff && $(MAKE) install +=20 +-netlib:=20 +- cd ../lapack && $(MAKE) $(LAPACK) +- cd ../blas && $(MAKE) $(BLAS) +- cd ../arpack && $(MAKE) install +- +-c9x-complex: +- @if test $(C9XCOMPLEX) !=3D "skip"; then \ +- cd ../c9x-complex && $(MAKE) libmc.a; \ +- fi +- + pb_init.o: pb_init.f + $(FPP) $(FPPFLAGS) $(AMBERFPPFLAGS) $< > _$< + $(FC) -c -O0 $(FFLAGS) $(AMBERFFLAGS) -o $@ _$< +diff -urN amber11.orig/AmberTools/src/ptraj/Makefile amber11/AmberTools/= src/ptraj/Makefile +--- amber11.orig/AmberTools/src/ptraj/Makefile 2011-04-14 15:30:19.00000= 0000 +0300 ++++ amber11/AmberTools/src/ptraj/Makefile 2011-10-25 22:16:34.407661018 = +0300 +@@ -57,25 +57,20 @@ + pubfft.o: pubfft.f + $(FC) -c $(FREEFORMAT_FLAG) $(FOPTFLAGS) $(FFLAGS) $(AMBERFFLAGS) -o $= @ $< +=20 +-rdparm$(SFX): libs $(NETCDFLIB) $(OBJECTS) ++rdparm$(SFX): libs $(OBJECTS) + $(CC) $(CFLAGS) $(AMBERCFLAGS) $(LDFLAGS) $(AMBERLDFLAGS) \ + -o rdparm$(SFX) $(OBJECTS) $(LIBS) $(NETCDFLIB) $(LM) +=20 +-ptraj$(SFX): libs netlib $(NETCDFLIB) $(OBJECTS) ++ptraj$(SFX): libs $(OBJECTS) + $(CC) $(CFLAGS) $(AMBERCFLAGS) $(LDFLAGS) $(AMBERLDFLAGS) \ + -o ptraj$(SFX) $(OBJECTS) $(LIBS) $(NETCDFLIB) $(LM) +=20 +-ptraj.MPI$(SFX): libs netlib $(PNETCDFLIB) $(OBJECTS) ++ptraj.MPI$(SFX): libs $(PNETCDFLIB) $(OBJECTS) + $(CC) $(CFLAGS) $(AMBERCFLAGS) $(LDFLAGS) $(AMBERLDFLAGS) \ + -o ptraj.MPI$(SFX) $(OBJECTS) $(LIBS) $(PNETCDFLIB) $(LM) +=20 + libs:=20 + cd pdb && $(MAKE)=20 +- cd ../arpack && $(MAKE) +- +-netlib: +- cd ../lapack && $(MAKE) $(LAPACK) +- cd ../blas && $(MAKE) $(BLAS) +=20 + clean: + cd pdb && $(MAKE) clean +diff -urN amber11.orig/AmberTools/src/ptraj/netcdf_ptraj.h amber11/Amber= Tools/src/ptraj/netcdf_ptraj.h +--- amber11.orig/AmberTools/src/ptraj/netcdf_ptraj.h 2011-04-14 15:30:19= .000000000 +0300 ++++ amber11/AmberTools/src/ptraj/netcdf_ptraj.h 2011-10-25 15:32:04.0091= 29320 +0300 +@@ -4,7 +4,7 @@ + # include "../../include/pnetcdf.h" + # define nc_strerror ncmpi_strerror + # else +-# include "../../include/netcdf.h" ++# include + # endif=20 + #endif +=20 +diff -urN amber11.orig/AmberTools/src/ptraj/ptraj.h amber11/AmberTools/s= rc/ptraj/ptraj.h +--- amber11.orig/AmberTools/src/ptraj/ptraj.h 2011-04-14 15:30:19.000000= 000 +0300 ++++ amber11/AmberTools/src/ptraj/ptraj.h 2011-10-25 15:32:04.009129320 += 0300 +@@ -94,7 +94,7 @@ + #define nc_strerror ncmpi_strerror + #include "../../include/pnetcdf.h" + #else +-#include "../../include/netcdf.h" ++#include + #endif + #endif +=20 +diff -urN amber11.orig/AmberTools/src/rism/Makefile amber11/AmberTools/s= rc/rism/Makefile +--- amber11.orig/AmberTools/src/rism/Makefile 2011-04-14 15:30:19.000000= 000 +0300 ++++ amber11/AmberTools/src/rism/Makefile 2011-10-25 15:32:04.010129318 += 0300 +@@ -49,7 +49,7 @@ + mdiis_orig_c.o mdiis_blas_c.o mdiis_blas2_c.o mdiis_c.o \ + fce_c.o erfcfun.o safemem.o blend.o timer_c.o +=20 +-librism: $(LIBOBJ) $(FLIBS_FFTW2) ++librism: $(LIBOBJ) + $(AR) $(LIBDIR)/$@.a $(LIBOBJ) + $(RANLIB) $(LIBDIR)/$@.a +=20 +diff -urN amber11.orig/AmberTools/src/sff/AmberNetcdf.c amber11/AmberToo= ls/src/sff/AmberNetcdf.c +--- amber11.orig/AmberTools/src/sff/AmberNetcdf.c 2011-04-14 15:30:19.00= 0000000 +0300 ++++ amber11/AmberTools/src/sff/AmberNetcdf.c 2011-10-25 15:32:04.0101293= 18 +0300 +@@ -27,7 +27,7 @@ + #endif + =20 + #ifdef BINTRAJ +-#include "../../include/netcdf.h" ++#include +=20 + #define NCFRAME "frame" + #define NCSPATIAL "spatial" +diff -urN amber11.orig/AmberTools/src/sff/dsarpack.f amber11/AmberTools/= src/sff/dsarpack.f +--- amber11.orig/AmberTools/src/sff/dsarpack.f 1970-01-01 03:00:00.00000= 0000 +0300 ++++ amber11/AmberTools/src/sff/dsarpack.f 2011-10-25 19:52:58.579517634 = +0300 +@@ -0,0 +1,654 @@ ++ subroutine dsarpack(n_dim,n_eig_in,n_eig_out,ncv_in,itr_in, ++ & eigval_tol,eigvals,eigvecs,spectrum, ++ & need_eigvecs,ierr,debug_arpack, ++ & v,workl,workd,d,resid,ax,select, ++ & xyz,grad,return_flag,label) ++c ++ implicit none ++c ++c %-----------------% ++c | Dummy Arguments | ++c %-----------------% ++c ++ integer n_dim,n_eig_in,n_eig_out,ncv_in,itr_in,spectrum, ++ & need_eigvecs,ierr,debug_arpack,return_flag,label ++ Double precision eigval_tol ++ Double precision eigvals(n_eig_in),eigvecs(n_dim * n_eig_in) ++ Double precision v(n_dim,ncv_in), ++ & workl(ncv_in*(ncv_in+8)),workd(3*n_dim), ++ & d(ncv_in,2),resid(n_dim),ax(n_dim), ++ & xyz(n_dim),grad(n_dim) ++ logical select(ncv_in) ++c ++ save ++c ++c %---------------% ++c | Include Files | ++c %---------------% ++c ++c include 'debug.h' ++c ++c\SCCS Information: @(#)=20 ++c FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2=20 ++c ++c %---------------------------------% ++c | See debug.doc for documentation | ++c %---------------------------------% ++ integer logfil, ndigit, mgetv0, ++ & msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd, ++ & mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd, ++ & mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd ++ common /debug/=20 ++ & logfil, ndigit, mgetv0, ++ & msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd, ++ & mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd, ++ & mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd ++c ++c This code shows how to use ARPACK to find a few eigenvalues=20 ++c (lambda) and corresponding eigenvectors (x) for the standard=20 ++c eigenvalue problem: ++c =20 ++c A*x =3D lambda*x ++c=20 ++c where A is an n by n real symmetric matrix. ++c ++c The main points illustrated here are=20 ++c ++c 1) How to declare sufficient memory to find NEV=20 ++c eigenvalues of largest magnitude. Other options ++c are available. ++c ++c 2) Illustration of the reverse communication interface=20 ++c needed to utilize the top level ARPACK routine DSAUPD=20 ++c that computes the quantities needed to construct ++c the desired eigenvalues and eigenvectors(if requested). ++c ++c 3) How to extract the desired eigenvalues and eigenvectors ++c using the ARPACK routine DSEUPD. ++c ++c The only thing that must be supplied in order to use this ++c routine on your problem is to change the array dimensions=20 ++c appropriately, to specify WHICH eigenvalues you want to compute=20 ++c and to supply a matrix-vector product ++c ++c w <- Av ++c ++c in place of the call to AV( ) below. ++c ++c Once usage of this routine is understood, you may wish to explore ++c the other available options to improve convergence, to solve gene= ralized ++c problems, etc. Look at the file ex-sym.doc in DOCUMENTS director= y. ++c This codes implements =20 ++c ++c\Example-1 ++c ... Suppose we want to solve A*x =3D lambda*x in regular mode, ++c where A is derived from the central difference discretization ++c of the 2-dimensional Laplacian on the unit square with ++c zero Dirichlet boundary condition. ++c ... OP =3D A and B =3D I. ++c ... Assume "call av (n,x,y)" computes y =3D A*x ++c ... Use mode 1 of DSAUPD. ++c ++c\BeginLib ++c ++c\Routines called: ++c dsaupd ARPACK reverse communication interface routine. ++c dseupd ARPACK routine that returns Ritz values and (optionally) ++c Ritz vectors. ++c dnrm2 Level 1 BLAS that computes the norm of a vector. ++c daxpy Level 1 BLAS that computes y <- alpha*x+y. ++c ++c\Author ++c Richard Lehoucq ++c Danny Sorensen ++c Chao Yang ++c Dept. of Computational & ++c Applied Mathematics ++c Rice University ++c Houston, Texas ++c ++c\SCCS Information: %Z% ++c FILE: %M% SID: %I% DATE OF SID: %G% RELEASE: %R% ++c ++c\Remarks ++c 1. None ++c ++c\EndLib ++c ++c----------------------------------------------------------------------= - ++c ++c %-------------------------------------------------------% ++c | Storage Declarations: | ++c | | ++c | The maximum dimensions for all arrays are | ++c | set here to accommodate a problem size of | ++c | N .le. MAXN | ++c | | ++c | NEV is the number of eigenvalues requested. | ++c | See specifications for ARPACK usage below. | ++c | | ++c | NCV is the largest number of basis vectors that will | ++c | be used in the Implicitly Restarted Arnoldi | ++c | Process. Work per major iteration is | ++c | proportional to N*NCV*NCV. | ++c | | ++c | You must set: | ++c | | ++c | MAXN: Maximum dimension of the A allowed. (dynamic) | ++c | MAXNEV: Maximum NEV allowed. (dynamic) | ++c | MAXNCV: Maximum NCV allowed. (dynamic) | ++c %-------------------------------------------------------% ++c ++C %--------------------------------------% ++C | F90 Allocatable Arrays (on the heap) | ++C %--------------------------------------% ++c ++C Double precision,allocatable,save :: v(:,:) ++C integer,save :: v_row_allocated =3D 0, v_col_allocated =3D 0 ++c ++c %----------------------------------------------% ++c | Originally, as F77 parameters, the following | ++c | integers were used to dimension work arrays. | ++c | They are replaced by dummy arguments used to | ++c | dimension the work arrays as F90 automatic | ++c | arrays, but the integers are still used for | ++c | passing the dimensions to lower level ARPACK | ++c | routines dsaupd, dseupd and dmout. | ++c %----------------------------------------------% ++c ++ integer maxn, maxnev, maxncv, ldv ++c ++c %-------------------------------------------% ++c | Local F90 Automatic Arrays (on the stack) | ++c %-------------------------------------------% ++c ++ Double precision ++C & workl(ncv_in*(ncv_in+8)), ++C & workd(3*n_dim), d(ncv_in,2), resid(n_dim), ++C & ax(n_dim), ++ & cg_dstat(4) ++C logical select(ncv_in) ++ integer iparam(11), ipntr(11), ++ & cg_istat(4) ++c ++c %---------------% ++c | Local Scalars | ++c %---------------% ++c ++ character bmat*1, which*2 ++ integer ido, n, nev, ncv, lworkl, info, ++ & i, j, nx, ishfts, maxitr, mode1, nconv ++ integer L12, L18, ARPACK_ERROR, status_flag ++ data L12, L18, ARPACK_ERROR /1, 2, -2/ ++C integer v_row_needed, v_col_needed ++ logical rvec ++ Double precision =20 ++ & tol, sigma ++c ++c %------------% ++c | Parameters | ++c %------------% ++c ++ Double precision ++ & zero ++ parameter (zero =3D 0.0D+0) ++c =20 ++c %-----------------------------% ++c | BLAS & LAPACK routines used | ++c %-----------------------------% ++c ++ Double precision =20 ++ & dnrm2 ++ external dnrm2, daxpy, hessvec ++c ++c %--------------------% ++c | Intrinsic function | ++c %--------------------% ++c ++ intrinsic abs ++c ++c %-----------------------% ++c | Executable Statements | ++c %-----------------------% ++c ++ if ( label.eq.0 ) go to 1 ++ go to (12,18) label ++ 1 continue ++c ++c %------------------------------------------------% ++c | Values used to calculate work array dimensions | ++c %------------------------------------------------% ++c ++ maxn =3D n_dim ++ maxnev =3D n_eig_in ++ maxncv =3D ncv_in ++ ldv =3D maxn ++c ++c %---------------------------------------------------% ++c | The include debug.h statement above and | ++c | assignments here initiate trace output from the | ++c | internal actions of ARPACK. See debug.doc in the | ++c | DOCUMENTS directory for usage. Initially, the | ++c | most useful information will be a breakdown of | ++c | time spent in the various stages of computation | ++c | given by setting msaupd =3D 1. | ++c %---------------------------------------------------% ++c ++ ndigit =3D -5 ++ logfil =3D 6 ++ msgets =3D 0 ++ msaitr =3D 0=20 ++ msapps =3D 0 ++ if ( debug_arpack.eq.1 ) then ++ msaupd =3D 1 ++ else ++ msaupd =3D 0 ++ endif ++ msaup2 =3D 0 ++ mseigt =3D 0 ++ mseupd =3D 0 ++c =20 ++c *** Allocatable array v will be allowed to grow to its largest size= ; ++c *** it is never deallocated: ++C v_row_needed =3D n_dim !!! ldv ++C v_col_needed =3D ncv_in !!! maxncv ++C if( allocated(v) )then ++C if( (v_row_needed .gt. v_row_allocated) ++C & .or. (v_col_needed .gt. v_col_allocated) )then ++C deallocate(v,stat=3Dierr) ++C if( ierr .ne. 0 )then ++C write( logfil, '(a,i16,1x,i8)' ) ++C & 'ARPACK: could not deallocate v' ++C go to 9000 ++C endif ++C endif ++C endif ++C if( .not. allocated(v) )then ++C allocate( v(v_row_needed,v_col_needed), stat=3Dierr ) ++C if( ierr .ne. 0 )then ++C write( logfil, '(a,2i10)' ) ++C & 'ARPACK: could not allocate v' ++C go to 9000 ++C endif ++C v_row_allocated =3D v_row_needed ++C v_col_allocated =3D v_col_needed ++C endif ++C v =3D zero !!! zero out entire v array ++c =20 ++c %-------------------------------------------------% ++c | The following sets dimensions for this problem. | ++c %-------------------------------------------------% ++c ++ n =3D n_dim ++c ++c %----------------------------------------------% ++c | |=20 ++c | Specifications for ARPACK usage are set |=20 ++c | below: | ++c | | ++c | 1) NEV =3D N_EIG_IN asks for N_EIG_IN | =20 ++c | eigenvalues to be computed. |=20 ++c | | ++c | 2) NCV =3D NCV_IN sets the length of the | ++c | Arnoldi factorization | ++c | | ++c | 3) This is a standard problem | ++c | (indicated by bmat =3D 'I') | ++c | | ++c | 4) Ask for the NEV eigenvalues of | ++c | smallest magnitude | ++c | (indicated by which =3D 'SM') | ++c | See documentation in SSAUPD for the | ++c | other options SA, LA, LM, BE. |=20 ++c | | ++c | Note: NEV and NCV must satisfy the following | ++c | conditions: | ++c | NEV <=3D MAXNEV | ++c | NEV + 1 <=3D NCV <=3D MAXNCV | ++c %----------------------------------------------% ++c ++ nev =3D n_eig_in ++ ncv =3D ncv_in=20 ++ bmat =3D 'I' ++ if ( spectrum .eq. 1 ) then ++ which =3D 'SM' ++ else if ( spectrum .eq. 2 ) then ++ which =3D 'SA' ++ else if ( spectrum .eq. 3 ) then ++ which =3D 'LM' ++ else if ( spectrum .eq. 4 ) then ++ which =3D 'LA' ++ else if ( spectrum .eq. 5 ) then ++ which =3D 'BE' ++ else ++ print *, ' ERROR with _SSIMP: Spectrum .NE. (SM|SA|LA|LM|BE)' ++ go to 9000 ++ end if ++c ++ if ( n .gt. maxn ) then ++ print *, ' ERROR with _SSIMP: N is greater than MAXN ' ++ go to 9000 ++ else if ( nev .gt. maxnev ) then ++ print *, ' ERROR with _SSIMP: NEV is greater than MAXNEV ' ++ go to 9000 ++ else if ( ncv .gt. maxncv ) then ++ print *, ' ERROR with _SSIMP: NCV is greater than MAXNCV ' ++ go to 9000 ++ end if ++c ++c %-----------------------------------------------------% ++c | | ++c | Specification of stopping rules and initial | ++c | conditions before calling DSAUPD | ++c | | ++c | TOL determines the stopping criterion. | ++c | | ++c | Expect | ++c | abs(lambdaC - lambdaT) < TOL*abs(lambdaC) | ++c | computed true | ++c | | ++c | If TOL .le. 0, then TOL <- macheps | ++c | (machine precision) is used. | ++c | | ++c | IDO is the REVERSE COMMUNICATION parameter | ++c | used to specify actions to be taken on return | ++c | from DSAUPD. (See usage below.) | ++c | | ++c | It MUST initially be set to 0 before the first | ++c | call to DSAUPD. |=20 ++c | | ++c | INFO on entry specifies starting vector information | ++c | and on return indicates error codes | ++c | | ++c | Initially, setting INFO=3D0 indicates that a |=20 ++c | random starting vector is requested to | ++c | start the ARNOLDI iteration. Setting INFO to | ++c | a nonzero value on the initial call is used | ++c | if you want to specify your own starting | ++c | vector (This vector must be placed in RESID.) |=20 ++c | | ++c | The work array WORKL is used in DSAUPD as |=20 ++c | workspace. Its dimension LWORKL is set as | ++c | illustrated below. | ++c | | ++c %-----------------------------------------------------% ++c ++ lworkl =3D ncv*(ncv+8) ++ tol =3D eigval_tol=20 ++ info =3D 0 ++ ido =3D 0 ++c ++c %---------------------------------------------------% ++c | Specification of Algorithm Mode: | ++c | | ++c | This program uses the exact shift strategy | ++c | (indicated by setting PARAM(1) =3D 1). | ++c | IPARAM(3) specifies the maximum number of Arnoldi | ++c | iterations allowed. Mode 1 of DSAUPD is used | ++c | (IPARAM(7) =3D 1). All these options can be changed | ++c | by the user. For details see the documentation in | ++c | DSAUPD. | ++c %---------------------------------------------------% ++c ++ ishfts =3D 1 ++ maxitr =3D itr_in=20 ++ mode1 =3D 1 ++c ++ iparam(1) =3D ishfts ++c =20 ++ iparam(3) =3D maxitr ++c =20 ++ iparam(7) =3D mode1 ++c ++c %------------------------------------------------% ++c | M A I N L O O P (Reverse communication loop) | ++c %------------------------------------------------% ++c ++ 10 continue ++c ++c %---------------------------------------------% ++c | Repeatedly call the routine DSAUPD and take |=20 ++c | actions indicated by parameter IDO until | ++c | either convergence is indicated or maxitr | ++c | has been exceeded. | ++c %---------------------------------------------% ++c ++ call dsaupd ( ido, bmat, n, which, nev, tol, resid,=20 ++ & ncv, v, ldv, iparam, ipntr, workd, workl, ++ & lworkl, info ) ++c ++ if (ido .eq. -1 .or. ido .eq. 1) then ++c ++c %--------------------------------------% ++c | Perform matrix vector multiplication | ++c | y <--- OP*x | ++c | The user should supply his/her own | ++c | matrix vector multiplication routine | ++c | here that takes workd(ipntr(1)) as | ++c | the input, and return the result to | ++c | workd(ipntr(2)). | ++c %--------------------------------------% ++c ++ status_flag =3D 0 ++ 11 continue ++ call hessvec ( n, workd(ipntr(1)), workd(ipntr(2)), ++ & xyz, grad, return_flag, status_flag ) ++ if ( status_flag.eq.0 ) go to 13 ++ if ( status_flag.lt.0 ) go to 9000 ++ label =3D L12 ++ return ++ 12 go to 11 ++ 13 continue ++c ++c %-----------------------------------------% ++c | L O O P B A C K to call DSAUPD again. | ++c %-----------------------------------------% ++c ++ go to 10 ++c ++ end if=20 ++c ++c %----------------------------------------% ++c | Either we have convergence or there is | ++c | an error. | ++c %----------------------------------------% ++c ++ if ( info .lt. 0 ) then ++c ++c %--------------------------% ++c | Error message. Check the | ++c | documentation in DSAUPD. | ++c %--------------------------% ++c ++ print *, ' ' ++ print *, ' Error with _saupd, info =3D ', info ++ print *, ' Check documentation in _saupd ' ++ print *, ' ' ++ go to 9000 ++c ++ else=20 ++c ++c %-------------------------------------------% ++c | No fatal errors occurred. | ++c | Post-Process using DSEUPD. | ++c | | ++c | Computed eigenvalues may be extracted. | =20 ++c | | ++c | Eigenvectors may be also computed now if | ++c | desired. (indicated by rvec =3D .true.) |=20 ++c | | ++c | The routine DSEUPD now called to do this | ++c | post processing (Other modes may require | ++c | more complicated post processing than | ++c | mode1.) | ++c | | ++c %-------------------------------------------% ++c =20 ++ if ( need_eigvecs .eq. 1 ) then ++ rvec =3D .true. ++ else ++ rvec =3D .false. ++ end if ++c ++ call dseupd ( rvec, 'All', select, d, v, ldv, sigma,=20 ++ & bmat, n, which, nev, tol, resid, ncv, v, ldv,=20 ++ & iparam, ipntr, workd, workl, lworkl, ierr ) ++c ++c %----------------------------------------------% ++c | Eigenvalues are returned in the first column | ++c | of the two dimensional array D and the | ++c | corresponding eigenvectors are returned in | ++c | the first NCONV (=3DIPARAM(5)) columns of the | ++c | two dimensional array V if requested. | ++c | Otherwise, an orthogonal basis for the | ++c | invariant subspace corresponding to the | ++c | eigenvalues in D is returned in V. | ++c %----------------------------------------------% ++c ++ if ( ierr .ne. 0) then ++c ++c %------------------------------------% ++c | Error condition: | ++c | Check the documentation of DSEUPD. | ++c %------------------------------------% ++c ++ print *, ' ' ++ print *, ' Error with _seupd, info =3D ', ierr ++ print *, ' Check the documentation of _seupd. ' ++ print *, ' ' ++ go to 9000 ++c ++ else if ( debug_arpack.eq.1 ) then ++c ++ nconv =3D iparam(5) ++ n_eig_out =3D nconv ++ if ( nconv .le. 0 ) then ++ print *, ' ' ++ print *, ' ARPACK: Not a single mode converged.' ++ print *, ' ' ++ go to 9000 ++ endif ++c ++C %--------------------------------------------% ++C | "UnDO" DO 20 j=3D1,nconv loop, because it is | ++C | illegal to jump in and out from a DO loop. | ++C %--------------------------------------------% ++c ++ j =3D 1 ++ 16 continue ++c ++c %---------------------------% ++c | Compute the residual norm | ++c | | ++c | || A*x - lambda*x || | ++c | | ++c | for the NCONV accurately | ++c | computed eigenvalues and | ++c | eigenvectors. (iparam(5) | ++c | indicates how many are | ++c | accurate to the requested | ++c | tolerance) | ++c %---------------------------% ++c ++ status_flag =3D 0 ++ 17 continue ++ call hessvec ( n, v(1,j), ax, xyz, grad, ++ & return_flag, status_flag ) ++ if ( status_flag.eq.0 ) go to 19 ++ if ( status_flag.lt.0 ) go to 9000 ++ label =3D L18 ++ return ++ 18 go to 17 ++ 19 continue ++c ++ call daxpy(n, -d(j,1), v(1,j), 1, ax, 1) ++ d(j,2) =3D dnrm2(n, ax, 1) ++ d(j,2) =3D d(j,2) / abs(d(j,1)) ++c ++ j =3D j + 1 ++ if ( j .gt. nconv ) go to 20 ++c ++ go to 16 ++c ++ 20 continue ++c ++c %-----------------------------% ++c | Display computed residuals. | ++c %-----------------------------% ++c ++ call dmout(6, nconv, 2, d, maxncv, -6, ++ & 'Ritz values and relative residuals') ++c ++c %-------------------------------------------% ++c | Print additional convergence information. | ++c %-------------------------------------------% ++c ++ if ( info .eq. 1) then ++ print *, ' ' ++ print *, ' Maximum number of iterations reached.' ++ print *, ' ' ++ else if ( info .eq. 3) then ++ print *, ' ' ++ print *, ' No shifts could be applied during implicit', ++ & ' Arnoldi update, try increasing NCV.' ++ print *, ' ' ++ end if ++c ++ print *, ' ' ++ print *, ' _SSIMP ' ++ print *, ' =3D=3D=3D=3D=3D=3D ' ++ print *, ' ' ++ print *, ' Size of the matrix is ', n ++ print *, ' The number of Ritz values requested is ', nev ++ print *, ' The number of Arnoldi vectors generated', ++ & ' (NCV) is ', ncv ++ print *, ' What portion of the spectrum: ', which ++ print *, ' The number of converged Ritz values is ', ++ & nconv ++ print *, ' The number of Implicit Arnoldi update', ++ & ' iterations taken is ', iparam(3) ++ print *, ' The number of OP*x is ', iparam(9) ++ print *, ' The convergence criterion is ', tol ++ print *, ' ' ++ end if ++c ++c %----------------------------% ++c | Return eigvals and eigvecs | ++c %----------------------------% ++c ++ nconv =3D iparam(5) ++ n_eig_out =3D nconv ++ if ( nconv .le. 0 ) then ++ print *, ' ' ++ print *, ' ARPACK: Not a single mode converged.' ++ print *, ' ' ++ go to 9000 ++ endif ++c ++ do 40 j=3D1, nconv ++ eigvals(j) =3D d(j,1) ++c ++ do 30 i=3D1, n ++ eigvecs((j-1)*n+i) =3D v(i,j) ++ 30 continue ++ 40 continue ++c ++ end if ++c ++c %--------------------------------% ++c | Done with subroutine dsarpack. | ++c %--------------------------------% ++c ++ label =3D 0 ++ return ++c ++ 9000 continue !!! Error ++c ++ if( status_flag.eq.0 ) status_flag =3D ARPACK_ERROR ++c ++ label =3D status_flag ++ return ++c ++ end ++c=20 ++c ------------------------------------------------------------------ +diff -urN amber11.orig/AmberTools/src/sff/Makefile amber11/AmberTools/sr= c/sff/Makefile +--- amber11.orig/AmberTools/src/sff/Makefile 2011-04-14 15:30:19.0000000= 00 +0300 ++++ amber11/AmberTools/src/sff/Makefile 2011-10-25 22:11:23.964319736 +0= 300 +@@ -1,11 +1,12 @@ + include ../config.h +=20 + .c.o: +- $(CC) -c -Dflex $(COPTFLAGS) $(CFLAGS) $(AMBERCFLAGS) $(RISMSFF) -o $@= $< ++ $(CC) -c -Dflex $(COPTFLAGS) $(CFLAGS) $(AMBERCFLAGS) $(RISMSFF) $(NET= CDFLIB) -o $@ $< +=20 + OBJS =3D binpos.o conjgrad.o lmodC.o memutil.o nblist.o newton.o nmode.= o \ + prm.o rand2.o sasad.o sff.o time.o xminC.o AmberNetcdf.o \ +- amber_rism_interface.o ++ amber_rism_interface.o \ ++ dsarpack.o \ +=20 + install: libsff hcp_getpdb +=20 +diff -urN amber11.orig/AmberTools/src/sqm/Makefile amber11/AmberTools/sr= c/sqm/Makefile +--- amber11.orig/AmberTools/src/sqm/Makefile 2011-04-14 15:30:20.0000000= 00 +0300 ++++ amber11/AmberTools/src/sqm/Makefile 2011-10-25 22:17:29.627071134 +0= 300 +@@ -77,7 +77,7 @@ + install: sqm$(SFX) + mv sqm$(SFX) $(BINDIR) +=20 +-sqm$(SFX): $(SQMOBJ) $(QMOBJ) netlib sys ++sqm$(SFX): $(SQMOBJ) $(QMOBJ) sys + $(FC) $(FFLAGS) $(AMBERFFLAGS) -o sqm$(SFX) $(SQMOBJ) $(QMOBJ) \ + $(FLIBSF) ../lib/sys.a $(LDFLAGS) $(AMBERLDFLAGS) +=20 +@@ -94,11 +94,6 @@ + sys: + cd ../lib; $(MAKE) sys.a +=20 +-netlib: +- cd ../lapack; $(MAKE) $(LAPACK) +- cd ../blas; $(MAKE) $(BLAS) +- cd ../arpack && $(MAKE) install +- + clean: + /bin/rm -f *.o _*.f *.mod *.d sqm$(SFX) +=20 +diff -urN amber11.orig/AmberTools/test/Makefile amber11/AmberTools/test/= Makefile +--- amber11.orig/AmberTools/test/Makefile 2011-04-14 15:30:55.000000000 = +0300 ++++ amber11/AmberTools/test/Makefile 2011-10-25 22:36:59.285906153 +0300 +@@ -12,7 +12,7 @@ +=20 + test.serial: clean is_amberhome_defined \ + test.nab test.ptraj test.cpptraj test.antechamber \ +- test.leap test.sleap test.resp test.pbsa test.mmpbsa \ ++ test.leap test.resp test.pbsa test.mmpbsa \ + test.ambpdb test.elsize test.chamber test.sqm test.rism1d \ + finished +=20 +diff -urN amber11.orig/AmberTools/test/test_at_serial.sh amber11/AmberTo= ols/test/test_at_serial.sh +--- amber11.orig/AmberTools/test/test_at_serial.sh 2011-03-10 20:12:24.0= 00000000 +0200 ++++ amber11/AmberTools/test/test_at_serial.sh 2011-10-25 21:52:52.178189= 963 +0300 +@@ -50,3 +50,9 @@ + else + echo "No test diffs to save!" + fi ++ ++if [ "${questionable_count}" -ne 0 -o "${error_count}" -ne 0 ] ++then ++ # Tests failed ++ exit 1 ++fi diff --git a/sci-chemistry/ambertools/metadata.xml b/sci-chemistry/ambert= ools/metadata.xml new file mode 100644 index 0000000..20e218e --- /dev/null +++ b/sci-chemistry/ambertools/metadata.xml @@ -0,0 +1,10 @@ + + + + sci-chemistry + + alexxy@gentoo.org + Alexey Shvetsov + + +