function [ NO,NH,NHE,NN ] = CALION( CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,F107 )
%CALION calculates relative density of O+, H+, He+ and N+
%
%	SUBROUTINE CALION(CRD,INVDIP,FL,DIMO,B0,
%                         DIPL,MLT,ALT,DDD,F107,NO,NH,NHE,NN)
%----------------------------------------------------------------------
% Version 1.0 (released 20.12.2002)
% CALION calculates relative density of O+, H+, He+ and N+  in the outer
% ionosphere with regard to solar activity (F107 index).
% CALION uses subroutines IONLOW and IONHIGH.
% Linearly interpolates for solar activity.
% Inputs: CRD - 0 .. INVDIP
%               1 .. FL, DIMO, B0, DIPL (used for calculation INVDIP inside)
%         INVDIP - "mix" coordinate of the dip latitude and of
%                    the invariant latitude;
%                    positive northward, in deg, range <-90.0;90.0>
%         FL, DIMO, B0 - McIlwain L parameter, dipole moment in
%                        Gauss, magnetic field strength in Gauss -
%                        parameters needed for invariant latitude
%                        calculation
%         DIPL - dip latitude
%                positive northward, in deg, range <-90.0;90.0>
%         MLT - magnetic local time (central dipole)
%               in hours, range <0;24)
%         ALT - altitude above the Earth's surface;
%               in km, range <350;2000>
%         DDD - day of year; range <0;365>
%         F107 - F107 index
% Output: NO,NH,NHE,NN - relative density of O+, H+, He+, and N+
% Versions:  1.0 FORTRAN
%
% REFERENCES:
%   Triskova, L., Truhlik, V., Smilauer, J. An empirical model of ion
%      composition in the outer ionosphere. Adv. Space Res. 31 (3), 
%      653–663, 2003.
%   Truhlik, V., Triskova, L., Smilauer, J. New advances in empirical
%      modeling of ion composition in the outer ionosphere. Adv. Space
%      Res. 33, 844–849, 2004.
%
% Author of the code:
%         Vladimir Truhlik
%         Institute of Atm. Phys.
%         Bocni II.
%         141 31 Praha 4, Sporilov
%         Czech Republic
%         e-mail: vtr@ufa.cas.cz
%         tel/fax: +420 267103058, +420 728073539 / +420 272 762528
%----------------------------------------------------------------------

%      REAL INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,F107
%	INTEGER CRD,DDD,ION
%      REAL NO,NH,NHE,NN,NOH,NHH,NHEH,NNH,NOL,NHL,NHEL,NNL,NTOT
%      DIMENSION  DOL(3,3,49),DHL(3,3,49),DHEL(3,3,49),DNL(3,3,49)
%      DIMENSION  DOH(4,3,49),DHH(4,3,49),DHEH(4,3,49),DNH(4,3,49)
  persistent DOL DHL DHEL DNL DOH DHH DHEH DNH;
  if isempty(DOL)
%/////////////////////coefficients high solar activity////////////////////////
%//////////////////////////////////O+/////////////////////////////////////////
%     550km equinox
    D11 = [-1.2838E-002, 3.3892E-009,-4.9527E-003, ...
                             9.6584E-009,-2.8249E-004, 9.2209E-009, ...
                            -1.5708E-003,-1.5997E-003,-1.7077E-010, ...
                             6.0805E-004,-3.2035E-009, 4.6574E-004, ...
                            -3.0838E-009,-1.7719E-003, 1.7746E-009, ...
                             2.0281E-003, 5.9550E-010,-8.4087E-004, ...
                             7.3645E-010, 1.6083E-003,-1.9020E-010, ...
                            -5.6389E-004, 2.1437E-010,-9.1530E-005, ...
                            -8.1471E-004,-1.4259E-009,-5.3451E-004, ...
                            -6.4989E-010, 9.7174E-005,-9.1365E-004, ...
                             3.6711E-010,-2.8037E-005, 7.6651E-011, ...
                             1.5422E-003, 1.4647E-010,-1.7107E-005, ...
                             2.1872E-010, 1.4265E-004, 6.1624E-010, ...
                             1.2512E-004, 4.8548E-004,-1.6132E-010, ...
                            -1.4022E-005,-1.1307E-004, 1.6024E-010, ...
                             2.7979E-004, 6.1773E-011,-2.7536E-005, ...
                             3.7412E-005];
%     550km June solstice
    D12 = [-1.3612E-002,-5.5550E-003,-8.8001E-003, ...
                            -6.7878E-003,-2.5424E-003,-6.6143E-004, ...
                            -3.0189E-003,-5.1701E-004,-3.4954E-004, ...
                            -2.9469E-005, 4.0382E-005, 3.1389E-006, ...
                             5.8065E-005, 1.6808E-003,-2.0046E-004, ...
                             1.1039E-003, 1.0451E-003,-1.0243E-004, ...
                            -1.6330E-004, 1.3405E-003,-4.0310E-004, ...
                             2.9640E-004, 3.3187E-004, 1.5748E-004, ...
                            -1.0201E-003,-3.4733E-004,-1.8801E-004, ...
                             1.3370E-004,-3.8261E-005, 2.5237E-004, ...
                             9.9983E-005, 5.3315E-005, 6.1462E-005, ...
                            -2.2161E-004, 3.8285E-004, 3.6890E-005, ...
                            -2.8965E-006,-2.6102E-005, 2.1884E-005, ...
                             5.6101E-005, 3.2898E-004, 4.8422E-005, ...
                             8.9837E-007, 2.0305E-005, 1.3643E-005, ...
                             1.1488E-004, 4.8798E-005,-1.7122E-006, ...
                             1.3591E-004];
%     900km equinox
    D21 = [-1.1873E-001,-7.9543E-008, 8.8754E-002, ...
                             1.2749E-007, 3.7834E-002,-3.7071E-008, ...
                            -3.3659E-002,-1.3753E-001,-6.7705E-008, ...
                            -7.8370E-003, 5.0045E-008, 1.7354E-002, ...
                            -1.2451E-008,-5.5262E-002,-1.6397E-008, ...
                             9.0203E-003,-3.1764E-009, 3.2200E-004, ...
                             4.4309E-009,-4.7726E-002,-1.6271E-008, ...
                            -1.6568E-002, 8.7942E-009, 3.9707E-003, ...
                            -1.3873E-002,-1.3387E-008,-5.5410E-003, ...
                             3.2760E-009, 1.5026E-003, 5.4130E-004, ...
                            -4.3665E-009,-8.5634E-003, 2.2732E-009, ...
                            -7.3394E-003,-9.4292E-009,-4.1713E-003, ...
                             2.0113E-009, 2.5152E-003,-1.4286E-010, ...
                            -2.7636E-003, 1.4591E-003,-3.7848E-009, ...
                            -2.1361E-003,-1.7300E-003,-6.3066E-012, ...
                            -1.8190E-003,-1.1929E-009,-2.4384E-003, ...
                             4.5096E-003];
%     900km June solstice
    D22 = [-1.1400E-001, 7.2284E-002, 5.9514E-002, ...
                            -9.2827E-002, 2.4670E-002, 1.8185E-002, ...
                            -5.3528E-003,-1.0798E-001, 4.9821E-002, ...
                            -5.4609E-003,-7.3866E-003, 5.5822E-003, ...
                            -2.2066E-003,-9.4552E-003,-7.0287E-003, ...
                             1.5038E-002,-4.9536E-003,-2.1970E-003, ...
                             1.8018E-003,-5.1372E-002, 1.5935E-002, ...
                            -7.7984E-004,-9.8830E-004,-6.1488E-004, ...
                            -5.4875E-003,-6.8829E-003, 9.0910E-003, ...
                            -3.6180E-003, 4.6157E-004,-3.7871E-003, ...
                            -9.0714E-005, 6.0385E-004, 1.6097E-004, ...
                            -7.2617E-003,-1.9084E-003, 3.5375E-003, ...
                            -8.3529E-004,-7.7380E-003, 1.0796E-004, ...
                             5.0314E-004,-1.3759E-002, 5.3603E-004, ...
                             6.4259E-004,-6.4764E-003,-1.6915E-004, ...
                            -7.3788E-003, 3.5767E-004,-3.8287E-003, ...
                            -3.2403E-003];
%     1500km equinox
    D31 = [-5.0096E-001, 3.9699E-007, 5.4222E-001, ...
                            -4.2933E-007, 4.2261E-002,-1.2006E-007, ...
                            -1.3304E-001,-5.7614E-001, 1.9950E-007, ...
                             4.2972E-002,-3.6102E-008, 3.6207E-002, ...
                            -8.1212E-009,-3.0608E-001, 7.6853E-008, ...
                             6.8090E-002,-5.5044E-008,-4.6984E-003, ...
                             2.6068E-008,-1.5518E-001,-2.0579E-008, ...
                            -2.1672E-002, 9.6017E-009, 7.6241E-003, ...
                            -1.5461E-001, 3.9902E-008, 3.9501E-003, ...
                            -9.3205E-009, 3.6564E-003,-1.8591E-002, ...
                            -1.5121E-008,-1.0493E-002, 5.6094E-009, ...
                             2.3030E-002,-4.0654E-008,-6.5416E-004, ...
                             1.2860E-010,-3.5348E-002, 1.1426E-008, ...
                            -4.0794E-003, 2.4538E-002,-2.8703E-008, ...
                             1.1241E-003, 3.0503E-003, 7.4212E-010, ...
                            -9.1099E-003,-6.3420E-009,-2.4364E-003, ...
                             7.8412E-003];
%     1500km June solstice
    D32 = [-3.8369E-001, 2.8162E-001, 3.3410E-001, ...
                            -4.4591E-001, 1.2217E-001, 1.4901E-001, ...
                            -1.2365E-001,-3.3668E-001, 1.4641E-001, ...
                             1.5156E-002,-4.2536E-002, 2.6524E-002, ...
                            -5.5077E-003,-1.1957E-001, 6.0421E-002, ...
                            -3.9161E-003,-1.0382E-002, 1.1853E-002, ...
                            -7.9129E-003, 5.4055E-002,-3.9953E-002, ...
                             7.1875E-003, 6.0955E-003,-3.0049E-003, ...
                            -4.5588E-003,-7.0102E-003, 8.8947E-005, ...
                             4.6705E-003,-1.5544E-003, 5.2816E-002, ...
                            -3.2857E-002, 7.5772E-003, 3.3781E-004, ...
                             5.3629E-002,-2.2430E-002, 2.4118E-003, ...
                             3.1271E-004,-1.4393E-002,-6.6816E-003, ...
                             1.7099E-003, 4.2075E-003,-2.0012E-003, ...
                            -6.8627E-004,-1.6996E-002, 1.9841E-003, ...
                            -1.0077E-002,-4.0022E-004,-3.5827E-003, ...
                             1.0792E-003];
