Subject: Code to read G92 chk files.

From: <[email-masked]>
Date: Sun, 16 Jan 1994 09:29:37 -0600 (CST)

Hi, Comp Chem Netters. This is particularly directed at people who
write code that interfaces with GAUSSIAN.

I am trying to get PSIG90 from the AIMPAC package of Bader's group
working on a IBM RISC 6000 under AIX and reading G92 chk files. The
AIMPAC manual says it works - just link with l401 and util from g92.
It is not that easy. The common dimensions changed from g90 to g92.
Anyway I think I fixed all that and I get a *.wfn file with the correct
coefficients and energies (agrees with output from OUTPUT=WFN). However
the atomic coordinates are stuffed up. The program below isolates the 
problem. It reads 997 off the chk files and prints the coordinates.
ICHARG, MULTIP -- NBASIS are correct. IAN is correct. C is not.

I know I can use OUTPUT=WFN but I want other information and I have a 
modified version of psig90 on the vax for g90 chk files. However I
need some results that are only or best obtained with g92 and I have 
that on the unix machine. I want the modified version to go on the 
RS6K but all this problem is still with the non-modified psig90.

A makefile, similar to the one needed for psig90 is also below along with
results for NH3 and H2O.

The program retains the structure of psig90 but strips off everything
not required to show up this problem.

      PROGRAM MAIN
      IMPLICIT REAL*8(A-H,O-Z) 
      Parameter (MAXATM=1000,MAXAT1=(MAXATM+1))
C     MAXATM=1000 REQUIRED FOR G92. 400 FOR G90.
      INTEGER NATOMS,ICHARG,MULTIP,NAE,NBE,NE,NBASIS,IAN
      REAL*8 ATMCHG,C
      COMMON /MOL/    NATOMS,ICHARG,MULTIP,NAE,NBE,NE,NBASIS,
     $                IAN(MAXAT1),ATMCHG(MAXATM),C(3,MAXATM)
      CHARACTER*40 NAME
      INTEGER FILNUM
      DATA IRWMOL/997/
C
 1000 FORMAT(' ATOMIC COORDINATES:')
 1010 FORMAT(1X,I3,3F10.5)
 1200 FORMAT(' Name of Input File: ',$)
 1210 FORMAT(A40)
C
      LENMOL = 4*MAXATM + INTOWP(8+MAXATM)
      IFUNIT = 2
      WRITE (6,1200)
      READ (5,1210) NAME
      CALL FOPEN(IFUNIT,2,NAME,0,JUNK)
      CALL FILEIO(2,-FILNUM(IRWMOL,IFUNIT),LENMOL,NATOMS,0)
      WRITE(7,1000)
      DO 10 I = 1, NATOMS
          WRITE(7,1010) IAN(I),(C(J,I),J=1,3)
 10   CONTINUE
      STOP
      END

# Makefile for coord
#
FFLAGS =  -qextname 
# To correctly call external routines in util.a. 
# 
OBJS = coord.o
# 
LIBS = /var/g92/util.a
# Points to where util.a resides.
#

coord: $(OBJS)
	xlf $(FFLAGS) -o coord $(OBJS) $(LIBS) 

The results for NH3 are below. The x and y coordinates are reversed,
otherwise the numbers are OK.

 ATOMIC COORDINATES:
   7    .00000    .00000   -.20633
   1   1.76194    .00000    .48145
   1   -.88097   1.52588    .48145
   1   -.88097  -1.52588    .48145

For H2O the results below are crazy.

 ATOMIC COORDINATES:
   8   -.19255    .00000   -.14510
   1   -.19255    .00000   1.85801
   1   1.73296    .00000   -.69723

The results on a VAX using G90 chk files and the same program but
with MAXATM changed to 400 which is appropriate for G90, are:-

 ATOMIC COORDINATES:
   7   0.00000   0.00000   0.23959
   1   0.00000   1.71267  -0.55904
   1   1.48322  -0.85634  -0.55904
   1  -1.48322  -0.85634  -0.55904

 ATOMIC COORDINATES:
   8   0.00000   0.00000   0.24110
   1   0.00000   1.59975  -0.96440
   1   0.00000  -1.59975  -0.96440

These are correct in the standard deviation. (N.B. the actual Z-matrix on
the VAX is slightly different from that on the RS6K.)

Now, have I made a blunder (most likely) or is there something wrong
in g92 about how it writes C to the chk file. I would welcome any help
you can give me. 

Cheers, Brian.

-- 
        Associate Professor Brian Salter-Duke (Brian Duke)
School of Chemistry and Earth Sciences, Northern Territory University,
Box 40146, Casuarina, NT 0811, Australia.  Phone 089-466702
e-mail: [email-masked]  or [email-masked]