      SUBROUTINE DETNT(N, DET, DETI)
      include 'param.inc'
      include 'common.inc'
      DLOSS = 1.
      CNTR = 0.
      DET = A(1,3)
      DETI = Q(1,3)
      LIM = N + N - 3
      DO 100 I=1,LIM,2
      J = I
      K = 4
      L = I
      M = 3
      II = 1
      GO TO 500
   10 J = I + 1
      K = 2
      L = J
      M = 1
      GO TO 600
   30 J = I + 2
      L = J
      II = 2
      GO TO 600
   40 L = I + 1
      M = 2
      GO TO 500
   50 K = 3
      M = 3
      II = 3
      GO TO 600
   60 K = 4
      IF (I .EQ. LIM) GO TO 70
      M = 4
      II = 4
      GO TO 600
   70 K = 3
      II = 2
      GO TO 700
  500 C = A(L,M)*A(L,M) + Q(L,M)*Q(L,M)
 80   bs = (A(J,K)*A(L,M) + Q(J,K)*Q(L,M)) / C
      bsI = (Q(J,K)*A(L,M) - A(J,K)*Q(L,M))/C
      GO TO (10,50), II
 600  TD = A(J,K) - (A(L,M)*bs - Q(L,M)*bsI)
      TDI = Q(J,K) - (A(L,M)*bsI + Q(L,M)*bs)
      TEM = TD**2 + TDI**2
      TEMP = A(J,K)**2 + Q(J,K)**2
      TEMP = TEM / TEMP
      IF (II .EQ. 2) GO TO 92
      IF (II .EQ. 4) GO TO 92
      Q(J,K) = Q(J,K) * 10.D-18
      A(J,K) = A(J,K) * 10.D-18
      IF (TEMP .GT. 10.D-35) GO TO 92
      CNTR = CNTR + 1.
      GO TO 90
 92   A(J,K) = TD
      Q(J,K) = TDI
 90   GO TO (700,40,60,70),II
  700 C   = DET*A(J,K) - DETI*Q(J,K)
      DETI = DET*Q(J,K) + DETI*A(J,K)
      DET = C
      GO TO (30,100), II
 100  CONTINUE
      RETURN
      END
