gen_grid.f90
Go to the documentation of this file.00001 subroutine gen_grid(Nt,E,em)
00002 implicit none
00003 real(8),parameter::au=27.21151d0
00004 real(8),parameter::dlt=0.05d0/au
00005 real(8),parameter::ratio=0.1d0
00006 real(8),parameter::eps=1.0d-6
00007 real(8)::alp,x,x1,dl,a,b,c,d,E,f,g
00008 integer::Nt,N,M,i,k
00009 complex(8)::em(Nt)
00010 if(Nt==1)then
00011 em(1)=0.0d0
00012 else
00013 M=int(ratio*dble(Nt))
00014 N=Nt-M
00015 alp=E/dlt
00016 x=1.5d0
00017 dl=1.0d0
00018 k=0
00019 do while(dl>eps)
00020 f=x**(N-1)-alp*x+alp-1.0d0
00021 g=dble(N-1)*x**(N-2)-alp
00022 x1=x-f/g
00023 dl=dabs(x1-x)
00024 k=k+1
00025 x=x1
00026 enddo
00027 a=dlt/(x-1.0d0)
00028 b=log(x)
00029 do i=1,N
00030 em(i)=dcmplx(a*exp(b*dble(i-1))-a,0.0d0)
00031 enddo
00032
00033
00034
00035
00036 c=E*exp(-log(3.0d0)*dble(N)/dble(M))
00037 d=log(3.0d0)/dble(M)
00038
00039 do i=N+1,N+M
00040 em(i)=dcmplx(c*exp(d*dble(i)),0.0d0)
00041 enddo
00042 endif
00043 return
00044 end