%     2250km equinox
    D41 = [-7.5121E-001, 4.7106E-006, 9.8731E-001, ...
                            -1.1517E-005,-2.1953E-001, 7.7259E-006, ...
                            -7.3014E-002,-3.4116E-001,-1.3414E-006, ...
                             3.8833E-002,-6.9663E-007, 1.0871E-002, ...
                             5.1607E-007,-5.2445E-001, 1.5335E-006, ...
                             1.1675E-001,-9.3384E-007,-8.9381E-003, ...
                             1.5077E-007,-4.9602E-003,-6.4438E-007, ...
                            -1.0283E-002,-3.9542E-008, 1.7114E-003, ...
                            -1.1767E-001, 2.1163E-007,-1.4566E-003, ...
                            -2.4207E-007, 1.9790E-003,-8.8082E-003, ...
                            -4.2416E-008, 1.0644E-003,-2.3959E-009, ...
                             9.4817E-002,-7.9695E-007,-4.1841E-003, ...
                            -5.9703E-008, 4.2488E-002, 4.4664E-008, ...
                             1.6134E-003, 4.5698E-002,-2.0829E-007, ...
                            -1.2046E-003,-1.0719E-004, 1.8530E-007, ...
                             8.5126E-003, 4.9934E-008, 7.7988E-003, ...
                             1.4431E-003];
%     2250km June solstice
    D42 = [-8.2190E-001, 3.6727E-001, 8.6943E-001, ...
                            -5.1681E-001, 4.3418E-002, 1.4628E-001, ...
                            -1.6190E-001,-4.8689E-001, 7.9939E-002, ...
                             2.9131E-002, 9.4168E-003, 1.6115E-002, ...
                            -1.1809E-002,-4.8438E-001, 1.0166E-001, ...
                             1.2800E-001,-6.1316E-002,-1.6983E-002, ...
                             1.4167E-002, 3.5405E-003,-7.8288E-003, ...
                            -3.2292E-003, 8.7041E-003,-3.6171E-003, ...
                            -1.5451E-001,-1.1808E-002, 2.8659E-002, ...
                            -2.7932E-004,-2.7786E-003, 1.5649E-001, ...
                            -4.8513E-003,-2.4998E-003,-9.9171E-004, ...
                            -8.0071E-002,-2.4185E-003, 6.4073E-003, ...
                            -2.6383E-004,-4.7954E-003,-8.6720E-003, ...
                             1.5965E-003,-7.1514E-003, 7.0614E-003, ...
                            -1.8408E-003,-1.1994E-002,-4.7379E-003, ...
                            -2.0841E-002,-2.9637E-003,-4.9867E-003, ...
                            -1.4069E-002];
    DOH = zeros(4,3,49);
    for J=1:49
      DOH(1,1,J) = D11(J);
      DOH(1,2,J) = D12(J);
      DOH(2,1,J) = D21(J);
      DOH(2,2,J) = D22(J);
      DOH(3,1,J) = D31(J);
      DOH(3,2,J) = D32(J);
      DOH(4,1,J) = D41(J);
      DOH(4,2,J) = D42(J);
    end
%//////////////////////////////////////////////////////////////////////
%//////////////////////////////////H+//////////////////////////////////
%     550km equinox
     D11 = [-3.1678E+000, 3.6289E-007,-5.5819E-002, ...
                            -1.0303E-006,-1.1119E-001,-1.7286E-007, ...
                             2.9466E-002, 6.9927E-001,-1.0867E-007, ...
                            -3.8446E-002,-3.1427E-008, 1.4009E-002, ...
                             4.5348E-008, 2.6142E-001, 9.8583E-008, ...
                            -1.5370E-002,-8.8257E-008, 1.1618E-002, ...
                             9.8907E-008,-5.4724E-002, 2.2519E-007, ...
                             1.5621E-002,-1.0045E-008, 3.6467E-003, ...
                            -1.2359E-001, 4.9284E-008,-1.1143E-002, ...
                             2.3898E-009,-5.8604E-003,-1.0020E-003, ...
                            -1.1869E-007,-8.7861E-004,-1.0543E-008, ...
                             9.8818E-002, 7.4183E-008, 1.3692E-002, ...
                            -1.6456E-008,-3.8041E-002, 3.5978E-008, ...
                            -3.9582E-003, 2.8077E-002,-2.2537E-008, ...
                             1.5597E-003,-3.7610E-003,-2.4712E-008, ...
                             4.0460E-003, 7.7021E-009,-1.4101E-003, ...
                             1.6789E-002];
%     550km June solstice
     D12 = [-2.8141E+000,-4.4836E-001, 8.2760E-003, ...
                             1.9407E-001, 2.8119E-002,-2.6308E-002, ...
                            -1.5432E-002, 4.8983E-001, 8.6385E-002, ...
                            -7.5200E-002, 1.8661E-002, 4.9780E-003, ...
                            -1.6762E-002, 1.8896E-001,-8.6811E-002, ...
                             5.1824E-004,-6.4436E-003, 3.5544E-003, ...
                             9.4714E-003, 2.0099E-002, 1.9941E-002, ...
                             2.5581E-002,-5.2659E-003,-3.4378E-003, ...
                            -1.2902E-001, 1.4578E-002,-2.5016E-003, ...
                            -2.0760E-002, 3.4195E-003,-8.2338E-002, ...
                             5.0698E-003,-3.4081E-004,-2.7512E-003, ...
                            -4.0443E-002, 2.2658E-003,-8.0779E-003, ...
                            -3.1290E-003,-1.5350E-003, 2.5313E-003, ...
                            -3.4740E-003, 8.2225E-003,-2.6921E-003, ...
                             1.3247E-003, 5.7483E-003, 4.0066E-003, ...
                             1.3048E-002, 1.6612E-004, 6.5345E-003, ...
                             6.1813E-003];
%     900km equinox
     D21 = [-1.5293E+000, 1.9563E-007,-7.1593E-001, ...
                             5.0551E-008,-1.0967E-001, 1.4302E-007, ...
                             2.3166E-001, 7.0241E-001, 6.7276E-008, ...
                            -3.9113E-003,-2.3431E-008,-2.9279E-002, ...
                            -2.1680E-008, 3.0214E-001, 8.5569E-008, ...
                            -5.9577E-002,-7.4572E-008, 1.3847E-002, ...
                             1.9007E-008, 9.1829E-002,-8.0079E-008, ...
                             2.6453E-002, 2.1214E-008,-3.2018E-003, ...
                            -2.1978E-001, 1.7330E-009,-1.1862E-003, ...
                             2.2427E-008, 1.3491E-003, 2.8588E-002, ...
                            -5.3489E-008, 1.1135E-002,-1.3678E-009, ...
                             7.9619E-002, 1.5714E-008, 7.1930E-003, ...
                             2.9905E-009,-3.8042E-002, 1.1725E-008, ...
                             3.4274E-003,-4.9647E-003, 2.1675E-009, ...
                             7.9079E-003,-7.9338E-003, 3.6623E-008, ...
                             8.5068E-004, 1.7537E-009, 2.3308E-002, ...
                            -2.1869E-002];
%     900km June solstice
     D22 = [-1.3652E+000,-3.7141E-001,-6.9554E-001, ...
                             2.1456E-001, 9.1424E-002, 4.0012E-002, ...
                             9.3601E-002, 4.8116E-001, 3.2264E-002, ...
                             6.8285E-002, 9.8315E-003,-3.4080E-003, ...
                            -1.1225E-003, 1.2620E-001, 3.3225E-002, ...
                            -4.8420E-002,-2.8323E-002,-2.2914E-003, ...
                             7.9720E-003, 1.2455E-001,-4.2949E-002, ...
                            -5.3643E-003, 6.7441E-003, 1.4582E-002, ...
                            -4.0379E-002, 3.8848E-002,-3.2937E-003, ...
                             9.1013E-003,-7.5494E-003,-6.2580E-002, ...
                             1.1877E-002,-4.8900E-003,-5.3770E-003, ...
                             1.5066E-002,-9.2034E-004,-7.2370E-003, ...
                            -3.5355E-004, 8.6705E-003, 1.0198E-002, ...
                             2.0618E-003, 5.7210E-002, 6.8151E-003, ...
                            -1.8874E-003, 1.7634E-002, 9.8946E-003, ...
                             1.8101E-002, 5.3287E-003, 3.0321E-002, ...
                             6.8488E-003];
%     1500km equinox
     D31 = [-8.1841E-001, 1.3246E-007,-9.9407E-001, ...
                            -3.5826E-007,-1.1572E-001,-3.8968E-007, ...
                             1.8954E-001, 2.6643E-001,-1.2399E-008, ...
                             2.2029E-002, 3.5262E-008,-2.5895E-002, ...
                             2.5542E-008, 1.7279E-001,-1.0393E-008, ...
                            -3.0719E-002,-6.3703E-009, 7.5848E-003, ...
                            -1.4497E-008, 9.7870E-002,-1.3003E-007, ...
                            -2.0224E-003,-3.9366E-008,-3.2416E-003, ...
                             1.5904E-002,-1.5451E-008,-3.5652E-003, ...
                            -1.3658E-009,-7.7126E-003,-1.5924E-002, ...
                             1.6773E-008,-3.7276E-003, 1.7795E-008, ...
                             7.4727E-003, 3.0856E-008, 7.4715E-004, ...
                             7.3372E-009, 1.3716E-002, 4.6691E-008, ...
                             4.0197E-003,-1.1936E-002, 5.8220E-009, ...
                             3.8995E-003, 7.2715E-003,-2.0243E-008, ...
                             4.1793E-003,-3.2785E-009, 1.3978E-002, ...
                            -6.1225E-003];
