fortran-lang / minpack

Modernized Minpack: for solving nonlinear equations and nonlinear least squares problems
https://fortran-lang.github.io/minpack/
Other
94 stars 20 forks source link

Wrong intent for arguments to FCN() in example_lmder1.f90 #21

Closed certik closed 2 years ago

certik commented 2 years ago

Reported by @xecej4:

The INTENT of arguments fvec and fjac of subroutine FCN should be changed from OUT to IN OUT. As of now, when the subroutine is entered with iflag = 1, fjac becomes undefined; when entered with iflag = another value, fvec becomes undefined.

This subtle difference matters when flags such as NAG's -C=undefined or FTN95's /undef are used.

Transferred from https://github.com/certik/minpack/issues/7

ivan-pi commented 2 years ago

This also pops up on the Python side, see https://github.com/scipy/scipy/issues/9765