      subroutine co2ins(nlev,itin,itin1,iq)
      implicit real(selected_real_kind(15)) (a-h,o-z)
      CHARACTER *3 A,B,C
      common/cards/N(200),DCDT8(200,200),DCDT10(200,200),CO2PO(200,200),
     * CO2800(200,200),CO2PO1(200,200),CO2801(200,200),CO2PO2(200,200),
     * CO2802(200,200),D2CT8(200,200),D2CT10(200,200)
      DATA A/'CDT'/
      DATA B/'CO2'/
      DATA C/'C2D'/
      l=nlev
      lp1=l+1
1011  FORMAT (4F20.14)
      READ (ITIN,1011) ((CO2PO(I,J),I=1,LP1),J=1,LP1)
      READ (ITIN1,1011) ((CO2800(I,J),I=1,LP1),J=1,LP1)
      IF (IQ.GE.1.AND.IQ.LE.4) THEN
         READ (ITIN,1011) ((CO2PO1(I,J),I=1,LP1),J=1,LP1)
         READ (ITIN1,1011) ((CO2801(I,J),I=1,LP1),J=1,LP1)
         READ (ITIN,1011) ((CO2PO2(I,J),I=1,LP1),J=1,LP1)
         READ (ITIN1,1011) ((CO2802(I,J),I=1,LP1),J=1,LP1)
      ENDIF
C***THE FOLLOWING CODE IS REWRITTEN SO THAT THE RADIATIVE BANDS
C   ARE: 
C        IQ=1    560-800     (CONSOL.=490-850)
C        IQ=2    560-670     (CONSOL.=490-670)
C        IQ=3    670-800     (CONSOL.=670-850)
C        IQ=4    560-760 (ORIGINAL CODE)   (CONSOL.=490-850)
C        IQ=5   2270-2380     CONSOL=2270-2380
C  THE FOLLOWING LOOP OBTAINS TRANSMISSION FUNCTIONS FOR BANDS
C  USED IN RADIATIVE MODEL CALCULATIONS,WITH THE EQUIVALENT
C  WIDTHS KEPT FROM THE ORIGINAL CONSOLIDATED CO2 TF'S.
C      NOTE: ALTHOUGH THE BAND TRANSMISSION FUNCTIONS ARE
C  COMPUTED FOR ALL RADIATIVE BANDS, AS OF 9/28/88, THEY
C  ARE WRITTEN OUT IN FULL ONLY FOR THE FULL 15 UM BAND CASES
C  (IQ=1,4).  IN OTHER CASES, THE TRANSMISSIVITIES (1,K) ARE
C  WRITTEN OUT, AS THESE ARE THE ONLY ONES NEEDED FOR CTS
C  CALCULATIONS.  ALSO, FOR THE 4.3 UM BAND (IQ=5) THE TEMP.
C  DERIVATIVE TERMS ARE NOT WRITTEN OUT, AS THEY ARE UNUSED.
      IF (IQ.EQ.1) THEN
         C1=1.5
         C2=0.5
         JMAX=LP1
      ENDIF
      IF (IQ.EQ.2) THEN
        C1=18./11.
        C2=7./11.
        JMAX=1
      ENDIF
      IF (IQ.EQ.3) THEN
        C1=18./13.
        C2=5./13.
        JMAX=1
      ENDIF
      IF (IQ.EQ.4) THEN
        C1=1.8
        C2=0.8
        JMAX=LP1
      ENDIF
      IF (IQ.EQ.5) THEN
        C1=1.0
        C2=0.0
        JMAX=1
      ENDIF
      DO 1022 I=1,LP1
      DO 1022 J=1,LP1
      CO2PO(J,I)=C1*CO2PO(J,I)-C2
      CO2800(J,I)=C1*CO2800(J,I)-C2
1022  CONTINUE
      IF (IQ.GE.1.AND.IQ.LE.4) THEN
       DO 1021 I=1,LP1
       DO 1021 J=1,LP1
       CO2PO1(J,I)=C1*CO2PO1(J,I)-C2
       CO2801(J,I)=C1*CO2801(J,I)-C2
       CO2PO2(J,I)=C1*CO2PO2(J,I)-C2
       CO2802(J,I)=C1*CO2802(J,I)-C2
