-
Notifications
You must be signed in to change notification settings - Fork 0
/
adjder.f90
36 lines (25 loc) · 1.02 KB
/
adjder.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
!=============================================================================!
subroutine adjder( neq, Z, y, dZ )
!=============================================================================!
implicit none
integer :: neq
real :: y
complex :: Z(neq), dZ(neq)
!.... local variables
complex :: Eh(neq,neq), Fh(neq,neq), Ehinv(neq,neq), Fht(neq,neq)
!.... local variables for Lapack routines
integer :: ipiv(neq), info
!=============================================================================!
call parallel( y, Eh, Fh, 0 )
!.... Multiply Fh by Eh^{-1}
call inverse( neq, Eh, Ehinv)
Fh = matmul( Ehinv, Fh )
! call CGETRF( neq, neq, Eh, neq, ipiv, info)
! if (info.ne.0) write(*,*) 'CGETRF: ', info
! call CGETRS('N', neq, neq, Eh, neq, ipiv, Fh, neq, info)
! if (info.ne.0) write(*,*) 'CGETRS: ',info
!.... Form the derivative
Fht = transpose( Fh )
dZ = matmul( Fht, Z )
return
end