added ipol option and computation of polarization parameters at all steps, added case imx negative to disable convergence in dispersion
This commit is contained in:
parent
8e593fdb1a
commit
3a798e9f4a
3
Makefile
3
Makefile
@ -11,7 +11,8 @@ vpath %.f src
|
|||||||
|
|
||||||
# Fortran compiler name and flags
|
# Fortran compiler name and flags
|
||||||
FC=gfortran
|
FC=gfortran
|
||||||
FFLAGS=-O3
|
#FFLAGS=-O3
|
||||||
|
FFLAGS=-O3 -Wall -fcheck=all
|
||||||
|
|
||||||
DIRECTIVES = -DREVISION="'$(shell svnversion src)'"
|
DIRECTIVES = -DREVISION="'$(shell svnversion src)'"
|
||||||
|
|
||||||
|
184
src/gray.f
184
src/gray.f
@ -122,6 +122,10 @@ c
|
|||||||
common/taumnx/taumn,taumx,pabstot,currtot
|
common/taumnx/taumn,taumx,pabstot,currtot
|
||||||
common/scal/iscal
|
common/scal/iscal
|
||||||
common/facttn/factt,factn
|
common/facttn/factt,factn
|
||||||
|
|
||||||
|
common/pardens/dens0,aln1,aln2
|
||||||
|
common/parqte/te0,dte0,alt1,alt2
|
||||||
|
|
||||||
c
|
c
|
||||||
c print all ray positions in local reference system
|
c print all ray positions in local reference system
|
||||||
c
|
c
|
||||||
@ -149,7 +153,7 @@ c
|
|||||||
if(iequil.eq.2) write(6,*) 'EQUILIBRIUM CASE : ',filenmeqq
|
if(iequil.eq.2) write(6,*) 'EQUILIBRIUM CASE : ',filenmeqq
|
||||||
if(iequil.eq.1) write(6,*) 'ANALTYCAL EQUILIBRIUM'
|
if(iequil.eq.1) write(6,*) 'ANALTYCAL EQUILIBRIUM'
|
||||||
if(iprof.eq.1) write(6,*) 'PROFILE file : ',filenmprf
|
if(iprof.eq.1) write(6,*) 'PROFILE file : ',filenmprf
|
||||||
if(iprof.eq.0) write(6,*) 'ANALTYCAL PROFILES'
|
if(iprof.eq.0) write(6,*) 'ANALTYCAL PROFILES ne0,Te0',dens0,te0
|
||||||
if(ibeam.ge.1) write(6,*) 'LAUNCHER CASE : ',filenmbm
|
if(ibeam.ge.1) write(6,*) 'LAUNCHER CASE : ',filenmbm
|
||||||
|
|
||||||
end if
|
end if
|
||||||
@ -231,6 +235,11 @@ c
|
|||||||
iopmin=100
|
iopmin=100
|
||||||
iowmin=100
|
iowmin=100
|
||||||
iowmax=0
|
iowmax=0
|
||||||
|
|
||||||
|
if(i.eq.1) then
|
||||||
|
psipol=psipol0
|
||||||
|
chipol=chipol0
|
||||||
|
end if
|
||||||
c
|
c
|
||||||
do j=1,nrayr
|
do j=1,nrayr
|
||||||
kkk=nrayth
|
kkk=nrayth
|
||||||
@ -445,7 +454,9 @@ c initial polarization (possibly reflected)
|
|||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
strfl11=i*dst
|
strfl11=i*dst
|
||||||
|
write(6,*) ' '
|
||||||
write(6,*) 'Reflected power fraction =',powrfl
|
write(6,*) 'Reflected power fraction =',powrfl
|
||||||
|
write(66,*) psipol0,chipol0,powrfl
|
||||||
istop=1
|
istop=1
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@ -611,9 +622,11 @@ c
|
|||||||
.'rhotj rhotjava rhotp rhotpav drhotjava drhotpav ratjamx '//
|
.'rhotj rhotjava rhotp rhotpav drhotjava drhotpav ratjamx '//
|
||||||
.'ratjbmx stmx psipol chipol index_rt Jphimx dPdVmx drhotj drhotp'
|
.'ratjbmx stmx psipol chipol index_rt Jphimx dPdVmx drhotj drhotp'
|
||||||
write(48,*) '#psi rhot Jphi Jcdb dPdV Icdins Pins P% index_rt'
|
write(48,*) '#psi rhot Jphi Jcdb dPdV Icdins Pins P% index_rt'
|
||||||
|
write(66,*) "# psipol0 chipol0 powrfl"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
||||||
c If(index_rt.eq.3) then
|
c If(index_rt.eq.3) then
|
||||||
write(4,*) ' '
|
write(4,*) ' '
|
||||||
write(8,*) ' '
|
write(8,*) ' '
|
||||||
@ -675,7 +688,9 @@ c
|
|||||||
common/anic/anx0c,any0c,anz0c
|
common/anic/anx0c,any0c,anz0c
|
||||||
common/mirr/x00,y00,z00
|
common/mirr/x00,y00,z00
|
||||||
common/pol0/psipol0,chipol0
|
common/pol0/psipol0,chipol0
|
||||||
|
common/ipol/ipol
|
||||||
c
|
c
|
||||||
|
common/pareq2/btaxis,rmaxis,zmaxis,rmnm,rmxm,zmnm,zmxm,dr,dz
|
||||||
common/pardens/dens0,aln1,aln2
|
common/pardens/dens0,aln1,aln2
|
||||||
common/parban/b0,rr0m,zr0m,rpam
|
common/parban/b0,rr0m,zr0m,rpam
|
||||||
common/parqq/q0,qa,alq
|
common/parqq/q0,qa,alq
|
||||||
@ -743,7 +758,7 @@ c iwarm=1 :weakly relativistic absorption
|
|||||||
c iwarm=2 :relativistic absorption, n<1 asymptotic expansion
|
c iwarm=2 :relativistic absorption, n<1 asymptotic expansion
|
||||||
c iwarm=3 :relativistic absorption, numerical integration
|
c iwarm=3 :relativistic absorption, numerical integration
|
||||||
c ilarm :order of larmor expansion
|
c ilarm :order of larmor expansion
|
||||||
c
|
|
||||||
read(2,*) iwarm,ilarm
|
read(2,*) iwarm,ilarm
|
||||||
c if(iwarm.gt.2) iwarm=2
|
c if(iwarm.gt.2) iwarm=2
|
||||||
c
|
c
|
||||||
@ -768,10 +783,12 @@ c from center of mirror and with angular spread
|
|||||||
c ipass=1/2 1 or 2 passes into plasma
|
c ipass=1/2 1 or 2 passes into plasma
|
||||||
c iox=1/2 OM/XM
|
c iox=1/2 OM/XM
|
||||||
c idst=0/1/2 0 integration in s, 1 integr. in ct, 2 integr. in Sr
|
c idst=0/1/2 0 integration in s, 1 integr. in ct, 2 integr. in Sr
|
||||||
|
c psipol0,chipol0 polarization angles
|
||||||
|
c ipol=0 compute mode polarization at antenna, ipol=1 use polariz angles
|
||||||
c
|
c
|
||||||
read(2,*) dst,nstep,istpr0,istpl0,idst
|
read(2,*) dst,nstep,istpr0,istpl0,idst
|
||||||
read(2,*) igrad,ipass,rwallm
|
read(2,*) igrad,ipass,rwallm
|
||||||
read(2,*) iox, psipol0,chipol0
|
read(2,*) iox, psipol0,chipol0,ipol
|
||||||
c
|
c
|
||||||
c ipsinorm 0 standard EQDSK format, 1 format Portone summer 2004
|
c ipsinorm 0 standard EQDSK format, 1 format Portone summer 2004
|
||||||
c sspl spline parameter for psi interpolation
|
c sspl spline parameter for psi interpolation
|
||||||
@ -935,7 +952,7 @@ c versus psi, rhop, rhot
|
|||||||
c set simple limiter as two cylindrical walls at rwallm and r00
|
c set simple limiter as two cylindrical walls at rwallm and r00
|
||||||
nlim=5
|
nlim=5
|
||||||
rlim(1)=rwallm
|
rlim(1)=rwallm
|
||||||
rlim(2)=r00*1.d-2
|
rlim(2)=max(r00*1.d-2,rmxm)
|
||||||
rlim(3)=rlim(2)
|
rlim(3)=rlim(2)
|
||||||
rlim(4)=rlim(1)
|
rlim(4)=rlim(1)
|
||||||
rlim(5)=rlim(1)
|
rlim(5)=rlim(1)
|
||||||
@ -982,7 +999,7 @@ c set simple limiter as two cylindrical walls at rwallm and r00
|
|||||||
return
|
return
|
||||||
|
|
||||||
900 format('# Nray_r Nray_th rwmax : ',2i5,1x,es12.5)
|
900 format('# Nray_r Nray_th rwmax : ',2i5,1x,es12.5)
|
||||||
901 format('# igrad iwarm ilarm ieccd idst : ',6i5)
|
901 format('# igrad iwarm ilarm ieccd idst ipol: ',7i5)
|
||||||
902 format('# X0 Y0 Z0 launching point (cm) : ',3(1x,es12.5))
|
902 format('# X0 Y0 Z0 launching point (cm) : ',3(1x,es12.5))
|
||||||
903 format('# w0xi w0eta d0xi d0eta (cm) phiw (deg) : ',5(1x,es12.5))
|
903 format('# w0xi w0eta d0xi d0eta (cm) phiw (deg) : ',5(1x,es12.5))
|
||||||
904 format('# GRAY revision : ',a)
|
904 format('# GRAY revision : ',a)
|
||||||
@ -1992,9 +2009,10 @@ c
|
|||||||
common/crhotq/crhotq
|
common/crhotq/crhotq
|
||||||
|
|
||||||
rpsi=sqrt(psi)
|
rpsi=sqrt(psi)
|
||||||
ip=int((nintp-1)*rpsi+1)
|
c ip=int((nintp-1)*rpsi+1)
|
||||||
if(ip.eq.0) ip=1
|
c if(ip.eq.0) ip=1
|
||||||
if(ip.eq.nintp) ip=nintp-1
|
c if(ip.eq.nintp) ip=nintp-1
|
||||||
|
ip=min(max(1,ip),nintp-1)
|
||||||
dps=rpsi-rpstab(ip)
|
dps=rpsi-rpstab(ip)
|
||||||
frhotor_av=spli(crhotq,nintp,ip,dps)
|
frhotor_av=spli(crhotq,nintp,ip,dps)
|
||||||
return
|
return
|
||||||
@ -2672,9 +2690,10 @@ c spline interpolation of H(lambda,rhop) and dH/dlambda
|
|||||||
common/pstab/rpstab
|
common/pstab/rpstab
|
||||||
common/eqnn/nr,nz,npp,nintp
|
common/eqnn/nr,nz,npp,nintp
|
||||||
common/cdadrhot/cdadrhot
|
common/cdadrhot/cdadrhot
|
||||||
ip=int((nintp-1)*rpsi+1)
|
c ip=int((nintp-1)*rpsi+1)
|
||||||
if(ip.eq.0) ip=1
|
c if(ip.eq.0) ip=1
|
||||||
if(ip.eq.nintp) ip=nintp-1
|
c if(ip.eq.nintp) ip=nintp-1
|
||||||
|
ip=min(max(1,ip),nintp-1)
|
||||||
dps=rpsi-rpstab(ip)
|
dps=rpsi-rpstab(ip)
|
||||||
fdadrhot=spli(cdadrhot,nintp,ip,dps)
|
fdadrhot=spli(cdadrhot,nintp,ip,dps)
|
||||||
return
|
return
|
||||||
@ -2688,8 +2707,9 @@ c spline interpolation of H(lambda,rhop) and dH/dlambda
|
|||||||
common/eqnn/nr,nz,npp,nintp
|
common/eqnn/nr,nz,npp,nintp
|
||||||
common/cdvdrhot/cdvdrhot
|
common/cdvdrhot/cdvdrhot
|
||||||
ip=int((nintp-1)*rpsi+1)
|
ip=int((nintp-1)*rpsi+1)
|
||||||
if(ip.eq.0) ip=1
|
if((ip.le.0).or.(ip.ge.nintp)) print*,rpsi, ip
|
||||||
if(ip.eq.nintp) ip=nintp-1
|
c if(ip.eq.nintp) ip=nintp-1
|
||||||
|
ip=min(max(1,ip),nintp-1)
|
||||||
dps=rpsi-rpstab(ip)
|
dps=rpsi-rpstab(ip)
|
||||||
fdvdrhot=spli(cdvdrhot,nintp,ip,dps)
|
fdvdrhot=spli(cdvdrhot,nintp,ip,dps)
|
||||||
return
|
return
|
||||||
@ -3671,8 +3691,8 @@ c
|
|||||||
call fpbisp(tr,nsr,tz,nsz,ccspl,3,3,
|
call fpbisp(tr,nsr,tz,nsz,ccspl,3,3,
|
||||||
. rrs,nrs,zzs,nzs,ffspl,wrk(1),wrk(5),iwrk(1),iwrk(2))
|
. rrs,nrs,zzs,nzs,ffspl,wrk(1),wrk(5),iwrk(1),iwrk(2))
|
||||||
psinv=(ffspl(1)-psinop)/psiant
|
psinv=(ffspl(1)-psinop)/psiant
|
||||||
if(psinv.lt.0.0d0)
|
c if(psinv.lt.0.0d0)
|
||||||
. print'(a,3e12.4)', ' psin < 0 , R, z ',psinv,rpsim,zpsim
|
c . print'(a,3e12.4)', ' psin < 0 , R, z ',psinv,rpsim,zpsim
|
||||||
c
|
c
|
||||||
nur=1
|
nur=1
|
||||||
nuz=0
|
nuz=0
|
||||||
@ -3950,7 +3970,6 @@ c
|
|||||||
complex*16 d2qi1,d2qi2,d2qqxx,d2qqyy,d2qqxy
|
complex*16 d2qi1,d2qi2,d2qqxx,d2qqyy,d2qqxy
|
||||||
complex*16 catand
|
complex*16 catand
|
||||||
external catand
|
external catand
|
||||||
c parameter(ui=(0.0d0,1.0d0))
|
|
||||||
c
|
c
|
||||||
common/nray/nrayr,nrayth
|
common/nray/nrayr,nrayth
|
||||||
common/rwmax/rwmax
|
common/rwmax/rwmax
|
||||||
@ -3967,6 +3986,9 @@ c
|
|||||||
common/ggradjk/ggri
|
common/ggradjk/ggri
|
||||||
common/ddd/dd,an2s,an2,fdia,bdotgr,ddi,ddr11
|
common/ddd/dd,an2s,an2,fdia,bdotgr,ddi,ddr11
|
||||||
common/evt/ext,eyt
|
common/evt/ext,eyt
|
||||||
|
common/pol0/psipol0,chipol0
|
||||||
|
common/ipol/ipol
|
||||||
|
|
||||||
c
|
c
|
||||||
ui=(0.0d0,1.0d0)
|
ui=(0.0d0,1.0d0)
|
||||||
csth=anz0c
|
csth=anz0c
|
||||||
@ -4169,7 +4191,26 @@ c
|
|||||||
ytmp=ywrk0(:,j,k)
|
ytmp=ywrk0(:,j,k)
|
||||||
yptmp=ypwrk0(:,j,k)
|
yptmp=ypwrk0(:,j,k)
|
||||||
call fwork(ytmp,yptmp)
|
call fwork(ytmp,yptmp)
|
||||||
|
|
||||||
|
if(ipol.eq.0) then
|
||||||
call pol_limit(ext(j,k,0),eyt(j,k,0))
|
call pol_limit(ext(j,k,0),eyt(j,k,0))
|
||||||
|
qq=abs(ext(j,k,0))**2-abs(eyt(j,k,0))**2
|
||||||
|
uu=2.0d0*dble(ext(j,k,0)*dconjg(eyt(j,k,0)))
|
||||||
|
vv=2.0d0*dimag(ext(j,k,0)*dconjg(eyt(j,k,0)))
|
||||||
|
call polellipse(qq,uu,vv,psipol0,chipol0)
|
||||||
|
else
|
||||||
|
qq=cos(2.0d0*chipol0*cvdr)*cos(2.0d0*psipol0*cvdr)
|
||||||
|
uu=cos(2.0d0*chipol0*cvdr)*sin(2.0d0*psipol0*cvdr)
|
||||||
|
vv=sin(2.0d0*chipol0*cvdr)
|
||||||
|
if(qq**2.lt.1) then
|
||||||
|
deltapol=asin(vv/sqrt(1.0d0-qq**2))
|
||||||
|
ext(j,k,0)= sqrt((1.0d0+qq)/2)
|
||||||
|
eyt(j,k,0)= sqrt((1.0d0-qq)/2)*exp(-ui*deltapol)
|
||||||
|
else
|
||||||
|
ext(j,k,0)= 1.0d0
|
||||||
|
eyt(j,k,0)= 0.0d0
|
||||||
|
end if
|
||||||
|
endif
|
||||||
c
|
c
|
||||||
grad2(j,k)=gr2
|
grad2(j,k)=gr2
|
||||||
dgrad2v(1,j,k)=dgr2x
|
dgrad2v(1,j,k)=dgr2x
|
||||||
@ -4223,9 +4264,11 @@ c ray tracing initial conditions igrad=0
|
|||||||
c
|
c
|
||||||
subroutine ic_rt
|
subroutine ic_rt
|
||||||
implicit real*8 (a-h,o-z)
|
implicit real*8 (a-h,o-z)
|
||||||
|
complex*16 ui
|
||||||
parameter(ndim=6,ndimm=3)
|
parameter(ndim=6,ndimm=3)
|
||||||
parameter(jmx=31,kmx=36,zero=0.0d0,izero=0,one=1.0d0)
|
parameter(jmx=31,kmx=36,zero=0.0d0,izero=0,one=1.0d0)
|
||||||
parameter(pi=3.14159265358979d0,cvdr=pi/180.0d0)
|
parameter(pi=3.14159265358979d0,cvdr=pi/180.0d0)
|
||||||
|
parameter(ui=(0.0d0,1.0d0))
|
||||||
dimension ywrk0(ndim,jmx,kmx),ypwrk0(ndim,jmx,kmx)
|
dimension ywrk0(ndim,jmx,kmx),ypwrk0(ndim,jmx,kmx)
|
||||||
dimension ytmp(ndim),yptmp(ndim)
|
dimension ytmp(ndim),yptmp(ndim)
|
||||||
dimension xc0(ndimm,jmx,kmx),du10(ndimm,jmx,kmx)
|
dimension xc0(ndimm,jmx,kmx),du10(ndimm,jmx,kmx)
|
||||||
@ -4248,6 +4291,8 @@ c
|
|||||||
common/ggradjk/ggri
|
common/ggradjk/ggri
|
||||||
common/ddd/dd,an2s,an2,fdia,bdotgr,ddi,ddr11
|
common/ddd/dd,an2s,an2,fdia,bdotgr,ddi,ddr11
|
||||||
common/evt/ext,eyt
|
common/evt/ext,eyt
|
||||||
|
common/pol0/psipol0,chipol0
|
||||||
|
common/ipol/ipol
|
||||||
c
|
c
|
||||||
csth=anz0c
|
csth=anz0c
|
||||||
snth=sqrt(1.0d0-csth**2)
|
snth=sqrt(1.0d0-csth**2)
|
||||||
@ -4334,7 +4379,32 @@ c
|
|||||||
ytmp=ywrk0(:,j,k)
|
ytmp=ywrk0(:,j,k)
|
||||||
yptmp=ypwrk0(:,j,k)
|
yptmp=ypwrk0(:,j,k)
|
||||||
call fwork(ytmp,yptmp)
|
call fwork(ytmp,yptmp)
|
||||||
|
|
||||||
|
if(ipol.eq.0) then
|
||||||
call pol_limit(ext(j,k,0),eyt(j,k,0))
|
call pol_limit(ext(j,k,0),eyt(j,k,0))
|
||||||
|
qq=abs(ext(j,k,0))**2-abs(eyt(j,k,0))**2
|
||||||
|
uu=2.0d0*dble(ext(j,k,0)*dconjg(eyt(j,k,0)))
|
||||||
|
vv=2.0d0*dimag(ext(j,k,0)*dconjg(eyt(j,k,0)))
|
||||||
|
call polellipse(qq,uu,vv,psipol0,chipol0)
|
||||||
|
else
|
||||||
|
qq=cos(2.0d0*chipol0*cvdr)*cos(2.0d0*psipol0*cvdr)
|
||||||
|
uu=cos(2.0d0*chipol0*cvdr)*sin(2.0d0*psipol0*cvdr)
|
||||||
|
vv=sin(2.0d0*chipol0*cvdr)
|
||||||
|
if(qq**2.lt.1.0d0) then
|
||||||
|
c deltapol=phix-phiy, phix =0
|
||||||
|
deltapol=atan2(vv,uu)
|
||||||
|
ext(j,k,0)= sqrt((1.0d0+qq)/2)
|
||||||
|
eyt(j,k,0)= sqrt((1.0d0-qq)/2)*exp(-ui*deltapol)
|
||||||
|
else
|
||||||
|
if(qq.gt.0.0d0) then
|
||||||
|
ext(j,k,0)= 1.0d0
|
||||||
|
eyt(j,k,0)= 0.0d0
|
||||||
|
else
|
||||||
|
eyt(j,k,0)= 1.0d0
|
||||||
|
ext(j,k,0)= 0.0d0
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
endif
|
||||||
c
|
c
|
||||||
do iv=1,3
|
do iv=1,3
|
||||||
gri(iv,j,k)=0.0d0
|
gri(iv,j,k)=0.0d0
|
||||||
@ -4408,6 +4478,7 @@ c
|
|||||||
common/ddd/dd,an2s,an2,fdia,bdotgr,ddi,ddr11
|
common/ddd/dd,an2s,an2,fdia,bdotgr,ddi,ddr11
|
||||||
common/yyrfl/yyrfl
|
common/yyrfl/yyrfl
|
||||||
common/evt/ext,eyt
|
common/evt/ext,eyt
|
||||||
|
common/pol0/psipol0,chipol0
|
||||||
|
|
||||||
do j=1,nrayr
|
do j=1,nrayr
|
||||||
do k=1,nrayth
|
do k=1,nrayth
|
||||||
@ -4441,7 +4512,12 @@ c
|
|||||||
ytmp=ywrk0(:,j,k)
|
ytmp=ywrk0(:,j,k)
|
||||||
yptmp=ypwrk0(:,j,k)
|
yptmp=ypwrk0(:,j,k)
|
||||||
call fwork(ytmp,yptmp)
|
call fwork(ytmp,yptmp)
|
||||||
|
|
||||||
call pol_limit(ext(j,k,0),eyt(j,k,0))
|
call pol_limit(ext(j,k,0),eyt(j,k,0))
|
||||||
|
qq=abs(ext(j,k,0))**2-abs(eyt(j,k,0))**2
|
||||||
|
uu=2.0d0*dble(ext(j,k,0)*dconjg(eyt(j,k,0)))
|
||||||
|
vv=2.0d0*dimag(ext(j,k,0)*dconjg(eyt(j,k,0)))
|
||||||
|
call polellipse(qq,uu,vv,psipol0,chipol0)
|
||||||
c
|
c
|
||||||
do iv=1,3
|
do iv=1,3
|
||||||
gri(iv,j,k)=0.0d0
|
gri(iv,j,k)=0.0d0
|
||||||
@ -4541,9 +4617,10 @@ c
|
|||||||
common/pstab/rpstab
|
common/pstab/rpstab
|
||||||
common/eqnn/nr,nz,npp,nintp
|
common/eqnn/nr,nz,npp,nintp
|
||||||
c
|
c
|
||||||
ip=int((nintp-1)*rpsi+1)
|
c ip=int((nintp-1)*rpsi+1)
|
||||||
if(ip.eq.0) ip=1
|
c if(ip.eq.0) ip=1
|
||||||
if(ip.eq.nintp) ip=nintp-1
|
c if(ip.eq.nintp) ip=nintp-1
|
||||||
|
ip=min(max(1,ip),nintp-1)
|
||||||
c
|
c
|
||||||
dps=rpsi-rpstab(ip)
|
dps=rpsi-rpstab(ip)
|
||||||
c
|
c
|
||||||
@ -4572,9 +4649,10 @@ c
|
|||||||
common/pstab/rpstab
|
common/pstab/rpstab
|
||||||
common/eqnn/nr,nz,npp,nintp
|
common/eqnn/nr,nz,npp,nintp
|
||||||
common/cratj/cratja,cratjb,cratjpl
|
common/cratj/cratja,cratjb,cratjpl
|
||||||
ip=int((nintp-1)*rpsi+1)
|
c ip=int((nintp-1)*rpsi+1)
|
||||||
if(ip.eq.0) ip=1
|
c if(ip.eq.0) ip=1
|
||||||
if(ip.eq.nintp) ip=nintp-1
|
c if(ip.eq.nintp) ip=nintp-1
|
||||||
|
ip=min(max(1,ip),nintp-1)
|
||||||
dps=rpsi-rpstab(ip)
|
dps=rpsi-rpstab(ip)
|
||||||
ratjai=spli(cratja,nintp,ip,dps)
|
ratjai=spli(cratja,nintp,ip,dps)
|
||||||
ratjbi=spli(cratjb,nintp,ip,dps)
|
ratjbi=spli(cratjb,nintp,ip,dps)
|
||||||
@ -4770,15 +4848,14 @@ c complex*16 e33,e21,e31,e32
|
|||||||
complex*16 a13,a31,a23,a32,a33
|
complex*16 a13,a31,a23,a32,a33
|
||||||
c
|
c
|
||||||
common/ygyg/yg
|
common/ygyg/yg
|
||||||
|
common/xgxg/xg
|
||||||
common/nplr/anpl,anprf
|
common/nplr/anpl,anprf
|
||||||
c
|
|
||||||
common/mode/sox
|
common/mode/sox
|
||||||
common/warm/iwarm,ilarm
|
common/warm/iwarm,ilarm
|
||||||
c
|
|
||||||
common/nprw/anprr,anpri
|
common/nprw/anprr,anpri
|
||||||
common/epolar/ex,ey,ez
|
common/epolar/ex,ey,ez
|
||||||
common/amut/amu
|
common/amut/amu
|
||||||
c
|
|
||||||
errnpr=1.0d0
|
errnpr=1.0d0
|
||||||
anpr2a=anprf**2
|
anpr2a=anprf**2
|
||||||
anpl2=anpl*anpl
|
anpl2=anpl*anpl
|
||||||
@ -4789,7 +4866,10 @@ c
|
|||||||
call diel_tens_fr(e330,epsl,lrm)
|
call diel_tens_fr(e330,epsl,lrm)
|
||||||
end if
|
end if
|
||||||
c
|
c
|
||||||
do i=1,imx
|
imxx=abs(imx)
|
||||||
|
c loop to disable convergence if failure detected
|
||||||
|
do
|
||||||
|
do i=1,imxx
|
||||||
c
|
c
|
||||||
do j=1,3
|
do j=1,3
|
||||||
do k=1,3
|
do k=1,3
|
||||||
@ -4816,8 +4896,6 @@ c e33=e330+anpr2a*a33
|
|||||||
c e21=-e12
|
c e21=-e12
|
||||||
c e31=e13
|
c e31=e13
|
||||||
c e32=-e23
|
c e32=-e23
|
||||||
c
|
|
||||||
if(i.gt.2.and.errnpr.lt.1.0d-3) go to 999
|
|
||||||
c
|
c
|
||||||
cc4=(e11-anpl2)*(1.0d0-a33)+(a13+anpl)*(a31+anpl)
|
cc4=(e11-anpl2)*(1.0d0-a33)+(a13+anpl)*(a31+anpl)
|
||||||
cc2=-e12*e12*(1.0d0-a33)
|
cc2=-e12*e12*(1.0d0-a33)
|
||||||
@ -4837,25 +4915,38 @@ c
|
|||||||
end if
|
end if
|
||||||
c
|
c
|
||||||
anpr2=(-cc2+s*sqrt(rr))/(2.0d0*cc4)
|
anpr2=(-cc2+s*sqrt(rr))/(2.0d0*cc4)
|
||||||
c
|
|
||||||
if(dble(anpr2).lt.0.0d0.and.dimag(anpr2).lt.0.0d0) then
|
|
||||||
anpr2=0.0d0
|
|
||||||
print*,' Y =',yg,' nperp2 < 0'
|
|
||||||
c ierr=99
|
|
||||||
go to 999
|
|
||||||
end if
|
|
||||||
c
|
c
|
||||||
errnpr=abs(1.0d0-abs(anpr2)/abs(anpr2a))
|
errnpr=abs(1.0d0-abs(anpr2)/abs(anpr2a))
|
||||||
|
if(i.gt.1.and.errnpr.lt.1.0d-5) exit
|
||||||
anpr2a=anpr2
|
anpr2a=anpr2
|
||||||
end do
|
end do
|
||||||
c
|
if(i.gt.imxx .and. imxx.gt.1) then
|
||||||
999 continue
|
if (imx.lt.0) then
|
||||||
if(i.gt.imx) print*,' i>imx ',yg,errnpr,i
|
write(*,"(' X =',f7.4,' Y =',f10.7,' Nperp =',f7.4,"//
|
||||||
|
."': convergence disabled.',e12.5)") xg,yg,sqrt(abs(anpr2)),anpl
|
||||||
|
imxx=1
|
||||||
|
else
|
||||||
|
write(*,"(' X =',f7.4,' Y =',f10.7,' Nperp =',f7.4,"//
|
||||||
|
."': convergence failed.',e12.5)") xg,yg,sqrt(abs(anpr2)),anpl
|
||||||
|
exit
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
exit
|
||||||
|
end if
|
||||||
|
print*,yg,imx,imxx
|
||||||
|
end do
|
||||||
|
c end loop to disable convergence
|
||||||
|
if(sqrt(dble(anpr2)).lt.0.0d0 .or. anpr2.ne.anpr2
|
||||||
|
. .or. abs(anpr2).eq.huge(one) .or. abs(anpr2).le.tiny(one)) then
|
||||||
|
write(*,"(' X =',f7.4,' Y =',f7.4,"//
|
||||||
|
. "' Nperp =',f7.4,'!')") xg,yg,sqrt(abs(anpr2))
|
||||||
|
ierr=99
|
||||||
|
anpr2=(0.0d0,0.0d0)
|
||||||
|
end if
|
||||||
c
|
c
|
||||||
anpr=sqrt(anpr2)
|
anpr=sqrt(anpr2)
|
||||||
anprr=dble(anpr)
|
anprr=dble(anpr)
|
||||||
anpri=dimag(anpr)
|
anpri=dimag(anpr)
|
||||||
99 format(20(1x,e12.5))
|
|
||||||
c
|
c
|
||||||
ex=dcmplx(0.0d0,0.0d0)
|
ex=dcmplx(0.0d0,0.0d0)
|
||||||
ey=dcmplx(0.0d0,0.0d0)
|
ey=dcmplx(0.0d0,0.0d0)
|
||||||
@ -4887,6 +4978,7 @@ c
|
|||||||
end if
|
end if
|
||||||
c
|
c
|
||||||
return
|
return
|
||||||
|
99 format(20(1x,e12.5))
|
||||||
end
|
end
|
||||||
c
|
c
|
||||||
c Fully relativistic case
|
c Fully relativistic case
|
||||||
@ -6279,7 +6371,9 @@ c
|
|||||||
do k=1,kkk
|
do k=1,kkk
|
||||||
ise0=0
|
ise0=0
|
||||||
ii=iiv(j,k)
|
ii=iiv(j,k)
|
||||||
if (ii.lt.nmx.and.psjki(j,k,ii+1).ne.0.0d0) ii=ii+1
|
if (ii.lt.nmx) then
|
||||||
|
if(psjki(j,k,ii+1).ne.0.0d0) ii=ii+1
|
||||||
|
end if
|
||||||
idecr=-1
|
idecr=-1
|
||||||
is=1
|
is=1
|
||||||
do i=1,ii
|
do i=1,ii
|
||||||
@ -6422,20 +6516,20 @@ c of gaussian profile
|
|||||||
rhpp=frhopol(rhotpav)
|
rhpp=frhopol(rhotpav)
|
||||||
rhpj=frhopol(rhotjava)
|
rhpj=frhopol(rhotjava)
|
||||||
dpdvp=pabs*2.0d0/(sqrt(pi)*drhotpav*fdvdrhot(rhpp))
|
dpdvp=pabs*2.0d0/(sqrt(pi)*drhotpav*fdvdrhot(rhpp))
|
||||||
ajphip=currt*2.0d0/(sqrt(pi)*drhotjava*fdadrhot(rhpj))
|
|
||||||
call ratioj(rhpj,ratjamx,ratjbmx,ratjplmx)
|
|
||||||
|
|
||||||
call profwidth(nd,rtab,dpdv,rhotp,rhopp,dpdvmx,
|
call profwidth(nd,rtab,dpdv,rhotp,rhopp,dpdvmx,
|
||||||
. drhotp,drhopp)
|
. drhotp,drhopp)
|
||||||
|
|
||||||
if(ieccd.ne.0) then
|
if(ieccd.ne.0) then
|
||||||
|
ajphip=currt*2.0d0/(sqrt(pi)*drhotjava*fdadrhot(rhpj))
|
||||||
|
call ratioj(rhpj,ratjamx,ratjbmx,ratjplmx)
|
||||||
call profwidth(nd,rtab,ajphiv,rhotjfi,rhopfi,ajmxfi,
|
call profwidth(nd,rtab,ajphiv,rhotjfi,rhopfi,ajmxfi,
|
||||||
. drhotjfi,drhopfi)
|
. drhotjfi,drhopfi)
|
||||||
xps=rhopfi
|
xps=rhopfi
|
||||||
c call ratioj(rhopfi,ratjamx,ratjbmx,ratjplmx)
|
|
||||||
else
|
else
|
||||||
rhotjfi=0.0d0
|
rhotjfi=0.0d0
|
||||||
rhopfi=0.0d0
|
rhopfi=0.0d0
|
||||||
ajmxfi=0.0d0
|
ajmxfi=0.0d0
|
||||||
|
ajphip=0.0d0
|
||||||
drhotjfi=0.0d0
|
drhotjfi=0.0d0
|
||||||
drhopfi=0.0d0
|
drhopfi=0.0d0
|
||||||
xps=rhopp
|
xps=rhopp
|
||||||
@ -6482,6 +6576,8 @@ c call ratioj(rhopfi,ratjamx,ratjbmx,ratjplmx)
|
|||||||
drhotjava=0.0d0
|
drhotjava=0.0d0
|
||||||
drhotp=0.0d0
|
drhotp=0.0d0
|
||||||
drhotpav=0.0d0
|
drhotpav=0.0d0
|
||||||
|
ratjamx=0.0d0
|
||||||
|
ratjbmx=0.0d0
|
||||||
taumn=0
|
taumn=0
|
||||||
taumx=0
|
taumx=0
|
||||||
stmx=stf
|
stmx=stf
|
||||||
|
Loading…
Reference in New Issue
Block a user