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

Runtime error with nagfor #60

Closed awvwgk closed 2 years ago

awvwgk commented 2 years ago

Testing with NAG's Fortran compiler yields runtime errors due to arithmetic exceptions

❯ nagfor
NAG Fortran Compiler Release 7.1(Hanzomon) Build 7104
❯ fpm test --compiler nagfor test_lmder
...
Runtime Error: *** Arithmetic exception: Floating overflow - aborting
test/test_lmder.f90, line 904: Error occurred in TEST:SSQFCN
test/test_lmder.f90, line 118: Called by TEST:FCN
././src/minpack.f90, line 1737: Called by MINPACK_MODULE:LMDER
././src/minpack.f90, line 1921: Called by MINPACK_MODULE:LMDER1
test/test_lmder.f90, line 63: Called by TEST
 <ERROR> Execution failed for "test_lmder"
STOP 1
❯ fpm test --compiler nagfor test_lmdif
...
Runtime Error: *** Arithmetic exception: Floating overflow - aborting
test/test_lmdif.f90, line 370: Error occurred in SSQFCN
test/test_lmdif.f90, line 122: Called by FCN
././src/minpack.f90, line 2207: Called by MINPACK_MODULE:LMDIF
././src/minpack.f90, line 2383: Called by MINPACK_MODULE:LMDIF1
test/test_lmdif.f90, line 74: Called by TEST
 <ERROR> Execution failed for "test_lmdif"
STOP 1
jacobwilliams commented 2 years ago

Note: I also see some these Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG warnings with gfortran on my Mac.

Need to investigate. Note: the original version of the code also had this. You can verify by running the scripts/validate.sh script in my test refactor branch. So it isn't something we caused in the refactoring.

jacobwilliams commented 2 years ago

Can you try this with the latest commit from #40? (or wait until we merge to main).