Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Bug fixes uncovered when compiling in gfortran with coarrays turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed May 18, 2023
1 parent 4ed6bf4 commit 297dedf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/misc/solver_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -424,22 +424,25 @@ end function f
! returns the minimum of two real numbers
real(DP) Function Minimum(x1,x2)
real(DP) x1,x2,resultat

if (x1 < x2) then
resultat = x1
resultat = x1
else
resultat = x2
resultat = x2
endif

Minimum = resultat
end function Minimum

! TRUE if x1*x2 negative
integer Function RootBracketed(x1,x2)
logical Function RootBracketed(x1,x2)
real(DP) x1,x2
integer resultat
logical resultat

if ((x1 > 0.and.x2 > 0).or.(x1 < 0.and.x2 < 0)) then
resultat = 0
resultat = .false.
else
resultat = 1
resultat = .true.
endif
RootBracketed = resultat
end function RootBracketed
Expand Down
4 changes: 4 additions & 0 deletions src/netcdf_io/netcdf_io_implementations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ module subroutine netcdf_io_close(self)
character(namelen) :: message

if (self%lfile_is_open) then
#ifdef COARRAY
write(message,*) this_image()
message = "netcdf_io_close on image " // trim(adjustl(message))
#else
message = "netcdf_io_close"
#endif
call netcdf_io_check( nf90_close(self%id), message)
self%lfile_is_open = .false.
end if
Expand Down
2 changes: 2 additions & 0 deletions src/swiftest/swiftest_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ program swiftest_driver
param%integrator = trim(adjustl(integrator))
param%display_style = trim(adjustl(display_style))
call param%read_in(param_file_name)
#ifdef COARRAY
if (.not.param%lcoarray .and. (this_image() /= 1)) stop ! Single image mode
#endif

associate(t0 => param%t0, &
tstart => param%tstart, &
Expand Down

0 comments on commit 297dedf

Please sign in to comment.