Skip to content

Commit f819400

Browse files
committed
fixed gfortran 11.1 crash in test case
minor changes and readme updates
1 parent f800340 commit f819400

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,16 @@ fpm test --profile release
193193
To generate the documentation using [ford](https://github.com/Fortran-FOSS-Programmers/ford), run:
194194

195195
```
196-
FoBis.py rule --execute makedoc -f ddeabm.fobis
196+
ford ddeabm.md
197197
```
198198

199199
## Documentation
200200

201-
The latest API documentation can be found [here](http://jacobwilliams.github.io/ddeabm/). This was generated from the source code using [FORD](https://github.com/Fortran-FOSS-Programmers/ford) (note that the included `build.sh` script will also generate these files).
201+
The latest API documentation can be found [here](http://jacobwilliams.github.io/ddeabm/). This was generated from the source code using [FORD](https://github.com/Fortran-FOSS-Programmers/ford).
202202

203203
## License
204204

205-
The ddeabm source code and related files and documentation are distributed under a permissive free software [license](https://github.com/jacobwilliams/ddeabm/blob/master/LICENSE) (BSD-style). The original DDEABM Fortran 77 code is [public domain](http://www.netlib.org/slatec/guide).
205+
The DDEABM source code and related files and documentation are distributed under a permissive free software [license](https://github.com/jacobwilliams/ddeabm/blob/master/LICENSE) (BSD-style). The original DDEABM Fortran 77 code is [public domain](http://www.netlib.org/slatec/guide).
206206

207207
## Keywords
208208

src/ddeabm_module.f90

+16-19
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,15 @@ module ddeabm_module
239239

240240
subroutine deriv_func(me,t,x,xdot)
241241
!! Interface to the [[ddeabm_class]] derivative function.
242+
!!
243+
!! Known as `df` in the documentation. provided by the user
244+
!! to define the system of first order differential equations
245+
!! which is to be solved. for the given values of t and the
246+
!! vector x(*)=(x(1),x(2),...,x(neq)), the subroutine must
247+
!! evaluate the neq components of the system of differential
248+
!! equations dx/dt=df(t,x) and store the derivatives in the
249+
!! array xdot(*), that is, xdot(i) = dx(i)/dt for
250+
!! equations i=1,...,neq.
242251
import :: wp,ddeabm_class
243252
implicit none
244253
class(ddeabm_class),intent(inout) :: me
@@ -1525,9 +1534,6 @@ end subroutine ddeabm_with_event_wrapper_vec
15251534
!
15261535
! the parameters are
15271536
!
1528-
! df -- this is the name of a subroutine which you provide to
1529-
! define the differential equations.
1530-
!
15311537
! neq -- this is the number of (first order) differential
15321538
! equations to be integrated.
15331539
!
@@ -1564,20 +1570,6 @@ end subroutine ddeabm_with_event_wrapper_vec
15641570
! appropriate variables for the initialization of the problem, and
15651571
! give information about how you want the problem to be solved.
15661572
!
1567-
! df -- provide a subroutine of the form
1568-
! df(x,u,uprime)
1569-
! to define the system of first order differential equations
1570-
! which is to be solved. for the given values of x and the
1571-
! vector u(*)=(u(1),u(2),...,u(neq)), the subroutine must
1572-
! evaluate the neq components of the system of differential
1573-
! equations du/dx=df(x,u) and store the derivatives in the
1574-
! array uprime(*), that is, uprime(i) = du(i)/dx for
1575-
! equations i=1,...,neq.
1576-
!
1577-
! subroutine df must not alter x or u(*). you must declare
1578-
! the name df in an external statement in your program that
1579-
! calls ddeabm. you must dimension u and uprime in df.
1580-
!
15811573
! neq -- set it to the number of differential equations.
15821574
! (neq >= 1)
15831575
!
@@ -1914,8 +1906,13 @@ subroutine ddeabm (me,neq,t,y,tout,info,rtol,atol,idid)
19141906
implicit none
19151907

19161908
class(ddeabm_class),intent(inout) :: me
1917-
integer,intent(in) :: neq
1918-
real(wp),intent(inout) :: t
1909+
integer,intent(in) :: neq !! the number of (first order) differential
1910+
!! equations to be integrated. (neq >= 1)
1911+
real(wp),intent(inout) :: t !! value of the independent variable.
1912+
!! on input, set it to the initial point of
1913+
!! the integration. the code changes its value.
1914+
!! on output, the solution was successfully
1915+
!! advanced to the output value of t.
19191916
real(wp),dimension(neq),intent(inout) :: y
19201917
real(wp),intent(in) :: tout
19211918
integer,dimension(4),intent(inout) :: info

tests/ddeabm_test_vec.f90

+5-1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ subroutine twobody_event(me,t,x,g,ig)
176176
integer,intent(in),optional :: ig !! the event function to compute
177177

178178
logical,dimension(ng) :: compute
179+
integer :: i !! counter
179180

180181
if (.not. present(ig)) then
181182
compute = .true. ! compute them all
@@ -184,7 +185,10 @@ subroutine twobody_event(me,t,x,g,ig)
184185
compute(ig) = .true. ! only compute this one
185186
end if
186187

187-
where (compute) g = r_target - x
188+
!where (compute) g = r_target - x ! gfortran 11.1 is crashing here.
189+
do i = 1, ng
190+
if (compute(i)) g(i) = r_target(i) - x(i)
191+
end do
188192

189193
end subroutine twobody_event
190194
!*********************************************************

0 commit comments

Comments
 (0)