Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/b3d rho dist #246

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BEAMS3D/Sources/beams3d_diagnostics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ SUBROUTINE beams3d_diagnostics
!dense_prof = SUM(SUM(SUM(SUM(dist5d_prof,DIM=6),DIM=5),DIM=4),DIM=3)
! We not apply the volume element for the radial profiles [m^-3]
DO k = 1, ns_prof1
s1 = REAL(k-0.5)/REAL(ns_prof1) ! Rho
s1 = MIN(REAL(k-0.5)/h1_prof,1.0) ! Rho
s2 = s1*s1
CALL EZspline_interp(Vp_spl_s,s2,vp_temp,ier)
vp_temp = vp_temp*2*s1*(1./REAL(ns_prof1))
vp_temp = vp_temp*2*s1/h1_prof
epower_prof(:,k) = epower_prof(:,k)/vp_temp
ipower_prof(:,k) = ipower_prof(:,k)/vp_temp
ndot_prof(:,k) = ndot_prof(:,k)/vp_temp
Expand Down
12 changes: 8 additions & 4 deletions BEAMS3D/Sources/beams3d_distnorm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ SUBROUTINE beams3d_distnorm
nr, nphi, nz
USE beams3d_lines, ONLY: ns_prof1, ns_prof2, ns_prof3, ns_prof4, &
ns_prof4, ns_prof5, dist5d_prof, &
partvmax, dist5d_fida
partvmax, dist5d_fida, h1_prof, h2_prof,&
h3_prof
USE beams3d_physics_mod, ONLY: beams3d_suv2rzp
USE fidasim_input_mod, ONLY: beams3d_write_fidasim
USE EZspline_obj
Expand Down Expand Up @@ -61,9 +62,12 @@ SUBROUTINE beams3d_distnorm
#endif
! Do physical volume elements
nvol = (ns_prof1)*(ns_prof2)*(ns_prof3)
ds = 1.0/REAL(ns_prof1) !distribution defined on centers (half grid)
du = pi2/REAL(ns_prof2)
dp = pi2/REAL(ns_prof3)
ds = 1.0/h1_prof
du = 1.0/h2_prof
dp = 1.0/h3_prof
! ds = 1.0/REAL(ns_prof1) !distribution defined on centers (half grid)
! du = pi2/REAL(ns_prof2)
! dp = pi2/REAL(ns_prof3)

!Initial condition near axis
rt = -1 ! will then use 0.75 point of R-grid
Expand Down
10 changes: 7 additions & 3 deletions BEAMS3D/Sources/beams3d_init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ SUBROUTINE beams3d_init
USE beams3d_input_mod, ONLY: read_beams3d_input, init_beams3d_input
USE beams3d_lines, ONLY: nparticles, epower_prof, ipower_prof, &
ndot_prof, j_prof, dense_prof, &
partvmax, partpmax, &
partvmax, partpmax, rho_max_dist,&
end_state, ns_prof1, ns_prof2, ns_prof3, &
ns_prof4, ns_prof5, dist5d_prof, win_dist5d, &
dist5d_fida, win_dist5d_fida,&
win_epower, win_ipower, win_ndot, win_jprof, &
win_dense, nsh_prof4, h2_prof, h3_prof, &
h4_prof, h5_prof, r_h, p_h, z_h, e_h, pi_h
win_dense, nsh_prof4, &
h1_prof,h2_prof, h3_prof, h4_prof, h5_prof, &
r_h, p_h, z_h, e_h, pi_h
USE fidasim_input_mod, ONLY: beams3d_write_fidasim
USE wall_mod
USE mpi_params
Expand Down Expand Up @@ -142,6 +143,9 @@ SUBROUTINE beams3d_init
ns_prof5 = 4
END IF

! Buffer in the rho direction so particles s>1 are in the 'extra' bin
h1_prof = ns_prof1/rho_max_dist

