        program aero
        implicit real*8 (a-h,o-z)
        real*8 b,AR,Swing,Lfuse,Dfuse,Afuse,Swetted,LoverD,cyl,cone,tail
c
c       namelist /AeroInput/ b, Swing, Lfuse, Dfuse
c
        open(3,file='AeroInput')
        read(3, *) b, Swing, Lfuse, Dfuse
        close(3)
c
c       wetted area calculation
c
        AR=(b*b)/Swing
        pi=4.0*atan(1.0)
	
        cyl = (pi * Dfuse * 0.6*Lfuse) 
        cone = (pi * (Dfuse/2.0)**2 * 0.4*Lfuse) / 3.0
        Afuse = cyl + cone + pi*(Dfuse/2.0)**2
        tail = 4*(1.25*Dfuse)*(0.125*Lfuse) + 2*(1.5*Dfuse)*(0.15*Lfuse)
        Swetted = Afuse + 2.0*Swing - 2.0*Dfuse*(Swing/b) + tail
c
c       estimate lift to drag ratio at cruise
c
        LoverD= 10.0 + 4.0*(AR/(Swetted/Swing)-1.0)
        if(LoverD.gt.16.0)LoverD=16.0
c
        open(4, file='AeroOutput', status='unknown', form='formatted')
c
        write(4,*) ' '
        write(4,*) ' '
        write(4,*) ' ============  AERO RESULTS ========== '
        write(4,*) ' '
        write(4,*) ' ==== Input for AERO ===='
        write(4,*) ' '
        
        write(4,101) Swing
 101    format( 'Surface Area of the Wing =', G15.6,' ft^2')
        write(4,102) b
 102    format( 'Wing Span =', G15.6,' ft' )
        write(4,103) Lfuse
 103    format( 'Length of Fuselage =', G15.6,' ft')
        write(4,104) Dfuse
 104	format( 'Diameter of Fuselage =', G15.6,' ft')
        write(4,*) ' '
        write(4,*) ' === Output from AERO ==='
        write(4,*) ' '
c        write(4,111) AR
c 111    format( 'Aspect Ratio of the Wing =', G15.6)
        write(4,112) Afuse
 112    format( 'Surface Area of the Fuselage =', G15.6,' ft^2')
        write(4,113) Swetted
 113    format( 'Wetted Area of the Aircract =', G15.6,' ft^2')
        write(4,114) LoverD
 114    format( 'Lift/Drag of the Aircract =', G15.6)
        close(4)
c       
        stop
        end
