From 36e8fcb430c211318b0e74b1f9a28e23c220813c Mon Sep 17 00:00:00 2001 From: NRavoisin96 Date: Mon, 7 Oct 2024 15:42:41 +0100 Subject: [PATCH 1/2] Compilation error fix gfortran >= 13.2 --- NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 b/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 index 4b8aa0cfa..888898857 100644 --- a/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 +++ b/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 @@ -111,11 +111,16 @@ subroutine getMacroXSs_byP(self, xss, p) class(mgNeutronMaterial), intent(in) :: self type(neutronMacroXSs), intent(out) :: xss class(particle), intent(in) :: p + integer(shortInt) :: matIdx character(100), parameter :: Here = 'getMacroXSs_byP (mgNeutronMateerial_inter.f90)' if (.not. p % isMG) call fatalError(Here, 'CE particle was given to MG data') - associate (matCache => cache_materialCache(p % matIdx())) + !! + !! Here it is necessary to store p % matIdx() in a dedicated variable to avoid compilation errors with gfortran >= 13.2 + !! + matIdx = p % matIdx() + associate (matCache => cache_materialCache(matIdx)) if (matCache % G_tail /= p % G) then ! Get cross sections From 4a28285351bb5ccab47b9f3a2a705b32a0092cae Mon Sep 17 00:00:00 2001 From: valeriaRaffuzzi <108435337+valeriaRaffuzzi@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:59:24 +0000 Subject: [PATCH 2/2] Update compiler versions in Docker container (#142) undefined --- .github/workflows/build-and-test.yml | 12 ++++++------ .../Tests/baseMgNeutronDatabase_iTest.f90 | 9 +++++++-- .../mgNeutronData/mgNeutronMaterial_inter.f90 | 5 ++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7bb7a6a9e..33b4fc16c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -10,7 +10,7 @@ jobs: build-and-test: strategy: matrix: - compiler: [gfortran8, gfortran9, gfortran10] + compiler: [gfortran10, gfortran11, gfortran12] runs-on: ubuntu-20.04 container: image: mikolajkowalski/scone-test:${{matrix.compiler}}_pfu4 @@ -22,12 +22,12 @@ jobs: cd build cmake .. make -j - make test + ctest --output-on-faliure cd - build-and-test-debug: runs-on: ubuntu-20.04 container: - image: mikolajkowalski/scone-test:gfortran10_pfu4 + image: mikolajkowalski/scone-test:gfortran12_pfu4 steps: - uses: actions/checkout@v3 - name: CompileAndTest @@ -36,12 +36,12 @@ jobs: cd build cmake -DDEBUG=ON .. make -j - make test + ctest --output-on-faliure cd - build-and-test-no-openmp: runs-on: ubuntu-20.04 container: - image: mikolajkowalski/scone-test:gfortran10_pfu4 + image: mikolajkowalski/scone-test:gfortran12_pfu4 steps: - uses: actions/checkout@v3 - name: CompileAndTest @@ -50,5 +50,5 @@ jobs: cd build cmake -DOPENMP=OFF .. make -j - make test + ctest --output-on-faliure cd - diff --git a/NuclearData/mgNeutronData/baseMgNeutron/Tests/baseMgNeutronDatabase_iTest.f90 b/NuclearData/mgNeutronData/baseMgNeutron/Tests/baseMgNeutronDatabase_iTest.f90 index 5ce32ddca..daa6784d9 100644 --- a/NuclearData/mgNeutronData/baseMgNeutron/Tests/baseMgNeutronDatabase_iTest.f90 +++ b/NuclearData/mgNeutronData/baseMgNeutron/Tests/baseMgNeutronDatabase_iTest.f90 @@ -7,6 +7,7 @@ module baseMgNeutronDatabase_iTest use dictionary_class, only : dictionary use dictParser_func, only : charToDict use particle_class, only : particle + use RNG_class, only : RNG ! Nuclear Data Objects & Interfaces use baseMgNeutronDatabase_class, only : baseMgNeutronDatabase, baseMgNeutronDatabase_CptrCast, & @@ -59,12 +60,12 @@ subroutine testBaseMgNeutronDatabaseWithP0() type(dictionary) :: matMenuDict type(particle) :: p type(neutronMacroXSs) :: xss + type(RNG), target :: pRNG type(baseMgNeutronMaterial),pointer :: mat class(baseMgNeutronMaterial),pointer :: matClass class(reactionHandle), pointer :: reac real(defReal),parameter :: TOL = 1.0E-6_defReal - data_ptr => database ! Load materialMenu @@ -81,6 +82,8 @@ subroutine testBaseMgNeutronDatabaseWithP0() @assertEqual(4, database % nGroups()) ! Test getting Transport XS + ! Associate pointer to pass tests in debug mode + p % pRNG => pRNG p % G = 1 @assertEqual(2.1_defReal, database % getTrackingXS(p, 1, MATERIAL_XS), TOL) @@ -185,12 +188,12 @@ subroutine testBaseMgNeutronDatabaseWithP1() type(dictionary) :: matMenuDict type(particle) :: p type(neutronMacroXSs) :: xss + type(RNG), target :: pRNG type(baseMgNeutronMaterial),pointer :: mat class(baseMgNeutronMaterial),pointer :: matClass class(reactionHandle), pointer :: reac real(defReal),parameter :: TOL = 1.0E-6_defReal - data_ptr => database ! Load materialMenu @@ -207,6 +210,8 @@ subroutine testBaseMgNeutronDatabaseWithP1() @assertEqual(4, database % nGroups()) ! Test getting Transport XS + ! Associate pointer to pass tests in debug mode + p % pRNG => pRNG p % G = 1 @assertEqual(2.1_defReal, database % getTrackingXS(p, 1, MATERIAL_XS), TOL) diff --git a/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 b/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 index 888898857..daa90c37f 100644 --- a/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 +++ b/NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90 @@ -116,10 +116,9 @@ subroutine getMacroXSs_byP(self, xss, p) if (.not. p % isMG) call fatalError(Here, 'CE particle was given to MG data') - !! - !! Here it is necessary to store p % matIdx() in a dedicated variable to avoid compilation errors with gfortran >= 13.2 - !! + ! Store p % matIdx() in a dedicated variable to avoid compilation errors with gfortran >= 13.2 matIdx = p % matIdx() + associate (matCache => cache_materialCache(matIdx)) if (matCache % G_tail /= p % G) then