! Handle existence of ADAS for NBI
IF (lbeam .and. .not.lsuzuki .and. myid_sharmem==master) THEN
lsuzuki = .not.adas_tables_avail()
Expand Down
2 changes: 1 addition & 1 deletion BEAMS3D/Sources/beams3d_init_continuegrid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SUBROUTINE beams3d_init_continuegrid
ZEFF_spl_s, nzeff, ZEFF_ARR, req_axis, zeq_axis, &
phiedge_eq, reff_eq, NI_spl_s, NI,&
s_max,s_max_te, s_max_ne,s_max_zeff,s_max_ti, s_max_pot
USE beams3d_lines, ONLY: GFactor, ns_prof1
USE beams3d_lines, ONLY: GFactor, ns_prof1, h1_prof
USE read_beams3d_mod, ONLY: get_beams3d_grid, get_beams3d_B, &
read_beams3d_deallocate, &
get_beams3d_magaxis, get_beams3d_gridB
Expand Down
16 changes: 6 additions & 10 deletions BEAMS3D/Sources/beams3d_init_fusion.f90
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,13 @@ SUBROUTINE beams3d_init_fusion
beam(nparticles), weight(nparticles), &
vr_start(nparticles), vphi_start(nparticles), vz_start(nparticles), &
lgc2fo_start(nparticles))
CALL mpialloc(NEUTRONS_ARR, nbeams, nr, nphi, nz, myid_sharmem, 0, MPI_COMM_SHARMEM, win_NEUTRONS)
CALL mpialloc(E_NEUTRONS, nbeams, myid_sharmem, 0, MPI_COMM_SHARMEM, win_E_NEUTRONS)
CALL mpialloc(NEUTRONS_ARR, 2, nr, nphi, nz, myid_sharmem, 0, MPI_COMM_SHARMEM, win_NEUTRONS)
CALL mpialloc(E_NEUTRONS, 2, myid_sharmem, 0, MPI_COMM_SHARMEM, win_E_NEUTRONS)
IF (myworkid == master) THEN
NEUTRONS_ARR = 0.0
E_NEUTRONS = 0.0
NEUTRONS_ARR(1,1:nr1,1:nphi1,1:nz1) = rateDT
NEUTRONS_ARR(2,1:nr1,1:nphi1,1:nz1) = rateDDHe
E_NEUTRONS(1) = 14.06E6
E_NEUTRONS(2) = 2.45E6
END IF