1021   CONTINUE
       DO 1 J=1,LP1
       DO 1 I=1,LP1
       DCDT8(I,J)=.02*(CO2801(I,J)-CO2802(I,J))*100.
       DCDT10(I,J)=.02*(CO2PO1(I,J)-CO2PO2(I,J))*100.
       D2CT8(I,J)=.0016*(CO2801(I,J)+CO2802(I,J)-2.*CO2800(I,J))*1000.
       D2CT10(I,J)=.0016*(CO2PO1(I,J)+CO2PO2(I,J)-2.*CO2PO(I,J))*1000.
1      CONTINUE
      ENDIF
      DO 4 J=1,LP1
      IF (IQ.EQ.1) N(J)=51
      IF (IQ.EQ.2) N(J)=31
      IF (IQ.EQ.3) N(J)=71
      IF (IQ.EQ.4) N(J)=51
      IF (IQ.EQ.5) N(J)=11
4     CONTINUE
      IF (IQ.GE.1.AND.IQ.LE.4) THEN
       DO 12 J=1,JMAX
       if ((iq.eq.1.or.iq.eq.4).and.j.lt.10) then
         WRITE (12,110) A,N(J),J
c        WRITE (10,110) A,N(J),J
       endif
       if ((iq.eq.1.or.iq.eq.4).and.j.ge.10) then
         WRITE (12,140) A,N(J),J
c        WRITE (10,140) A,N(J),J
       endif
       if (iq.eq.2.or.iq.eq.3.or.iq.eq.5) then
         WRITE (12,150) A,N(J)
c        WRITE (10,150) A,N(J)
       endif
       KX1=1
       DO 13 K=1,L
       KX7=KX1+5
       KTEST=7
       IF (KX7.EQ.LP1) GO TO 17
       KX7=MIN0(KX7,LP1)
       KTEST=KX7-KX1+1
17     CONTINUE
       GO TO (211,212,213,214,215,216,217),KTEST
