> ....
OK, given the previous caveats, and on the assumption you can/will
figure out some way to verify the results are as expected, the following
would have at least a chance of working...and this is not intended as a
tutorial of how I might code such a routine; only that this should work
(w/ the assumption of default REALs being correct) and a F77-level
compiler. NB: Fortran is _not_ case-sensitive (so Tau and TAU and tau
are all seen internally to the compiler as "TAU") and F77 didn't include
lowercase at all. But, afaik there is no F77 compiler that doesn't
include accepting lowercase in source code so I've not modified your
typing in that regards.
Note I've switched the logic
SUBROUTINE ADD(Tau,m,k,Sigma,Mu,n)
IMPLICIT NONE
REAL Tau,m,k,Sigma,Mu,n
Tau =m*k*SQRT(1.0-EXP((-Sigma*Mu)/(m*K))**n)
RETURN
END
At a minimum, that should work and as before I'm not sure I'd put the
constraints in here but instead expect the routine to be called where I
knew them to be within reasonable bounds. But, since this is a packaged
program it may not be that you can control that and do need to deal with
it. I'd think there would be a defined error interface; if so you
should use it. If not, the following will stop the application; crude
but effective.
SUBROUTINE ADD(Tau,m,k,Sigma,Mu,n)
IMPLICIT NONE
REAL Tau,m,k,Sigma,Mu,n
IF(m.LE.0.0 .OR. m.GE.1.0 .OR. n.LT.1.0 .OR.n.GT.3.0) STOP
Tau =m*k*SQRT(1.0-EXP((-Sigma*Mu)/(m*K))**n)
RETURN
END
Note I've turned the logic around; hopefully I did so w/o a
transcription error.
--