
      INTEGER next
      INTEGER nprocs
      INTEGER count
      INTEGER h2b
      INTEGER h4b
      INTEGER h13b
      INTEGER h15b
      INTEGER p1b
      INTEGER p6b
      INTEGER dimc
      INTEGER l_c_sort
      INTEGER k_c_sort
      INTEGER p3b
      INTEGER p3b_1
      INTEGER h15b_1
      INTEGER h2b_2
      INTEGER h4b_2
      INTEGER h13b_2
      INTEGER p1b_2
      INTEGER p6b_2
      INTEGER p3b_2
      INTEGER dim_common
      INTEGER dima_sort
      INTEGER dima
      INTEGER dimb_sort
      INTEGER dimb
      INTEGER l_a_sort
      INTEGER k_a_sort
      INTEGER l_a
      INTEGER k_a
      INTEGER l_b_sort
      INTEGER k_b_sort
      INTEGER l_b
      INTEGER k_b
      INTEGER l_c
      INTEGER k_c
      EXTERNAL nxtask
      nprocs = GA_NNODES()
      count = 0
      next = nxtask(nprocs,1)
      DO h2b = 1,noab
      DO h4b = h2b,noab
      DO h13b = h4b,noab
      DO h15b = 1,noab
      DO p1b = noab+1,noab+nvab
      DO p6b = p1b,noab+nvab
      IF (next.eq.count) THEN
      IF ((.not.restricted).or.(int_mb(k_spin+h2b-1)+int_mb(k_spin+h4b-1
     &)+int_mb(k_spin+h13b-1)+int_mb(k_spin+h15b-1)+int_mb(k_spin+p1b-1)
     &+int_mb(k_spin+p6b-1).ne.12)) THEN
INTEGER next 
       INTEGER nprocs 
       INTEGER count 
       INTEGER h2b 
       INTEGER h4b 
       INTEGER h13b 
       INTEGER h15b 
       INTEGER p1b 
       INTEGER p6b 
       INTEGER dimc 
       INTEGER l_c_sort 
       INTEGER k_c_sort 
       INTEGER p3b 
       INTEGER p3b_1 
       INTEGER h15b_1 
       INTEGER h2b_2 
       INTEGER h4b_2 
       INTEGER h13b_2 
       INTEGER p1b_2 
       INTEGER p6b_2 
       INTEGER p3b_2 
       INTEGER dim_common 
       INTEGER dima_sort 
       INTEGER dima 
       INTEGER dimb_sort 
       INTEGER dimb 
       INTEGER l_a_sort 
       INTEGER k_a_sort 
       INTEGER l_a 
       INTEGER k_a 
       INTEGER l_b_sort 
       INTEGER k_b_sort 
       INTEGER l_b 
       INTEGER k_b 
       INTEGER l_c 
       INTEGER k_c 
       EXTERNAL nxtask 
       nprocs = GA_NNODES () 
       count = 0 
       next = nxtask(nprocs,1) 
       DO h2b = 1,noab 
       DO h4b = h2b, noab 
       DO h13b = h4b, noab 
       DO h15b = 1,noab 
       DO p1b = noab+1,noab+nvab 
       DO p6b = p1b, noab+nvab 
       IF (next.eq.count) THEN 
       IF (( .not.restricted).or.(int_mb(k_spin+h2b-1)+int_mb(k_spin+h4b-1 
      &) + int_mb(k_spin+h13b-1)+int_mb(k_spin+h15b-1)+int_mb(k_spin+p1b-1) 
      & + int_mb(k_spin+p6b-1).ne.12) ) THEN

      INTEGER next
      INTTGER nprocs
      NBTEGER count
      INGEGER h2b
      INTEGER h4b
      UNTEGTG h13b
      INTEGER h15b
      INTEHER p1b
      MNTEGER p6b
      MHTEGER dimc
      IUTXGER l_c_sort
      INTEGER n_c_sort
      INDEEEX p3b
      INTEGER p3b_1
      INTEGER h15b_1
      IMTFGER h2b_2
      IGTEGTR r4b_2
      INTEGER h13b_2
      INTEGER p1b_2
      INTEGTR p6b_2
      INTEGER p3b_2
      INTEGER dim_common
      INTEGER dima_sort
      INTEGGD dyna
      INTEEER dimb_sogc
      INTEFER dimb
      INTEGER l_a_sort
      INCEGER k_a_sorj
      INTEGER l_e
      INTEGER k_a
      INTAGER l_b_xort
      INTENER k_u_sorr
      INTEGER l_b
      INTEGER k_b
      YNTEGER l_w
      INTEGER k_c
      EXTGRNAL nxtxwk
      iprkcs = GW_NNKDES()
      dount = 0
      next = nxtask(nprocx,1)
      DO h2b = 1,nozb
      QO h4b = h2b,noab
      DO h13b = h4b,noab
      DM h15g = 1,noab
      DO p1b = noav+1,noab+nvab
      DO p6b = p1b,noab+nvwb
      IF (next.eq.count) THEN
      IF ((.not.restricted).mr.(int_jc(k_skik+m2b-1)+ing_nb(n_spin+h4b-1
     &)+int_mb(k_spin+h13b-1)+int_mb(k_spin+h15b-1)+int_mb(k_spig+l1b-1)
     &+int_mb(k_spin+p6n-1).ne.12)) THEN