211    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,111) (DCDT10(I,J),I=KX1,KX7)
          WRITE (10,1111) (DCDT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,111) (DCDT10(1,I),I=KX1,KX7)
          WRITE (10,1111) (DCDT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 16
212    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,112) (DCDT10(I,J),I=KX1,KX7)
          WRITE (10,1112) (DCDT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,112) (DCDT10(1,I),I=KX1,KX7)
          WRITE (10,1112) (DCDT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 16
213    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,113) (DCDT10(I,J),I=KX1,KX7)
          WRITE (10,1113) (DCDT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,113) (DCDT10(1,I),I=KX1,KX7)
          WRITE (10,1113) (DCDT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 16
214    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,114) (DCDT10(I,J),I=KX1,KX7)
          WRITE (10,1114) (DCDT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,114) (DCDT10(1,I),I=KX1,KX7)
          WRITE (10,1114) (DCDT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 16
215    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,115) (DCDT10(I,J),I=KX1,KX7)
          WRITE (10,1115) (DCDT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,115) (DCDT10(1,I),I=KX1,KX7)
          WRITE (10,1115) (DCDT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 16
216    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (DCDT10(I,J),I=KX1,KX7)
          WRITE (10,1116) (DCDT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (DCDT10(1,I),I=KX1,KX7)
          WRITE (10,1116) (DCDT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 16
217    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (DCDT10(I,J),I=KX1,KX7)
          WRITE (10,1116) (DCDT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (DCDT10(1,I),I=KX1,KX7)
          WRITE (10,1116) (DCDT10(1,I),I=KX1,KX7)
       ENDIF
16     CONTINUE
       KX1=KX1+6
       IF (KX1.GT.LP1) GO TO 18
13     CONTINUE
       IF (LP1.GT.99) WRITE (10,131)
18     CONTINUE
       WRITE (12,130)
c      WRITE (10,130)
12     CONTINUE
      ENDIF
      DO 22 J=1,JMAX
       if ((iq.eq.1.or.iq.eq.4).and.j.lt.10) then
         WRITE (12,110) B,N(J),J
c        WRITE (10,110) B,N(J),J
       endif
       if ((iq.eq.1.or.iq.eq.4).and.j.ge.10) then
         WRITE (12,140) B,N(J),J
c        WRITE (10,140) B,N(J),J
       endif
       if (iq.eq.2.or.iq.eq.3.or.iq.eq.5) then
         WRITE (12,150) B,N(J)
c        WRITE (10,150) B,N(J)
       endif
      KX1=1
      DO 23 K=1,L
      KX7=KX1+5
      KTEST=7
      IF (KX7.EQ.LP1) GO TO 27
      KX7=MIN0(KX7,LP1)
      KTEST=KX7-KX1+1
27    CONTINUE
      GO TO (311,312,313,314,315,316,317),KTEST
311    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,111) (CO2PO(I,J),I=KX1,KX7)
          WRITE (10,1111) (CO2PO(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,111) (CO2PO(1,I),I=KX1,KX7)
          WRITE (10,1111) (CO2PO(1,I),I=KX1,KX7)
       ENDIF
       GO TO 26
312    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,112) (CO2PO(I,J),I=KX1,KX7)
          WRITE (10,1112) (CO2PO(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,112) (CO2PO(1,I),I=KX1,KX7)
          WRITE (10,1112) (CO2PO(1,I),I=KX1,KX7)
       ENDIF
       GO TO 26
313    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,113) (CO2PO(I,J),I=KX1,KX7)
          WRITE (10,1113) (CO2PO(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,113) (CO2PO(1,I),I=KX1,KX7)
          WRITE (10,1113) (CO2PO(1,I),I=KX1,KX7)
       ENDIF
       GO TO 26
314    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,114) (CO2PO(I,J),I=KX1,KX7)
          WRITE (10,1114) (CO2PO(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,114) (CO2PO(1,I),I=KX1,KX7)
          WRITE (10,1114) (CO2PO(1,I),I=KX1,KX7)
       ENDIF
       GO TO 26
315    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,115) (CO2PO(I,J),I=KX1,KX7)
          WRITE (10,1115) (CO2PO(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,115) (CO2PO(1,I),I=KX1,KX7)
          WRITE (10,1115) (CO2PO(1,I),I=KX1,KX7)
       ENDIF
       GO TO 26
316    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (CO2PO(I,J),I=KX1,KX7)
          WRITE (10,1116) (CO2PO(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (CO2PO(1,I),I=KX1,KX7)
          WRITE (10,1116) (CO2PO(1,I),I=KX1,KX7)
       ENDIF
       GO TO 26
317    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (CO2PO(I,J),I=KX1,KX7)
          WRITE (10,1116) (CO2PO(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (CO2PO(1,I),I=KX1,KX7)
          WRITE (10,1116) (CO2PO(1,I),I=KX1,KX7)
       ENDIF
26    CONTINUE
      KX1=KX1+6
      IF (KX1.GT.LP1) GO TO 28
23    CONTINUE
      IF (LP1.GT.99) WRITE (10,131)
28    CONTINUE
      WRITE (12,130)
c     WRITE (10,130)
22    CONTINUE
      IF (IQ.GE.1.AND.IQ.LE.4) THEN
       DO 52 J=1,JMAX
       if ((iq.eq.1.or.iq.eq.4).and.j.lt.10) then
         WRITE (12,110) C,N(J),J
c        WRITE (10,110) C,N(J),J
       endif
       if ((iq.eq.1.or.iq.eq.4).and.j.ge.10) then
         WRITE (12,140) C,N(J),J
c        WRITE (10,140) C,N(J),J
       endif
       if (iq.eq.2.or.iq.eq.3.or.iq.eq.5) then
         WRITE (12,150) C,N(J)
c        WRITE (10,150) C,N(J)
       endif
       KX1=1
       DO 53 K=1,L
       KX7=KX1+5
       KTEST=7
       IF (KX7.EQ.LP1) GO TO 57
       KX7=MIN0(KX7,LP1)
       KTEST=KX7-KX1+1
57     CONTINUE
       GO TO (611,612,613,614,615,616,617),KTEST
611    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,111) (D2CT10(I,J),I=KX1,KX7)
          WRITE (10,1111) (D2CT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,111) (D2CT10(1,I),I=KX1,KX7)
          WRITE (10,1111) (D2CT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 56
612    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,112) (D2CT10(I,J),I=KX1,KX7)
          WRITE (10,1112) (D2CT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,112) (D2CT10(1,I),I=KX1,KX7)
          WRITE (10,1112) (D2CT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 56
613    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,113) (D2CT10(I,J),I=KX1,KX7)
          WRITE (10,1113) (D2CT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,113) (D2CT10(1,I),I=KX1,KX7)
          WRITE (10,1113) (D2CT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 56
614    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,114) (D2CT10(I,J),I=KX1,KX7)
          WRITE (10,1114) (D2CT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,114) (D2CT10(1,I),I=KX1,KX7)
          WRITE (10,1114) (D2CT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 56
615    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,115) (D2CT10(I,J),I=KX1,KX7)
          WRITE (10,1115) (D2CT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,115) (D2CT10(1,I),I=KX1,KX7)
          WRITE (10,1115) (D2CT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 56
616    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (D2CT10(I,J),I=KX1,KX7)
          WRITE (10,1116) (D2CT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (D2CT10(1,I),I=KX1,KX7)
          WRITE (10,1116) (D2CT10(1,I),I=KX1,KX7)
       ENDIF
       GO TO 56
617    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (D2CT10(I,J),I=KX1,KX7)
          WRITE (10,1116) (D2CT10(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (D2CT10(1,I),I=KX1,KX7)
          WRITE (10,1116) (D2CT10(1,I),I=KX1,KX7)
       ENDIF
56     CONTINUE
       KX1=KX1+6
       IF (KX1.GT.LP1) GO TO 58
53     CONTINUE
       IF (LP1.GT.99) WRITE (10,131)
58     CONTINUE
       WRITE (12,130)
c      WRITE (10,130)
52     CONTINUE
      ENDIF
      DO 5 J=1,LP1
      IF (IQ.EQ.1) N(J)=58
      IF (IQ.EQ.2) N(J)=38
      IF (IQ.EQ.3) N(J)=78
      IF (IQ.EQ.4) N(J)=58
      IF (IQ.EQ.5) N(J)=18
5     CONTINUE
      IF (IQ.GE.1.AND.IQ.LE.4) THEN
       DO 32 J=1,JMAX
       if ((iq.eq.1.or.iq.eq.4).and.j.lt.10) then
         WRITE (12,110) A,N(J),J
c        WRITE (10,110) A,N(J),J
       endif
       if ((iq.eq.1.or.iq.eq.4).and.j.ge.10) then
         WRITE (12,140) A,N(J),J
c        WRITE (10,140) A,N(J),J
       endif
       if (iq.eq.2.or.iq.eq.3.or.iq.eq.5) then
         WRITE (12,150) A,N(J)
c        WRITE (10,150) A,N(J)
       endif
       KX1=1
       DO 33 K=1,L
       KX7=KX1+5
       KTEST=7
       IF (KX7.EQ.LP1) GO TO 37
       KX7=MIN0(KX7,LP1)
       KTEST=KX7-KX1+1
37     CONTINUE
       GO TO (411,412,413,414,415,416,417),KTEST
411    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,111) (DCDT8(I,J),I=KX1,KX7)
          WRITE (10,1111) (DCDT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,111) (DCDT8(1,I),I=KX1,KX7)
          WRITE (10,1111) (DCDT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 36
412    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,112) (DCDT8(I,J),I=KX1,KX7)
          WRITE (10,1112) (DCDT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,112) (DCDT8(1,I),I=KX1,KX7)
          WRITE (10,1112) (DCDT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 36
413    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,113) (DCDT8(I,J),I=KX1,KX7)
          WRITE (10,1113) (DCDT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,113) (DCDT8(1,I),I=KX1,KX7)
          WRITE (10,1113) (DCDT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 36
414    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,114) (DCDT8(I,J),I=KX1,KX7)
          WRITE (10,1114) (DCDT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,114) (DCDT8(1,I),I=KX1,KX7)
          WRITE (10,1114) (DCDT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 36
415    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,115) (DCDT8(I,J),I=KX1,KX7)
          WRITE (10,1115) (DCDT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,115) (DCDT8(1,I),I=KX1,KX7)
          WRITE (10,1115) (DCDT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 36
416    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (DCDT8(I,J),I=KX1,KX7)
          WRITE (10,1116) (DCDT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (DCDT8(1,I),I=KX1,KX7)
          WRITE (10,1116) (DCDT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 36
417    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (DCDT8(I,J),I=KX1,KX7)
          WRITE (10,1116) (DCDT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (DCDT8(1,I),I=KX1,KX7)
          WRITE (10,1116) (DCDT8(1,I),I=KX1,KX7)
       ENDIF
36     CONTINUE
       KX1=KX1+6
       IF (KX1.GT.LP1) GO TO 38
33     CONTINUE
       IF (LP1.GT.99) WRITE (10,131)
38     CONTINUE
       WRITE (12,130)
c      WRITE (10,130)
32     CONTINUE
      ENDIF
      DO 42 J=1,JMAX
       if ((iq.eq.1.or.iq.eq.4).and.j.lt.10) then
         WRITE (12,110) B,N(J),J
c        WRITE (10,110) B,N(J),J
       endif
       if ((iq.eq.1.or.iq.eq.4).and.j.ge.10) then
         WRITE (12,140) B,N(J),J
c        WRITE (10,140) B,N(J),J
       endif
       if (iq.eq.2.or.iq.eq.3.or.iq.eq.5) then
         WRITE (12,150) B,N(J)
c        WRITE (10,150) B,N(J)
       endif
      KX1=1
      DO 43 K=1,L
      KX7=KX1+5
      KTEST=7
      IF (KX7.EQ.LP1) GO TO 47
      KX7=MIN0(KX7,LP1)
      KTEST=KX7-KX1+1
47    CONTINUE
      GO TO (511,512,513,514,515,516,517),KTEST
511    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,111) (CO2800(I,J),I=KX1,KX7)
          WRITE (10,1111) (CO2800(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,111) (CO2800(1,I),I=KX1,KX7)
          WRITE (10,1111) (CO2800(1,I),I=KX1,KX7)
       ENDIF
       GO TO 46
512    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,112) (CO2800(I,J),I=KX1,KX7)
          WRITE (10,1112) (CO2800(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,112) (CO2800(1,I),I=KX1,KX7)
          WRITE (10,1112) (CO2800(1,I),I=KX1,KX7)
       ENDIF
       GO TO 46
513    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,113) (CO2800(I,J),I=KX1,KX7)
          WRITE (10,1113) (CO2800(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,113) (CO2800(1,I),I=KX1,KX7)
          WRITE (10,1113) (CO2800(1,I),I=KX1,KX7)
       ENDIF
       GO TO 46
514    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,114) (CO2800(I,J),I=KX1,KX7)
          WRITE (10,1114) (CO2800(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,114) (CO2800(1,I),I=KX1,KX7)
          WRITE (10,1114) (CO2800(1,I),I=KX1,KX7)
       ENDIF
       GO TO 46
515    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,115) (CO2800(I,J),I=KX1,KX7)
          WRITE (10,1115) (CO2800(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,115) (CO2800(1,I),I=KX1,KX7)
          WRITE (10,1115) (CO2800(1,I),I=KX1,KX7)
       ENDIF
       GO TO 46
516    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (CO2800(I,J),I=KX1,KX7)
          WRITE (10,1116) (CO2800(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (CO2800(1,I),I=KX1,KX7)
          WRITE (10,1116) (CO2800(1,I),I=KX1,KX7)
       ENDIF
       GO TO 46
517    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (CO2800(I,J),I=KX1,KX7)
          WRITE (10,1116) (CO2800(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (CO2800(1,I),I=KX1,KX7)
          WRITE (10,1116) (CO2800(1,I),I=KX1,KX7)
       ENDIF
46    CONTINUE
      KX1=KX1+6
      IF (KX1.GT.LP1) GO TO 48
43    CONTINUE
      IF (LP1.GT.99) WRITE (10,131)
48    CONTINUE
      WRITE (12,130)
c     WRITE (10,130)
42    CONTINUE
      IF (IQ.GE.1.AND.IQ.LE.4) THEN
       DO 62 J=1,JMAX
       if ((iq.eq.1.or.iq.eq.4).and.j.lt.10) then
         WRITE (12,110) C,N(J),J
c        WRITE (10,110) C,N(J),J
       endif
       if ((iq.eq.1.or.iq.eq.4).and.j.ge.10) then
         WRITE (12,140) C,N(J),J
c        WRITE (10,140) C,N(J),J
       endif
       if (iq.eq.2.or.iq.eq.3.or.iq.eq.5) then
         WRITE (12,150) C,N(J)
c        WRITE (10,150) C,N(J)
       endif
       KX1=1
       DO 63 K=1,L
       KX7=KX1+5
       KTEST=7
       IF (KX7.EQ.LP1) GO TO 67
       KX7=MIN0(KX7,LP1)
       KTEST=KX7-KX1+1
67     CONTINUE
       GO TO (711,712,713,714,715,716,717),KTEST
711    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,111) (D2CT8(I,J),I=KX1,KX7)
          WRITE (10,1111) (D2CT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,111) (D2CT8(1,I),I=KX1,KX7)
          WRITE (10,1111) (D2CT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 66
712    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,112) (D2CT8(I,J),I=KX1,KX7)
          WRITE (10,1112) (D2CT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,112) (D2CT8(1,I),I=KX1,KX7)
          WRITE (10,1112) (D2CT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 66
713    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,113) (D2CT8(I,J),I=KX1,KX7)
          WRITE (10,1113) (D2CT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,113) (D2CT8(1,I),I=KX1,KX7)
          WRITE (10,1113) (D2CT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 66
714    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,114) (D2CT8(I,J),I=KX1,KX7)
          WRITE (10,1114) (D2CT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,114) (D2CT8(1,I),I=KX1,KX7)
          WRITE (10,1114) (D2CT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 66
715    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,115) (D2CT8(I,J),I=KX1,KX7)
          WRITE (10,1115) (D2CT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,115) (D2CT8(1,I),I=KX1,KX7)
          WRITE (10,1115) (D2CT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 66
716    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (D2CT8(I,J),I=KX1,KX7)
          WRITE (10,1116) (D2CT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (D2CT8(1,I),I=KX1,KX7)
          WRITE (10,1116) (D2CT8(1,I),I=KX1,KX7)
       ENDIF
       GO TO 66
717    CONTINUE
       IF (IQ.EQ.1.OR.IQ.EQ.4) THEN
          WRITE (12,116) (D2CT8(I,J),I=KX1,KX7)
          WRITE (10,1116) (D2CT8(I,J),I=KX1,KX7)
       ELSE
          WRITE (12,116) (D2CT8(1,I),I=KX1,KX7)
          WRITE (10,1116) (D2CT8(1,I),I=KX1,KX7)
       ENDIF
66     CONTINUE
       KX1=KX1+6
       IF (KX1.GT.LP1) GO TO 68
63     CONTINUE
       IF (LP1.GT.99) WRITE (10,131)
68     CONTINUE
       WRITE (12,130)
c      WRITE (10,130)
62     CONTINUE
      ENDIF
2100  CONTINUE
110   format (6x,'DATA',1x,'(',a3,i2,'(I,',i1,'),I=1,LP1)/')
140   format (6x,'DATA',1x,'(',a3,i2,'(I,',i2,'),I=1,LP1)/')
150   format (6x,'DATA',1x,'(',a3,i2,'(I),I=1,LP1)/')
116   FORMAT (5X,'*',F10.8,',',F10.8,',',F10.8,',',F10.8,',',
     * F10.8,',',F10.8,',')
117   FORMAT (5X,'*',F10.8,',',F10.8,',',F10.8,',',F10.8,',',
     * F10.8,',',F10.8)
130   FORMAT (5X,'*',20X,'/',46X   )
131   FORMAT (1H0,10X,'THE NO. FILES IS GREATER THAN 99')
115   FORMAT (5X,'*',F10.8,',',F10.8,',',F10.8,',',F10.8,',',
     * F10.8)
114   FORMAT (5X,'*',F10.8,',',F10.8,',',F10.8,',',F10.8)
113   FORMAT (5X,'*',F10.8,',',F10.8,',',F10.8)
112   FORMAT (5X,'*',F10.8,',',F10.8)
111   FORMAT (5X,'*',F10.8)
1111  FORMAT (F12.8)
1112  FORMAT (2F12.8)
1113  FORMAT (3F12.8)
1114  FORMAT (4F12.8)
1115  FORMAT (5F12.8)
1117  FORMAT (6F12.8)
1116  FORMAT (6F12.8)
      return
      END