! We set this true because we assume all particles generated are gyrocenters. Should a
Expand Down Expand Up @@ -327,7 +329,6 @@ SUBROUTINE beams3d_init_fusion
! Do the D-T -> H4 reaction
l = l + 1
vpart = sqrt(2*E_BEAMS(l)/mHe4)
E_NEUTRONS(l) = 14.06E6
DO s = 1,nr1*nphi1*nz1
i = MOD(s-1,nr1)+1
j = MOD(s-1,nr1*nphi1)
Expand All @@ -346,7 +347,6 @@ SUBROUTINE beams3d_init_fusion
Zatom(k1:k2) = 2
t_end(k1:k2) = t_end_in(1)
weight(k1:k2) = rateDT(i,j,k)/n3d(i,j,k)
NEUTRONS_ARR(l,i,j,k) = rateDT(i,j,k)
k1 = k2+1
END DO
END IF
Expand All @@ -373,7 +373,6 @@ SUBROUTINE beams3d_init_fusion
Zatom(k1:k2) = 1
t_end(k1:k2) = t_end_in(1)
weight(k1:k2) = rateDDT(i,j,k)/n3d(i,j,k)
!NEUTRONS_ARR(l,i,j,k) = rateDDT(i,j,k)
k1 = k2+1
END DO
END IF
Expand All @@ -400,15 +399,13 @@ SUBROUTINE beams3d_init_fusion
Zatom(k1:k2) = 1
t_end(k1:k2) = t_end_in(1)
weight(k1:k2) = rateDDT(i,j,k)/n3d(i,j,k)
!NEUTRONS_ARR(l,i,j,k) = rateDDT(i,j,k)
k1 = k2+1
END DO
END IF
IF (lfusion_He3) THEN
! Do the D-D -> He3 reaction
l = l + 1
vpart = sqrt(2*E_BEAMS(l)/mHe3)
E_NEUTRONS(l) = 2.45E6
DO s = 1,nr1*nphi1*nz1
i = MOD(s-1,nr1)+1
j = MOD(s-1,nr1*nphi1)
Expand All @@ -427,7 +424,6 @@ SUBROUTINE beams3d_init_fusion
Zatom(k1:k2) = 2
t_end(k1:k2) = t_end_in(1)
weight(k1:k2) = rateDDHe(i,j,k)/n3d(i,j,k)
NEUTRONS_ARR(l,i,j,k) = rateDDHe(i,j,k)
k1 = k2+1
END DO
END IF
Expand Down
5 changes: 3 additions & 2 deletions BEAMS3D/Sources/beams3d_init_vmec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SUBROUTINE beams3d_init_vmec
ZEFF_spl_s, nzeff, ZEFF_ARR, req_axis, zeq_axis, &
phiedge_eq, reff_eq, NI_spl_s, NI,&
s_max,s_max_te, s_max_ne,s_max_zeff,s_max_ti, s_max_pot
USE beams3d_lines, ONLY: GFactor, ns_prof1
USE beams3d_lines, ONLY: GFactor, ns_prof1, h1_prof
USE wall_mod, ONLY: wall_load_mn
USE mpi_params
USE mpi_inc
Expand Down Expand Up @@ -410,7 +410,8 @@ SUBROUTINE beams3d_init_vmec
! Only master has Gfactor
ALLOCATE(Gfactor(ns_prof1))
DO s = 1, ns_prof1
sflx = REAL(s-1 + 0.5)/ns_prof1 ! Half grid rho
sflx = MIN(REAL(s-0.5)/h1_prof,1.0)
!sflx = REAL(s-1 + 0.5)/ns_prof1 ! Half grid rho
sflx = sflx*sflx
CALL EZspline_interp(ZEFF_spl_s,sflx,uflx,ier)
! sflx=s uflx=Zeff
Expand Down
5 changes: 3 additions & 2 deletions BEAMS3D/Sources/beams3d_lines.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ MODULE beams3d_lines
!-----------------------------------------------------------------------
USE stel_kinds, ONLY: rprec
USE beams3d_globals, ONLY: nparticles, ns_prof1, ns_prof2, &
ns_prof3, ns_prof4, ns_prof5, partvmax
ns_prof3, ns_prof4, ns_prof5, &
partvmax, rho_max_dist

