Skip to content

Commit

Permalink
Merge pull request #65 from jacobwilliams/64-iflag
Browse files Browse the repository at this point in the history
fixed iflag argument intents for fdjac1 and fdjac2
  • Loading branch information
jacobwilliams authored Apr 5, 2022
2 parents 4717189 + fb8c03b commit fa4bcbd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/minpack.f90
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ subroutine fdjac1(fcn, n, x, Fvec, Fjac, Ldfjac, Iflag, Ml, Mu, Epsfcn, Wa1, Wa2
!! of functions and variables.
integer, intent(in) :: Ldfjac !! a positive integer input variable not less than n
!! which specifies the leading dimension of the array fjac.
integer, intent(out) :: Iflag !! an integer variable which can be used to terminate
integer, intent(inout) :: Iflag !! an integer variable which can be used to terminate
!! the execution of fdjac1. see description of [[func]].
integer, intent(in) :: Ml !! a nonnegative integer input variable which specifies
!! the number of subdiagonals within the band of the
Expand Down Expand Up @@ -482,7 +482,6 @@ subroutine fdjac1(fcn, n, x, Fvec, Fjac, Ldfjac, Iflag, Ml, Mu, Epsfcn, Wa1, Wa2
if (h == zero) h = eps
x(j) = Wa2(j) + h
end do
Iflag = 1 ! JW added
call fcn(n, x, Wa1, Iflag)
if (Iflag < 0) return
do j = k, n, msum
Expand All @@ -502,7 +501,6 @@ subroutine fdjac1(fcn, n, x, Fvec, Fjac, Ldfjac, Iflag, Ml, Mu, Epsfcn, Wa1, Wa2
h = eps*abs(temp)
if (h == zero) h = eps
x(j) = temp + h
Iflag = 1 ! JW added
call fcn(n, x, Wa1, Iflag)
if (Iflag < 0) return
x(j) = temp
Expand Down Expand Up @@ -533,7 +531,7 @@ subroutine fdjac2(fcn, m, n, x, Fvec, Fjac, Ldfjac, Iflag, Epsfcn, Wa)
!! of variables. n must not exceed m.
integer, intent(in) :: Ldfjac !! a positive integer input variable not less than m
!! which specifies the leading dimension of the array fjac.
integer, intent(out) :: Iflag !! an integer variable which can be used to terminate
integer, intent(inout) :: Iflag !! an integer variable which can be used to terminate
!! the execution of fdjac2. see description of [[func2]].
real(wp), intent(in) :: Epsfcn !! an input variable used in determining a suitable
!! step length for the forward-difference approximation. this
Expand Down

0 comments on commit fa4bcbd

Please sign in to comment.