@@ -60,6 +60,7 @@ subroutine calc_chi(chi,chi_low,j,kz,kperp,x)
6060 ! ! Subroutine that calculates the susceptibility of species j based on NHDS.
6161 use alps_var, only : bMnmaxs, bMBessel_zeros, bMbetas, bMalphas,bMpdrifts
6262 use alps_var, only : ms, qs, ns
63+ use alps_var, only : kperp_norm
6364 implicit none
6465
6566 double complex , intent (out ) :: chi(3 ,3 )
@@ -193,7 +194,11 @@ subroutine calc_chi(chi,chi_low,j,kz,kperp,x)
193194 chi(2 ,3 )= Y(2 ,3 )/ (ell* ell)
194195 chi(3 ,1 )= Y(3 ,1 )/ (ell* ell)
195196 chi(3 ,2 )= Y(3 ,2 )/ (ell* ell)
196- chi(3 ,3 )= kperp* kperp* 2.d0 * x* vdrift/ (ell* ell* kz* vtherm* vtherm* bMalphas(j))+ Y(3 ,3 )/ (ell* ell)
197+ if (kperp_norm) then
198+ chi(3 ,3 )= 2.d0 * x* vdrift/ (ell* ell* kz* vtherm* vtherm* bMalphas(j))+ Y(3 ,3 )/ (ell* ell)
199+ else
200+ chi(3 ,3 )= kperp* kperp* 2.d0 * x* vdrift/ (ell* ell* kz* vtherm* vtherm* bMalphas(j))+ Y(3 ,3 )/ (ell* ell)
201+ endif
197202
198203 n= 0
199204 chi_low(1 ,1 ,n)= Y0(1 ,1 )/ (ell* ell)
@@ -204,7 +209,11 @@ subroutine calc_chi(chi,chi_low,j,kz,kperp,x)
204209 chi_low(2 ,3 ,n)= Y0(2 ,3 )/ (ell* ell)
205210 chi_low(3 ,1 ,n)= Y0(3 ,1 )/ (ell* ell)
206211 chi_low(3 ,2 ,n)= Y0(3 ,2 )/ (ell* ell)
207- chi_low(3 ,3 ,n)= Y0(3 ,3 )/ (ell* ell)+ kperp* kperp* 2.d0 * x* vdrift/ (ell* ell* kz* vtherm* vtherm* bMalphas(j))
212+ if (kperp_norm) then
213+ chi_low(3 ,3 ,n)= Y0(3 ,3 )/ (ell* ell)+ 2.d0 * x* vdrift/ (ell* ell* kz* vtherm* vtherm* bMalphas(j))
214+ else
215+ chi_low(3 ,3 ,n)= Y0(3 ,3 )/ (ell* ell)+ kperp* kperp* 2.d0 * x* vdrift/ (ell* ell* kz* vtherm* vtherm* bMalphas(j))
216+ endif
208217
209218 n= 1
210219 chi_low(1 ,1 ,n)= Y1(1 ,1 )/ (ell* ell)
@@ -242,6 +251,7 @@ subroutine calc_ypsilon(Y,j,n,kz,kperp,x)
242251 ! ! Calculates the Y-tensor according to Stix for a bi-Maxwelling, using the NHDS calculation.
243252 use alps_var, only : bMbetas, bMalphas,bMpdrifts
244253 use alps_var, only : ms, qs, ns
254+ use alps_var, only : kperp_norm
245255 implicit none
246256
247257 double complex , parameter :: uniti= (0.d0 ,1.d0 )
@@ -338,28 +348,29 @@ subroutine calc_ypsilon(Y,j,n,kz,kperp,x)
338348 endif
339349
340350
341- ! The tensor in Stix's (10-57)
342- ! Y(1,1)=1.d0*(n*n)*BInz*An/z
343- ! Y(1,2)=-uniti*n*(BInz-dBInzdz)*An
344- ! Y(1,3)=kperp*n*BInz*Bn/(Omega*z)
345- ! Y(2,1)=uniti*n*(BInz-dBInzdz)*An
346- ! Y(2,2)=(1.d0*(n*n)*BInz/z+2.d0*z*BInz-2.d0*z*dBInzdz)*An
347- ! Y(2,3)=uniti*kperp*(BInz-dBInzdz)*Bn/Omega
348- ! Y(3,1)=kperp*BInz*n*Bn/(Omega*z)
349- ! Y(3,2)=-uniti*kperp*(BInz-dBInzdz)*Bn/Omega
350- ! Y(3,3)=2.d0*(x-1.d0*n*Omega)*BInz*Bn/(kz*vtherm*vtherm*bMalphas(j))
351-
352- ! The tensor in Stix's (10-57), multiplied by kperp^2 d_ref^2
353- Y(1 ,1 )= 1.d0 * (n* n)* BInz* An/ zp
354- Y(1 ,2 )=- uniti* n* (BInz- dBInzdz)* An* kperp* kperp
355- Y(1 ,3 )= kperp* n* BInz* Bn/ (Omega* zp)
356- Y(2 ,1 )= uniti* n* (BInz- dBInzdz)* An* kperp* kperp
357- Y(2 ,2 )= (1.d0 * (n* n)* BInz/ zp+ kperp* kperp* 2.d0 * z* BInz- kperp* kperp* 2.d0 * z* dBInzdz)* An
358- Y(2 ,3 )= uniti* kperp* kperp* kperp* (BInz- dBInzdz)* Bn/ Omega
359- Y(3 ,1 )= kperp* BInz* n* Bn/ (Omega* zp)
360- Y(3 ,2 )=- uniti* kperp* kperp* kperp* (BInz- dBInzdz)* Bn/ Omega
361- Y(3 ,3 )= kperp* kperp* 2.d0 * (x-1.d0 * n* Omega)* BInz* Bn/ (kz* vtherm* vtherm* bMalphas(j))
362-
351+ if (kperp_norm) then
352+ ! The tensor in Stix's (10-57)
353+ Y(1 ,1 )= 1.d0 * (n* n)* BInz* An/ z
354+ Y(1 ,2 )=- uniti* n* (BInz- dBInzdz)* An
355+ Y(1 ,3 )= kperp* n* BInz* Bn/ (Omega* z)
356+ Y(2 ,1 )= uniti* n* (BInz- dBInzdz)* An
357+ Y(2 ,2 )= (1.d0 * (n* n)* BInz/ z+2.d0 * z* BInz-2.d0 * z* dBInzdz)* An
358+ Y(2 ,3 )= uniti* kperp* (BInz- dBInzdz)* Bn/ Omega
359+ Y(3 ,1 )= kperp* BInz* n* Bn/ (Omega* z)
360+ Y(3 ,2 )=- uniti* kperp* (BInz- dBInzdz)* Bn/ Omega
361+ Y(3 ,3 )= 2.d0 * (x-1.d0 * n* Omega)* BInz* Bn/ (kz* vtherm* vtherm* bMalphas(j))
362+ else
363+ ! The tensor in Stix's (10-57), multiplied by kperp^2 d_ref^2
364+ Y(1 ,1 )= 1.d0 * (n* n)* BInz* An/ zp
365+ Y(1 ,2 )=- uniti* n* (BInz- dBInzdz)* An* kperp* kperp
366+ Y(1 ,3 )= kperp* n* BInz* Bn/ (Omega* zp)
367+ Y(2 ,1 )= uniti* n* (BInz- dBInzdz)* An* kperp* kperp
368+ Y(2 ,2 )= (1.d0 * (n* n)* BInz/ zp+ kperp* kperp* 2.d0 * z* BInz- kperp* kperp* 2.d0 * z* dBInzdz)* An
369+ Y(2 ,3 )= uniti* kperp* kperp* kperp* (BInz- dBInzdz)* Bn/ Omega
370+ Y(3 ,1 )= kperp* BInz* n* Bn/ (Omega* zp)
371+ Y(3 ,2 )=- uniti* kperp* kperp* kperp* (BInz- dBInzdz)* Bn/ Omega
372+ Y(3 ,3 )= kperp* kperp* 2.d0 * (x-1.d0 * n* Omega)* BInz* Bn/ (kz* vtherm* vtherm* bMalphas(j))
373+ endif
363374
364375 end subroutine
365376
@@ -369,6 +380,7 @@ subroutine calc_chi_cold(chi,j,kz,kperp,x)
369380 ! ! Subroutine that calculates the susceptibility of species j based on the cold-plasma dispersion relation based on the paper Verscharen & Chandran, ApJ 764, 88, 2013.
370381 use alps_var, only : bMbetas,bMpdrifts
371382 use alps_var, only : ms, qs, ns
383+ use alps_var, only : kperp_norm
372384 implicit none
373385
374386 double complex , intent (out ) :: chi(3 ,3 )
@@ -434,16 +446,21 @@ subroutine calc_chi_cold(chi,j,kz,kperp,x)
434446 dispM= uniti* (1.d0 / (ell* ell))* kperp* vdrift* Omega/ ((x- kz* vdrift)** 2 - Omega** 2 )
435447
436448
437- chi(1 ,1 )= (dispR+ dispL)/ 2.d0
438- chi(1 ,2 )=- uniti* (dispR- dispL)/ 2.d0
439- chi(1 ,3 )= dispJ
440- chi(2 ,1 )= uniti* (dispR- dispL)/ 2.d0
441- chi(2 ,2 )= (dispR+ dispL)/ 2.d0
442- chi(2 ,3 )= dispM
443- chi(3 ,1 )= dispJ
444- chi(3 ,2 )=- dispM
445- chi(3 ,3 )= dispP
446-
449+ if (kperp_norm) then
450+ chi(1 ,1 )= (dispR+ dispL)/ 2.d0
451+ chi(1 ,2 )=- uniti* (dispR- dispL)/ 2.d0
452+ chi(1 ,3 )= dispJ
453+ chi(2 ,1 )= uniti* (dispR- dispL)/ 2.d0
454+ chi(2 ,2 )= (dispR+ dispL)/ 2.d0
455+ chi(2 ,3 )= dispM
456+ chi(3 ,1 )= dispJ
457+ chi(3 ,2 )=- dispM
458+ chi(3 ,3 )= dispP
459+ else
460+ write (* ,* ) ' ERROR: check kperp norm for cold plasma distribution!!'
461+ stop
462+ endif
463+
447464 end subroutine
448465
449466
0 commit comments