Skip to content

Commit

Permalink
Ported changes from n3lo branch
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkarlberg committed Jul 16, 2024
1 parent f255242 commit aa7e8fc
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions src/structure_functions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,17 @@ subroutine InitStrFct(order, separate_orders, xR, xF, flavour_decomposition)
! Now we set up the tables. HoppetStart already called, so we can copy over the structure
call AllocPdfTable(sf_tables, tables(0))
if(inc_flavour_decomposition) call AllocPdfTable(sf_tables_flav, tables(0))
! Finally we need to set tab_iflv_max = 7. We don't change sf_tables(0) as it contains the PDF
sf_tables(0) = tables(0)
sf_tables_flav(0) = tables(0)
! Finally we need to set tab_iflv_max = 7. We don't change tables(0) as it contains the PDF
!sf_tables(0) = tables(0)
!sf_tables_flav(0) = tables(0)
sf_tables(1:)%tab_iflv_max = 7
if(inc_flavour_decomposition) sf_tables_flav(1:)%tab_iflv_max = 6
sf_alloc_already_done = .true. ! Signals that the tables have been set up.

! To turn off b quarks completely (only for testing and comparison)
! uncomment following two lines:
! sf_tables(0)%tab(:,-5,:) = zero
! sf_tables(0)%tab(:,+5,:) = zero
! tables(0)%tab(:,-5,:) = zero
! tables(0)%tab(:,+5,:) = zero

