      SUBROUTINE NEWFLX (WVLN0,FLUX0,WVLNIN,FLUX)
C
      include "newflx.comments"
C                                                                 
C     NEWFLX   VERSION 1.0  CGW   BEGUN 01/24/97  COMPLETED 01/22/97 CGW 
C                                                                 
c-h   Added 343 nm for N19 Channel-12.  April 2013
      DIMENSION WVLNS(12,16),FLUXS(12,16)
C
      DATA FLUXS/47.8200, 46.3783, 45.4201, 44.5518, 43.7644, 43.1192, 
     1        42.5656, 42.2269, 42.1858, 42.3710, 42.8200, 43.5018,
     2        229.374, 229.043, 227.770, 224.378, 216.218, 207.436, 
     3        199.623, 190.392, 180.324, 171.124, 163.958, 156.081,
     4        321.873, 324.843, 329.226, 332.769, 334.943, 335.992, 
     5        336.243, 335.595, 334.280, 332.887, 330.565, 327.336,
     6        377.241, 376.621, 373.692, 365.745, 356.442, 350.096, 
     7        341.245, 332.724, 328.838, 325.005, 319.516, 319.085,
     8        598.671, 591.863, 583.143, 575.541, 567.450, 559.837, 
     9        554.824, 549.912, 545.592, 544.105, 545.818, 547.794,
     X        531.910, 533.377, 536.564, 537.184, 536.896, 540.101, 
     Y        548.382, 555.231, 561.813, 569.827, 575.882, 582.719,
     A        489.545, 495.345, 503.250, 511.740, 523.162, 534.208, 
     B        542.072, 548.368, 550.026, 544.503, 532.915, 520.003,
     C        486.160, 482.086, 474.860, 466.699, 461.470, 460.367, 
     D        462.004, 469.919, 484.496, 502.356, 521.780, 543.104,
     E        658.369, 648.480, 637.496, 628.785, 617.355, 603.695, 
     F        594.631, 588.984, 586.435, 587.942, 591.632, 593.684,
     G        710.074, 701.467, 698.249, 694.794, 695.467, 698.604, 
     H        697.715, 698.668, 703.432, 709.668, 715.186, 720.685,
     I        788.156, 808.419, 821.971, 827.021, 823.331, 813.965, 
     J        802.226, 788.303, 767.815, 746.174, 727.759, 710.900,
     K        734.635, 743.591, 746.694, 744.893, 741.454, 737.718, 
     L        730.951, 721.049, 710.232, 697.649, 684.541, 675.009,
     M        954.07,  956.93,  964.28,  977.53,  993.19, 1011.24, 
     N        1032.96, 1055.24, 1075.52, 1093.77, 1112.28,1124.05,
     O        1022.87, 1012.40, 1008.30, 1007.12, 1002.96, 1001.43, 
     P        1003.14, 1003.81, 1001.06, 1000.94, 1006.23, 1009.16,
     Q        986.77,  994.01, 1005.31, 1017.60, 1031.77, 1046.13, 
     R        1058.56, 1067.60, 1073.52, 1076.26, 1075.40, 1071.88,
     S        1030.33, 1036.60, 1040.56, 1043.17, 1045.98, 1048.81,
     T        1047.40, 1039.65, 1025.84, 1008.25,  988.90,  966.94/
C
      DATA WVLNS/251.5,251.6,251.7,251.8,251.9,
     1     252.0,252.1,252.2,252.3,252.4,252.5,252.6,
     2     273.0,273.1,273.2,273.3,273.4,
     3     273.5,273.6,273.7,273.8,273.9,274.0,274.1,
     4     282.7,282.8,282.9,283.0,283.1,
     5     283.2,283.3,283.4,283.5,283.6,283.7,283.8,
     6     287.1,287.2,287.3,287.4,287.5,
     7     287.6,287.7,287.8,287.9,288.0,288.1,288.2,
     8     291.7,291.8,291.9,292.0,292.1,
     9     292.2,292.3,292.4,292.5,292.6,292.7,292.8,
     X     294.5,294.6,294.7,294.8,294.9,
     Y     295.0,295.1,295.2,295.3,295.4,295.5,295.6,
     A     297.0,297.1,297.2,297.3,297.4,
     B     297.5,297.6,297.7,297.8,297.9,298.0,298.1,
     C     301.5,301.6,301.7,301.8,301.9,
     D     302.0,302.1,302.2,302.3,302.4,302.5,302.6,
     E     305.3,305.4,305.5,305.6,305.7,
     F     305.8,305.9,306.0,306.1,306.2,306.3,306.4,
     G     312.0,312.1,312.2,312.3,312.4,
     H     312.5,312.6,312.7,312.8,312.9,313.0,313.1,
     I     317.0,317.1,317.2,317.3,317.4,
     J     317.5,317.6,317.7,317.8,317.9,318.0,318.1,
     K     321.8,321.9,322.0,322.1,322.2,
     L     322.3,322.4,322.5,322.6,322.7,322.8,322.9,
     M     328.5,328.6,328.7,328.8,328.9,
     N     329.0,329.1,329.2,329.3,329.4,329.5,329.6,
     O     330.7,330.8,330.9,331.0,331.1,
     P     331.2,331.3,331.4,331.5,331.6,331.7,331.8,
     Q     339.3,339.4,339.5,339.6,339.7,
     R     339.8,339.9,340.0,340.1,340.2,340.3,340.4,
     S     342.5,342.6,342.7,342.8,342.9,
     T     343.0,343.1,343.2,343.3,343.4,343.5,343.6/
C
      FLUX = 0.0
      WVLNTH = WVLNIN / 10.0
      WV0 = WVLN0 / 10.0
C
C  INTERPOLATE FOR WV0
C
      DO 300 L=1,16
        IF(WV0.GE.WVLNS(1,L).AND.WV0.LE.WVLNS(12,L)) THEN
          I0 = 1
          IW = 1
  100     CONTINUE
          I0 = I0 + 1
          IF(I0.GT.12) GO TO 999
          IF(WV0.GT.WVLNS(I0,L)) GO TO 100
C
          FLX0 = FLUXS(I0-1,L) + (WV0-WVLNS(I0-1,L)) /
     1  (WVLNS(I0,L) - WVLNS(I0-1,L))*(FLUXS(I0,L) - FLUXS(I0-1,L))
C
C  INTERPOLATE FOR WVLNTH
C
        IF(WVLNTH.LT.WVLNS(1,L).OR.WVLNTH.GT.WVLNS(12,L)) GO TO 999
  200     CONTINUE
          IW = IW + 1
          IF(IW.GT.12) GO TO 999
          IF(WVLNTH.GT.WVLNS(IW,L)) GO TO 200
C
          FLX = FLUXS(IW-1,L) + (WVLNTH-WVLNS(IW-1,L)) /
     1  (WVLNS(IW,L) - WVLNS(IW-1,L))*(FLUXS(IW,L) - FLUXS(IW-1,L))
C
          FLUX = FLUX0 * (FLX / FLX0)
C
          GO TO 999
        ENDIF
  300 CONTINUE
C
  999 CONTINUE

C      WRITE(6,3000) WVLN0,FLUX0,L,I0,IW,WVLNTH,FLX0,FLX,FLUX

      RETURN                                                      
C
C  FORMATS
C
 3000 FORMAT(1x,'NEWFLX: WVLN0,FLUX0,L,I0,IW,WVLNTH,FLX0,FLX,FLUX',
     1     /,2F10.3,3I5,4F10.3)
      END                                                         
