PROGRAM tappCA1 IMPLICIT NONE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! NAMED CONSTANTS !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CHARACTER*3 :: name_2 = "VRB" INTEGER, PARAMETER :: f_conv_whole = 32 INTEGER, PARAMETER :: alt_conv_whole = 100 REAL, PARAMETER :: f_conv_fraction = 1.8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! LOCAL VARIABLES !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CHARACTER*4 :: station_1, station_2, station_3 CHARACTER*3 :: wind_direc_2 CHARACTER*3 :: wind_direc_1, wind_direc_3 INTEGER :: wind_speed_1, wind_speed_2, wind_speed_3 INTEGER :: time_1, time_2, time_3 REAL :: temp_1, temp_2, temp_3 REAL :: dwpt_1, dwpt_2, dwpt_3 REAL :: altim_1, altim_2, altim_3 REAL :: t_1, t_2, t_3 REAL :: dew_1, dew_2, dew_3 REAL :: alt_1, alt_2, alt_3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! INPUT SECTION !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! OPEN (500, file = "/ocs/research/metr4424/metar.txt") 25 FORMAT (A4,3X,I4,2X,A3,I2,15X,F2.0,1X,F2.0,2X,F4.0) 50 FORMAT (A4,3X,I4,2X,A3,I2,22X,F2.0,1X,F2.0,2X,F4.0) 75 FORMAT (A4,3X,I4,2X,A3,I2,29X,F2.0,1X,F2.0,2X,F4.0) READ (500,25) station_1, time_1, wind_direc_1, wind_speed_1, temp_1, dwpt_1, altim_1 READ (500,50) station_2, time_2, wind_direc_2, wind_speed_2, temp_2, dwpt_2, altim_2 READ (500,75) station_3, time_3, wind_direc_3, wind_speed_3, temp_3, dwpt_3, altim_3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! CALCULATION SECTION !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Convert user defined temperature into degrees Celsius. t_1 = (temp_1 * f_conv_fraction) + f_conv_whole t_2 = (temp_2 * f_conv_fraction) + f_conv_whole t_3 = (temp_3 * f_conv_fraction) + f_conv_whole ! Convert user defined dewpoint into degrees Celsius. dew_1 = (dwpt_1 * f_conv_fraction) + f_conv_whole dew_2 = (dwpt_2 * f_conv_fraction) + f_conv_whole dew_3 = (dwpt_3 * f_conv_fraction) + f_conv_whole ! Convert altimeter setting into proper decimal depiction. alt_1 = altim_1 / alt_conv_whole alt_2 = altim_2 / alt_conv_whole alt_3 = altim_3 / alt_conv_whole !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! OUTPUT SECTION !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PRINT *, " " PRINT *, "The following weather conditions were observed at ", station_1, & & " at", time_1, "Zulu: " PRINT *, " " PRINT "(A,F4.1,A)", " Temperature: ", t_1, " degrees Fahrenheit" PRINT "(A,F4.1,A)", " Dew Point Temperature: ", dew_1, " degrees Fahrenheit" PRINT *, " Wind Speed: ", wind_speed_1, " Knots" PRINT *, " Wind Direction: ", wind_direc_1, " Degrees" PRINT *, " Altimeter Setting: ", alt_1, " Inches of Mercury" PRINT *, " " PRINT *, "The following weather conditions were observed at ", station_2, & & " at", time_2, "Zulu: " PRINT *, " " PRINT "(A,F4.1,A)", " Temperature: ", t_2, " degrees Fahrenheit" PRINT "(A,F4.1,A)", " Dew Point Temperature: ", dew_2, " degrees Fahrenheit" PRINT *, " Wind Speed: ", wind_speed_2, " Knots" IF (wind_direc_2 == name_2) THEN PRINT *, " Wind Direction: Variable " ELSE PRINT *, " Wind Direction: ", wind_direc_2, " Degrees" END IF PRINT *, " Altimeter Setting: ", alt_2, " Inches of Mercury" PRINT *, " " PRINT *, "The following weather conditions were observed at ", station_3, & & " at", time_3, "Zulu: " PRINT *, " " PRINT "(A,F4.1,A)", " Temperature: ", t_3, " degrees Fahrenheit" PRINT "(A,F4.1,A)", " Dew Point Temperature: ", dew_3, " degrees Fahrenheit" PRINT *, " Wind Speed: ", wind_speed_3, " Knots" PRINT *, " Wind Direction: ", wind_direc_3, " Degrees" PRINT *, " Altimeter Setting: ", alt_3, " Inches of Mercury" PRINT *, " " PRINT *, "Enjoy your decoded Metar data!" END PROGRAM tappCA1