%     1500km June solstice
     D32 = [-8.1500E-001,-3.1034E-001,-1.0382E+000, ...
                             2.2304E-001,-1.3799E-001, 6.2362E-002, ...
                             2.6902E-001, 2.6612E-001,-4.7466E-002, ...
                             1.9184E-002,-7.0576E-002,-1.7642E-002, ...
                             1.4685E-002, 7.7755E-002,-3.1315E-002, ...
                             1.9684E-002,-1.3324E-002, 3.4012E-003, ...
                             3.7043E-002,-1.8646E-002, 2.6457E-002, ...
                             9.8637E-003, 2.6819E-003, 1.7598E-003, ...
                            -2.1755E-002, 4.2552E-003,-1.6633E-002, ...
                            -6.7044E-003, 3.4964E-003,-4.8719E-003, ...
                             5.9790E-003, 2.3021E-005, 5.4778E-003, ...
                            -1.2598E-002, 9.9962E-003,-1.0507E-003, ...
                             5.7994E-003, 2.0765E-002, 1.1593E-002, ...
                            -3.2365E-004,-1.5353E-003, 1.4942E-003, ...
                             1.9642E-003, 8.8836E-003, 4.2172E-003, ...
                            -1.8502E-004, 2.3092E-003, 1.8370E-003, ...
                            -3.7978E-004];
%     2250km equinox
     D41 = [-6.6978E-001, 4.5698E-007,-1.2361E+000, ...
                            -1.5676E-007,-1.2804E-001,-6.0241E-007, ...
                             2.7591E-001, 4.0136E-002,-1.1570E-007, ...
                             2.1493E-002,-4.5863E-008, 2.6574E-003, ...
                             1.7588E-008, 1.5964E-001, 1.2470E-007, ...
                             1.8918E-002, 9.3632E-008,-2.4488E-003, ...
                             2.0725E-008, 6.6975E-002, 1.1782E-008, ...
                             1.9413E-002, 6.2877E-009, 5.3689E-003, ...
                            -1.5363E-002,-2.0022E-009,-2.1002E-002, ...
                            -6.7078E-009,-2.9894E-003, 6.1202E-003, ...
                             1.2119E-008,-2.2888E-003, 4.3298E-009, ...
                            -4.6405E-002,-5.8474E-008,-3.6078E-003, ...
                            -1.6963E-008,-1.8254E-002,-1.0377E-009, ...
                            -1.3715E-003,-2.2111E-003, 3.4185E-009, ...
                             9.5343E-004,-2.2094E-003, 2.7066E-009, ...
                            -2.4215E-003,-3.1546E-009,-1.0581E-003, ...
                            -1.0098E-003];
%     2250km June solstice
    D42 = [-5.6899E-001,-2.5609E-001,-1.0606E+000, ...
                            -1.6164E-002,-1.9427E-001, 1.0428E-001, ...
                             1.9448E-001, 1.1527E-001, 1.6518E-002, ...
                             3.6148E-002,-7.0688E-003, 1.0841E-002, ...
                             3.6512E-003, 1.0339E-001,-2.1704E-003, ...
                            -7.0271E-003, 1.9422E-002, 4.1677E-003, ...
                            -6.6189E-003, 4.3364E-002,-2.5002E-002, ...
                             1.4219E-002,-2.2654E-003, 5.6440E-003, ...
                            -3.7866E-002, 1.0338E-004,-3.9639E-003, ...
                            -3.3311E-003,-3.3289E-004,-5.2423E-002, ...
                             2.5430E-003,-7.1279E-003, 3.2787E-003, ...
                             5.9375E-003, 7.2932E-003,-1.9167E-003, ...
                            -1.8983E-003, 4.5326E-003, 6.8099E-003, ...
                            -7.4999E-005,-7.8634E-003,-5.5813E-003, ...
                            -5.3892E-004, 8.5280E-004, 1.4028E-003, ...
                             3.5032E-003,-3.7237E-004,-2.5767E-005, ...
                            -8.0710E-004];
    DHH = zeros(4,3,49);
    for J=1:49
      DHH(1,1,J) = D11(J);
      DHH(1,2,J) = D12(J);
      DHH(2,1,J) = D21(J);
      DHH(2,2,J) = D22(J);
      DHH(3,1,J) = D31(J);
      DHH(3,2,J) = D32(J);
      DHH(4,1,J) = D41(J);
      DHH(4,2,J) = D42(J);
    end
%//////////////////////////////////////////////////////////////////////
%//////////////////////////////////He+/////////////////////////////////
%     550km equinox
    D11 = [-3.0827E+000, 4.4643E-007,-3.4361E-001, ...
                            -4.7996E-007,-2.9473E-001, 1.5576E-007, ...
                             2.0815E-001, 4.0991E-001,-2.9466E-008, ...
                            -5.9793E-002, 3.8185E-008, 2.5958E-002, ...
                            -5.2957E-008, 6.6694E-001, 1.1803E-007, ...
                            -2.9476E-002, 1.4225E-008,-1.3761E-002, ...
                            -7.2518E-008,-2.8967E-001,-2.0293E-008, ...
                             1.8383E-002, 1.0666E-008,-9.8637E-003, ...
                            -2.1268E-001, 4.3123E-008,-1.3389E-002, ...
                             2.6780E-009, 9.9442E-004,-7.8858E-003, ...
                             5.6098E-009,-4.9395E-003,-4.3890E-010, ...
                            -8.3089E-002, 5.4720E-008, 1.4305E-002, ...
                            -9.3089E-009,-6.8383E-003,-7.1157E-009, ...
                            -3.9638E-003, 9.9653E-003, 1.0788E-008, ...
                            -1.1729E-003,-2.9558E-003, 1.6849E-008, ...
                             1.2213E-003,-8.7021E-009,-1.4505E-002, ...
                            -5.6113E-004];
%     550km June solstice
    D12 = [-2.9760E+000,-8.6799E-001, 4.8259E-002, ...
                             4.8124E-001,-9.2323E-003,-1.7802E-001, ...
                             1.2279E-001, 1.6776E-001, 2.1054E-001, ...
                            -5.1912E-002,-1.0298E-002, 1.5834E-002, ...
                            -8.3905E-003, 1.5721E-001,-2.7260E-002, ...
                            -6.7125E-002,-3.9449E-002, 4.7324E-003, ...
                             1.0327E-002,-1.8399E-001, 2.0860E-002, ...
                             4.3145E-002,-4.9043E-003,-5.6411E-003, ...
                            -2.4448E-001, 7.1468E-002,-1.2413E-002, ...
                            -1.3358E-002,-2.2098E-003,-3.9760E-002, ...
                            -7.9188E-003, 6.9939E-004,-5.3921E-003, ...
                            -5.5414E-002, 8.5107E-003,-9.8890E-003, ...
                             5.1361E-004, 6.6272E-002,-2.5510E-003, ...
                            -7.3423E-003, 2.0118E-003,-6.4885E-003, ...
                             2.7256E-003, 8.6778E-003,-8.9810E-004, ...
                             1.0350E-002,-3.1749E-003, 1.6338E-002, ...
                            -2.1051E-003];
%     900km equinox
    D21 = [-1.7100E+000, 5.2540E-007,-8.2280E-001, ...
                            -8.2344E-007,-4.0545E-001,-5.5031E-007, ...
                             3.3911E-001, 2.5554E-001, 8.4842E-008, ...
                             8.3244E-002, 9.6193E-008,-6.0073E-002, ...
                            -2.0823E-007, 3.0060E-001, 7.9876E-008, ...
                            -1.1750E-001,-2.9524E-008,-3.5514E-002, ...
                            -2.9102E-008,-4.5851E-002,-4.7236E-009, ...
                             2.4348E-002, 4.2832E-009,-7.4072E-003, ...
                            -1.1252E-001, 9.5787E-008, 2.6864E-002, ...
                             1.7685E-008,-5.9893E-003,-1.6605E-001, ...
                            -1.3665E-007, 1.2534E-002, 1.1691E-008, ...
                             4.7303E-002, 6.8012E-010, 1.0472E-002, ...
                             1.9695E-009,-8.2855E-003,-8.1465E-009, ...
                             5.7602E-003, 7.8478E-003,-2.5233E-008, ...
                             3.0308E-003,-8.5876E-003, 2.5667E-009, ...
                             6.5844E-003,-1.7771E-008,-6.1409E-003, ...
                            -1.0949E-002];
%     900km June solstice
    D22 = [-2.0393E+000,-8.1007E-001,-4.3286E-001, ...
                             3.0351E-001,-1.7024E-001, 4.6307E-002, ...
                            -2.4220E-003,-6.3442E-002,-1.6370E-003, ...
                             6.7460E-002,-1.0338E-002,-4.4583E-002, ...
                             9.6863E-003, 5.3744E-003, 2.6359E-003, ...
                            -5.8995E-002,-1.6310E-002, 7.3342E-003, ...
                             9.4701E-004, 6.9508E-002,-4.3418E-002, ...
                            -5.1968E-003,-3.0680E-003, 1.1837E-002, ...
                            -1.2321E-001, 4.2603E-002,-3.5437E-002, ...
                             1.6518E-002,-1.2969E-002, 3.2534E-002, ...
                             2.8450E-003, 3.5741E-003,-2.0381E-003, ...
                            -5.0507E-002, 8.2961E-003, 3.8507E-004, ...
                             1.0441E-003, 4.1571E-002,-2.9669E-003, ...
                            -7.7910E-004, 2.2211E-002,-3.5130E-003, ...
                             2.3044E-003, 2.9926E-002, 2.6085E-003, ...
                             2.5759E-002, 3.9804E-004, 3.1126E-002, ...
                             1.0860E-002];
%     1500km equinox
    D31 = [-1.2078E+000,-8.3889E-008,-8.6323E-001, ...
                            -1.5199E-007,-4.4768E-001, 2.5090E-007, ...
                             3.5311E-001, 1.3210E-001,-4.2130E-009, ...
                            -2.5480E-003, 3.0688E-008,-4.3178E-002, ...
                             1.8903E-009, 8.9046E-002,-1.0776E-008, ...
                             2.9388E-002, 2.2664E-008,-1.1335E-002, ...
                            -1.4036E-008,-4.9870E-002,-2.0597E-008, ...
                             5.1163E-003, 1.5444E-008, 7.0597E-003, ...
                            -1.1044E-001, 3.2974E-008, 3.3729E-002, ...
                             9.6660E-009,-2.0066E-002,-4.7281E-002, ...
                             1.0175E-008, 4.5853E-003, 3.9224E-009, ...
                            -5.6840E-002, 3.2182E-008, 1.2884E-002, ...
                             6.6859E-009, 4.2958E-002, 7.5059E-009, ...
                             5.0972E-003,-3.4220E-002, 4.4177E-009, ...
                             6.6776E-003,-4.7692E-003, 1.1823E-008, ...
                            -8.8228E-003,-2.5359E-009,-1.1986E-002, ...
                            -5.1509E-003];
