!***************************************************** !* This program caculates the absolute stellar * !* based on relative magintude and distance * !* -------------------------------------------------- * !* SAMPLE RUN: * !* * !* To calculate absolute stellar magnitude: * !* Give relative mag. and distance in parsecs: 10 3 * !* * !* A star with relative magnitude 10.00 * !* at a distance of 3.0 parsecs * !* has an absolute magnitude of 12.61 * !* * !* -------------------------------------------------- * !* Ref.: "Problem Solving with Fortran 90 By David R. * !* Brooks, Springer-Verlag New York, 1997". * !****************************************************** ! Explanations; ! ------------ ! The absolute magnitude M of a star is related to its ! relative magnitude m and and the distance to a star r, ! measured in parsecs, where 1 parsec = 3.26 light years, ! by the equation: ! ! M = m + 5 - 5 log10(r) ! ! According to this equation, a star with a relative ! magnitude of +1 at a distance of 10 parsecs has an ! absolute magnitude of +1. The larger the magnitude, the ! dimmer the star. Sirius is a very bright star with a ! relative magnitude of -1.58. Stars visible to the naked ! eye range mostly from about +1 to +6 in relative magni- ! tude. ! The dimmest star that can be seen with the 200-inch ! Hale telescope has a magnitude of about +23. !--------------------------------------------------------- Program Starmag Implicit None Real abs_mag, rel_mag, parsecs print *,' ' write (*,"(' To calculate absolute stellar magnitude:')") write (*,"(' Give relative mag. and distance in parsecs: ')", & advance='no') read *, rel_mag, parsecs abs_mag = rel_mag + 5.0 - 5.0 * Log10(parsecs) print *,' ' Write (*,10) rel_mag, parsecs, abs_mag print *,' ' 10 format(' A star with relative magnitude ',f6.2/ & ' at a distance of ',f5.1,' parsecs'/ & ' has an absolute magnitude of ',f6.2) End !end of file starmag.f90