total = total + largest(a,b,c)
INTEGER, EXTERNAL :: largest
INTEGER FUNCTION largest(i,j,k) IMPLICIT NONE INTEGER :: i, j, k largest = i IF (j .GT. largest) largest = j IF (k .GT. largest) largest = k END FUNCTION largest
or equivalently as,
FUNCTION largest(i,j,k) IMPLICIT NONE INTEGER :: i, j, k INTEGER :: largest ... END FUNCTION largest
For more information, click here