%     1500km June solstice
    D32 = [-1.5728E+000,-6.8726E-001,-4.6811E-001, ...
                             2.4677E-002,-4.5196E-001, 1.5523E-001, ...
                             3.0631E-001, 1.4197E-001,-7.8123E-002, ...
                            -1.7428E-002,-1.7897E-002,-1.8015E-002, ...
                             2.7210E-002, 6.0701E-002,-1.3212E-001, ...
                            -2.2745E-002,-1.7608E-002,-1.2909E-002, ...
                             2.0402E-002,-4.0894E-003, 3.9555E-003, ...
                            -3.6464E-003, 1.4643E-002,-5.5944E-003, ...
                            -8.8090E-002,-1.0930E-002,-7.3501E-003, ...
                            -5.6046E-003, 2.6169E-003,-1.6782E-002, ...
                             1.4274E-002,-2.7868E-004, 2.1147E-003, ...
                            -1.8199E-002, 8.8925E-003,-1.5835E-003, ...
                             1.8784E-003, 1.1248E-002, 7.2779E-003, ...
                             4.4115E-004, 1.8361E-003,-1.1211E-003, ...
                             1.1060E-003, 1.1001E-002, 1.2477E-003, ...
                             9.0196E-003,-5.8886E-004, 9.7300E-003, ...
                             4.9376E-003];
%     2250km equinox
    D41 = [-1.1230E+000,-2.9419E-007,-9.5822E-001, ...
                            -3.4817E-007,-3.5165E-001, 2.2927E-007, ...
                             3.3646E-001, 8.9248E-002,-1.1195E-007, ...
                             3.8351E-002,-7.4946E-008, 2.5411E-005, ...
                             2.1650E-008,-8.8392E-003,-1.7418E-008, ...
                             1.2222E-002, 4.5854E-009,-2.1108E-002, ...
                             3.0780E-008, 3.1391E-002,-9.2939E-009, ...
                             1.1868E-002,-2.3493E-009, 4.0791E-003, ...
                            -9.2411E-003,-3.1598E-009,-2.5908E-003, ...
                            -9.0595E-009,-1.0797E-003, 4.0200E-002, ...
                            -2.9380E-009,-1.5619E-003,-2.7627E-010, ...
                             2.2044E-002,-1.6962E-008,-8.5223E-003, ...
                            -3.6076E-009, 2.3448E-002,-4.9645E-009, ...
                            -5.8718E-004,-1.5134E-002,-8.6918E-009, ...
                            -2.3766E-003, 7.2023E-004, 9.0865E-010, ...
                             3.0388E-003,-2.6828E-009, 4.6501E-004, ...
                            -7.7390E-004];
%     2250km June solstice
    D42 = [-1.3029E+000,-4.3965E-001,-4.3540E-001, ...
                            -1.2774E-001,-5.4683E-001, 8.9815E-002, ...
                             2.4691E-001, 1.5207E-001, 4.5816E-002, ...
                             4.2447E-002,-2.7108E-002, 2.7242E-003, ...
                            -7.3419E-003,-4.7334E-002, 5.0151E-002, ...
                            -2.1149E-002,-2.3378E-002, 4.3055E-003, ...
                            -1.6985E-002, 1.5813E-002,-1.6609E-002, ...
                             1.1566E-002, 6.2104E-003, 5.0605E-003, ...
                            -3.5118E-002,-2.0272E-002,-8.5016E-003, ...
                            -9.0160E-003,-6.8417E-003,-2.5045E-002, ...
                            -1.0184E-002,-6.3754E-003, 6.0554E-003, ...
                            -2.0355E-002,-2.8685E-003,-2.6734E-003, ...
                            -1.5766E-003, 6.4888E-003,-1.6234E-003, ...
                            -2.5859E-003, 6.6457E-003,-1.4526E-003, ...
                            -1.1457E-003, 2.2648E-003,-8.7925E-004, ...
                             4.1493E-003,-2.3712E-004, 7.9344E-004, ...
                             1.8450E-003];
    DHEH = zeros(4,3,49);
    for J=1:49
      DHEH(1,1,J) = D11(J);
      DHEH(1,2,J) = D12(J);
      DHEH(2,1,J) = D21(J);
      DHEH(2,2,J) = D22(J);
      DHEH(3,1,J) = D31(J);
      DHEH(3,2,J) = D32(J);
      DHEH(4,1,J) = D41(J);
      DHEH(4,2,J) = D42(J);
    end
%//////////////////////////////////////////////////////////////////////
%///////////////////////////////////N+/////////////////////////////////
%     550km equinox
     D11 = [-1.6313E+000, 3.3826E-009, 2.3816E-001, ...
                             2.8373E-007,-2.0961E-002,-5.3533E-007, ...
                             8.7160E-002, 9.8248E-002, 4.4888E-008, ...
                            -3.2244E-002,-2.0063E-008,-2.0732E-002, ...
                             1.4134E-009, 6.8670E-002, 3.8855E-008, ...
                            -7.9258E-002, 3.6878E-008, 3.0244E-002, ...
                            -3.3364E-008,-6.6861E-002, 3.2622E-008, ...
                             2.0265E-002,-1.4791E-008, 6.6954E-003, ...
                             2.1340E-002,-3.2037E-008, 9.0073E-003, ...
                             2.0858E-008,-5.2152E-003, 3.9714E-002, ...
                            -1.9344E-009,-8.9600E-005,-3.7487E-009, ...
                            -4.0648E-002, 1.7220E-008, 5.6330E-003, ...
                             4.4101E-009, 4.1397E-003,-4.3699E-010, ...
                            -3.5601E-003,-1.6551E-002,-2.6274E-009, ...
                             8.3802E-004, 1.2105E-003,-1.0517E-008, ...
                            -8.5131E-003, 4.5467E-009,-2.2753E-003, ...
                            -3.3013E-003];
%     550km June solstice
     D12 = [-1.5950E+000, 1.2602E-001, 2.4136E-001, ...
                             1.6546E-001, 1.7991E-002,-1.3398E-002, ...
                             9.3804E-002,-7.7106E-003, 1.4206E-002, ...
                            -2.3237E-003,-1.2863E-003, 2.3217E-004, ...
                            -2.2888E-003,-3.3507E-002, 2.1777E-002, ...
                            -2.3190E-002,-2.6550E-002, 5.4864E-003, ...
                             6.3951E-003,-4.8363E-002, 2.1732E-002, ...
                            -2.9250E-003,-7.9064E-003,-5.4980E-003, ...
                             4.0796E-002, 1.3459E-002, 7.4514E-003, ...
                            -5.7685E-003, 2.1205E-004,-1.9001E-002, ...
                            -1.4431E-003, 6.2449E-004,-1.2225E-003, ...
                             4.9048E-003,-1.4864E-002,-1.6067E-003, ...
                            -1.5020E-003,-3.7769E-003,-1.3646E-003, ...
                            -1.4496E-003,-1.2677E-002,-2.8348E-003, ...
                            -3.0407E-005,-3.0275E-003,-1.4841E-003, ...
                            -6.7625E-003,-2.2857E-003,-1.9180E-003, ...
                            -5.1806E-003];
%     900km equinox
     D21 = [-1.4724E+000, 6.2234E-007, 1.9984E-001, ...
                            -6.2436E-007,-5.9609E-002, 5.3063E-008, ...
                             4.0544E-002,-2.9918E-002, 4.1071E-007, ...
                             5.6303E-004,-4.7255E-008, 8.0654E-003, ...
                            -3.4962E-008, 1.6174E-002, 1.0136E-007, ...
                             1.1632E-002,-2.4108E-008, 1.0895E-002, ...
                            -1.4658E-008,-4.3236E-002, 1.5584E-007, ...
                            -7.6984E-003, 1.8395E-008, 6.3333E-004, ...
                            -5.2038E-003, 1.5845E-007,-6.8821E-003, ...
                            -1.8127E-008, 1.2382E-003,-6.6883E-002, ...
                             6.0510E-008,-7.3364E-003, 1.1055E-008, ...
                            -2.0130E-002, 1.0636E-007,-4.3419E-003, ...
                            -5.6930E-009,-1.9632E-002, 2.3733E-008, ...
                            -1.7396E-003, 4.7721E-003, 5.6015E-008, ...
                            -1.6795E-003,-4.7359E-004,-1.4109E-008, ...
                             1.4272E-004, 2.0978E-008,-2.9585E-003, ...
                             1.0551E-002];
%     900km June solstice
     D22 = [-1.4816E+000, 2.5836E-001, 2.5713E-001, ...
                            -1.1671E-002,-1.1685E-001,-8.0473E-002, ...
                            -2.5842E-002, 1.7538E-002, 3.1480E-002, ...
                            -5.2361E-003,-2.0114E-002, 1.0788E-002, ...
                             6.0475E-003,-8.2585E-002, 1.5506E-002, ...
                            -9.3973E-003, 6.9887E-003, 1.6035E-003, ...
                            -4.6125E-003, 1.2645E-003, 2.8444E-002, ...
                             8.2369E-003,-2.6763E-003,-7.5445E-004, ...
                             2.6349E-002,-1.6736E-002, 1.3463E-003, ...
                             1.7333E-005,-9.0561E-004,-8.1050E-003, ...
                            -5.6762E-003, 3.1943E-003,-3.0766E-004, ...
                            -2.6193E-002,-1.2177E-002,-1.2289E-003, ...
                             4.1217E-004,-2.4327E-002,-6.1348E-003, ...
                            -1.2113E-003,-1.7103E-002,-2.2901E-003, ...
                             6.3735E-004,-1.2284E-002,-3.8308E-003, ...
                            -1.0159E-002,-1.7879E-003,-1.2510E-002, ...
                            -1.0009E-002];
