      SUBROUTINE ccsdt_lr_alpha1(d_i0,d_o1,d_t1,d_t2,d_t3,d_tr1,d_tr2,d_
     &tr3,d_y1,d_y2,d_y3,k_i0_offset,k_o1_offset,k_t1_offset,k_t2_offset
     &,k_t3_offset,k_tr1_offset,k_tr2_offset,k_tr3_offset,k_y1_offset,k_
     &y2_offset,k_y3_offset)
C     $Id: ccsdt_lr_alpha1.F 19702 2010-10-29 17:26:22Z d3y133 $
C     This is a Fortran77 program generated by Tensor Contraction Engine v.1.0
C     Copyright (c) Battelle & Pacific Northwest National Laboratory (2002)
C     i0 ( )_tro + = 1 * Sum ( p10 h11 ) * o ( h11 p10 )_o * i1 ( p10 h11 )_tr
C         i1 ( p10 h11 )_tr + = 1 * tr ( p10 h11 )_tr
C         i1 ( p10 h11 )_ytr + = 1 * Sum ( h4 p3 ) * tr ( p3 p10 h4 h11 )_tr * y ( h4 p3 )_y
C         i1 ( p10 h11 )_ytr + = 1/4 * Sum ( h5 h6 p3 p4 ) * tr ( p3 p4 p10 h5 h6 h11 )_tr * y ( h5 h6 p3 p4 )_y
C         i1 ( p10 h11 )_yttr + = -1 * Sum ( h2 ) * tr ( p10 h2 )_tr * i2 ( h2 h11 )_yt
C             i2 ( h2 h11 )_yt + = 1 * Sum ( p3 ) * t ( p3 h11 )_t * y ( h2 p3 )_y
C             i2 ( h2 h11 )_yt + = -1/2 * Sum ( h5 p3 p4 ) * t ( p3 p4 h5 h11 )_t * y ( h2 h5 p3 p4 )_y
C             i2 ( h2 h11 )_yt + = 1/12 * Sum ( h6 h7 p3 p4 p5 ) * t ( p3 p4 p5 h6 h7 h11 )_t * y ( h2 h6 h7 p3 p4 p5 )_y
C         i1 ( p10 h11 )_ytrt + = 1/2 * Sum ( h8 ) * t ( p10 h8 )_t * i2 ( h8 h11 )_ytr
C             i2 ( h8 h11 )_ytr + = -1 * Sum ( h5 p3 p4 ) * tr ( p3 p4 h5 h11 )_tr * y ( h5 h8 p3 p4 )_y
C             i2 ( h8 h11 )_ytr + = -1/6 * Sum ( h6 h7 p3 p4 p5 ) * tr ( p3 p4 p5 h6 h7 h11 )_tr * y ( h6 h7 h8 p3 p4 p5 )_y
C             i2 ( h8 h11 )_ytr + = -2 * Sum ( p3 ) * tr ( p3 h11 )_tr * y ( h8 p3 )_y
C         i1 ( p10 h11 )_yttr + = 1/2 * Sum ( h1 h3 p2 ) * tr ( p2 p10 h1 h3 )_tr * i2 ( h1 h3 h11 p2 )_yt
C             i2 ( h1 h3 h11 p2 )_yt + = -1 * Sum ( p6 ) * t ( p6 h11 )_t * y ( h1 h3 p2 p6 )_y
C             i2 ( h1 h3 h11 p2 )_yt + = 1/2 * Sum ( h7 p5 p6 ) * t ( p5 p6 h7 h11 )_t * y ( h1 h3 h7 p2 p5 p6 )_y
C         i1 ( p10 h11 )_yttr + = -1/12 * Sum ( h5 h6 h7 p3 p4 ) * tr ( p3 p4 p10 h5 h6 h7 )_tr * i2 ( h5 h6 h7 h11 p3 p4 )_yt
C             i2 ( h5 h6 h7 h11 p3 p4 )_yt + = 1 * Sum ( p8 ) * t ( p8 h11 )_t * y ( h5 h6 h7 p3 p4 p8 )_y
C         i1 ( p10 h11 )_ytrt + = 1/2 * Sum ( h1 h3 p2 ) * t ( p2 p10 h1 h3 )_t * i2 ( h1 h3 h11 p2 )_ytr
C             i2 ( h1 h3 h11 p2 )_ytr + = -1 * Sum ( p6 ) * tr ( p6 h11 )_tr * y ( h1 h3 p2 p6 )_y
C             i2 ( h1 h3 h11 p2 )_ytr + = 1/2 * Sum ( h7 p5 p6 ) * tr ( p5 p6 h7 h11 )_tr * y ( h1 h3 h7 p2 p5 p6 )_y
C         i1 ( p10 h11 )_ytrt + = -1/12 * Sum ( h5 h6 h7 p3 p4 ) * t ( p3 p4 p10 h5 h6 h7 )_t * i2 ( h5 h6 h7 h11 p3 p4 )_ytr
C             i2 ( h5 h6 h7 h11 p3 p4 )_ytr + = 1 * Sum ( p8 ) * tr ( p8 h11 )_tr * y ( h5 h6 h7 p3 p4 p8 )_y
C     i0 ( )_ytro + = -1 * Sum ( h2 h1 ) * o ( h1 h2 )_o * i1 ( h2 h1 )_ytr
C         i1 ( h2 h1 )_ytr + = 1 * Sum ( p3 ) * tr ( p3 h1 )_tr * y ( h2 p3 )_y
C         i1 ( h2 h1 )_ytr + = 1/2 * Sum ( h5 p3 p4 ) * tr ( p3 p4 h1 h5 )_tr * y ( h2 h5 p3 p4 )_y
C         i1 ( h2 h1 )_ytr + = 1/12 * Sum ( h6 h7 p3 p4 p5 ) * tr ( p3 p4 p5 h1 h6 h7 )_tr * y ( h2 h6 h7 p3 p4 p5 )_y
C     i0 ( )_otry + = 1 * Sum ( p1 h3 ) * y ( h3 p1 )_y * i1 ( p1 h3 )_otr
C         i1 ( p1 h3 )_otr + = 1 * Sum ( p2 ) * o ( p1 p2 )_o * tr ( p2 h3 )_tr
C     i0 ( )_ytro + = 1/2 * Sum ( p2 p1 ) * o ( p1 p2 )_o * i1 ( p2 p1 )_ytr
C         i1 ( p2 p1 )_ytr + = 1 * Sum ( h4 h5 p3 ) * tr ( p2 p3 h4 h5 )_tr * y ( h4 h5 p1 p3 )_y
C         i1 ( p2 p1 )_ytr + = 1/6 * Sum ( h5 h6 h7 p3 p4 ) * tr ( p2 p3 p4 h5 h6 h7 )_tr * y ( h5 h6 h7 p1 p3 p4 )_y
      IMPLICIT NONE
