      SUBROUTINE AIRFOL
C
C  CALCULATE NACA DESIGNATED AIRFOIL COORDINATES
C
      REAL A/1.0000000000000000000000000000000
     1111111111111111111/
      COMMON /
     1TEST/ C
      COMMON /IBODY/ PB,NACA(80)
      COMMON /IWING/ PW, X(60)
      COMMON / IHT / PHT, XU(60),XL(60)
      COMMON / IVT / PVT, YUN(60),YLN(60)
      COMMON / IBW / PBW,L,I,J,K,II,JJ,KK,III,JJJ,KKK,LLL
      COMMON / IBH / PBH, THN(60),CAM(60)
      COMMON /IBWHV/ PBWHV, RHO,TMAX
      COMMON /FLOLOG/ DUM(29),PART
      LOGICAL DUM,PART
      INTEGER A4HW,A4HH,A4HV,A4HF
      DIMENSION THN2(60)
      DATA A4HW,A4HH,A4HV,A4HF/4HW   ,4HH   ,4HV   ,4HF   /
C
C  DECODE THE USERS INPUT NACA DESIGNATION
C
      CALL DECODE(NACA,NA)
C
C  CALCULATE THE AIRFOIL COORDINATES
C
      IF(PART)WRITE(6,1100)
      IF(PART .AND. NACA(6).EQ.A4HW)WRITE(6,1230)
      IF(PART .AND. NACA(6).EQ.A4HH)WRITE(6,1240)
      IF(PART .AND. NACA(6).EQ.A4HV)WRITE(6,1250)
      IF(PART .AND. NACA(6).EQ.A4HF)WRITE(6,1260)
C
      GO TO (1000,1010,1020,1030,1040,1050,1060), NA
C
 1000 IF(PART)WRITE(6,1110)I,J,K,II
C
C**  CALCULATE NACA 4-DIGIT AIRFOIL COORDINATES
C
      CALL COORD4
      GO TO 1080
 1010 IF(PART)WRITE(6,1120)I,J,K,II,KK,III
C
C**  CALCULATE NACA MODIFIED 4-DIGIT AIRFOIL COORDINATES
C
      CALL CORD4M
      GO TO 1080
 1020 IF(PART)WRITE(6,1130)I,J,K,II,JJ
C
C**  CALCULATE NACA 5-DIGIT AIRFOIL COORDINATES
C
      CALL COORD5
      GO TO 1080
 1030 IF(PART)WRITE(6,1140)I,J,K,II,JJ,III,JJJ
C
C**  CALCULATE NACA MODIFIED 5-DIGIT AIRFOIL COORDINATES
C
      CALL CORD5M
      GO TO 1080
 1040 IF(PART)WRITE(6,1150)I,J,II,JJ,KK
C
C**  CALCULATE NACA 1-SERIES AIRFOIL COORDINATES
C
      CALL COORD1
      GO TO 1080
 1050 IF(PART .AND. (K .EQ. 0 .AND. II .EQ. 0))
     1   WRITE(6,1160)I,J,JJ,KK,III
      IF(PART .AND. (K .NE. 0 .AND. II .EQ. 0))
     1   WRITE(6,1170)I,J,K,JJ,KK,III
      IF(PART .AND. (K .EQ. 0 .AND. II .NE. 0))
     1   WRITE(6,1180)I,J,JJ,KK,III
      IF(PART .AND. (K .NE. 0 .AND. II .NE. 0))
     1   WRITE(6,1190)I,J,K,JJ,KK,III
      IF(PART .AND. (JJJ .GE. 1)) WRITE(6,1200)JJJ
C
C**  CALCULATE NACA 6-SERIES AIRFOIL COORDINATES
C
      CALL COORD6
      GO TO 1080
 1060 IF(I.NE.2)GO TO 1070
      J=5
      K=0
      II=0
 1070 IF(PART)WRITE(6,1270)I,J,K,II,JJ,KK,III,JJJ,KKK,LLL
C
C**   CALCULATE GEOMTRY FOR SUPERSONIC AIRFOILS
C
      CALL CORDSP
C
C**   CALCULATE AIRFIOL SECTION X Y COORDINATES OR THICKNESS/CAMBER
C               DISTRIBUTION
C
      CALL XYCORD(0,0)
 1080 IF(PART)WRITE(6,1210)
C
      DO 1090 M=1,L
         THN2(M)=2.*THN(M)
 1090 CONTINUE
      IF(PART)WRITE(6,1220)(XU(M),YUN(M),XL(M),YLN(M),X(M),CAM(M),
     1              THN2(M),M=1,L)
      RETURN
C
 1100 FORMAT(1H1,29X,75HAUTOMATED STABILITY AND CONTROL METHODS PER APRI
     1L 1976 VERSION OF DATCOM     )
 1110 FORMAT(1H ,62X,6H NACA ,4I1)
 1120 FORMAT(1H ,60X,6H NACA ,4I1,3H - ,2I1)
 1130 FORMAT(1H ,62X,6H NACA ,5I1)
 1140 FORMAT(1H ,60X,6H NACA ,5I1,3H - ,2I1)
 1150 FORMAT(1H ,61X,6H NACA ,2I1,3H - ,3I1)
 1160 FORMAT(1H ,62X,6H NACA ,2I1,1H-,3I1)
 1170 FORMAT(1H ,60X,6H NACA ,2I1,1H,,I1,1H-,3I1)
 1180 FORMAT(1H ,61X,6H NACA ,2I1,1HA,3I1)
 1190 FORMAT(1H ,60X,6H NACA ,2I1,1H,,I1,1HA,3I1)
 1200 FORMAT(1H ,65X,4HA=0.,I1)
 1210 FORMAT(1H ,3X,15H UPPER ABSCISSA,4X,15H UPPER ORDINATE,4X,
     1              15H LOWER ABSCISSA,4X,15H LOWER ORDINATE,6X,
     2              16HX-FRACTION CHORD,4X,9HMEAN LINE,4X,9HTHICKNESS)
 1220 FORMAT(8X,F8.5,11X,F8.5,10X,F8.5,10X,F8.5,13X,F8.5,10X,
     1       F8.5,6X,F8.5)
 1230 FORMAT(1H ,55X,23HWING SECTION DEFINITION)
 1240 FORMAT(1H ,50X,34HHORIZONTAL TAIL SECTION DEFINITION)
 1250 FORMAT(1H ,51X,32HVERTICAL TAIL SECTION DEFINITION)
 1260 FORMAT(1H ,52X,30HVENTRAL FIN SECTION DEFINITION )
 1270 FORMAT(1H ,54X,8H NACA S-,I1,1H-,2I1,1H.,I1,1H-,2I1,1H.,I1,
     1 1H-,2I1,1H.,I1)
      END