%     1500km equinox
     D31 = [-1.6315E+000, 1.1175E-007, 4.7753E-001, ...
                            -1.0014E-007,-1.0097E-001,-1.0216E-007, ...
                            -5.3935E-002,-3.3570E-001, 2.0709E-007, ...
                             4.4824E-002, 1.8159E-008, 2.2117E-002, ...
                            -8.4695E-008,-1.6189E-001, 9.9261E-008, ...
                             5.7796E-002, 4.8814E-008,-7.5845E-003, ...
                            -5.1309E-008,-1.2423E-001, 1.3321E-007, ...
                            -1.6181E-002,-7.7736E-009, 4.6002E-003, ...
                            -1.2281E-001, 2.4201E-007, 1.4288E-002, ...
                             1.1896E-008,-5.3069E-003,-1.8104E-002, ...
                            -1.9814E-008,-8.4131E-003, 2.2753E-009, ...
                             5.1336E-003, 1.4694E-007, 4.9619E-003, ...
                             4.1959E-009,-2.2226E-002,-5.4731E-008, ...
                            -5.2711E-003, 1.3040E-002, 4.8906E-008, ...
                             2.2301E-003,-2.7938E-004,-2.2648E-008, ...
                            -1.5969E-002,-6.5911E-009, 3.6104E-003, ...
                             2.9534E-003];
%     1500km June solstice
     D32 = [-1.5647E+000, 4.2744E-001, 4.7853E-001, ...
                            -2.7160E-001,-3.7019E-002, 2.1446E-002, ...
                            -1.3457E-001,-1.1104E-001, 8.7769E-002, ...
                             4.0593E-003,-2.7075E-002, 8.4188E-003, ...
                            -1.2262E-002,-6.4727E-002, 7.1687E-002, ...
                            -3.8468E-002,-7.9663E-003, 1.2872E-002, ...
                             2.8088E-003,-1.2956E-002,-3.9502E-002, ...
                            -7.9875E-005, 6.1428E-003,-1.2074E-003, ...
                             3.8344E-003, 3.3477E-003,-3.3677E-003, ...
                            -3.0964E-003, 9.6501E-004, 8.2409E-003, ...
                            -2.8989E-002, 4.3657E-003, 9.4355E-005, ...
                             1.3130E-002,-1.8814E-002, 2.7093E-003, ...
                            -1.2167E-003,-5.7969E-003,-6.4927E-003, ...
                             4.1950E-004,-9.1788E-003,-7.2444E-003, ...
                            -1.4730E-003,-1.0845E-002,-2.5005E-003, ...
                            -8.2969E-003,-1.9660E-003,-6.3399E-003, ...
                            -5.8925E-003];
%     2250km equinox
     D41 = [-1.7525E+000,-1.0714E-006, 8.6183E-001, ...
                             1.1184E-006,-2.7829E-001, 2.7162E-007, ...
                            -1.0538E-001,-1.3943E-001,-1.1095E-007, ...
                             4.5835E-002,-1.8177E-007, 8.3712E-003, ...
                             1.0937E-007,-4.2987E-001,-3.9255E-007, ...
                             6.6012E-002, 5.4483E-008, 9.0376E-003, ...
                             7.3468E-008, 5.0653E-003,-6.8615E-009, ...
                            -1.3051E-002,-4.6976E-009, 3.9132E-003, ...
                            -3.8456E-002, 1.6913E-008,-8.3270E-004, ...
                            -3.9315E-008, 2.9990E-003,-5.9986E-003, ...
                             6.4241E-009,-3.6095E-004,-4.3472E-009, ...
                             9.3971E-002, 6.1373E-008,-7.0760E-003, ...
                            -2.7203E-009, 4.5148E-002,-1.1452E-008, ...
                            -1.6323E-004, 2.2101E-002, 5.6630E-009, ...
                            -9.0528E-004, 6.7390E-003, 1.1191E-009, ...
                             5.7927E-003, 2.2189E-009, 8.9446E-003, ...
                            -6.3752E-004];
%     2250km June solstice
     D42 = [-1.7520E+000, 3.8232E-001, 8.1527E-001, ...
                            -2.8870E-001,-1.0730E-001, 7.0220E-002, ...
                            -1.6764E-001,-2.1758E-001,-2.0171E-002, ...
                             3.4368E-002,-2.2874E-003, 2.7205E-002, ...
                            -6.4735E-003,-3.3147E-001, 9.2558E-002, ...
                             4.9336E-002,-4.1876E-002, 5.0738E-003, ...
                             1.2235E-002,-1.2631E-002,-2.6016E-002, ...
                             1.0295E-002,-6.0847E-003, 2.2948E-003, ...
                            -1.8060E-001,-1.7793E-002, 5.4176E-003, ...
                             2.2462E-004, 1.8786E-003, 1.1605E-001, ...
                             1.7233E-003,-1.5451E-003, 1.3382E-003, ...
                            -7.3353E-002,-3.7852E-004, 1.3236E-003, ...
                            -9.6993E-004, 1.8479E-002,-5.6199E-003, ...
                             8.0329E-004,-1.7815E-002, 3.5429E-003, ...
                            -1.5325E-003,-4.6303E-003,-3.9437E-003, ...
                            -1.7196E-002,-2.0703E-003,-3.6631E-004, ...
                            -1.6702E-002];
    DNH = zeros(4,3,49);
    for J=1:49
      DNH(1,1,J) = D11(J);
      DNH(1,2,J) = D12(J);
      DNH(2,1,J) = D21(J);
      DNH(2,2,J) = D22(J);
      DNH(3,1,J) = D31(J);
      DNH(3,2,J) = D32(J);
      DNH(4,1,J) = D41(J);
      DNH(4,2,J) = D42(J);
    end
%//////////////////////////////////////////////////////////////////////
%/////////////////coefficients low solar activity///////////////////// 
%//////////////////////////////////O+//////////////////////////////////
%     400km equinox
     D11 = [-3.4295E-003, 4.8322E-010, 7.9335E-004, ...
                             1.8237E-009, 1.0320E-003,-7.3733E-010, ...
                            -5.8045E-004,-2.1541E-003,-6.5013E-010, ...
                            -3.1081E-004,-9.8478E-012, 8.0628E-005, ...
                             2.1821E-010,-1.9044E-003,-8.3791E-010, ...
                            -1.5618E-004,-4.6595E-011, 1.5868E-004, ...
                            -1.6618E-010, 7.2724E-005,-3.1159E-010, ...
                             1.5783E-004,-6.1281E-010,-3.2544E-005, ...
                            -5.8917E-004,-6.1467E-010,-1.0295E-004, ...
                             5.7992E-011, 5.7641E-005, 6.7711E-005, ...
                             6.1432E-010, 8.6370E-005,-2.3670E-010, ...
                             2.2941E-005,-4.7808E-011, 4.7716E-005, ...
                             2.1198E-011, 2.8298E-006, 3.6265E-010, ...
                            -4.4578E-006, 1.7541E-004, 2.1511E-010, ...
                             2.5195E-005,-2.7325E-005,-2.3875E-011, ...
                            -3.1418E-006, 4.6152E-011,-2.9151E-005, ...
                             3.7913E-005];
%     400km June solstice
     D12 = [-7.5061E-003, 4.2214E-003, 3.2811E-003, ...
                            -4.3773E-003, 4.1127E-005, 2.7276E-003, ...
                            -4.5069E-004,-6.9573E-003, 3.2289E-003, ...
                             4.5324E-004,-5.4022E-004,-2.8733E-004, ...
                             1.7425E-004,-4.4235E-003,-1.1619E-005, ...
                             1.3238E-003,-5.1465E-004,-3.3052E-004, ...
                             3.8804E-004, 6.8531E-004,-1.9665E-004, ...
                             1.9622E-004, 2.8863E-004,-6.5642E-005, ...
                            -2.8855E-003, 5.0512E-004, 7.0149E-004, ...
                            -1.5869E-004,-1.5202E-004, 1.5939E-003, ...
                            -5.6796E-004,-1.0670E-004, 1.2569E-007, ...
                            -8.3699E-004,-8.4185E-005, 2.4768E-005, ...
                             4.6445E-005, 1.9761E-004, 6.0184E-005, ...
                            -1.0454E-005, 3.2389E-004,-3.7438E-005, ...
                            -3.4186E-005,-3.5859E-004,-6.1472E-005, ...
                            -4.7218E-004, 7.6277E-006, 1.4752E-004, ...
                            -4.5090E-004];
%     650km equinox
     D21 = [-2.6245E-001, 8.4041E-007, 2.2991E-001, ...
                            -2.1060E-006,-5.9700E-002, 5.5301E-006, ...
                             2.6165E-002,-3.4817E-001, 2.5875E-007, ...
                             1.7171E-002,-7.7857E-007,-6.4432E-003, ...
                             6.9845E-007,-1.3705E-001, 1.0700E-006, ...
                             7.5614E-003,-5.6468E-007, 8.2754E-004, ...
                             1.9031E-007,-2.5396E-002,-7.2603E-007, ...
                            -1.7557E-002, 2.1324E-007,-1.0498E-003, ...
                            -6.4057E-002, 4.6894E-007,-9.1390E-003, ...
                             9.6493E-009, 1.7969E-004, 7.0926E-002, ...
                            -3.6416E-007,-6.9695E-003, 8.9469E-008, ...
                             2.4310E-002,-1.7204E-007,-5.4500E-003, ...
                             9.1857E-008, 2.1846E-002, 8.1249E-008, ...
                            -7.2438E-004, 2.1225E-002,-1.1084E-008, ...
                            -4.9135E-004,-1.5282E-003, 5.4962E-008, ...
                            -2.0812E-003, 3.7817E-008,-4.2919E-004, ...
                             1.7766E-004];
