*********************************************************************** * * H4 PES Fit to the 6101 ab initio points of Boothroyd et al. * J. Chem. Phys. 95, 4331 (1991) * * See A. Aguado, C. Suarez and M. Paniagua. J. Chem. Phys. Accepted * ************************************************************************ * TEST MAIN PROGRAM, call function H4FINAL to obtain the true PES. PROGRAM H4JCP IMPLICIT REAL * 8 (A-H,O-Z) READ(5,*) NPUN,NFUN *********************************************************************** * IF (NFUN.GT.0) obtain the H4 energy from H4FINAL, given the * six internuclear distances. Note that you must fix * the atoms A,B,C,D, before using the function * H4FINAL(RAB,RAC,RBC,RAD,RBD,RCD), giving the * distances in that order. Note also that the six * internuclear distances are not independent * variables (if you want independent variables use, * e.g., the H4INTC or your own set by computing * the six internuclear distances, and then calling * to H4FINAL). * * IF (NFUN.LE.0) obtain the H4 energy from H4INTC, given the * internal coordinates as defined in the JCP paper. *********************************************************************** write(6,5) 5 format(1x,'NABS AB INITIO FITTED ENERGY') rms = 0.d0 DO 10 I=1,NPUN IF(NFUN.GT.0) THEN READ(5,*) nabs,RAB,RAC,RBC,RAD,RBD,RCD,ENER ENER2=H4FINAL(RAB,RAC,RBC,RAD,RBD,RCD) ELSE READ(5,*) nabs,R,RAB,RCD,ALFA,BETA,GAMA,ener ENER2=H4INTC(R,RAB,RCD,ALFA,BETA,GAMA) endif rms = rms + (ener-ener2)**2 10 write(6,20) nabs,ener,ener2 * 10 continue 20 format(1x,i5,2(1x,f12.6)) rms=dsqrt(rms/npun) write(6,30) npun,rms,rms*627.5d0 30 format(1x,'The rms in ',i4,' points is ',f12.6,' a.u. or ',f12.6, ,' kcal/mol') STOP END