! default is to sum each order before convolutions (it's faster)
if (scale_choice_save == scale_choice_arbitrary) then
Expand Down Expand Up @@ -497,10 +497,10 @@ subroutine set_structure_functions_upto (order)
real(dp) :: PNLOLO_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: PLO3_f(0:grid%ny,ncompmin:ncompmax)

do iQ = 0, sf_tables(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(sf_tables(0),sf_muF(Q),f)
Q = tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
call set_scale_logs(Q)

as2pi = alphasLocal(sf_muR(Q)) / (twopi)
Expand Down Expand Up @@ -619,10 +619,10 @@ subroutine set_structure_functions_upto_flav (order)
real(dp) :: PNLOLO_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: PLO3_f(0:grid%ny,ncompmin:ncompmax)

do iQ = 0, sf_tables_flav(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables_flav(0)%Q_vals(iQ)
call EvalPdfTable_Q(sf_tables_flav(0),sf_muF(Q),f)
Q = tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
call set_scale_logs(Q)

as2pi = alphasLocal(sf_muR(Q)) / (twopi)
Expand Down Expand Up @@ -678,10 +678,10 @@ subroutine set_LO_structure_functions()

! all coefficient functions at LO are delta functions (F2, FL and F3),
! so simply pass table(0) for each of the pieces
do iQ = 0, sf_tables(0)%nQ
Q = sf_tables(0)%Q_vals(iQ)
do iQ = 0, tables(0)%nQ
Q = tables(0)%Q_vals(iQ)
! explicitly evaluate the PDF at scale sf_muF(Q)
call EvalPdfTable_Q(sf_tables(0),sf_muF(Q),f)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
if (use_mass_thresholds) then
call use_vfns(f, Q)
endif
Expand All @@ -699,10 +699,10 @@ subroutine set_LO_structure_functions_flav()

! all coefficient functions at LO are delta functions (F2, FL and F3),
! so simply pass table(0) for each of the pieces
do iQ = 0, sf_tables_flav(0)%nQ
Q = sf_tables_flav(0)%Q_vals(iQ)
do iQ = 0, tables(0)%nQ
Q = tables(0)%Q_vals(iQ)
! explicitly evaluate the PDF at scale sf_muF(Q)
call EvalPdfTable_Q(sf_tables_flav(0),sf_muF(Q),f)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
if (use_mass_thresholds) then
call use_vfns(f, Q)
endif
Expand All @@ -721,11 +721,11 @@ subroutine set_LO_structure_functions_anyscale()

! all coefficient functions at LO are delta functions (F2, FL and F3),
! so simply pass table(0) for each of the pieces
do iQ = 0, sf_tables(0)%nQ
f = sf_tables(0)%tab(:,:,iQ)
do iQ = 0, tables(0)%nQ
f = tables(0)%tab(:,:,iQ)

if (use_mass_thresholds) then
call use_vfns(f, sf_tables(0)%Q_vals(iQ))
call use_vfns(f, tables(0)%Q_vals(iQ))
endif

sf_tables(1)%tab(:,:,iQ) = structure_function_general(&
Expand All @@ -743,11 +743,11 @@ subroutine set_LO_structure_functions_anyscale_flav()

! all coefficient functions at LO are delta functions (F2, FL and F3),
! so simply pass table(0) for each of the pieces
do iQ = 0, sf_tables_flav(0)%nQ
f = sf_tables_flav(0)%tab(:,:,iQ)
do iQ = 0, tables(0)%nQ
f = tables(0)%tab(:,:,iQ)

if (use_mass_thresholds) then
call use_vfns(f, sf_tables_flav(0)%Q_vals(iQ))
call use_vfns(f, tables(0)%Q_vals(iQ))
endif

sf_tables_flav(1)%tab(:,:,iQ) = ch%CLLO*f
Expand All @@ -768,10 +768,10 @@ subroutine set_NLO_structure_functions()
real(dp) :: PLO_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(sf_tables(0),sf_muF(Q),f)
Q = tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
call set_scale_logs(Q)

if (use_mass_thresholds) then
Expand Down Expand Up @@ -811,10 +811,10 @@ subroutine set_NLO_structure_functions_flav()
real(dp) :: PLO_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables_flav(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables_flav(0)%Q_vals(iQ)
call EvalPdfTable_Q(sf_tables_flav(0),sf_muF(Q),f)
Q = tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
call set_scale_logs(Q)

if (use_mass_thresholds) then
Expand Down Expand Up @@ -856,10 +856,10 @@ subroutine set_NLO_structure_functions_anyscale()
real(dp) :: PLO_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables(0)%nQ
do iQ = 0, tables(0)%nQ
! Internal Q value effectively corresponds to sf_muF(Q1,Q2)
Q = sf_tables(0)%Q_vals(iQ)
f = sf_tables(0)%tab(:,:,iQ)
Q = tables(0)%Q_vals(iQ)
f = tables(0)%tab(:,:,iQ)

! Save the NLO pieces in sf_tables(2) and sf_tables(3)

Expand Down Expand Up @@ -890,10 +890,10 @@ subroutine set_NLO_structure_functions_anyscale_flav()
real(dp) :: PLO_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables_flav(0)%nQ
do iQ = 0, tables(0)%nQ
! Internal Q value effectively corresponds to sf_muF(Q1,Q2)
Q = sf_tables_flav(0)%Q_vals(iQ)
f = sf_tables_flav(0)%tab(:,:,iQ)
Q = tables(0)%Q_vals(iQ)
f = tables(0)%tab(:,:,iQ)

! Save the NLO pieces in sf_tables(2) and sf_tables(3)

Expand Down Expand Up @@ -947,10 +947,10 @@ subroutine set_NNLO_structure_functions()
real(dp) :: PLO2_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(sf_tables(0),sf_muF(Q),f)
Q = tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
call set_scale_logs(Q)

if (use_mass_thresholds) then
Expand Down Expand Up @@ -1027,10 +1027,10 @@ subroutine set_NNLO_structure_functions_anyscale()
real(dp) :: PLO2_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables(0)%Q_vals(iQ)
f = sf_tables(0)%tab(:,:,iQ)
Q = tables(0)%Q_vals(iQ)
f = tables(0)%tab(:,:,iQ)

! save the NNLO pieces in sf_tables(4:7)

Expand Down Expand Up @@ -1086,10 +1086,10 @@ subroutine set_N3LO_structure_functions()
real(dp) :: PLO3_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(sf_tables(0),sf_muF(Q),f)
Q = tables(0)%Q_vals(iQ)
call EvalPdfTable_Q(tables(0),sf_muF(Q),f)
call set_scale_logs(Q)

if (use_mass_thresholds) then
Expand Down Expand Up @@ -1203,10 +1203,10 @@ subroutine set_N3LO_structure_functions_anyscale()
real(dp) :: PLO3_f(0:grid%ny,ncompmin:ncompmax)
real(dp) :: Q

do iQ = 0, sf_tables(0)%nQ
do iQ = 0, tables(0)%nQ

Q = sf_tables(0)%Q_vals(iQ)
f = sf_tables(0)%tab(:,:,iQ)
Q = tables(0)%Q_vals(iQ)
f = tables(0)%tab(:,:,iQ)

! save the N3LO pieces in sf_tables(8:15)

Expand Down Expand Up @@ -2022,7 +2022,7 @@ subroutine rescale_pdf_n3lo (Qval, order)
factor = 1.0_dp
if (f2n3lo.gt.0.0_dp) factor = f2nnlo/f2n3lo
do ii = ncompmin, ncompmax
sf_tables(0)%tab(iy,ii,:) = sf_tables(0)%tab(iy,ii,:) * factor
tables(0)%tab(iy,ii,:) = tables(0)%tab(iy,ii,:) * factor
enddo

enddo
Expand Down Expand Up @@ -2063,7 +2063,7 @@ subroutine rescale_pdf_nnlo (Qval, order)
factor = 1.0_dp
if (f2nnlo.gt.0.0_dp) factor = f2nlo/f2nnlo
do ii = ncompmin, ncompmax
sf_tables(0)%tab(iy,ii,:) = sf_tables(0)%tab(iy,ii,:) * factor
tables(0)%tab(iy,ii,:) = tables(0)%tab(iy,ii,:) * factor
enddo
enddo

Expand Down

0 comments on commit aa7e8fc

Please sign in to comment.