!-----------------------------------------------------------------------
! Module Variables
Expand All @@ -32,7 +33,7 @@ MODULE beams3d_lines
myqm, rand_prob, cum_prob, tau, next_t, &
fact_crit, fact_pa, fact_vsound, fact_kick, &
fact_coul, fact_crit_pro, &
partpmax, h2_prof, h3_prof, h4_prof, h5_prof, r_h, &
partpmax, h1_prof, h2_prof, h3_prof, h4_prof, h5_prof, r_h, &
z_h, p_h, e_h, pi_h, E_by_v
LOGICAL, ALLOCATABLE :: neut_lines(:,:)
INTEGER, ALLOCATABLE :: end_state(:)
Expand Down
6 changes: 3 additions & 3 deletions BEAMS3D/Sources/beams3d_physics_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MODULE beams3d_physics_mod
end_state, fact_crit, fact_crit_pro, fact_pa, &
fact_vsound, fact_coul, fact_kick, &
ns_prof1, ns_prof2, ns_prof3, ns_prof4, &
ns_prof5, my_end
ns_prof5, my_end, h1_prof
USE beams3d_grid, ONLY: BR_spl, BZ_spl, delta_t, BPHI_spl, &
MODB_spl, MODB4D, &
phimax, S4D, X4D, Y4D, TE4D, NE4D, TI4D, ZEFF4D, &
Expand Down Expand Up @@ -387,7 +387,7 @@ SUBROUTINE beams3d_physics_gc(t, q)
q(4) = vll
RETURN
END IF
l = MAX(MIN(CEILING(SQRT(s_temp)*ns_prof1),ns_prof1),1)
l = MAX(MIN(CEILING(SQRT(s_temp)*h1_prof),ns_prof1),1)
epower_prof(mybeam,l) = epower_prof(mybeam,l) + mymass*dve*dt*speed*weight(myline)
ipower_prof(mybeam,l) = ipower_prof(mybeam,l) + mymass*dvi*dt*speed*weight(myline)
vll = vfrac*vll
Expand Down Expand Up @@ -617,7 +617,7 @@ SUBROUTINE beams3d_physics_fo(t, q)
q(6) = q(6) + vll*bz_temp
RETURN
END IF
l = MAX(MIN(CEILING(SQRT(s_temp)*ns_prof1),ns_prof1),1)
l = MAX(MIN(CEILING(SQRT(s_temp)*h1_prof),ns_prof1),1)
epower_prof(mybeam,l) = epower_prof(mybeam,l) + mymass*dve*dt*speed*weight(myline)
ipower_prof(mybeam,l) = ipower_prof(mybeam,l) + mymass*dvi*dt*speed*weight(myline)
vll = vfrac*vll
Expand Down
28 changes: 14 additions & 14 deletions BEAMS3D/Sources/beams3d_write.f90
Original file line number Diff line number Diff line change
Expand Up @@ -299,48 +299,48 @@ SUBROUTINE beams3d_write(write_type)
ATT='Maximum velocity of dist func [m/s]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'partvmax',ier)
CALL write_scalar_hdf5(fid,'ns_prof1',ier,INTVAR=ns_prof1,&
ATT='Rho Dist. Grid Points [0,1]',ATT_NAME='description')
ATT='Rho Dist. Grid Points',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'ns_prof1',ier)
CALL write_scalar_hdf5(fid,'ns_prof2',ier,INTVAR=ns_prof2,&
ATT='U Dist. Grid Points [0,2pi]',ATT_NAME='description')
ATT='U (poloidal) Dist. Grid Points',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'ns_prof2',ier)
CALL write_scalar_hdf5(fid,'ns_prof3',ier,INTVAR=ns_prof3,&
ATT='PHI Dist. Grid Points [0,2pi]',ATT_NAME='description')
ATT='PHI (toroidal) Dist. Grid Points',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'ns_prof3',ier)
CALL write_scalar_hdf5(fid,'ns_prof4',ier,INTVAR=ns_prof4,&
ATT='VLL Dist. Grid Points[-vmax,vmax]',ATT_NAME='description')
ATT='Parallel Velocity Dist. Grid Points',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'ns_prof4',ier)
CALL write_scalar_hdf5(fid,'ns_prof5',ier,INTVAR=ns_prof5,&
ATT='Vperp Dist. Grid Points [0, vmax]',ATT_NAME='description')
ATT='Perpendicular Velocity Dist. Grid Points',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'ns_prof5',ier)
ALLOCATE(rtemp(ns_prof1))
FORALL(i = 1:ns_prof1) rtemp(i) = (DBLE(i)-0.5)/ns_prof1
FORALL(i = 1:ns_prof1) rtemp(i) = (DBLE(i)-0.5)*h1_prof
CALL write_var_hdf5(fid,'dist_rhoaxis',ns_prof1,ier,DBLVAR=rtemp,&
ATT='Rhoaxis (radial coordinate) from S_ARR [-]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'rhoaxis',ier)
ATT='Dist. Func. Radial Grid (r/a)',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'dist_rhoaxis',ier)
DEALLOCATE(rtemp)
ALLOCATE(rtemp(ns_prof2))
FORALL(i = 1:ns_prof2) rtemp(i) = (DBLE(i)-0.5)/ns_prof2*pi2
CALL write_var_hdf5(fid,'dist_uaxis',ns_prof2,ier,DBLVAR=rtemp,&
ATT='U-Axis (poloidal angle) [-]',ATT_NAME='description')
ATT='Dist. Func. Poloidal Grid (U) [rad]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'uaxis',ier)
DEALLOCATE(rtemp)
ALLOCATE(rtemp(ns_prof3))
FORALL(i = 1:ns_prof3) rtemp(i) = (DBLE(i)-0.5)/ns_prof3*pi2
CALL write_var_hdf5(fid,'dist_paxis',ns_prof3,ier,DBLVAR=rtemp,&
ATT='Phi-Axis (toroidal angle) [-]',ATT_NAME='description')
ATT='Dist. Func. Toridal Grid (phi) [rad]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'paxis',ier)
DEALLOCATE(rtemp)
ALLOCATE(rtemp(ns_prof4))
FORALL(i = 1:ns_prof4) rtemp(i) = 2*partvmax/(ns_prof4) * (DBLE(i)-0.5) - partvmax !partvmax* (2*(DBLE(i)-1)/ns_prof4-1)
CALL write_var_hdf5(fid,'dist_Vaxis',ns_prof4,ier,DBLVAR=rtemp,&
ATT='V-Axis (parallel velocity v_ll) [-]',ATT_NAME='description')
ATT='Dist. Func. Para. Velocity Grid (v_para) [m/s]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'vaxis',ier)
DEALLOCATE(rtemp)
ALLOCATE(rtemp(ns_prof5))
FORALL(i = 1:ns_prof5) rtemp(i) = (DBLE(i)-0.5)/ns_prof5*partvmax
CALL write_var_hdf5(fid,'dist_Waxis',ns_prof5,ier,DBLVAR=rtemp,&
ATT='W-Axis (perpendicular velocity v_perp) [-]',ATT_NAME='description')
ATT='Dist. Func. Perp. Velocity Grid (v_perp) [m/s]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'waxis',ier)
IF (ASSOCIATED(ndot_prof)) THEN
CALL write_var_hdf5(fid,'ndot_prof',nbeams,ns_prof1,ier,DBLVAR=ndot_prof,&
Expand Down Expand Up @@ -381,12 +381,12 @@ SUBROUTINE beams3d_write(write_type)
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'shine_port',ier)
END IF
IF (ASSOCIATED(NEUTRONS_ARR)) THEN
CALL write_var_hdf5(fid,'NEUTRON_RATE',nbeams,nr,nphi,nz,ier,DBLVAR=NEUTRONS_ARR,&
CALL write_var_hdf5(fid,'NEUTRON_RATE',2,nr,nphi,nz,ier,DBLVAR=NEUTRONS_ARR,&
ATT='Neutron Rate [m^-3]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'NEUTRONS_ARR',ier)
END IF
IF (ASSOCIATED(E_NEUTRONS)) THEN
CALL write_var_hdf5(fid,'E_NEUTRONS',nbeams,ier,DBLVAR=E_NEUTRONS,&
CALL write_var_hdf5(fid,'E_NEUTRONS',2,ier,DBLVAR=E_NEUTRONS,&
ATT='Neutron Energy [eV]',ATT_NAME='description')
IF (ier /= 0) CALL handle_err(HDF5_WRITE_ERR,'E_NEUTRONS',ier)
END IF
Expand Down
6 changes: 3 additions & 3 deletions BEAMS3D/Sources/fidasim_input_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MODULE fidasim_input_mod
ns_prof4, ns_prof5, dist5d_prof, &
partvmax, dist5D_fida, &
h2_prof, h3_prof, h4_prof, h5_prof, &
nsh_prof4, r_h, p_h, z_h, e_h, pi_h
nsh_prof4, r_h, p_h, z_h, e_h, pi_h, h1_prof
USE beams3d_grid, ONLY: nr, nphi, nz, B_R, B_PHI, B_Z, raxis, &
zaxis, phiaxis, POT_ARR, &
TE, TI, NE, npot, nte, nti, &
Expand Down Expand Up @@ -261,7 +261,7 @@ SUBROUTINE beams3d_write_fidasim(write_type)
IF (x0<0) x0 = x0 + pi2

! Calc dist func bins
l = MAX(MIN(CEILING(SQRT(y0)*ns_prof1 ), ns_prof1), 1) ! Rho Bin
l = MAX(MIN(CEILING(SQRT(y0)*h1_prof ), ns_prof1), 1) ! Rho Bin
m = MAX(MIN(CEILING( z0*h2_prof ), ns_prof2), 1) ! U Bin
n = MAX(MIN(CEILING( x0*h3_prof ), ns_prof3), 1) ! V Bin
rtemp(i,k,j) = SUM(dist5d_prof(:,l,m,n,:,:))!output in r-z-phi
Expand Down Expand Up @@ -347,7 +347,7 @@ SUBROUTINE beams3d_write_fidasim(write_type)
IF (x0<0) x0 = x0 + pi2

! Calc dist func bins
l = MAX(MIN(CEILING(SQRT(y0)*ns_prof1 ), ns_prof1), 1) ! Rho Bin
l = MAX(MIN(CEILING(SQRT(y0)*h1_prof ), ns_prof1), 1) ! Rho Bin
m = MAX(MIN(CEILING( z0*h2_prof ), ns_prof2), 1) ! U Bin
n = MAX(MIN(CEILING( x0*h3_prof ), ns_prof3), 1) ! V Bin
dist5d_fida(:,:,i,k,j) = dist5d_temp(l,m,n,:,:) !output in r-z-phi
Expand Down
4 changes: 2 additions & 2 deletions BEAMS3D/Sources/out_beams3d_nag.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SUBROUTINE out_beams3d_nag(t, q)
ns_prof5, mymass, mycharge, mybeam, end_state, &
dist5d_prof, dist5d_fida, win_dist5d, nsh_prof4, &
h2_prof, h3_prof, h4_prof, h5_prof, my_end, &
r_h, p_h, z_h, e_h, pi_h, E_by_v
r_h, p_h, z_h, e_h, pi_h, E_by_v, h1_prof
USE beams3d_grid
USE beams3d_physics_mod, ONLY: beams3d_physics_gc
USE wall_mod, ONLY: collide, get_wall_ik, get_wall_area
Expand Down Expand Up @@ -97,7 +97,7 @@ SUBROUTINE out_beams3d_nag(t, q)
IF (x0 < 0) x0 = x0 + pi2
IF (z0 < 0) z0 = z0 + pi2
vperp = SQRT(2*moment*fval(1)/mymass)
d1 = MAX(MIN(CEILING(rho_help*ns_prof1 ), ns_prof1), 1) ! Rho Bin
d1 = MAX(MIN(CEILING(rho_help*h1_prof ), ns_prof1), 1) ! Rho Bin
d2 = MAX(MIN(CEILING( z0*h2_prof ), ns_prof2), 1) ! U Bin
d3 = MAX(MIN(CEILING( x0*h3_prof ), ns_prof3), 1) ! V Bin
d4 = MAX(MIN(1+nsh_prof4+FLOOR(h4_prof*q(4)), ns_prof4), 1) ! vll
Expand Down
4 changes: 2 additions & 2 deletions BEAMS3D/Sources/outpart_beams3d_nag.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SUBROUTINE outpart_beams3d_nag(t, q)
ns_prof5, mymass, mycharge, mybeam, end_state, &
dist5d_prof, dist5d_fida, win_dist5d, nsh_prof4, &
h2_prof, h3_prof, h4_prof, h5_prof, my_end, &
r_h, p_h, z_h, e_h, pi_h, E_by_v
r_h, p_h, z_h, e_h, pi_h, E_by_v, h1_prof
USE beams3d_grid
USE beams3d_physics_mod, ONLY: beams3d_physics_fo
USE wall_mod, ONLY: collide, get_wall_ik, get_wall_area
Expand Down Expand Up @@ -122,7 +122,7 @@ SUBROUTINE outpart_beams3d_nag(t, q)
! Calc dist func bins
x0 = MOD(q(2),pi2)
IF (x0 < 0) x0 = x0 + pi2
d1 = MAX(MIN(CEILING(SQRT(y0)*ns_prof1 ), ns_prof1), 1) ! Rho Bin
d1 = MAX(MIN(CEILING(SQRT(y0)*h1_prof ), ns_prof1), 1) ! Rho Bin
d2 = MAX(MIN(CEILING( z0*h2_prof ), ns_prof2), 1) ! U Bin
d3 = MAX(MIN(CEILING( x0*h3_prof ), ns_prof3), 1) ! V Bin
d4 = MAX(MIN(1+nsh_prof4+FLOOR(h4_prof*vll_temp), ns_prof4), 1) ! vll
Expand Down
Loading