%     650km June solstice
     D22 = [-3.1262E-001, 2.1640E-001, 2.9808E-001, ...
                            -2.9615E-001, 6.4926E-002, 3.8438E-003, ...
                            -9.0777E-002,-3.8422E-001, 1.3193E-001, ...
                             3.1168E-002,-3.6264E-002, 2.3774E-002, ...
                            -9.3167E-003,-1.5581E-001, 1.5604E-002, ...
                             2.3125E-002, 1.3240E-002,-1.2961E-003, ...
                            -1.1848E-002,-3.2185E-002,-5.1446E-003, ...
                             1.0193E-002,-7.9351E-003, 3.2452E-003, ...
                            -1.3403E-001,-1.0768E-003, 1.2773E-002, ...
                             2.9588E-003,-9.6663E-004, 5.6863E-002, ...
                            -2.1862E-002, 1.0585E-002,-3.1121E-003, ...
                            -3.3781E-002,-1.2186E-002, 4.7556E-003, ...
                            -5.7030E-004, 1.2328E-002,-6.4108E-003, ...
                             1.7929E-003,-2.1691E-003,-8.2313E-003, ...
                             1.9333E-003,-1.1646E-002,-1.6945E-003, ...
                            -2.7066E-002, 1.3570E-004,-8.5273E-003, ...
                            -1.5711E-002];
%     1000km equinox
     D31 = [-8.9352E-001, 2.4097E-005, 3.7286E-001, ...
                            -1.0359E-005, 1.0068E-002,-1.7035E-005, ...
                            -2.0139E-002,-1.0039E+000, 8.8331E-006, ...
                            -1.3731E-001, 4.7035E-006,-3.6637E-002, ...
                            -2.6654E-006,-2.0386E-001, 1.5439E-005, ...
                            -3.6661E-002, 1.0260E-005,-4.5066E-002, ...
                            -2.8682E-006,-1.7254E-001,-4.9526E-006, ...
                            -6.7622E-002,-1.0877E-006,-1.2351E-002, ...
                            -1.0953E-001, 7.0854E-006,-1.4296E-002, ...
                             6.7187E-006,-2.0577E-002, 6.4692E-002, ...
                            -3.0932E-006,-1.1908E-002,-1.6660E-006, ...
                             6.6329E-002,-7.0914E-007,-1.5392E-002, ...
                             2.1883E-006, 4.5838E-003,-8.4412E-007, ...
                             5.4739E-004, 2.8565E-002,-9.7635E-007, ...
                             5.0974E-003,-5.1648E-004,-2.9444E-008, ...
                            -1.0738E-003,-2.7121E-007, 3.4379E-003, ...
                            -2.1828E-003];
%     1000km June solstice
     D32 = [-6.9317E-001, 3.3146E-001, 5.9247E-001, ...
                            -3.8841E-001, 1.5031E-001, 3.4648E-002, ...
                            -2.0436E-001,-7.6788E-001, 1.1303E-001, ...
                            -3.0861E-002, 3.1730E-002, 5.8057E-002, ...
                            -3.2321E-002,-2.3509E-001, 1.2907E-001, ...
                            -2.5901E-002, 9.7355E-003, 3.0717E-002, ...
                            -2.7170E-002,-1.0447E-001,-7.0094E-002, ...
                            -2.6774E-002, 2.0725E-002, 2.4860E-004, ...
                            -2.9119E-001, 9.3440E-002,-8.0132E-003, ...
                            -1.9018E-003, 4.4841E-003, 5.9359E-002, ...
                            -1.9317E-002,-1.8184E-002, 5.0489E-003, ...
                            -1.0292E-001, 1.2137E-002, 8.1073E-004, ...
                             7.1284E-004, 8.3372E-003, 1.3340E-002, ...
                            -6.7512E-003, 1.7102E-002,-2.4549E-003, ...
                            -1.7239E-003, 1.9465E-002,-5.4019E-003, ...
                             4.8407E-002,-4.4151E-003,-1.9067E-002, ...
                             1.5001E-002];
    DOL = zeros(3,3,49);
    for J=1:49
      DOL(1,1,J) = D11(J);
      DOL(1,2,J) = D12(J);
      DOL(2,1,J) = D21(J);
      DOL(2,2,J) = D22(J);
      DOL(3,1,J) = D31(J);
      DOL(3,2,J) = D32(J);
    end
%//////////////////////////////////////////////////////////////////////
%//////////////////////////////////H+//////////////////////////////////
%     400km equinox
     D11 = [-2.3735E+000,-4.1106E-007,-1.5043E-001, ...
                             7.1050E-008,-4.4023E-002, 5.1900E-008, ...
                             7.5167E-002, 2.6079E-001,-5.4677E-008, ...
                             4.0421E-002, 8.4393E-009, 4.2554E-003, ...
                             1.7166E-008, 1.9018E-001,-6.0764E-008, ...
                             3.8687E-002, 6.3717E-008, 6.4895E-003, ...
                            -4.0891E-008, 3.8167E-002, 1.8652E-008, ...
                            -1.0038E-002, 1.9645E-008, 2.1804E-003, ...
                            -1.4444E-002, 6.5822E-009, 7.0666E-003, ...
                            -8.4659E-009,-5.5334E-003, 1.5556E-002, ...
                             1.2414E-008,-4.3661E-003, 4.4984E-009, ...
                             9.3627E-003,-2.4554E-009,-3.6096E-003, ...
                             7.8989E-009,-1.2352E-002, 1.0504E-008, ...
                            -4.5357E-006, 7.8762E-004,-5.2915E-009, ...
                            -1.9697E-003, 4.2966E-004, 5.9770E-009, ...
                             3.7248E-003, 6.9259E-009, 3.0955E-003, ...
                             2.7742E-003];
%     400km June solstice
     D12 = [-2.2303E+000,-2.7930E-001,-1.6289E-001, ...
                             8.4439E-002, 4.3059E-002,-1.0900E-002, ...
                             5.9060E-003, 3.8539E-001,-9.7745E-002, ...
                             1.8579E-002, 1.4256E-002, 6.8489E-004, ...
                            -1.1027E-003, 2.3516E-001, 3.8591E-002, ...
                            -2.9264E-002,-1.9275E-003, 2.4632E-002, ...
                            -3.0091E-004,-2.4136E-002, 2.1471E-002, ...
                            -1.4274E-002,-2.9073E-003, 4.0650E-003, ...
                             2.6483E-002, 3.9806E-003,-1.3560E-002, ...
                             3.6952E-004, 5.3108E-004,-3.9132E-002, ...
                             2.3689E-002,-6.6253E-004, 1.3556E-003, ...
                             2.3462E-002,-3.2744E-003, 1.4565E-003, ...
                             2.4812E-004,-3.2051E-004, 2.6108E-003, ...
                             7.5391E-004,-1.9602E-002, 5.0088E-003, ...
                             8.0312E-004, 1.3604E-002, 3.2853E-003, ...
                             8.1745E-003, 1.9033E-003, 1.6966E-002, ...
                             1.2348E-002];
%     650km equinox
     D21 = [-7.5599E-001,-2.3535E-007,-4.1761E-001, ...
                            -2.8901E-008, 4.8799E-002,-1.4005E-007, ...
                            -7.5257E-002, 5.0850E-001,-5.5769E-008, ...
                             7.4268E-002,-4.0953E-008, 2.0880E-002, ...
                            -3.9792E-008, 1.9637E-001, 3.5212E-008, ...
                             3.5924E-002,-3.2961E-008,-1.1911E-002, ...
                             5.4324E-009, 2.9918E-002, 1.0830E-008, ...
                             3.4518E-002,-5.4744E-009, 1.0144E-002, ...
                            -1.5615E-002, 9.3932E-009, 7.9662E-003, ...
                            -4.4936E-009,-1.4126E-003,-3.1648E-002, ...
                             2.2804E-008, 6.2742E-003,-9.5574E-009, ...
                            -1.1306E-002, 1.6269E-009, 2.2078E-004, ...
                             2.8647E-009,-1.7932E-002,-5.0077E-009, ...
                            -2.3559E-003,-9.2953E-003,-5.1441E-009, ...
                            -2.2185E-003, 2.9117E-005,-4.8547E-009, ...
                             4.4236E-003,-2.8102E-009, 9.3261E-004, ...
                             1.9538E-003];
%     650km June solstice
     D22 = [-7.6906E-001,-4.2549E-001,-6.2598E-001, ...
                             2.2279E-001, 1.4493E-001, 1.0653E-001, ...
                             2.7012E-001, 3.8710E-001,-6.1640E-002, ...
                             4.6697E-002,-5.7444E-002, 2.0933E-002, ...
                             8.8119E-003, 1.4986E-001, 2.1907E-002, ...
                            -1.8032E-002,-4.6878E-002,-1.6714E-002, ...
                             4.2935E-002,-2.4183E-002, 2.0290E-002, ...
                            -1.0109E-002, 5.2285E-003,-6.9878E-003, ...
                             4.2781E-002, 5.6690E-003,-1.1873E-002, ...
                            -4.5405E-003,-3.6632E-003,-2.2072E-002, ...
                             1.2209E-003,-5.8301E-003, 3.1915E-006, ...
                             1.0209E-002, 1.9771E-003, 1.3042E-003, ...
                             1.4817E-003, 2.0904E-003,-7.5031E-004, ...
                             2.2646E-003, 1.1547E-002, 6.7321E-003, ...
                             9.5170E-004, 1.7845E-002, 6.1338E-003, ...
                             1.2967E-002, 2.3311E-003, 2.9597E-002, ...
                            -2.2654E-003];
%     1000km equinox
     D31 = [-3.1869E-001, 1.5090E-007,-4.0560E-001, ...
                             2.8552E-007,-4.2289E-003, 3.6878E-008, ...
                             1.9957E-001, 2.7526E-001, 4.0798E-007, ...
                             1.1343E-001,-1.0028E-007, 5.1526E-002, ...
                            -6.0643E-008, 9.2397E-002,-2.1866E-007, ...
                             8.6528E-002, 2.3460E-008, 3.6848E-002, ...
                             6.2456E-008, 1.5483E-002,-1.7108E-007, ...
                             3.6333E-002,-1.0845E-008, 1.0259E-002, ...
                             4.3320E-003,-2.6987E-007,-1.0254E-002, ...
                            -8.8644E-008,-2.1170E-003,-2.1956E-002, ...
                            -1.3044E-007,-6.8424E-003,-3.8852E-008, ...
                            -1.6083E-002,-2.8545E-008, 4.7800E-003, ...
                             4.3092E-008,-9.4451E-004,-4.6383E-008, ...
                             1.7086E-003, 7.9651E-003, 2.1903E-007, ...
                             3.3880E-004, 4.5247E-004, 1.0538E-007, ...
                             3.7229E-003,-8.6806E-008,-5.2132E-004, ...
                            -5.7966E-004];
