subroutine rdiffset c c This routine calculates the diffusion associated with particle noise c in GK PIC simulations. The code evaluates an analytical derivation c by Greg Hammett. The parameters ifilter, N_p, n_zpic, and bmax are c described in the input file (itg.in). c implicit none include 'itg.par' include 'itg.cmn' integer m, n real tmp, fa_par, fac fa_par=2*pi*qsf/epsn/float(n_zpic) ! a_par/L_n do n=1,nd do m=1,md tmp=0.5*sqrt(pi/2)*eta(1)**2/float(n_p)*fa_par*chi_int . *bmax/(2+bmax) c first time step hack if(rdiff(m,n).eq.0.) then rdiff(m,n)=tmp else fac=1+sqrt(2/pi)/fa_par . /(rdiff(m,n)-wpfx(ne,1)/eta(1)/1.5) . *2/bmax*(2+bmax)/(1+bmax) rdiff(m,n)=tmp*alog(fac) endif enddo enddo return end