MODULE Temperature !----------------------------------------------------------------------- ! Module that contains the following subprograms for processing ! temperatures on various scales: ! Fahr_to_Celsius, a Fahrenheit-to-conversion function ! Celsius_to_Fahr, a Celsius-to-Fahrenheit conversion function ! . . . !----------------------------------------------------------------------- IMPLICIT NONE CONTAINS !-Fahr_to_Celsius ---------------------------------------------------- ! Function to convert a Fahrenheit temperature to Celsius. ! Accepts: A temperature Temp in Fahrenheit ! Returns: The corresponding Celsius temperature !--------------------------------------------------------------------- FUNCTION Fahr_to_Celsius(Temp) REAL:: Fahr_to_Celsius REAL, INTENT(IN) :: Temp Fahr_to_Celsius = (Temp - 32.0) / 1.8 END FUNCTION Fahr_to_Celsius !-Celsius_to_Fahr----------------------------------------------------- ! Function to convert a Celsius temperature to Fahrenheit. ! Accepts: A temperature Temp in Celsius ! Returns: The corresponding Fahrenheit temperature !--------------------------------------------------------------------- FUNCTION Celsius_to_Fahr(Temp) REAL:: Celsius_to_Fahr REAL, INTENT(IN) :: Temp Celsius_to_Fahr = 1.8 * Temp + 32.0 END FUNCTION Celsius_to_Fahr ! ... Other temperature-related subprograms can be added ... END MODULE Temperature