%     1000km June solstice
     D32 = [-4.6737E-001,-1.2403E-001,-6.4613E-001, ...
                             1.8831E-001, 1.2419E-001,-5.9911E-002, ...
                             1.9218E-001, 2.9484E-001, 4.0311E-002, ...
                             9.8207E-002,-2.9219E-002,-1.1908E-002, ...
                             3.8705E-002,-1.8943E-003,-4.2874E-002, ...
                            -4.6060E-002,-3.4199E-002,-2.2322E-002, ...
                             2.5785E-002, 2.5357E-002, 2.7261E-002, ...
                             9.8865E-003, 1.6691E-003, 6.2808E-003, ...
                            -9.1296E-003,-1.3707E-002,-8.7014E-003, ...
                            -3.4345E-003,-4.6994E-003,-2.5409E-002, ...
                            -6.7929E-003, 1.2701E-003, 3.6829E-003, ...
                            -2.9346E-003,-2.1371E-003,-7.4109E-003, ...
                             1.4351E-003,-7.4944E-003,-2.3530E-003, ...
                            -2.3960E-003,-8.2307E-003,-4.0801E-004, ...
                             1.9430E-003, 1.8990E-003, 6.7012E-004, ...
                            -2.2565E-003,-4.5399E-004,-1.7694E-003, ...
                            -6.3397E-004];
    DHL = zeros(3,3,49);
    for J=1:49
      DHL(1,1,J) = D11(J);
      DHL(1,2,J) = D12(J);
      DHL(2,1,J) = D21(J);
      DHL(2,2,J) = D22(J);
      DHL(3,1,J) = D31(J);
      DHL(3,2,J) = D32(J);
    end
%//////////////////////////////////////////////////////////////////////
%//////////////////////////////////He+/////////////////////////////////
%     400km equinox
     D11 = [-2.8533E+000,-2.1986E-007, 7.2644E-002, ...
                             2.2489E-007,-1.8677E-001,-3.9095E-007, ...
                             1.0850E-002, 2.2428E-001,-1.5216E-008, ...
                            -1.0736E-001,-7.9766E-008,-4.1078E-002, ...
                             4.7277E-008, 6.3340E-001,-1.5529E-008, ...
                             8.1139E-003, 1.4044E-008, 5.8076E-003, ...
                            -4.6109E-008,-8.8933E-002,-6.0933E-009, ...
                             8.9345E-003, 7.8024E-009, 1.0524E-002, ...
                            -7.0800E-002, 3.0069E-008,-3.8559E-002, ...
                             1.9810E-009,-2.7640E-002,-3.8927E-002, ...
                             2.5396E-008,-5.9943E-003, 1.4326E-008, ...
                            -2.0216E-002,-1.0963E-008,-1.0778E-002, ...
                            -3.1408E-009,-9.0961E-003,-1.6521E-008, ...
                             5.3029E-003,-3.3221E-002, 2.9052E-011, ...
                            -1.9158E-003, 6.3675E-003,-8.1957E-009, ...
                             7.4360E-003,-7.6241E-009, 6.5228E-003, ...
                             3.2586E-003];
%     400km June solstice
     D12 = [-3.0612E+000,-1.0562E+000, 8.8532E-002, ...
                             8.5373E-002, 8.1474E-002, 2.8747E-002, ...
                             1.3534E-001, 4.3580E-001, 4.4317E-002, ...
                            -1.8054E-002,-1.3027E-002, 4.1295E-002, ...
                            -4.4592E-003, 1.0223E-001, 1.3085E-001, ...
                            -7.7696E-002,-7.3836E-002, 1.9780E-002, ...
                             1.5735E-002,-5.9522E-002, 4.8434E-002, ...
                             1.5970E-002, 3.5974E-003,-3.8010E-003, ...
                            -1.0031E-001, 1.7651E-002, 1.2491E-002, ...
                             9.0502E-003,-8.7768E-003,-9.6294E-003, ...
                             1.8994E-002, 4.6892E-003, 2.5748E-004, ...
                            -9.6002E-003,-6.2450E-003, 9.0447E-003, ...
                            -1.8477E-003, 1.8898E-002,-6.9182E-003, ...
                             2.0626E-003, 4.7967E-003,-5.7386E-003, ...
                            -6.0267E-004, 2.5325E-002, 1.1937E-003, ...
                             2.1619E-002,-1.3459E-003, 3.7915E-002, ...
                             1.7314E-002];
%     650km equinox
     D21 = [-1.6103E+000,-1.3811E-007, 1.1838E-001, ...
                             2.4209E-007,-1.2965E-001,-6.5882E-008, ...
                             1.3191E-001, 4.6161E-001,-2.5600E-007, ...
                             1.2864E-001, 7.8717E-008, 2.9376E-002, ...
                            -2.0378E-009, 3.7085E-001, 2.5941E-007, ...
                             2.3336E-002,-2.5896E-007, 7.0754E-002, ...
                             1.5037E-007,-1.6104E-001, 2.5861E-008, ...
                             2.1873E-002,-3.9311E-010, 1.7883E-002, ...
                            -5.9487E-002, 7.5016E-008,-3.8658E-003, ...
                            -1.5184E-008,-2.2297E-002,-3.2125E-002, ...
                             1.3503E-008,-1.0069E-003, 2.3685E-008, ...
                            -2.3076E-002, 1.6395E-008,-4.7465E-003, ...
                             2.1465E-009,-2.1087E-002,-1.0412E-008, ...
                            -4.4450E-003, 6.9945E-003, 1.6080E-008, ...
                             3.1289E-003, 9.4760E-003,-8.4313E-009, ...
                            -2.1643E-003,-8.3007E-009, 2.3316E-003, ...
                            -8.8253E-003];
%     650km June solstice
     D22 = [-2.2374E+000,-7.4507E-001,-1.4689E-001, ...
                            -2.5946E-002, 4.7283E-002, 1.4143E-001, ...
                             3.2299E-001, 1.9366E-001, 8.7688E-002, ...
                             1.2526E-002,-2.2810E-002,-2.2711E-003, ...
                            -1.1824E-002,-4.8523E-002,-8.2298E-004, ...
                            -2.2395E-001,-3.4992E-002, 1.8125E-002, ...
                             1.4230E-002,-2.7661E-002, 2.3424E-002, ...
                             4.7094E-003,-1.0739E-002,-3.4746E-003, ...
                            -2.2153E-001,-1.8756E-002,-7.1623E-003, ...
                             4.6047E-003,-4.5071E-003, 2.2894E-002, ...
                            -2.4285E-002,-5.5847E-003,-9.8852E-004, ...
                             6.7171E-002,-5.0134E-004,-2.9361E-003, ...
                            -4.2558E-003, 1.5103E-002,-9.7860E-003, ...
                            -1.8098E-003, 1.8795E-002, 4.5063E-003, ...
                             2.4747E-003, 1.1677E-002,-4.2526E-003, ...
                             1.4606E-002, 2.2638E-003, 2.1285E-002, ...
                             1.3963E-002];
%     1000km equinox
     D31 = [-1.3192E+000, 1.8143E-006,-2.1284E-002, ...
                            -5.7860E-006,-1.3203E-001, 1.0367E-006, ...
                             8.7882E-002, 2.5246E-001, 3.0540E-007, ...
                             1.2671E-001, 7.0752E-007, 5.1175E-002, ...
                            -1.0432E-006, 1.5597E-001,-1.9061E-007, ...
                             9.7418E-002, 2.2626E-006, 6.3152E-002, ...
                            -2.4478E-006,-1.6992E-001,-6.0624E-007, ...
                            -1.6865E-002, 2.6681E-007, 2.4771E-003, ...
                            -3.9535E-002, 5.9015E-007,-5.4337E-002, ...
                            -1.4229E-007,-2.5864E-002, 4.5711E-002, ...
                             1.4937E-007,-1.9960E-002,-1.0504E-007, ...
                             1.2233E-002,-6.6122E-008, 8.5225E-004, ...
                             8.6051E-009, 2.7375E-002, 6.5450E-008, ...
                            -6.1311E-003, 1.2666E-002, 1.9864E-007, ...
                             2.8454E-003, 1.9020E-002,-5.1153E-008, ...
                             4.4576E-003,-2.0117E-008, 8.6293E-003, ...
                            -5.5447E-003];
%     1000km June solstice
     D32 = [-1.9424E+000,-5.8403E-001, 3.4084E-001, ...
                            -1.9084E-001,-5.4692E-002, 2.0943E-001, ...
                             6.7653E-003, 1.7048E-001, 1.9560E-001, ...
                             7.2251E-002,-1.3912E-003, 4.9874E-002, ...
                            -5.1299E-003,-2.2192E-001,-1.3285E-001, ...
                            -1.7111E-001,-2.8852E-002, 1.7141E-002, ...
                            -4.1047E-002, 1.3092E-001, 2.9271E-002, ...
                             2.1492E-002, 3.1053E-002, 1.7248E-002, ...
                            -1.7665E-001,-1.9095E-003,-1.0090E-002, ...
                            -2.8027E-002,-1.5999E-002, 6.9373E-002, ...
                            -4.0136E-002, 1.3345E-002, 9.5536E-003, ...
                            -1.0609E-002,-2.2548E-002,-1.5098E-002, ...
                            -1.1711E-002, 2.6458E-002,-1.5922E-002, ...
                             3.4746E-003,-1.8009E-002, 4.8529E-004, ...
                            -3.8353E-003, 1.9446E-003,-7.4106E-003, ...
                            -3.9309E-003,-1.3632E-003,-4.7108E-003, ...
                             7.2728E-003];
    DHEL = zeros(3,3,49);
    for J=1:49
      DHEL(1,1,J) = D11(J);
      DHEL(1,2,J) = D12(J);
      DHEL(2,1,J) = D21(J);
      DHEL(2,2,J) = D22(J);
      DHEL(3,1,J) = D31(J);
      DHEL(3,2,J) = D32(J);
    end
