










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











Example:
(A) Functions:
When we write: Y = SIN(X), our code is calling an (intrinsic) function.
FUNCTION name (arguments) Usual Fortran statements Execution statements RETURN END FUNCTION name
Example:
FUNCTION f_to_c (Temperature) ! or… REAL FUNCTION f_to_c (Temperature) ! ! Input: Temperature = temp in deg F ! Output: f_to_c = temp in deg C ! IMPLICIT NONE REAL :: f_to_c, Temperature ! f_to_c = (Temperature - 32.0)*9./5. ! RETURN END FUNCTION f_to_c
So:
And:
There are two places we can put the “function code”:
Going back to our TEMPCON and f_to_c example…