Skip to content

Commit

Permalink
Work around compiler bug in later version of gfortran.
Browse files Browse the repository at this point in the history
  • Loading branch information
cianciosa committed Sep 9, 2024
1 parent d684a06 commit b00a0c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ target_link_libraries (stell
$<$<AND:$<BOOL:${LAPACK_FOUND}>,$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.18>>:LAPACK::LAPACK>
$<$<AND:$<BOOL:${BLAS_FOUND}>,$<VERSION_LESS:${CMAKE_VERSION},3.18>>:${BLAS_LIBRARIES}>
$<$<AND:$<BOOL:${LAPACK_FOUND}>,$<VERSION_LESS:${CMAKE_VERSION},3.18>>:${LAPACK_LIBRARIES}>
# sanitizer
# traps
# checks
)
target_include_directories (stell

Expand Down
2 changes: 1 addition & 1 deletion Sources/Miscel/line_segment.f
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ PURE FUNCTION y_value_int(x0, x1, yy, xx, ilow, ihigh)
y_value_int = 0.0
ELSE
y_value_int = slope(yy, xx, ilow, ihigh) &
& / 2.0*(x1**2.0 - x0**2.0) &
& / 2.0*(x1*x1 - x0*x0) &
& + offset(yy, xx, ilow, ihigh)*(x1 - x0)
END IF

Expand Down
18 changes: 8 additions & 10 deletions Sources/Modules/integration_path.f
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ MODULE integration_path
!> @param[in] length Length of the interval.
!> @returns A pointer to a constructed @ref integration_path_class object.
!-------------------------------------------------------------------------------
FUNCTION make_integrator(method, npoints, length)
FUNCTION make_integrator(method, npoints, length) RESULT(res)

IMPLICIT NONE

! Declare Arguments
CLASS (integration_path_class), POINTER :: make_integrator
CLASS (integration_path_class), POINTER :: res
CHARACTER (len=*), INTENT(in) :: method
INTEGER, INTENT(in) :: npoints
REAL (rprec), INTENT(in) :: length
Expand All @@ -179,14 +179,13 @@ FUNCTION make_integrator(method, npoints, length)
SELECT CASE (method)

CASE ('add')
make_integrator => integration_path_class()
res => integration_path_class()

CASE ('gleg')
make_integrator => integration_path_gleg_class(npoints)
res => integration_path_gleg_class(npoints)

CASE ('hp_gleg')
make_integrator => integration_path_hp_glep_class(npoints, &
& length)
res => integration_path_hp_glep_class(npoints, length)

END SELECT

Expand Down Expand Up @@ -442,8 +441,8 @@ RECURSIVE FUNCTION integration_path_integrate_paths(this, path, &
start_time = profiler_get_start_time()

IF (ASSOCIATED(path%next)) THEN
total = this%integrate(path%next, context)
total = total + this%integrate(context, path, path%next)
total = this%integrate_paths(path%next, context) &
& + this%integrate_path(context, path, path%next)
ELSE
total = 0.0
END IF
Expand Down Expand Up @@ -997,8 +996,7 @@ FUNCTION path_test()
& (/ 2.0_rprec, 0.0_rprec, 0.0_rprec /))
CALL path_append_vertex(test_path, &
& (/ 0.0_rprec, 0.0_rprec, 0.0_rprec /))
result = integration_path_integrate_paths(int_params, test_path, &
& context)
result = int_params%integrate(test_path, context)
path_test = check(2.0_rprec, result, 1, 'path_integrate')
IF (.not.path_test) THEN
RETURN
Expand Down

0 comments on commit b00a0c8

Please sign in to comment.