f2c - FORTRAN to C
I am surprised by Stuart's reported remarks. It is absurd to say
"There's no way one can verify whether FORTRAN->C works correctly". For
the particular model I tested the verification was simply that I got the
same results from the f2c translation that I got from the original
FORTRAN.
Of course, Stuart may have meant that there is no way one verify the
correct operation 'in general'. To which I would reply that there is no
way one can verify the correct operation of the FORTRAN code 'in
general'. It has been my experience that not all FORTRAN compilers can
be relied upon to produce the same answers from identical FORTRAN source code.
Here are some condensed results on the identical problem run on an
hp730, an iris4d (FORTRAN) and iris4dc (C from f2c), and a sun4. Notice
that 3 different FORTRAN compilers use different numbers of func evals
and claim different numbers of sig figs. The FORTRAN was from NONMEM
version 3 and the problems were run in 1992. NONMEM has changed since
then and it is quite likely that f2c has been enhanced also. Run times
are hh:mm:sec except for the hp730 which didnt need hh!
hp730O2.lst 22012.500 eval=720 sig=3.6 sub=909 obs=5253
THETA = 28.7 0.0169 -0.0374 -1.42 0c 20.9 61 1.58 13.5 0.001c 1.08 1.76 2.78 1c 1c 1c 1c 1c 1c 1c
ETASD = 0.376829 2.08087 1.25698 1.27671 0 0 0 0 0
ETAR12 = 0.310
ETAR23 = 0.374 0.520
ERRSD = 3.13847 0 0
THETA:se = 0.444 0.00348 0.00838 0.199 0c 6 28.6 0.564 3.43 0c 0.029 0.25 1.09 0c 0c 0c 0c 0c 0c 0c
ETASD:se = 0.0782304 1.41421 0.735527 0.697137
ERRSD:se = 0.614817 0 0
MINIMIZATION ROUTINE SUCCESSFULLY TERMINATED
Jun 17 09:17 user 42:16.1 real 42:52.5
iris4dO2.lst 22012.500 eval=1010 sig=5.2 sub=909 obs=5253
THETA = 28.7 0.0169 -0.0374 -1.42 0c 20.9 61 1.58 13.5 0.001c 1.08 1.76 2.78 1c 1c 1c 1c 1c 1c 1c
ETASD = 0.376829 2.08087 1.25698 1.27671 0 0 0 0 0
ETAR12 = 0.310
ETAR23 = 0.374 0.520
ERRSD = 3.13847 0 0
THETA:se = 0.444 0.00348 0.00838 0.199 0c 6 28.6 0.564 3.43 0c 0.029 0.25 1.09 0c 0c 0c 0c 0c 0c 0c
ETASD:se = 0.0782304 1.41421 0.735527 0.697137
ERRSD:se = 0.614817 0 0
MINIMIZATION ROUTINE TERMINATED
DUE TO MAX. NO. OF FUNCTION EVALUATIONS EXCEEDED
Jun 14 22:14 user 2:15:50.2 real 15:19:22.5
iris4dO2c.lst 22012.500 eval=701 sig=4.5 sub=909 obs=5253
THETA = 28.7 0.0169 -0.0374 -1.42 0c 20.9 61 1.58 13.5 0.001c 1.08 1.76 2.78 1c 1c 1c 1c 1c 1c 1c
ETASD = 0.376829 2.08087 1.25698 1.27671 0 0 0 0 0
ETAR12 = 0.310
ETAR23 = 0.374 0.520
ERRSD = 3.13847 0 0
THETA:se = 0.444 0.00348 0.00838 0.199 0c 6 28.6 0.564 3.43 0c 0.029 0.25 1.09 0c 0c 0c 0c 0c 0c 0c
ETASD:se = 0.0782304 1.41421 0.735527 0.697137
ERRSD:se = 0.614817 0 0
MINIMIZATION ROUTINE SUCCESSFULLY TERMINATED
May 1 22:27 user 2:03:08.9 real 2:16:39.8
sun4O2.lst 22012.500 eval=682 sig=3.8 sub=909 obs=5253
THETA = 28.7 0.0169 -0.0374 -1.42 0c 20.9 61 1.58 13.5 0.001c 1.08 1.76 2.78 1c 1c 1c 1c 1c 1c 1c
ETASD = 0.376829 2.08087 1.25698 1.27671 0 0 0 0 0
ETAR12 = 0.310
ETAR23 = 0.374 0.520
ERRSD = 3.13847 0 0
THETA:se = 0.444 0.00348 0.00838 0.199 0c 6 28.6 0.564 3.43 0c 0.029 0.25 1.09 0c 0c 0c 0c 0c 0c 0c
ETASD:se = 0.0782304 1.41421 0.735527 0.697137
ERRSD:se = 0.614817 0 0
MINIMIZATION ROUTINE SUCCESSFULLY TERMINATED
May 4 12:45 user 4:14:40.0 real 4:73:20.0
I also dont see the point of trying to stop the use of f2c. If someone
found a problem that was attributable to an error in the translation I
would not be surprised if it did not point to a weakness in the way that
the original FORTRAN was coded and NONMEM might be improved by
attempting to make that section of code more robust.
I must also retract my earlier statement that the f2c C source was
slower than the FORTRAN sourced executable. The time per function eval
was slower from the C code but the overall run time was faster with C
code because fewer func evals were required to complete the problem.
[See
topic 13
]