      SUBROUTINE ccsdt_lambda_o1(d_i0,d_o1,d_t1,d_t2,d_t3,d_y1,d_y2,d_y3
     &,k_i0_offset,k_o1_offset,k_t1_offset,k_t2_offset,k_t3_offset,k_y1_
     &offset,k_y2_offset,k_y3_offset)
C     $Id: ccsdt_lambda_o1.F 19701 2010-10-29 17:16:57Z 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 ( h2 p1 )_yo + = -1 * Sum ( h5 ) * y ( h5 p1 )_y * i1 ( h2 h5 )_o
C         i1 ( h2 h5 )_o + = 1 * o ( h2 h5 )_o
C         i1 ( h2 h5 )_ot + = 1 * Sum ( p3 ) * o ( h2 p3 )_o * t ( p3 h5 )_t
C     i0 ( h2 p1 )_yo + = 1 * Sum ( p3 ) * o ( p3 p1 )_o * y ( h2 p3 )_y
C     i0 ( h2 p1 )_yo + = 1 * Sum ( h4 p3 ) * o ( p3 h4 )_o * y ( h2 h4 p1 p3 )_y
C     i0 ( h2 p1 )_yto + = -1 * Sum ( h3 ) * o ( h3 p1 )_o * i1 ( h2 h3 )_yt
C         i1 ( h2 h3 )_yt + = 1 * Sum ( p4 ) * t ( p4 h3 )_t * y ( h2 p4 )_y
C         i1 ( h2 h3 )_yt + = 1/2 * Sum ( h6 p5 p4 ) * t ( p4 p5 h3 h6 )_t * y ( h2 h6 p4 p5 )_y
C         i1 ( h2 h3 )_yt + = 1/12 * Sum ( h8 h7 p6 p5 p4 ) * t ( p4 p5 p6 h3 h7 h8 )_t * y ( h2 h7 h8 p4 p5 p6 )_y
C     i0 ( h2 p1 )_oty + = 1/2 * Sum ( p4 h5 h6 ) * y ( h5 h6 p1 p4 )_y * i1 ( h2 p4 h5 h6 )_ot
C         i1 ( h2 p4 h5 h6 )_ot + = -1 * Sum ( p3 ) * o ( h2 p3 )_o * t ( p3 p4 h5 h6 )_t
C     i0 ( h2 p1 )_oty + = -1/12 * Sum ( p4 p5 h6 h7 h8 ) * y ( h6 h7 h8 p1 p4 p5 )_y * i1 ( h2 p4 p5 h6 h7 h8 )_ot
C         i1 ( h2 p4 p5 h6 h7 h8 )_ot + = 1 * Sum ( p3 ) * o ( h2 p3 )_o * t ( p3 p4 p5 h6 h7 h8 )_t
      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_y1
      INTEGER k_y1_offset
      INTEGER d_i1
      INTEGER k_i1_offset
      INTEGER d_o1
      INTEGER k_o1_offset
      INTEGER d_y2
      INTEGER k_y2_offset
      INTEGER d_y3
      INTEGER k_y3_offset
      INTEGER l_i1_offset
      INTEGER size_i1
      INTEGER d_t1
      INTEGER k_t1_offset
      INTEGER d_t2
      INTEGER k_t2_offset
      INTEGER d_t3
      INTEGER k_t3_offset
      CHARACTER*255 filename
#if !defined(CCSDTLR)
      CALL ERRQUIT('CCSDTLR not compiled (ccsdt_lambda_o1.F)',
     &              0,CAPMIS_ERR)
      RETURN
      END
#else
      CALL OFFSET_ccsdt_lambda_o1_1_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lambda_o1_1_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lambda_o1_1_1(d_o1,k_o1_offset,d_i1,k_i1_offset)
      CALL ccsdt_lambda_o1_1_2(d_o1,k_o1_offset,d_t1,k_t1_offset,d_i1,k_
     &i1_offset)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lambda_o1_1(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_lambda_o1'
     &,-1,MA_ERR)
      CALL ccsdt_lambda_o1_2(d_o1,k_o1_offset,d_y1,k_y1_offset,d_i0,k_i0
     &_offset)
      CALL ccsdt_lambda_o1_3(d_o1,k_o1_offset,d_y2,k_y2_offset,d_i0,k_i0
     &_offset)
      CALL OFFSET_ccsdt_lambda_o1_4_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lambda_o1_4_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lambda_o1_4_1(d_t1,k_t1_offset,d_y1,k_y1_offset,d_i1,k_
     &i1_offset)
      CALL ccsdt_lambda_o1_4_2(d_t2,k_t2_offset,d_y2,k_y2_offset,d_i1,k_
     &i1_offset)
      CALL ccsdt_lambda_o1_4_3(d_t3,k_t3_offset,d_y3,k_y3_offset,d_i1,k_
     &i1_offset)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lambda_o1_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_lambda_o1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lambda_o1_5_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lambda_o1_5_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lambda_o1_5_1(d_o1,k_o1_offset,d_t2,k_t2_offset,d_i1,k_
     &i1_offset)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lambda_o1_5(d_y2,k_y2_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_lambda_o1'
     &,-1,MA_ERR)
      CALL OFFSET_ccsdt_lambda_o1_6_1(l_i1_offset,k_i1_offset,size_i1)
      CALL TCE_FILENAME('ccsdt_lambda_o1_6_1_i1',filename)
      CALL CREATEFILE(filename,d_i1,size_i1)
      CALL ccsdt_lambda_o1_6_1(d_o1,k_o1_offset,d_t3,k_t3_offset,d_i1,k_
     &i1_offset)
      CALL RECONCILEFILE(d_i1,size_i1)
      CALL ccsdt_lambda_o1_6(d_y3,k_y3_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_lambda_o1'
     &,-1,MA_ERR)
      RETURN
      END
#endif
