To check all calls in a larger project, I copy all Fortran files together into one file for compilation. In case of an optional parameter I got a fatal error: error 326 - SUBROUTINE GETANGLE has been called with too few arguments. I made a small example:
SUBROUTINE CALLER1 ()
IMPLICIT NONE
REAL*8 Phi, Omega, Kappa
INTEGER iAerial
CALL getAngle (Phi, Omega, Kappa, iAerial)
RETURN
END
SUBROUTINE CALLER2 ()
IMPLICIT NONE
REAL*8 Phi, Omega, Kappa
CALL getAngle (Phi, Omega, Kappa)
RETURN
END
SUBROUTINE getAngle (Phi, Omega, Kappa, iAerial)
IMPLICIT NONE
Real*8, INTENT(OUT) :: Phi, Omega, Kappa
INTEGER, OPTIONAL :: iAerial
IF (PRESENT(iAerial)) GOTO 10
Phi = 1.0D0
Omega = 1.0D0
Kappa = 1.0D0
RETURN
10 Phi = 2.0D0
Omega = 2.0D0
Kappa = 2.0D0
RETURN
END SUBROUTINE getAngle
This provides just a worning: warning 673 - SUBROUTINE GETANGLE has been called with too few arguments If I change the sequence of the subroutines it works o.k.
Erwin