function [ DOUT ] = KOF107( MIRREQ )
%KOF107 coefficients - F107 model part
%
%      SUBROUTINE KOF107(MIRREQ,DOUT)
%-------------------------------------------------------------------------------
%   coefficients - F107 model part
%-------------------------------------------------------------------------------

%      REAL DOUT(5,3,81)
%      INTEGER MIRREQ(81),I,J,K
%      REAL DPF107(5,3,81)
  persistent DPF107 NI NJ NK;
  if isempty(DPF107)
    NI = 5;
    NJ = 3;
    NK = 81;
    dat = cell(NI,NJ-1);
    %     350km equinox
    dat{1,1} = [ 2.1179E+00, 2.6093E-07, 4.4282E-02, ...
                -1.3876E-06, 2.7803E-02, 1.3986E-06, ...
                 2.9846E-02, 5.5440E-07, 1.3094E-02, ...
                -2.5151E-02,-1.0646E-07,-3.7429E-03, ...
                 1.6883E-08,-8.7810E-05, 2.4570E-08, ...
                 5.3157E-04, 2.4498E-09,-7.4921E-03, ...
                 3.4559E-07, 2.7384E-03,-2.9301E-07, ...
                -6.4160E-03,-2.9594E-08,-1.2326E-03, ...
                 2.0038E-07, 1.4916E-01, 8.9752E-08, ...
                 1.7673E-02,-3.3613E-08, 3.8401E-03, ...
                 5.1558E-08, 4.3661E-05,-1.3354E-01, ...
                -4.2996E-08,-1.6325E-02,-5.9756E-08, ...
                -7.8924E-04, 9.0574E-09, 9.4891E-05, ...
                -4.6522E-02, 1.6467E-07, 3.0933E-03, ...
                -2.4212E-08,-8.5264E-04,-2.8060E-09, ...
                 2.0465E-02, 3.9607E-08, 2.4059E-03, ...
                 2.3086E-08,-9.3343E-04, 2.1124E-08, ...
                 3.5658E-02,-4.9285E-08,-9.9046E-04, ...
                -2.8411E-08, 4.9889E-04,-2.0836E-02, ...
                 2.7124E-07, 3.9610E-03,-5.1577E-08, ...
                 1.2194E-03, 2.0681E-02, 2.2079E-08, ...
                -1.5148E-03,-1.4727E-08, 2.9282E-02, ...
                -7.1036E-08,-1.0708E-03,-7.0356E-09, ...
                 3.5476E-02, 1.4627E-08, 1.6406E-03, ...
                 2.0173E-02, 1.1973E-07, 5.7493E-06, ...
                 9.8510E-04,-5.6858E-08,-6.9055E-03, ...
                 8.8015E-08,-5.2797E-03, 4.9785E-02];
    %     350km June solstice
    dat{1,2} = [ 2.1118E+00, 1.2667E-02, 7.8532E-02, ...
                 2.8013E-03, 4.6247E-03,-1.8002E-02, ...
                 1.7402E-02, 2.1645E-02, 9.7880E-04, ...
                 1.6106E-03, 1.5252E-02, 4.2830E-04, ...
                 2.2738E-03, 5.1962E-03,-1.2009E-03, ...
                -2.4580E-03, 1.1339E-03, 2.4005E-03, ...
                -9.1238E-03,-6.2242E-03, 7.1732E-04, ...
                 4.7369E-03,-2.0235E-03,-2.8728E-03, ...
                 1.5519E-03,-1.5735E-01, 5.1640E-03, ...
                -1.0377E-02, 1.5376E-03,-1.2147E-04, ...
                 1.1153E-03,-4.0444E-04, 6.2152E-02, ...
                 4.3814E-03, 8.5715E-03,-1.1794E-03, ...
                -1.4507E-03,-2.9136E-04, 4.8678E-05, ...
                -2.5783E-02,-6.4352E-03, 2.8888E-03, ...
                -2.3923E-04,-7.8468E-04, 1.0567E-04, ...
                 1.8717E-02,-3.7789E-03, 1.9293E-03, ...
                 2.7927E-03, 6.1046E-04,-6.4161E-04, ...
                 2.9512E-02, 1.8061E-03,-6.0273E-04, ...
                -1.4189E-03,-1.2866E-04, 3.4173E-02, ...
                 7.0098E-03, 2.7884E-03, 1.3619E-03, ...
                 1.0141E-03, 4.4472E-02,-3.6668E-03, ...
                -6.6634E-04,-9.1539E-04,-4.3310E-02, ...
                 4.6828E-03,-1.0213E-03, 9.6850E-04, ...
                -8.9240E-04, 3.0694E-03, 1.1888E-03, ...
                -3.2205E-02, 2.4068E-04, 1.5491E-03, ...
                -1.3486E-03, 1.5805E-03, 1.2679E-02, ...
                 1.5963E-03,-9.2296E-03, 3.3470E-02];
    %     550km equinox
    dat{2,1} = [ 2.2596E+00,-1.0250E-06,-6.0469E-02, ...
                -5.1717E-08, 2.4081E-02, 1.3561E-06, ...
                 2.2501E-02, 1.8975E-07,-1.9328E-03, ...
                 1.8631E-03,-6.9838E-08, 8.5643E-03, ...
                 2.2625E-07,-9.6354E-04, 1.4344E-07, ...
                -9.9794E-04,-1.4888E-07,-2.1439E-02, ...
                 1.6757E-07, 2.2087E-02, 1.9753E-07, ...
                 3.3401E-03, 1.7510E-08,-4.4513E-03, ...
                -1.9434E-07, 2.1312E-02, 4.1158E-07, ...
                 4.1293E-03, 1.2532E-07, 1.6378E-03, ...
                -6.0591E-08, 3.8969E-04,-8.2128E-04, ...
                -3.7332E-07,-9.0674E-03,-1.6562E-07, ...
                -6.4580E-04,-2.4214E-08, 1.7187E-04, ...
                -7.8323E-03,-3.4188E-09,-3.3704E-03, ...
                -3.7064E-08,-8.1990E-04,-3.4103E-08, ...
                 2.8832E-04,-1.3091E-07, 5.9580E-04, ...
                 3.5007E-09,-2.4893E-05, 3.7407E-08, ...
                 9.8550E-03, 5.2340E-08, 2.4715E-03, ...
                -2.2799E-09, 6.0276E-04,-2.3370E-03, ...
                 1.5897E-07,-7.8384E-04, 6.2186E-08, ...
                 1.5512E-04, 1.0034E-03, 6.2956E-08, ...
                 1.2935E-03, 1.1142E-08,-5.6848E-03, ...
                 5.7028E-08,-1.1159E-03, 5.2481E-09, ...
                -6.4583E-04,-4.9024E-08,-8.7256E-05, ...
                -3.6805E-03,-4.2162E-11, 5.9164E-04, ...
                -1.1688E-03,-6.3884E-09,-3.4464E-03, ...
                -2.9236E-08,-3.2531E-03, 7.3254E-04];
    %     550km June solstice
    dat{2,2} = [ 2.2443E+00,-7.5467E-03, 4.6154E-03, ...
                -3.2706E-02,-9.4369E-03,-2.9842E-03, ...
                 9.5202E-03, 2.6462E-02, 8.1390E-03, ...
                 2.2865E-03,-8.1542E-03, 1.1328E-03, ...
                -4.8105E-03, 1.5307E-03, 1.8632E-03, ...
                 1.1856E-03, 9.7583E-04,-1.4236E-03, ...
                 1.0665E-02, 1.1196E-02, 1.0141E-02, ...
                 2.7029E-03, 7.6283E-04,-2.2904E-04, ...
                -7.3431E-04,-6.9053E-03, 2.8684E-04, ...
                 8.7857E-04, 8.9792E-04, 1.8426E-03, ...
                 1.0182E-05, 9.9144E-04,-6.8376E-03, ...
                 4.1889E-03,-8.3520E-04, 4.7692E-03, ...
                -2.1779E-04,-3.2160E-04,-2.3404E-04, ...
                -3.9832E-03,-8.0937E-04,-2.5324E-03, ...
                -1.1029E-04,-3.9410E-04,-2.9127E-04, ...
                 1.4673E-02, 1.4644E-03, 4.4913E-03, ...
                 1.2082E-03, 1.1461E-03, 9.7184E-04, ...
                 8.7871E-03, 2.9808E-05, 2.7913E-03, ...
                 7.6192E-04, 9.4134E-04, 5.0748E-04, ...
                 3.2757E-03, 1.3459E-03, 7.4301E-04, ...
                 5.2271E-05,-1.1622E-03, 2.0424E-03, ...
                 7.4028E-04, 3.1044E-04,-7.8888E-04, ...
                 7.3294E-04, 4.5496E-04, 3.7781E-04, ...
                -6.7759E-03,-1.3669E-03, 2.5073E-04, ...
                 7.8526E-03, 2.1084E-04,-6.8010E-06, ...
                -1.2768E-04, 9.3358E-05, 5.0014E-03, ...
                 5.5091E-04, 6.4201E-04, 2.6821E-03];
    %     850km equinox
    dat{3,1} = [ 2.2430E+00, 6.3529E-07,-2.1093E-02, ...
                 2.3192E-06, 3.9848E-03,-4.0399E-06, ...
                -2.0864E-03, 1.4147E-06,-2.7632E-03, ...
                 3.8821E-03, 4.3770E-07,-6.7410E-04, ...
                 3.7620E-07, 2.5406E-04,-5.5479E-07, ...
                 4.2678E-04, 3.7791E-07,-2.1396E-03, ...
                 4.3688E-07,-1.3975E-04, 5.5689E-08, ...
                -7.7591E-04,-2.3032E-07,-7.6251E-06, ...
                 1.1410E-07, 3.5107E-02, 3.3463E-07, ...
                 5.8991E-03,-1.6889E-07, 6.4584E-04, ...
                 1.6902E-07, 1.7415E-04, 7.1402E-03, ...
                 4.6111E-07,-6.6733E-04, 1.5319E-07, ...
                -2.8179E-04,-4.4107E-08, 1.8358E-04, ...
                 3.9796E-03,-4.7690E-08,-2.6286E-04, ...
                -1.6931E-07, 5.3136E-05, 4.6929E-08, ...
                 4.6506E-06, 1.0615E-07,-2.2795E-04, ...
                -1.9598E-08,-3.4348E-05,-1.8839E-08, ...
                -6.1345E-03,-1.5260E-08, 5.7992E-04, ...
                -7.6335E-08, 2.2449E-04, 4.1926E-03, ...
                 4.8940E-08, 1.2125E-03,-7.3629E-08, ...
                 3.8057E-04, 1.9487E-03,-1.6906E-09, ...
                 2.1031E-04,-8.3425E-09,-2.3397E-03, ...
                 3.7214E-08,-2.0578E-04,-7.7983E-08, ...
                 1.9869E-02,-1.5178E-07, 7.1451E-05, ...
                -1.6288E-02,-2.8123E-08,-6.2559E-04, ...
                 1.6419E-04,-8.6871E-08,-3.8220E-03, ...
                -3.4288E-08,-1.6062E-02,-2.3689E-03];
    %     850km June solstice
    dat{3,2} = [ 2.2234E+00, 8.7471E-03,-3.6271E-02, ...
                -1.8205E-02, 1.4310E-02, 1.4137E-02, ...
                 1.1152E-03,-5.6408E-03,-2.3086E-04, ...
                 9.8994E-03, 3.6786E-04,-7.5900E-03, ...
                 3.6605E-03, 4.2347E-03, 9.9788E-04, ...
                -1.0637E-03, 6.0786E-05, 3.3041E-03, ...
                 3.2600E-03,-3.9354E-03,-1.1438E-04, ...
                 2.8440E-03, 6.3044E-04,-1.1396E-03, ...
                 1.1203E-04, 3.9674E-02, 1.7704E-03, ...
                -1.3756E-03,-2.0221E-04,-5.5309E-04, ...
                 2.5297E-04, 2.3301E-04, 2.1051E-02, ...
                 8.2900E-03,-9.2282E-04,-2.2149E-03, ...
                -1.2940E-03, 5.0482E-04, 3.2355E-04, ...
                 3.3826E-03,-6.9424E-03, 4.4450E-04, ...
                 3.5048E-04,-2.8501E-04, 8.5714E-05, ...
                 5.0172E-05,-6.0011E-03,-1.9778E-03, ...
                 7.9132E-04, 4.8467E-04,-8.8136E-06, ...
                 5.5216E-03,-3.1276E-03,-1.6523E-03, ...
                 2.7189E-04, 1.2939E-04, 1.6626E-02, ...
                -3.9681E-04, 3.1331E-03, 1.1602E-05, ...
                -2.8408E-04, 1.3352E-02, 2.8371E-03, ...
                 4.9534E-04,-1.7470E-04,-6.1464E-04, ...
                -7.3693E-03,-2.1311E-04, 8.8980E-05, ...
                 2.0388E-02, 2.5072E-04,-1.3785E-03, ...
                -2.1501E-02,-2.0520E-03, 3.9847E-04, ...
                -9.8123E-04, 3.0419E-03, 6.5642E-03, ...
                -1.3463E-03,-4.1453E-03,-3.4043E-03];
    %     1400km equinox
    dat{4,1} = [ 2.0721E+00,-1.2810E-06,-2.2446E-02, ...
                 4.0113E-06, 1.5405E-02,-4.0985E-06, ...
                -4.4873E-03, 1.6972E-06, 1.0420E-03, ...
                -1.0762E-03, 4.3349E-08, 1.2188E-03, ...
                 2.3954E-08,-2.0416E-03,-2.3801E-08, ...
                 2.9302E-04,-2.3188E-08,-7.1780E-04, ...
                -1.8559E-08,-2.6530E-03,-9.1704E-08, ...
                 1.9664E-03, 7.4905E-08, 9.7068E-06, ...
                 3.6472E-08, 9.6520E-03,-1.1466E-06, ...
                -5.4198E-03, 4.4641E-07,-1.3638E-04, ...
                -8.7144E-08, 4.4808E-05,-3.3499E-02, ...
                 1.2687E-06, 2.7432E-03,-6.2446E-07, ...
                -4.9937E-04, 1.3601E-07,-1.1713E-04, ...
                 7.6744E-03,-2.2096E-08,-5.5947E-05, ...
                -3.6655E-08,-2.3160E-04, 1.5485E-09, ...
                 1.9511E-03, 3.2565E-08,-5.0748E-04, ...
                -2.2702E-08, 2.1519E-04, 4.2344E-09, ...
                -2.4070E-02, 4.2536E-08,-1.0566E-03, ...
                -4.8657E-08,-2.4020E-05,-5.3805E-02, ...
                 1.2672E-06, 1.9215E-03,-1.5258E-07, ...
                 1.4154E-04,-3.3868E-03, 4.4217E-08, ...
                -6.1293E-04,-1.1966E-08,-7.1448E-03, ...
                -1.3842E-08,-4.8955E-04, 1.9888E-08, ...
                -5.3833E-02, 5.0588E-07, 1.7924E-04, ...
                -1.0013E-02, 4.5334E-07, 4.6489E-04, ...
                -1.7219E-05, 2.8226E-08, 1.2155E-03, ...
                -5.5547E-08,-2.5776E-02, 3.7582E-02];
    %     1400km June solstice
    dat{4,2} = [ 2.0715E+00, 1.1060E-02,-7.2558E-03, ...
                 1.6759E-02, 4.4526E-03,-3.1949E-03, ...
                -1.1849E-03, 1.9253E-03, 1.6289E-03, ...
                 2.1829E-04,-3.3721E-03, 2.6217E-03, ...
                 7.8261E-04, 5.2241E-04,-1.0364E-03, ...
                 1.4120E-05,-1.7664E-04, 2.6144E-03, ...
                 4.9622E-04,-1.1139E-03, 2.5938E-03, ...
                -1.3858E-03,-4.7107E-04,-2.2748E-04, ...
                -6.5263E-04, 1.5465E-04,-1.8961E-04, ...
                 1.9626E-03,-1.3251E-03,-3.5464E-04, ...
                -3.6056E-04, 7.2928E-04,-3.4355E-02, ...
                -5.4377E-04,-3.7358E-04,-5.4676E-04, ...
                -6.0062E-04,-8.5823E-05,-4.2649E-04, ...
                -2.5657E-03, 2.0810E-03,-5.0775E-04, ...
                -6.9662E-05,-1.1269E-04,-2.9248E-05, ...
                -4.2538E-04, 3.1001E-03, 9.3147E-05, ...
                -2.0474E-04, 9.2787E-05, 1.5224E-04, ...
                 1.6699E-02,-1.0915E-03, 3.9374E-04, ...
                 6.2488E-05, 5.3697E-05, 4.2104E-03, ...
                 2.6857E-04,-5.6046E-04,-1.7589E-04, ...
                -1.6645E-04,-1.0895E-03, 3.1274E-04, ...
                -7.0907E-05,-1.8092E-04,-3.0431E-03, ...
                -4.6234E-04,-2.6949E-05,-3.1150E-06, ...
                 4.6148E-03,-3.4373E-04, 9.9880E-04, ...
                -2.2815E-03, 3.8619E-04,-8.9996E-05, ...
                -2.2212E-05, 2.8260E-04, 3.3863E-03, ...
                -6.4781E-04, 1.0682E-02,-5.7521E-03];
    %     2000km equinox
    dat{5,1} = [ 2.2225E+00,-1.8465E-07, 3.9702E-02, ...
                 7.4498E-08, 6.7294E-03,-1.5623E-07, ...
                 8.6264E-04, 4.9782E-07,-1.0457E-02, ...
                -1.7603E-02,-4.2609E-07, 1.1957E-02, ...
                 2.8967E-07, 4.0676E-03,-4.8392E-08, ...
                -2.0672E-03,-2.7825E-08, 2.3117E-02, ...
                -8.1847E-07, 6.3865E-04, 1.2350E-07, ...
                -3.1363E-03, 2.3973E-08, 7.4011E-04, ...
                 2.2201E-08, 1.5339E-02,-9.2354E-07, ...
                -5.0780E-04, 2.4487E-07,-1.4002E-03, ...
                -9.5180E-08,-2.2099E-04,-2.6709E-02, ...
                 2.0174E-07, 5.2254E-03,-6.4659E-08, ...
                -4.5011E-04,-1.3226E-08,-5.0770E-04, ...
                 2.3246E-02, 4.0279E-07, 4.2692E-03, ...
                -8.2578E-08, 2.8635E-04, 1.9589E-08, ...
                 6.1547E-04,-1.6112E-07,-3.4024E-03, ...
                -3.3185E-08,-8.0475E-04, 6.1774E-09, ...
                 3.9677E-02, 1.8432E-07, 2.2421E-03, ...
                -3.3228E-09,-2.2705E-05,-2.1308E-02, ...
                -1.1246E-07, 2.6961E-03, 2.2048E-08, ...
                 1.6385E-05, 1.0901E-02, 4.6221E-07, ...
                -3.8862E-06,-4.9407E-08, 1.3349E-02, ...
                 9.8339E-08,-5.5719E-04,-1.8928E-08, ...
                 3.9061E-02, 4.3038E-07, 1.0085E-03, ...
                 1.1895E-02, 4.6967E-07, 4.3363E-04, ...
                -5.3628E-03, 4.2370E-07, 1.2707E-03, ...
                 1.0193E-07, 1.2395E-02, 1.0030E-02];
    %     2000km June solstice
    dat{5,2} = [ 2.2631E+00, 2.1866E-02, 4.6921E-03, ...
                -3.3329E-02, 1.0108E-02,-1.2195E-02, ...
                 4.8366E-03, 2.1350E-02,-8.6916E-03, ...
                 3.4443E-03,-7.1057E-03,-1.4225E-03, ...
                -9.9691E-03,-6.0693E-04,-2.9332E-03, ...
                -1.0505E-03,-1.9665E-03, 2.1469E-02, ...
                -1.9500E-02,-1.0986E-02, 5.2916E-03, ...
                 2.7388E-03,-4.6114E-05,-2.6742E-03, ...
                 2.0601E-06, 7.5298E-03,-1.1021E-02, ...
                -3.8100E-03,-1.2864E-03,-1.0705E-03, ...
                -4.8383E-04,-1.2329E-03, 3.4064E-02, ...
                -1.6264E-02, 2.6406E-04, 1.1486E-03, ...
                 2.0181E-03, 4.7744E-04,-2.2118E-04, ...
                 8.5559E-03, 4.6544E-03,-3.0707E-03, ...
                 1.0697E-03, 7.4102E-05,-6.8598E-04, ...
                -3.7443E-02,-4.1490E-03, 4.8394E-03, ...
                 2.8449E-04,-8.1610E-04, 4.1996E-04, ...
                -2.3120E-02,-2.2430E-03,-1.6598E-03, ...
                 5.4323E-04,-3.9800E-04, 8.7947E-03, ...
                 5.9441E-03, 1.2565E-04, 8.0901E-04, ...
                -7.3510E-04,-2.1540E-02,-2.6029E-04, ...
                 1.1616E-03,-1.5312E-04, 6.3625E-03, ...
                -4.0037E-03,-1.5571E-03,-5.7964E-04, ...
                 8.1764E-03,-2.3762E-05,-1.2959E-04, ...
                 6.2361E-03,-4.9235E-03, 6.0991E-04, ...
                 1.6101E-03,-3.9088E-03,-1.3380E-02, ...
                -4.2837E-04,-1.1667E-02, 3.9335E-03];
    DPF107 = zeros(NI,NJ,NK);
    for I=1:NI
      for J=1:NJ-1
        for K=1:NK
          DPF107(I,J,K) = dat{I,J}(K);
        end
      end
    end
  end
  DOUT = DPF107;
  for K=1:NK
    for I=1:NI
      DOUT(I,NJ,K)=DPF107(I,NJ-1,K)*MIRREQ(K);
    end
  end

end