#include "global.fh"
#include "mafdecls.fh"
#include "util.fh"
#include "errquit.fh"
#include "tce.fh"
      INTEGER d_i0
      INTEGER k_i0_offset
      INTEGER d_o1
      INTEGER k_o1_offset
      INTEGER d_i1
      INTEGER k_i1_offset
      INTEGER d_y1
      INTEGER k_y1_offset
      INTEGER l_i1_offset
      INTEGER d_tr1
      INTEGER k_tr1_offset
      INTEGER size_i1
      INTEGER d_tr2
      INTEGER k_tr2_offset
      INTEGER d_tr3
      INTEGER k_tr3_offset
      INTEGER d_y2
      INTEGER k_y2_offset
      INTEGER d_i2
      INTEGER k_i2_offset
      INTEGER d_t1
      INTEGER k_t1_offset
      INTEGER d_t2
      INTEGER k_t2_offset
      INTEGER d_t3
      INTEGER k_t3_offset
      INTEGER l_i2_offset
      INTEGER size_i2
      INTEGER d_y3
      INTEGER k_y3_offset
      CHARACTER*255 filename
#if !defined(CCSDTLR)
      CALL ERRQUIT('CCSDTLR not compiled (ccsdt_lr_alpha1.F)',
     &              0,CAPMIS_ERR)
      RETURN
      END
