!        Generated by TAPENADE     (INRIA, Tropics team)
!  Tapenade 3.6 (r4165) - 21 sep 2011 20:54
!
!  Differentiation of da_couple in reverse (adjoint) mode:
!   gradient     of useful results: field
!   with respect to varying inputs: field mut
SUBROUTINE DA_COUPLE_B(mut, mutb, field, fieldb, msf, ids, ide, jds, jde&
&  , kds, kde)
  IMPLICIT NONE
! if (trace_use) call da_trace_exit("da_couple")
  INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde
  REAL, INTENT(IN) :: mut(ids:ide, jds:jde)
  REAL :: mutb(ids:ide, jds:jde)
  REAL, INTENT(IN) :: msf(ids:ide, jds:jde)
  REAL, INTENT(INOUT) :: field(ids:ide, jds:jde, kds:kde)
  REAL, INTENT(INOUT) :: fieldb(ids:ide, jds:jde, kds:kde)
  INTEGER :: i, j, k
  mutb = 0.0
  DO j=jde,jds,-1
    DO k=kde,kds,-1
      DO i=ide,ids,-1
        mutb(i, j) = mutb(i, j) + field(i, j, k)*fieldb(i, j, k)/msf(i, &
&          j)
        fieldb(i, j, k) = mut(i, j)*fieldb(i, j, k)/msf(i, j)
      END DO
    END DO
  END DO
END SUBROUTINE DA_COUPLE_B