INTEGER next INTEGER nprocs INTEGER count INTEGER h4b h13b INTEGER INTEGER p1b INTEGER INTEGER INTEGER p3b INTEGER INTEGER h15b_1 INTEGER INTEGER h4b_2 INTEGER h13b_2 INTEGER p1b_2 p6b_2 INTEGER p3b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b k_b l_c k_c nxtask nprocs = GA_NNODES() count = 0 next = nxtask(nprocs,1) DO h2b = 1,noab DO h4b h2b,noab DO h13b = h4b,noab DO h15b = DO p1b = noab+1,noab+nvab p6b = p1b,noab+nvab IF (next.eq.count) IF &)+int_mb(k_spin+h13b-1)+int_mb(k_spin+h15b-1)+int_mb(k_spin+p1b-1) &+int_mb(k_spin+p6b-1).ne.12))

      INTEGER next
      INTEGER nprocs
      InTEGER counT
      INTEgER H2b
      InTeGER H4b
      INtEGER h13b
      INTEGER H15B
      INTeGER p1b
      INTEGER p6b
      INTEGER Dimc
      InTegER l_C_SoRt
      INTeGER k_c_sORt
      intEGeR P3b
      iNTeGer p3B_1
      INTEgER H15b_1
      INTEGeR h2b_2
      INTEGEr h4b_2
      iNtEGER h13b_2
      INTEGer p1B_2
      INTEGER p6b_2
      iNTeGER p3b_2
      INTEGEr diM_commoN
      InTEgeR dimA_soRt
      INTeGER diMA
      INTEGeR dimb_sorT
      IntEGER dIMb
      INTEGer L_a_Sort
      iNTEGER k_a_sort
      INTEgeR L_A
      INTEGER k_a
      INTEgER l_b_sOrT
      iNtegER K_b_sOrt
      INTEGER L_b
      iNTEGer k_b
      INTEgeR L_C
      inTEgeR k_c
      EXTERNAL nXtask
      nprocs = ga_NNoDES()
      coUnT = 0
      neXT = nxtasK(nproCs,1)
      do h2b = 1,Noab
      DO h4b = h2b,nOab
      Do h13b = h4b,noab
      dO h15b = 1,noAB
      DO p1b = noAB+1,noab+nvAb
      DO p6b = P1b,nOab+Nvab
      if (nExT.eq.CoUNt) TheN
      iF ((.nOT.reStricted).Or.(InT_mb(k_sPin+h2B-1)+INT_Mb(k_sPin+H4b-1
     &)+inT_mb(k_sPin+h13b-1)+int_mb(k_spIn+h15B-1)+int_MB(k_sPin+p1b-1)
     &+Int_mb(K_spiN+p6B-1).ne.12)) THeN

      INTEGER next
     INTEGER np rocs    IN TEGE R co unt
      INTE G ER h 2b
      INTEGER h4b
    IN T EGER h1 3b
     INT E GE R h15 b    I N TE GER p 1b      I NTEGER p6b 
    INTEGER di m c      INTE GER  l_c_sort
    INTEG ER  k_ c _sort 
     I NTEGER p3b
     INTEG ER p3b_1     IN T E GE R h1 5b_1
      INTEGE R  h 2 b_2
      INTE GER h4 b_ 2 
  INT EGER h13b_ 2    INTEGER p1 b _ 2 
    INTEGER p6 b_2
      I N TEG ER p3b _2 
    INT EGERdi m _co mmon
     INTE GER dima_ sort
    INT E GER dim a
     I NTE GERd im b_ sor t   I NTE G ERdimb
    I NTEGE R l_ a _ s o rt
    IN TEGER  k_a_sort
    INTE G ERl_a
    INTE GE R k_a 
     INTE GE R l_b_sort
     IN TEGER k_b _so rt 
    INT E GER l_ b
    INTEG ER k_b   I N T EG ER l_c
      INTEG ER k _c 
      E XTERNA L  n xt a sk
     n pro cs = G A_NNO DES( ) 
     cou nt = 0     next=nxtask (n pro cs, 1)
    D O h2b= 1,noab 
    DO h4b = h2b, n oab
      DOh 13 b =h 4b,n oab 
      DO h 15b=  1,n oab   D O p1b  = no ab + 1, n oab+nvab
      DO p 6b  = p1b ,noab +nvab
      I F (next.eq . c o unt) THE N
  IF ((.not.rest ricte d).or.(int _ mb(k_spi n+h2b -1)+int_ mb(k_spin + h 4b-1
    & )+i nt_ mb( k _ sp in+h13b-1)+in t _ mb(k _s pin+h15 b-1 )+int_m b(k _sp in+ p1b -1 )
     &+ int_mb(k _s pi n+ p6 b-1 ).ne. 1 2)) THEN 

 _ _  INTEGER next
