!=============================================================================================
! Project name: test
! Project version: 1.0.0.68
!---------------------------------------------------------------------------------------------
! Generated by Aqualis (algorithm and equation analyzer for lightwave simulation)
! Aqualis version: 185.0.3.0
! Generated date: 2025/06/19 12:56:32
!=============================================================================================
program test
implicit none
complex(kind(0d0)) :: uj=(0d0,1d0)
integer :: ic0001
integer :: ic0002
integer :: i0001
integer :: i0002
integer :: i0003
complex(kind(0d0)) :: z0001
integer,allocatable :: i10001(:)
integer :: i10001_size(1:1)=(/ -1 /)
complex(kind(0d0)),allocatable :: z10001(:)
integer :: z10001_size(1:1)=(/ -1 /)
complex(kind(0d0)),allocatable :: z20001(:,:)
integer :: z20001_size(1:2)=(/ -1,-1 /)
z20001_size(1) = 4
z20001_size(2) = 4
allocate(z20001(1:z20001_size(1),1:z20001_size(2)))
z10001_size(1) = 4
allocate(z10001(1:z10001_size(1)))
do ic0001=0,z20001_size(1)-1
  do ic0002=0,z20001_size(2)-1
    !ハンケル関数計算テスト
    z0001 = dbesj0(1.0d-1*(ic0001+2*ic0002+1))-dbesy0(1.0d-1*(ic0001+2*ic0002+1))*uj
    z20001(ic0001+1,ic0002+1) = z0001
  end do
end do
z10001=0
do ic0001=0,z10001_size(1)-1
  do ic0002=0,z20001_size(2)-1
    z10001(ic0001+1) = z10001(ic0001+1)+z20001(ic0001+1,ic0002+1)*ic0002
  end do
end do
!===連立方程式の求解====================================================================
  i0001 = z20001_size(1)
  i0002 = 1
  i10001_size(1) = i0001
  allocate(i10001(1:i10001_size(1)))
  call zgesv(i0001,i0002,z20001,i0001,i10001,z10001,i0001,i0003)
  i10001_size(1) = -1
  deallocate(i10001)
!===end 連立方程式の求解================================================================
do ic0001=0,z10001_size(1)-1
  print *, real(z10001(ic0001+1)),aimag(z10001(ic0001+1))
end do
z10001_size(1) = -1
deallocate(z10001)
z20001_size(1) = -1
deallocate(z20001)

contains

end program test
