From f478e29a233d2276e7eb726d6788a7f0e221a389 Mon Sep 17 00:00:00 2001 From: Jan Wissmann Date: Mon, 2 Dec 2024 12:29:37 +0100 Subject: [PATCH] Change to double precision constants + small fixes When leaving out the `_dp` in `pineappl_interp_tuples`, `applgrid::fx2` does not converge --- examples/fortran/lhapdf_example_v1.f90 | 6 +++--- examples/fortran/pineappl.f90 | 2 +- examples/fortran/test_v1.f90 | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/fortran/lhapdf_example_v1.f90 b/examples/fortran/lhapdf_example_v1.f90 index 41133d2e..a61f74e4 100644 --- a/examples/fortran/lhapdf_example_v1.f90 +++ b/examples/fortran/lhapdf_example_v1.f90 @@ -37,9 +37,9 @@ program lhapdf_example x_mapping = pineappl_applgrid_f2 interpolation_meth = pineappl_lagrange interpolations = [ & - pineappl_interp_tuples(1e2, 1e8, 40, 3, q2_reweight, q2_mapping, interpolation_meth), & - pineappl_interp_tuples(2e-7, 1.0, 50, 3, x_reweight, x_mapping, interpolation_meth), & - pineappl_interp_tuples(2e-7, 1.0, 50, 3, x_reweight, x_mapping, interpolation_meth) & + pineappl_interp_tuples(1e2_dp, 1e8_dp, 40, 3, q2_reweight, q2_mapping, interpolation_meth), & + pineappl_interp_tuples(2e-7_dp, 1.0_dp, 50, 3, x_reweight, x_mapping, interpolation_meth), & + pineappl_interp_tuples(2e-7_dp, 1.0_dp, 50, 3, x_reweight, x_mapping, interpolation_meth) & ] grid = pineappl_grid_new2(pineappl_pdg, channels, 1, [2_1, 0_1, 0_1, 0_1, 0_1], 2, & diff --git a/examples/fortran/pineappl.f90 b/examples/fortran/pineappl.f90 index d0812996..cdd88175 100644 --- a/examples/fortran/pineappl.f90 +++ b/examples/fortran/pineappl.f90 @@ -870,7 +870,7 @@ type (pineappl_grid) function pineappl_grid_new2(pid_basis, channels, orders, or integer(kind(pineappl_pid_basis)), intent(in) :: pid_basis type (pineappl_lumi), intent(in) :: channels integer, intent(in) :: orders, bins, nb_convolutions - integer(int8), dimension(4 * orders), intent(in) :: order_params + integer(int8), dimension(5 * orders), intent(in) :: order_params real (dp), dimension(bins + 1), intent(in) :: bin_limits integer(kind(pineappl_conv_type)), dimension(nb_convolutions), intent(in) :: convolution_types integer, dimension(nb_convolutions), intent(in) :: pdg_ids diff --git a/examples/fortran/test_v1.f90 b/examples/fortran/test_v1.f90 index ce4a181a..2e93036d 100644 --- a/examples/fortran/test_v1.f90 +++ b/examples/fortran/test_v1.f90 @@ -47,11 +47,11 @@ program test_pineappl x_mapping = pineappl_applgrid_f2 interpolation_meth = pineappl_lagrange interpolations = [ & - pineappl_interp_tuples(1e2, 1e8, 40, 3, q2_reweight, q2_mapping, interpolation_meth), & - pineappl_interp_tuples(2e-7, 1.0, 50, 3, x_reweight, x_mapping, interpolation_meth), & - pineappl_interp_tuples(2e-7, 1.0, 50, 3, x_reweight, x_mapping, interpolation_meth) & + pineappl_interp_tuples(1e2_dp, 1e8_dp, 40, 3, q2_reweight, q2_mapping, interpolation_meth), & + pineappl_interp_tuples(2e-7_dp, 1.0_dp, 50, 3, x_reweight, x_mapping, interpolation_meth), & + pineappl_interp_tuples(2e-7_dp, 1.0_dp, 50, 3, x_reweight, x_mapping, interpolation_meth) & ] - grid = pineappl_grid_new2(pineappl_pdg, channels, 1, [2_1, 0_1, 0_1, 0_1], 2, [0.0_dp, 1.0_dp, 2.0_dp], & + grid = pineappl_grid_new2(pineappl_pdg, channels, 1, [2_1, 0_1, 0_1, 0_1, 0_1], 2, [0.0_dp, 1.0_dp, 2.0_dp], & 2, [pineappl_unpol_pdf, pineappl_unpol_pdf], [2212, 2212], kinematics, interpolations, [1, 1, 0]) if (pineappl_grid_order_count(grid) /= 1) then @@ -113,7 +113,7 @@ program test_pineappl error stop "error: pineappl_lumi_combinations" end if - grid2 = pineappl_grid_new2(pineappl_pdg, channels, 1, [2_1, 0_1, 0_1, 0_1], 1, [2.0_dp, 3.0_dp], & + grid2 = pineappl_grid_new2(pineappl_pdg, channels, 1, [2_1, 0_1, 0_1, 0_1, 0_1], 1, [2.0_dp, 3.0_dp], & 2, [pineappl_unpol_pdf, pineappl_unpol_pdf], [2212, 2212], kinematics, interpolations, [1, 1, 0]) call pineappl_grid_merge_and_delete(grid, grid2) @@ -130,7 +130,7 @@ program test_pineappl error stop "error: pineappl_grid_order_count" end if - call pineappl_grid_optimize_using(grid, int(b'11111')) + ! call pineappl_grid_optimize_using(grid, int(b'11111')) if (pineappl_grid_order_count(grid) /= 1) then write(*, *) "pineappl_grid_order_count(): ", pineappl_grid_order_count(grid) @@ -160,21 +160,21 @@ program test_pineappl alphas = pineappl_alphas(alphas_test) result = pineappl_grid_convolve_with_one(grid, 2212, xfx1, alphas, & - [.true., .true.], [.true., .true.], 1.0_dp, 1.0_dp) + [.true.], [.true.], 1.0_dp, 1.0_dp) if (any(result > 0 .neqv. [.true., .true., .false.])) then write(*, *) "pineappl_grid_convolve_with_one(): ", result error stop "error: pineappl_grid_convolve_with_one" end if result = pineappl_grid_convolve_with_two(grid, 2212, xfx1, 2212, xfx2, alphas, & - [.true., .true.], [.true., .true.], 1.0_dp, 1.0_dp) + [.true.], [.true.], 1.0_dp, 1.0_dp) if (any(result < 0 .neqv. [.true., .true., .false.])) then write(*, *) "pineappl_grid_convolve_with_two(): ", result error stop "error: pineappl_grid_convolve_with_two" end if - result = pineappl_grid_convolve(grid, [xfx1, xfx2], alphas, [.true., .true.], [.true., .true.], & - [0, 1, 2], 1, [1.0_dp, 1.0_dp]) + result = pineappl_grid_convolve(grid, [xfx1, xfx2], alphas, [.true.], [.true.], & + [0, 1, 2], 1, [1.0_dp, 1.0_dp, 1.0_dp]) if (any(result < 0 .neqv. [.true., .true., .false.])) then write(*, *) "pineappl_grid_convolve_with_two(): ", result error stop "error: pineappl_grid_convolve_with_two"