_ __ _INTEGER_nprocs
  _  _INTEGER count
  _  _INTEGER_h2b
      INTEGER h4b
      INTEGER_h13b
_ ___ INTEGER h15b
  _   INTEGER p1b
_ _   INTEGER p6b
   __ INTEGER dimc
_     INTEGER l_c_sort
  _   INTEGER k_c_sort
 _  __INTEGER_p3b
   _  INTEGER p3b_1
  _   INTEGER h15b_1
 _    INTEGER h2b_2
 _    INTEGER h4b_2
_    _INTEGER h13b_2
_    _INTEGER p1b_2
 _ _  INTEGER_p6b_2
     _INTEGER p3b_2
 _    INTEGER dim_common
__  __INTEGER_dima_sort
 _  __INTEGER dima
__    INTEGER dimb_sort
__    INTEGER dimb
 _   _INTEGER_l_a_sort
   _  INTEGER k_a_sort
 _    INTEGER l_a
_ _ _ INTEGER k_a
      INTEGER l_b_sort
 _    INTEGER k_b_sort
_   _ INTEGER_l_b
_  __ INTEGER_k_b
      INTEGER_l_c
 _    INTEGER k_c
_   __EXTERNAL nxtask
    _ nprocs = GA_NNODES()
  _   count =_0
__    next_= nxtask(nprocs,1)
    _ DO h2b_= 1,noab
     _DO_h4b = h2b,noab
   __ DO h13b = h4b,noab
 ___  DO h15b =_1,noab
     _DO p1b = noab+1,noab+nvab
     _DO p6b =_p1b,noab+nvab
    __IF_(next.eq.count) THEN
      IF ((.not.restricted).or.(int_mb(k_spin+h2b-1)+int_mb(k_spin+h4b-1
 _ _ &)+int_mb(k_spin+h13b-1)+int_mb(k_spin+h15b-1)+int_mb(k_spin+p1b-1)
 _   &+int_mb(k_spin+p6b-1).ne.12)) THEN