%/////////////////////////////////////////////////////////////////////
%//////////////////////////////////N+/////////////////////////////////
%     400km equinox
     D11 = [-1.7368E+000,-3.0027E-008, 2.2184E-001, ...
                            -6.7089E-007,-1.0635E-001, 6.8139E-007, ...
                             5.8091E-002,-6.2121E-002, 3.1864E-007, ...
                             4.8208E-002,-2.7440E-007,-2.4000E-003, ...
                             6.6031E-008,-1.0868E-001, 7.2869E-008, ...
                            -1.0042E-002,-4.6008E-008, 1.6205E-003, ...
                             4.6331E-009,-3.6398E-002, 1.7139E-007, ...
                             6.2127E-004,-4.0138E-008, 1.2439E-003, ...
                            -1.8217E-002, 4.6073E-008, 3.7524E-003, ...
                            -2.0566E-008,-3.0241E-003, 2.7188E-002, ...
                             6.3375E-008,-3.7723E-003,-3.9013E-009, ...
                             6.9304E-003, 5.7030E-008,-1.2236E-004, ...
                            -6.4988E-009, 1.2409E-002, 6.2839E-009, ...
                            -1.4527E-003, 1.4370E-003, 1.8605E-008, ...
                             1.8677E-004, 3.9142E-003,-4.8721E-009, ...
                            -4.1931E-003, 7.9621E-009, 1.9265E-004, ...
                            -1.3332E-003];
%     400km June solstice
     D12 = [-1.7418E+000, 7.0525E-002, 2.9785E-001, ...
                             1.1675E-002,-9.2159E-002,-1.2950E-001, ...
                            -5.8461E-002,-1.3966E-001, 1.5042E-002, ...
                             4.6388E-002,-9.7774E-003, 3.5422E-003, ...
                            -8.6287E-003,-8.7710E-002, 3.8852E-002, ...
                            -9.0949E-003,-1.8152E-002, 3.6013E-004, ...
                             7.2089E-003, 2.5707E-002, 8.4327E-003, ...
                            -6.5605E-003, 4.8306E-004, 5.0042E-004, ...
                            -3.1783E-002, 5.7723E-003, 8.8230E-003, ...
                            -2.6260E-003,-1.1217E-003, 5.7169E-002, ...
                            -5.2793E-003,-3.1765E-003, 5.1564E-004, ...
                             1.3519E-002,-3.9896E-003, 1.7336E-003, ...
                            -2.8791E-004, 1.3395E-002,-5.3013E-003, ...
                            -5.6986E-004, 3.0630E-003,-3.8017E-003, ...
                             9.3966E-004,-5.1651E-004,-3.0807E-003, ...
                            -4.4359E-003,-2.0503E-003, 8.0675E-004, ...
                             1.1912E-004];
%     650km equinox
     D21 = [-1.5547E+000, 6.7091E-007, 4.0622E-001, ...
                            -5.5830E-008,-1.3901E-001,-6.7244E-007, ...
                             1.4880E-001,-8.2658E-002, 2.6659E-007, ...
                             1.0021E-002, 1.3823E-007,-7.4716E-003, ...
                            -8.9220E-008,-1.3959E-001, 2.0864E-007, ...
                            -1.0484E-002, 4.4276E-008, 1.9706E-002, ...
                            -1.1884E-007,-1.2037E-002,-6.2490E-008, ...
                            -2.9276E-002, 4.0271E-008,-1.2310E-002, ...
                            -2.6679E-003, 3.5891E-008,-6.5922E-003, ...
                            -1.6467E-008,-3.9885E-004, 2.0962E-002, ...
                            -5.5785E-008,-7.4266E-003, 2.5071E-008, ...
                             2.2400E-002,-2.8034E-008,-1.2509E-003, ...
                            -1.9655E-008, 1.0287E-002, 2.6129E-008, ...
                            -1.3332E-003, 1.0731E-002, 2.4252E-009, ...
                             1.5417E-003, 3.1698E-003, 1.8012E-008, ...
                            -3.1057E-003, 1.5340E-008, 3.0302E-003, ...
                            -2.9436E-003];
%     650km June solstice
     D22 = [-1.5723E+000, 4.0251E-001, 4.0235E-001, ...
                            -1.6855E-001,-1.4445E-001,-2.9990E-002, ...
                            -2.0387E-001,-1.7979E-001, 1.9726E-001, ...
                            -6.8767E-002,-2.7798E-002, 4.5989E-003, ...
                             1.3561E-002,-1.2212E-001, 2.4244E-002, ...
                            -4.2670E-002, 6.2073E-002,-5.2021E-003, ...
                            -2.3860E-002,-6.4837E-002, 3.1524E-002, ...
                            -1.8784E-002, 1.2402E-002, 1.1119E-005, ...
                            -1.9303E-002,-2.2166E-002, 1.1413E-002, ...
                            -2.2769E-003, 1.0334E-003,-3.6042E-003, ...
                            -3.4116E-003,-4.2969E-003, 3.7668E-003, ...
                            -1.6617E-002,-2.0903E-002, 1.1176E-002, ...
                            -3.4928E-003,-1.9803E-002,-3.7789E-003, ...
                             2.9788E-004,-3.1880E-002,-1.0222E-002, ...
                             3.7033E-003,-3.0094E-002,-2.2242E-004, ...
                            -2.8816E-002,-4.4691E-003,-2.2928E-002, ...
                            -1.6669E-002];
%     1000km equinox
     D31 = [-1.7382E+000,-6.0635E-007, 4.4740E-001, ...
                             4.7518E-007, 9.1015E-002, 8.6631E-007, ...
                            -4.1582E-003,-3.1542E-001,-8.6896E-007, ...
                            -8.8282E-002, 1.7889E-007,-3.8424E-002, ...
                             5.6129E-008,-1.0561E-001, 1.0863E-007, ...
                            -3.7752E-002,-1.1781E-007,-4.1151E-002, ...
                            -1.4323E-008,-3.8984E-002,-4.7271E-007, ...
                            -3.7386E-002, 8.5416E-008,-1.2316E-002, ...
                             1.0742E-001, 1.5944E-007,-2.8192E-003, ...
                            -1.2504E-008,-1.6905E-002, 2.8270E-002, ...
                            -1.9685E-007, 8.9762E-003, 2.8706E-008, ...
                             6.7218E-002, 5.7165E-008,-8.2717E-003, ...
                             3.0388E-008, 1.9133E-002, 1.4687E-008, ...
                             5.5305E-004, 7.9431E-003, 4.8793E-008, ...
                             8.6786E-003, 4.9010E-003, 3.2400E-008, ...
                            -3.8863E-003,-2.5953E-008,-2.3986E-003, ...
                            -6.9512E-003];
%     1000km June solstice
     D32 = [-1.4667E+000, 1.6300E-001, 6.4765E-001, ...
                            -1.6832E-001,-1.9603E-001, 1.3735E-001, ...
                            -2.8157E-001,-9.1417E-002,-2.4826E-002, ...
                            -2.7273E-002, 3.1754E-002, 2.0120E-002, ...
                            -6.8389E-003,-9.6535E-002, 1.9137E-002, ...
                            -3.2374E-002, 7.1156E-002, 1.3993E-002, ...
                            -3.8484E-002, 3.1979E-002,-4.2560E-002, ...
                            -3.8190E-003, 1.1174E-002,-2.3599E-003, ...
                             3.4835E-003,-6.4330E-003,-1.4724E-003, ...
                            -2.7194E-003, 1.8374E-003, 7.9017E-003, ...
                            -1.3993E-002, 1.4415E-004, 1.8409E-003, ...
                             1.5734E-003,-1.3150E-002,-4.3392E-003, ...
                            -8.7189E-004,-6.9494E-003,-7.0281E-003, ...
                            -1.5472E-003, 7.6997E-004,-9.7752E-003, ...
                            -1.0346E-003,-4.2392E-003,-7.3591E-003, ...
                             1.0610E-002,-5.8767E-003, 2.4544E-004, ...
                             6.0162E-003];
    DNL = zeros(3,3,49);
    for J=1:49
      DNL(1,1,J) = D11(J);
      DNL(1,2,J) = D12(J);
      DNL(2,1,J) = D21(J);
      DNL(2,2,J) = D22(J);
      DNL(3,1,J) = D31(J);
      DNL(3,2,J) = D32(J);
    end
  end
%//////////////////////////////////////////////////////////////////////
%/////////////////////////solar minimum////////////////////////////////
  [NOL,DOL] = IRI2012.IONLOW(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DOL,IRI2012.O_ION);
  [NHL,DHL] = IRI2012.IONLOW(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DHL,IRI2012.H_ION);
  [NHEL,DHEL] = IRI2012.IONLOW(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DHEL,IRI2012.He_ION);
  [NNL,DNL] = IRI2012.IONLOW(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DNL,IRI2012.N_ION);
%     normalization
  NTOT=NOL+NHL+NHEL+NNL;
  NOL=NOL/NTOT;
  NHL=NHL/NTOT;
  NHEL=NHEL/NTOT;
  NNL=NNL/NTOT;
%///////////////////////////solar maximum//////////////////////////////
  [NOH,DOH] = IRI2012.IONHIGH(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DOH,IRI2012.O_ION);
  [NHH,DHH] = IRI2012.IONHIGH(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DHH,IRI2012.H_ION);
  [NHEH,DHEH] = IRI2012.IONHIGH(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DHEH,IRI2012.He_ION);
  [NNH,DNH] = IRI2012.IONHIGH(CRD,INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,DDD,DNH,IRI2012.N_ION);
%     normalization
  NTOT=NOH+NHH+NHEH+NNH;
  NOH=NOH/NTOT;
  NHH=NHH/NTOT;
  NHEH=NHEH/NTOT;
  NNH=NNH/NTOT;
%     interpolation (in logarithm)
  if F107 > 220
    F107=220;
  end
  if F107 < 65
    F107=65;
  end
  NO=(log10(NOH)-log10(NOL))/(200.0-85.0)*(F107-85.0)+log10(NOL);
  NH=(log10(NHH)-log10(NHL))/(200.0-85.0)*(F107-85.0)+log10(NHL);
  NHE=(log10(NHEH)-log10(NHEL))/(200.0-85.0)*(F107-85.0)+ ...
      log10(NHEL);
  NN=(log10(NNH)-log10(NNL))/(200.0-85.0)*(F107-85.0)+log10(NNL);
%     percentages
  NO=10^NO;
  NH=10^NH;
  NHE=10^NHE;
  NN=10^NN;
%     last normalization
  NTOT=NO+NH+NHE+NN;
  NO=NO/NTOT;
  NH=NH/NTOT;
  NHE=NHE/NTOT;
  NN=NN/NTOT;

end