#else
      CALL OFFSET_ccsdt_lr_alpha1_1_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_1_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lr_alpha1_1_1(d_tr1,k_tr1_offset,d_i1,k_i1_offset)
      CALL ccsdt_lr_alpha1_1_2(d_tr2,k_tr2_offset,d_y1,k_y1_offset,d_i1,
     &k_i1_offset)
      CALL ccsdt_lr_alpha1_1_3(d_tr3,k_tr3_offset,d_y2,k_y2_offset,d_i1,
     &k_i1_offset)
      CALL OFFSET_ccsdt_lr_alpha1_1_4_1(l_i2_offset,k_i2_offset,size_i2)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_1_4_1_i2',filename)
      CALL CREATEFILE(filename,d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_4_1(d_t1,k_t1_offset,d_y1,k_y1_offset,d_i2,
     &k_i2_offset)
      CALL ccsdt_lr_alpha1_1_4_2(d_t2,k_t2_offset,d_y2,k_y2_offset,d_i2,
     &k_i2_offset)
      CALL ccsdt_lr_alpha1_1_4_3(d_t3,k_t3_offset,d_y3,k_y3_offset,d_i2,
     &k_i2_offset)
      CALL RECONCILEFILE(d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_4(d_tr1,k_tr1_offset,d_i2,k_i2_offset,d_i1,
     &k_i1_offset)
      CALL DELETEFILE(d_i2)
      IF (.not.MA_POP_STACK(l_i2_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_1_5_1(l_i2_offset,k_i2_offset,size_i2)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_1_5_1_i2',filename)
      CALL CREATEFILE(filename,d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_5_1(d_tr2,k_tr2_offset,d_y2,k_y2_offset,d_i
     &2,k_i2_offset)
      CALL ccsdt_lr_alpha1_1_5_2(d_tr3,k_tr3_offset,d_y3,k_y3_offset,d_i
     &2,k_i2_offset)
      CALL ccsdt_lr_alpha1_1_5_3(d_tr1,k_tr1_offset,d_y1,k_y1_offset,d_i
     &2,k_i2_offset)
      CALL RECONCILEFILE(d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_5(d_t1,k_t1_offset,d_i2,k_i2_offset,d_i1,k_
     &i1_offset)
      CALL DELETEFILE(d_i2)
      IF (.not.MA_POP_STACK(l_i2_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_1_6_1(l_i2_offset,k_i2_offset,size_i2)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_1_6_1_i2',filename)
      CALL CREATEFILE(filename,d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_6_1(d_t1,k_t1_offset,d_y2,k_y2_offset,d_i2,
     &k_i2_offset)
      CALL ccsdt_lr_alpha1_1_6_2(d_t2,k_t2_offset,d_y3,k_y3_offset,d_i2,
     &k_i2_offset)
      CALL RECONCILEFILE(d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_6(d_tr2,k_tr2_offset,d_i2,k_i2_offset,d_i1,
     &k_i1_offset)
      CALL DELETEFILE(d_i2)
      IF (.not.MA_POP_STACK(l_i2_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_1_7_1(l_i2_offset,k_i2_offset,size_i2)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_1_7_1_i2',filename)
      CALL CREATEFILE(filename,d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_7_1(d_t1,k_t1_offset,d_y3,k_y3_offset,d_i2,
     &k_i2_offset)
      CALL RECONCILEFILE(d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_7(d_tr3,k_tr3_offset,d_i2,k_i2_offset,d_i1,
     &k_i1_offset)
      CALL DELETEFILE(d_i2)
      IF (.not.MA_POP_STACK(l_i2_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_1_8_1(l_i2_offset,k_i2_offset,size_i2)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_1_8_1_i2',filename)
      CALL CREATEFILE(filename,d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_8_1(d_tr1,k_tr1_offset,d_y2,k_y2_offset,d_i
     &2,k_i2_offset)
      CALL ccsdt_lr_alpha1_1_8_2(d_tr2,k_tr2_offset,d_y3,k_y3_offset,d_i
     &2,k_i2_offset)
      CALL RECONCILEFILE(d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_8(d_t2,k_t2_offset,d_i2,k_i2_offset,d_i1,k_
     &i1_offset)
      CALL DELETEFILE(d_i2)
      IF (.not.MA_POP_STACK(l_i2_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_1_9_1(l_i2_offset,k_i2_offset,size_i2)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_1_9_1_i2',filename)
      CALL CREATEFILE(filename,d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_9_1(d_tr1,k_tr1_offset,d_y3,k_y3_offset,d_i
     &2,k_i2_offset)
      CALL RECONCILEFILE(d_i2,size_i2)
      CALL ccsdt_lr_alpha1_1_9(d_t3,k_t3_offset,d_i2,k_i2_offset,d_i1,k_
     &i1_offset)
      CALL DELETEFILE(d_i2)
      IF (.not.MA_POP_STACK(l_i2_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lr_alpha1_1(d_o1,k_o1_offset,d_i1,k_i1_offset,d_i0,k_i0
     &_offset)
      CALL DELETEFILE(d_i1)
      IF (.not.MA_POP_STACK(l_i1_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_2_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_2_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lr_alpha1_2_1(d_tr1,k_tr1_offset,d_y1,k_y1_offset,d_i1,
     &k_i1_offset)
      CALL ccsdt_lr_alpha1_2_2(d_tr2,k_tr2_offset,d_y2,k_y2_offset,d_i1,
     &k_i1_offset)
      CALL ccsdt_lr_alpha1_2_3(d_tr3,k_tr3_offset,d_y3,k_y3_offset,d_i1,
     &k_i1_offset)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lr_alpha1_2(d_o1,k_o1_offset,d_i1,k_i1_offset,d_i0,k_i0
     &_offset)
      CALL DELETEFILE(d_i1)
      IF (.not.MA_POP_STACK(l_i1_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_3_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_3_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lr_alpha1_3_1(d_o1,k_o1_offset,d_tr1,k_tr1_offset,d_i1,
     &k_i1_offset)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lr_alpha1_3(d_y1,k_y1_offset,d_i1,k_i1_offset,d_i0,k_i0
     &_offset)
      CALL DELETEFILE(d_i1)
      IF (.not.MA_POP_STACK(l_i1_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lr_alpha1_4_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lr_alpha1_4_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lr_alpha1_4_1(d_tr2,k_tr2_offset,d_y2,k_y2_offset,d_i1,
     &k_i1_offset)
      CALL ccsdt_lr_alpha1_4_2(d_tr3,k_tr3_offset,d_y3,k_y3_offset,d_i1,
     &k_i1_offset)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lr_alpha1_4(d_o1,k_o1_offset,d_i1,k_i1_offset,d_i0,k_i0
     &_offset)
      CALL DELETEFILE(d_i1)
      IF (.not.MA_POP_STACK(l_i1_offset)) CALL ERRQUIT('ccsdt_lr_alpha1'
     &,-1,MA_ERR)
      RETURN
      END
#endif
