      PROGRAM pwtruhtp
      IMPLICIT none

      INTEGER I,YEAR,DDD,CRD,F107Y,SEASY
      REAL INVDIP,FL,DIMO,B0,DIPL,MLT,F107,TE(4),SIGTE(4),PI

      OPEN(3,FILE='Data.txt',STATUS='OLD') 
      OPEN(4,FILE='Res.txt',STATUS='NEW')

      PI=3.14159
      I=1
      
	CRD=0
	!Set the following to dummy values
	FL=0
	DIMO=0
	B0=0

	READ(3,*)F107Y,SEASY

      DO WHILE (I.EQ.1)
                            
       READ(3,*,END=200)DDD,INVDIP,MLT,F107                               

       INVDIP=INVDIP*180/PI

       CALL ELTEIK_4(CRD,F107Y,SEASY,INVDIP,FL,DIMO,B0,
     &                   DIPL,MLT,DDD,F107,TE,SIGTE)

       WRITE(4,*)TE 
             
      END DO

200   CONTINUE      

      CLOSE(3)
      CLOSE(4)

      END


      SUBROUTINE ELTEIK_4(CRD,F107Y,SEASY,INVDIP,FL,DIMO,B0,
     &                   DIPL,MLT,DDD,F107,TE,SIGTE)
C Version 2000a (released 17.5.2000)
C Empirical model of electron temperature (Te) in the outer ionosphere
C for high solar activity conditions (F107 >= 100).
C Based on spherical harmonics approximation of measured
C Te (by IK19, IK24, and IK25 satellites) at altitudes centred on 550km,
C 900km, 1500km, and 2500km. For intermediate altitudes a linear
C interpolation is used. Recommended altitude range: 500-3000 km!!!
C Linear extrapolation is used for altitude ranges <500;550)km
C and (2500;3000> km. For days between seasons centred at
C (21.3. = 79; 21.6. = 171; 23.9. 265; 21.12. = 354) Te is
C linearly interpolated.
C Inputs: CRD - 0 .. INVDIP
C               1 .. FL, DIMO, B0, DIPL (used for calculation INVDIP inside)
C         F107Y - 0 .. F107 correction NOT included
C                 1 .. F107 correction included
C         SEASY - 0 .. seasonal correction NOT included
C                 1 .. seasonal correction included
C         INVDIP - "mix" coordinate of the dip latitude and of
C                    the invariant latitude;
C                    positive northward, in deg, range <-90.0;90.0>
C         FL, DIMO, BO - McIlwain L parameter, dipole moment in
C                        Gauss, magnetic field strength in Gauss -
C                        parameters needed for invariant latitude
C                        calculation
C         DIPL - dip latitude
C                positive northward, in deg, range <-90.0;90.0>
C         MLT - magnetic local time (central dipole)
C               in hours, range <0;24)
C         DDD - day of year; range <0;365>
C         F107 - daily solar radio flux;
C                high solar activity; range <100;250>
C Output: TE(4) - electron temperature in K at altitudes 550km,
C                 900km,1500km, and 2500km 
C         SIGTE(4) - standard deviation of TE in K
C                 (not yet included)
C Versions: 1.00 (IDL) the first version Te=Te(invl,mlt,alt,season)
C           1.50 (IDL) corrected IK19 Te at 900km for possible Ne>2E11 m-3
C           2.00 (IDL) F107 included as a linear perturbation on global Te pattern
C                      Te=Te(invlat,mlt,alt,season,F107)
C           3.00 (IDL) invdipl introduced
C           2000 (IDL,FORTRAN) correction for seasons included
C           2000a output TE(4) at 550km, 900km, 1500km and 2500km
C Authors of the model (Te measurements (1), data processing (2), model
C                       formulation and building (3)):
C                V. Truhlik (2,3), L. Triskova (2,3), J. Smilauer (1,2),
C                          (Institute of Atm. Phys., Prague)
C                                 and V.V. Afonin (1)
C                                      (IKI, Moscow)
C Author of the code:
C         Vladimir Truhlik
C         Institute of Atm. Phys.
C         Bocni II.
C         141 31 Praha 4, Sporilov
C         Czech Republic
C         e-mail: vtr@ufa.cas.cz
C         tel/fax: +420 67103058, +420 602 273111 / +420 72 762528
      REAL INVDIP,FL,DIMO,B0,DIPL,MLT,ALT,F107,TE(4),SIGTE(4)
      INTEGER CRD,F107Y,SEASY,DDD
      DIMENSION  D(4,3,81),MIRREQ(81),FA(4,3,49),FB(4,3,49),MF107(49),
     &           SZ(4,4,25)
      DOUBLE PRECISION B(8),A
      REAL DTOR,ASA,INVL,RINVL,INVDP,RDIPL,ALFA,BETA
      REAL RMLT,RCOLAT
      REAL C(82),CF107(49),CSZ(25)
      INTEGER SEZA,SEZB,SEZAI,SEZBI,DDDA,DDDB,DDDD
      REAL T0A550,T0B550,T1A550,T1B550,T2A550,T2B550,
     &     T3A550,T3B550,T550A,T550B,T550
      REAL T0A900,T0B900,T1A900,T1B900,T2A900,T2B900,
     &     T3A900,T3B900,T900A,T900B,T900
      REAL T0A150,T0B150,T1A150,T1B150,T2A150,T2B150,
     &     T3A150,T3B150,T150A,T150B,T1500
      REAL T0A250,T0B250,T1A250,T1B250,T2A250,T2B250,
     &     T3A250,T3B250,T250A,T250B,T2500
      DATA B/1.259921D0  ,-0.1984259D0 ,-0.04686632D0,-0.01314096D0,
     &      -0.00308824D0, 0.00082777D0,-0.00105877D0, 0.00183142D0/
C///////////////coefficients - main model part//////////////////////
      DATA (MIRREQ(J),J=1,81)/
     &  1,-1, 1,-1, 1,-1, 1,-1, 1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
     &  1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1, 1,-1, 1,-1, 1,-1, 1, 1,-1, 1,
     & -1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1, 1,-1, 1,-1, 1, 1,-1,
     &  1,-1, 1,-1, 1,-1, 1,-1, 1, 1,-1, 1, 1,-1, 1,-1, 1, 1/
C     550km equinox
      DATA (D(1,1,J),J=1,81)/ 2.1185E+03,-9.0960E-01, 8.7479E+02,
     &                        5.3665E-01, 7.2315E+01,-1.4522E+00,
     &                       -6.8231E+01,-1.7205E-01,-9.5868E+01,
     &                       -5.3740E+02,-5.5762E-01,-1.3700E+02,
     &                       -6.6880E-01,-6.4616E-01,-1.4436E-02,
     &                       -1.3574E+01,-5.1068E-03, 1.9176E+02,
     &                       -3.5708E-01,-1.6800E+01, 5.3899E-01,
     &                        2.7730E+01, 2.1264E-01,-1.1162E+00,
     &                       -2.1020E-01,-4.7027E+02,-2.2692E-01,
     &                       -8.4973E+00,-1.2278E-01, 4.9200E+00,
     &                       -1.4939E-02, 2.6356E+00,-9.3732E+01,
     &                        1.7524E-01,-8.0270E+00, 4.8917E-02,
     &                        4.1404E+00, 2.1455E-01, 6.5988E-01,
     &                        2.3973E+02, 6.7066E-03, 3.2942E+01,
     &                        1.0491E-01,-1.1019E+00,-8.9674E-03,
     &                       -2.5871E+02,-4.0511E-01, 1.8509E+01,
     &                       -6.5590E-02, 3.3369E+00,-1.4607E-02,
     &                        1.9345E+02, 4.5946E-01,-1.7988E+01,
     &                        6.5776E-02,-1.7171E+00, 3.2232E+01,
     &                       -1.3975E-01,-7.9626E+00,-8.9984E-02,
     &                       -5.2076E-01,-6.7466E+01,-2.4359E-02,
     &                        1.2132E+00,-9.7418E-04, 1.6662E+02,
     &                        3.0197E-01, 3.4870E-01, 2.0862E-03,
     &                       -1.0091E+02,-1.1583E-01,-6.4353E-01,
     &                       -4.5914E+01,-2.9075E-01,-1.3476E+00,
     &                       -2.5206E+01, 5.5027E-02,-1.0663E+02,
     &                        1.3394E-01, 2.7825E+01, 3.3973E+01/
C     550km June solstice
      DATA (D(1,2,J),J=1,81)/ 2.0732E+03, 1.1858E+02, 7.0341E+02,
     &                        4.0606E+02,-1.5410E+02, 5.9091E+01,
     &                       -7.3198E+01,-1.0067E+02,-7.0712E+01,
     &                       -6.3323E+02, 4.7818E+01,-7.6003E+01,
     &                       -4.9778E+01, 6.7586E+01,-7.3829E+00,
     &                       -7.0501E+00, 1.3663E+01, 1.2661E+02,
     &                       -4.9014E+01,-4.4884E+01,-2.7004E+01,
     &                       -5.4925E+00,-1.4390E+01, 1.4573E+01,
     &                        1.4890E+01,-2.2243E+02, 4.6961E+01,
     &                        2.1169E+01, 6.3799E-01,-1.4838E+00,
     &                        6.6321E+00, 4.1318E-01,-1.5642E+02,
     &                        1.1300E+02,-8.9014E+00,-4.9933E+00,
     &                        7.3107E+00, 9.4305E+00,-1.5203E+00,
     &                        1.9325E+02,-2.2070E+01,-6.2284E+00,
     &                       -1.0572E-01,-3.6677E+00,-6.1689E+00,
     &                       -6.8242E+01,-2.9507E+01, 1.3496E+01,
     &                        7.9801E+00,-1.7483E+00, 4.2264E-01,
     &                        1.3232E+02, 9.7530E+00,-3.3159E+00,
     &                       -3.8368E+00, 7.3997E-01, 1.2738E+02,
     &                        4.3677E-01,-4.3172E-01, 3.2624E+00,
     &                        2.4603E-01,-1.5297E+02, 3.8130E-01,
     &                       -5.6753E+00,-1.7841E-01, 1.4078E+01,
     &                        8.1371E+00,-1.0298E+00,-8.7611E-01,
     &                        1.8043E+01,-2.0388E+01, 3.5874E+00,
     &                       -6.8187E+01, 1.2396E+01, 1.4384E+00,
     &                       -1.8542E+01, 9.8107E+00,-1.7652E+00,
     &                       -1.0545E+01, 1.2793E+01, 2.4878E+01/
C     900km equinox
      DATA (D(2,1,J),J=1,81)/ 2.6253E+03,-1.4102E+00, 1.0578E+03,
     &                        6.0533E-01,-2.0122E+02,-2.5531E+00,
     &                       -9.8647E+01, 1.5826E+00,-1.4076E+02,
     &                       -9.1764E+02, 5.2004E-01,-1.0194E+02,
     &                       -5.3743E-01, 4.6185E+01, 3.0271E-01,
     &                       -1.6661E+01,-4.3778E-01, 2.7636E+02,
     &                        9.9112E-02,-2.7807E+01,-3.6236E-01,
     &                        9.2380E+01, 5.5131E-01,-5.7407E+00,
     &                        1.2985E-01,-5.1480E+02,-3.2325E-01,
     &                       -4.2135E+01, 4.6360E-02,-4.7321E-01,
     &                       -2.0887E-01,-2.3466E+00,-3.4132E+02,
     &                       -8.1632E-01, 2.0252E+01, 3.1349E-01,
     &                       -3.2548E+00,-2.9720E-02,-2.5120E+00,
     &                        3.1281E+02,-4.4738E-02, 4.4130E+00,
     &                       -3.1125E-02, 1.3784E+00, 4.1569E-02,
     &                       -1.0980E+02, 7.0001E-01, 4.0861E+00,
     &                       -1.6670E-01,-4.8520E+00, 3.6492E-02,
     &                        1.8057E+02, 2.0765E-01, 8.8382E+00,
     &                       -2.8354E-02,-1.6340E+00, 1.7492E+02,
     &                       -7.0915E-01, 9.6069E+00, 1.2205E-01,
     &                        3.7218E-01,-5.7398E+01,-2.9121E-01,
     &                       -4.3088E+00, 5.6543E-02, 6.0417E+01,
     &                        2.5141E-01, 2.2588E+00,-6.5538E-02,
     &                       -1.6084E+02, 3.2163E-01,-3.5354E+00,
     &                       -3.9077E+01,-4.4285E-02,-3.4426E+00,
     &                        2.6798E+01, 6.7368E-02,-6.7479E+01,
     &                        9.8125E-02, 7.0079E+01, 2.1724E+01/
C     900km June solstice
      DATA (D(2,2,J),J=1,81)/ 2.5964E+03, 2.7369E+02, 7.1893E+02,
     &                        4.4751E+02,-3.8908E+02, 6.4097E+00,
     &                       -5.0443E+01, 7.9006E+01,-9.5540E+01,
     &                       -9.8162E+02, 9.4112E+00,-3.9071E+01,
     &                       -1.2918E+01, 6.0870E+01, 2.3039E+01,
     &                       -3.1332E+01, 8.3557E+00, 1.3100E+02,
     &                       -3.2576E+01,-9.6546E+01, 5.8694E+00,
     &                        7.1925E+01, 1.0059E+01,-9.7102E+00,
     &                       -1.8709E-01,-3.9806E+02,-3.0957E+01,
     &                       -7.8514E+00, 2.9864E+00, 4.7169E+00,
     &                       -6.3766E+00, 4.5467E+00,-2.1713E+02,
     &                        2.7924E+01, 6.9898E+00, 6.4391E+00,
     &                       -2.9495E+00, 1.3537E+00, 3.0092E+00,
     &                        2.4662E+02,-4.3575E+00,-8.7582E+00,
     &                       -5.6902E+00,-1.8440E+00, 2.0276E+00,
     &                       -1.5456E+02,-4.1566E+00, 1.5940E+00,
     &                       -2.2610E+00,-1.8790E+00,-2.0589E-01,
     &                        1.6612E+02,-2.8783E+00,-9.7839E-02,
     &                        7.1863E-01, 2.2400E-01, 8.9569E+01,
     &                       -8.7802E+00,-2.9563E+00,-1.5339E+00,
     &                       -6.9508E-01,-8.9068E+01, 2.4977E+00,
     &                        5.6978E-01, 1.0112E+00, 1.0725E+02,
     &                       -8.8621E+00,-4.8559E+00,-8.5244E-01,
     &                       -6.2185E+01, 7.2504E+00, 1.8318E+00,
     &                       -7.9203E+01, 2.8472E+00,-1.3483E-01,
     &                        2.1818E+01,-4.2387E+00,-5.7925E+01,
     &                        2.5552E+00, 4.6600E+01, 3.4333E+01/
C     1500km equinox
      DATA (D(3,1,J),J=1,81)/ 2.9228E+03,-1.0193E+00, 5.0052E+02,
     &                        1.9156E+00,-8.8798E+01, 4.4598E+00,
     &                        2.2407E+01, 2.3050E+00,-3.8484E+00,
     &                       -1.2959E+03,-8.7330E-01, 2.7027E+01,
     &                       -6.0724E-01, 2.8496E+01,-5.2927E-01,
     &                        5.7042E+00,-2.5504E-01,-3.9328E+01,
     &                        1.8577E+00, 2.5325E+01, 1.0570E+00,
     &                        3.9141E+01, 1.2857E-02, 4.4854E+00,
     &                       -1.0437E+00,-4.9104E+02,-6.2939E-02,
     &                       -4.1205E+01, 3.2220E-01,-1.0599E+01,
     &                       -1.8242E-01, 9.1160E-01,-3.5425E+02,
     &                       -1.6068E-01,-1.3725E+00, 9.6252E-02,
     &                        6.6323E+00, 1.0111E-01, 1.5864E+00,
     &                        2.6698E+02,-1.3164E-01, 2.5957E+01,
     &                        1.8661E-01, 9.5289E-01, 1.2827E-01,
     &                       -2.0802E+01,-5.0001E-01, 1.7802E+00,
     &                       -2.2686E-01,-9.9243E-01,-8.8453E-02,
     &                        1.6938E+02, 1.5072E-01,-1.2249E+00,
     &                        5.9212E-03, 2.1008E+00, 1.4981E+02,
     &                       -3.0983E-02,-2.3113E+00,-1.6773E-02,
     &                        5.0314E-01,-2.8870E+01,-1.2562E-01,
     &                        5.5983E+00, 3.6513E-02,-3.2056E+01,
     &                       -3.5823E-01,-7.1938E-01,-3.0424E-02,
     &                       -5.9756E+01,-3.1999E-01, 3.8169E-01,
     &                        5.7626E+01, 3.4086E-01, 5.0895E+00,
     &                        1.2152E+00, 1.4523E-01,-6.0723E+01,
     &                       -1.5587E-02, 5.2597E+01,-6.7261E+00/
C     1500km June solstice
      DATA (D(3,2,J),J=1,81)/ 2.9621E+03, 3.9688E+02, 2.9652E+02,
     &                        2.7782E+02,-1.3500E+02,-2.8285E+01,
     &                        1.8036E+01,-8.2958E+01,-3.9738E+01,
     &                       -1.2058E+03, 6.8198E+01, 2.2164E+01,
     &                       -1.5473E+01, 1.9760E+01, 1.3793E+01,
     &                       -2.2130E+01, 2.2585E+00,-9.5227E+01,
     &                       -7.9347E+01,-1.8617E+01,-1.4626E+01,
     &                        2.8497E+01, 9.7753E+00, 5.1487E+00,
     &                       -3.0464E+00,-5.0302E+02, 3.2524E+01,
     &                       -6.2727E+00,-2.7864E+00, 4.3374E+00,
     &                       -1.0944E+00, 1.0615E+00,-1.4955E+02,
     &                        4.5911E+00, 1.3417E+01,-3.8776E+00,
     &                       -8.6030E-02, 4.9763E+00, 1.7831E+00,
     &                        2.8593E+02,-4.1944E+01, 2.5430E+00,
     &                        4.1294E+00, 5.5434E+00, 2.1086E+00,
     &                       -7.9921E+01, 8.9160E+00,-1.4931E+01,
     &                        6.7306E+00,-7.4849E+00, 2.0152E+00,
     &                        2.4435E+02,-2.7216E+01,-6.5424E+00,
     &                       -2.2848E-01, 6.6780E-01,-5.0210E+00,
     &                       -1.6876E+00,-3.8484E+00, 4.8596E-01,
     &                        1.2499E+00,-1.2823E+02,-4.7155E+00,
     &                       -8.9457E+00,-2.6414E-01,-1.0880E+01,
     &                        1.7040E+01,-1.3495E+00, 4.6478E-02,
     &                       -5.5357E+01, 2.9895E+01,-2.6035E+00,
     &                       -3.7697E+00,-5.3693E+00, 5.3346E-01,
     &                        1.4172E+01, 5.3848E+00,-2.3065E+01,
     &                       -5.2616E+00, 2.2592E+01,-1.5174E+01/
C     2500km equinox
      DATA (D(4,1,J),J=1,81)/ 3.3738E+03,-1.4579E-01, 2.9057E+02,
     &                       -8.9423E-01,-1.7818E+02, 1.3821E+00,
     &                       -8.9134E+01,-3.1758E-01,-6.7731E+01,
     &                       -1.4372E+03, 6.2781E-02, 4.6214E+01,
     &                       -4.0312E-02,-7.0553E+00,-5.7943E-02,
     &                       -1.5921E+01, 7.6970E-02,-5.3597E+01,
     &                       -3.2922E+00,-5.7514E+01,-2.2513E+00,
     &                        2.7316E+01,-4.9774E-01, 1.0223E+01,
     &                        1.5541E-01,-5.1080E+02, 1.5422E-01,
     &                       -2.6147E+01, 4.5060E-01, 7.7452E-01,
     &                       -3.2680E-02,-7.4846E-01,-2.1399E+02,
     &                       -1.0117E+00, 1.5173E+01,-7.2407E-01,
     &                        3.2157E+00,-9.5540E-02, 2.0921E+00,
     &                        3.3803E+02, 3.2007E-01,-2.5597E+01,
     &                       -1.8768E-02,-4.3258E+00,-9.4149E-02,
     &                       -1.1274E+02,-5.5848E-01,-1.9836E+01,
     &                       -1.9519E-01,-2.9500E+00,-6.5675E-02,
     &                        2.7506E+02,-9.4098E-02, 1.8588E+01,
     &                       -1.5460E-01, 8.1344E-01, 1.8479E+02,
     &                       -3.9938E-01, 1.3448E+01, 8.8669E-02,
     &                        3.9040E+00,-5.3105E+01, 2.0753E-01,
     &                       -3.5771E+00,-1.4386E-02, 1.3306E+02,
     &                        2.2388E-01,-4.3013E-01, 5.8347E-02,
     &                       -7.2119E+01, 1.5187E-03, 2.1445E+00,
     &                        1.5871E+00, 3.4653E-01, 1.8858E+00,
     &                        1.1009E+01,-1.0913E-01, 1.3126E-01,
     &                        1.6358E-01, 3.3089E+01, 4.9158E+01/
C     2500km June solstice
      DATA (D(4,2,J),J=1,81)/ 3.2890E+03, 2.3406E+02, 2.3242E+02,
     &                        1.6845E+02,-3.7964E+02,-2.3183E+01,
     &                       -6.7725E+01, 9.8597E+01, 2.8565E+01,
     &                       -1.3705E+03, 7.5544E+01, 1.3235E+02,
     &                        1.9927E-01,-1.3429E+00,-9.8459E-01,
     &                       -1.7632E+00,-4.2301E+00,-2.1162E+02,
     &                        5.5279E-01,-9.5367E+01,-1.2788E+01,
     &                        4.0782E+01, 4.8734E+00,-5.0869E+00,
     &                       -4.8522E+00,-5.2566E+02, 6.0198E+01,
     &                       -2.0405E+01, 3.0107E+01, 1.9692E+00,
     &                        4.2044E+00,-1.6327E+00,-1.1121E+02,
     &                       -3.5375E+01, 5.2049E+00, 1.5725E+01,
     &                        1.0054E+01, 3.7913E+00,-1.6254E-01,
     &                        1.4983E+02,-4.0229E+01, 1.9216E+00,
     &                       -2.5669E+00,-1.3679E+00, 1.9556E+00,
     &                       -5.2991E+01, 1.2377E+01,-1.8352E+01,
     &                       -2.7843E-01,-2.6711E+00, 1.0270E+00,
     &                       -1.7185E+01,-1.0283E+00,-1.3286E+01,
     &                        1.4314E+00,-5.3584E-01,-6.7809E+01,
     &                       -9.6756E+00,-4.6022E+00, 1.8112E+00,
     &                       -6.1062E-03, 2.6330E+01, 1.6726E+01,
     &                        3.9444E+00, 2.7303E+00, 4.7634E+01,
     &                       -3.2729E+01, 1.2863E+00,-8.7681E-01,
     &                        5.8417E+00,-1.1842E+01, 1.7747E+00,
     &                        4.9485E+01,-9.5141E+00,-1.7739E+00,
     &                        2.8452E+01,-8.8851E+00,-4.4171E+00,
     &                        4.1421E+00,-2.6145E+01,-4.4075E+01/
C/////////////coefficients - F107 correction//////////////////////
      DATA (MF107(J),J=1,49)/
     &            1,-1, 1,-1, 1,-1, 1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
     &            1,-1, 1,-1, 1,-1, 1, 1,-1, 1,-1, 1, 1,-1, 1,-1, 1,
     &           -1, 1,-1, 1,-1, 1, 1,-1, 1, 1,-1, 1,-1, 1, 1/
C     550km equinox
      DATA (FA(1,1,J),J=1,49)/
     &         2.1792E+00,-2.1275E-07,-3.0369E-01,-3.1861E-07,
     &        -4.0109E-01,-2.3529E-07,-5.1800E-01,-2.1268E-02,
     &         6.5788E-11, 3.2767E-01,-3.9204E-08, 6.0337E-03,
     &         1.8103E-09,-3.1331E-02, 1.3981E-08, 4.8055E-01,
     &        -3.5571E-08, 9.8510E-02, 3.0118E-09,-7.7406E-02,
     &         1.4673E-08,-1.1584E-01, 2.6239E-08,-3.7815E-02,
     &        -7.5343E-01,-4.5728E-09,-2.2223E-01,-1.0071E-09,
     &        -6.8871E-02,-8.8247E-02, 6.3637E-09, 3.7528E-02,
     &        -1.4578E-09, 8.6601E-02, 4.0820E-08, 1.3803E-01,
     &         6.0607E-09,-2.8557E-02,-4.8644E-09, 1.5314E-03,
     &        -8.0197E-02,-1.5931E-08,-1.6002E-02,-2.9124E-02,
     &         4.8067E-09, 9.0446E-03, 1.2273E-08,-3.0496E-02,
     &         7.8786E-03/
	DATA (FB(1,1,J),J=1,49)/
     &        -4.1934E+02, 7.5753E-05, 3.0092E+02, 1.1961E-04,
     &         1.6897E+02, 8.2549E-05, 8.4754E+01,-7.4083E-02,
     &        -1.8769E-06,-8.7576E+01, 1.3779E-05, 7.9487E+00,
     &        -2.3550E-06,-7.1043E+01,-3.4455E-06,-7.5485E+01,
     &         1.3096E-05,-4.7573E+00, 1.9409E-06, 7.5447E+01,
     &        -2.3927E-06, 1.9243E+01, 2.4230E-06, 3.6926E+00,
     &         1.5966E+02, 6.5501E-06, 4.3220E+01,-2.1216E-06,
     &         1.4776E+01, 2.5894E+01,-8.0222E-09,-6.4715E+00,
     &        -3.7197E-07, 1.1891E+01,-9.2441E-06,-2.8838E+01,
     &         2.6401E-06,-8.3915E-01,-6.8336E-07, 4.1298E-01,
     &         2.1763E+01,-1.2271E-06, 2.7614E+00, 8.3170E+00,
     &        -1.7405E-06, 9.7560E-01,-1.4005E-06, 3.5829E+00,
     &         7.5525E-01/
C     550km June solstice
      DATA (FA(1,2,J),J=1,49)/
     &         3.2236E+00, 7.8580E-01, 4.0518E-02,-7.8758E-02,
     &        -7.4039E-01,-5.5023E-01, 2.2661E-01,-1.7191E-01,
     &        -4.5161E-01, 7.7189E-02, 2.4208E-02, 7.5019E-02,
     &         5.4542E-03, 1.8923E+00,-8.6309E-01,-7.3536E-02,
     &        -1.5410E-01,-1.2294E-01,-1.1886E-01,-2.0559E+00,
     &        -4.3640E-02,-2.2578E-01, 6.3167E-03, 5.8175E-02,
     &        -5.5051E-01,-3.0664E-01,-4.9306E-02, 5.2511E-02,
     &         1.4045E-02, 2.2313E-01, 1.9961E-01,-8.9555E-03,
     &        -4.0830E-02,-7.4402E-01,-3.4520E-02,-1.1823E-01,
     &        -4.1510E-02, 1.2895E-01, 3.8704E-02, 5.3682E-03,
     &         7.9895E-02, 1.2443E-01, 2.5079E-03,-3.8743E-02,
     &        -2.1658E-02, 6.8794E-02, 3.6839E-02,-4.1913E-02,
     &        -3.5795E-03/
	DATA (FB(1,2,J),J=1,49)/
     &        -6.2695E+02,-1.7178E+01, 1.1405E+02, 1.7127E+02,
     &         1.3752E+02, 1.3641E+02,-7.0975E+01, 1.4633E+01,
     &         5.2949E+01,-2.8160E+01,-3.0614E+01,-2.7290E+01,
     &         1.8518E+00,-3.5465E+02, 1.7895E+02, 2.0545E+01,
     &         5.6681E+01, 3.4224E+01, 2.6772E+01, 3.7167E+02,
     &         9.1041E+00, 2.1472E+01,-4.3844E-01,-1.2918E+01,
     &         8.1502E+01, 3.8268E+01, 1.0318E+00,-7.3473E+00,
     &        -5.1080E+00,-4.6510E+01,-3.0223E+01, 5.3605E+00,
     &         9.3017E+00, 1.2710E+02, 4.5835E+00, 2.5091E+01,
     &         6.7618E+00,-2.4027E+01,-8.2618E+00, 8.1357E-02,
     &        -1.8817E+01,-2.0141E+01,-3.1208E-01, 1.8021E+00,
     &         2.7531E+00,-1.4198E+01,-8.6175E+00, 8.0561E+00,
     &        -2.6929E+00/
C     900km equinox
      DATA (FA(2,1,J),J=1,49)/
     &         3.3758E+00,-4.8705E-07,-1.4844E+00,-7.9140E-07,
     &        -1.2010E+00,-4.3759E-07,-6.1125E-01,-2.4395E+00,
     &         8.4646E-09, 5.0103E-01, 1.5398E-09, 1.9140E-01,
     &         4.5214E-08, 2.2253E+00,-7.6345E-08,-9.5472E-01,
     &         6.7707E-08, 5.3013E-03,-5.0649E-08,-5.8881E-01,
     &         1.1959E-08, 3.1184E-02,-2.4972E-09,-4.4759E-03,
     &        -1.9022E+00, 3.8763E-09,-1.0882E-01, 3.0299E-08,
     &        -3.4453E-02, 1.3296E-01, 3.1168E-08, 1.4878E-02,
     &        -8.3137E-09,-4.7944E-01,-2.8746E-08, 3.5825E-02,
     &        -1.2058E-08, 3.0506E-01,-9.5413E-09, 7.1259E-03,
     &         7.0469E-03,-2.3296E-09,-8.8034E-03,-2.8111E-02,
     &        -2.4131E-09, 5.6115E-03,-4.8153E-09,-6.9450E-05,
     &         1.1739E-02/
      DATA (FB(2,1,J),J=1,49)/
     &        -6.7222E+02, 1.1078E-04, 2.9062E+02, 1.8966E-04,
     &         2.9021E+02, 9.9730E-05, 1.4805E+02, 4.9025E+02,
     &        -1.4587E-05,-6.2774E+01,-5.6489E-06,-2.3959E+01,
     &         3.4145E-06,-4.9272E+02, 1.5930E-05, 1.8363E+02,
     &        -9.9393E-06,-7.0072E+00, 4.4609E-06, 8.6865E+01,
     &        -2.9546E-06,-3.1763E+00,-1.2566E-07,-5.8817E-01,
     &         3.9687E+02,-6.5285E-06, 1.0005E+01,-2.5441E-06,
     &         4.6315E+00,-2.7349E+01, 5.5261E-06,-1.1131E+00,
     &         1.9219E-06, 8.5274E+01,-3.1671E-06,-9.8191E+00,
     &         7.4340E-07,-6.7348E+01,-1.2024E-06,-5.3796E-01,
     &        -1.4772E+01, 8.2916E-06, 1.9457E+00, 8.3258E+00,
     &         3.5652E-07,-3.4240E+00, 5.4810E-07, 2.9803E-01,
     &        -4.8309E+00/
C     900km June solstice
      DATA (FA(2,2,J),J=1,49)/
     &         1.7678E+00,-1.2523E-01,-3.1971E-02,-1.1885E+00,
     &        -2.0748E-01,-6.2911E-01,-6.9839E-01, 1.4225E-01,
     &         2.9845E-02,-7.4911E-02, 1.8080E-01,-1.3199E-03,
     &        -1.1076E-01,-5.5801E-03,-6.3437E-01, 1.9093E-01,
     &         1.2925E-01, 8.6250E-02, 1.7273E-01,-1.5010E-01,
     &        -1.2204E-01, 4.7007E-02, 5.8541E-02, 6.9108E-03,
     &         3.3109E-01, 1.4050E-01, 8.0140E-02,-3.4096E-02,
     &        -8.3293E-03,-1.0468E-01, 1.0780E-01,-2.3355E-02,
     &         2.1534E-02, 5.9510E-02, 4.3653E-03,-2.2744E-02,
     &         4.2113E-02,-7.8295E-02,-4.2225E-02,-1.9368E-03,
     &        -9.3049E-02,-9.7186E-03,-1.5204E-02,-5.1251E-03,
     &        -1.5143E-02,-1.3670E-02,-1.6588E-02,-1.1932E-02,
     &        -2.7587E-02/
      DATA (FB(2,2,J),J=1,49)/
     &        -3.9911E+02, 5.9796E+01, 4.1540E+01, 2.3466E+02,
     &         4.0871E+01, 1.4529E+02, 1.2104E+02,-4.6233E+01,
     &         1.1266E+01, 2.7210E+01,-3.6695E+01,-6.5125E+00,
     &         1.9678E+01,-6.3622E+01, 1.6088E+02,-4.1296E+01,
     &        -7.7296E+00,-2.0603E+01,-3.7075E+01, 2.4707E+01,
     &         3.2399E+01,-6.7277E+00,-6.0272E+00,-3.4630E+00,
     &        -5.5263E+01,-2.5945E+01,-1.4906E+01, 4.1722E+00,
     &         3.4384E+00, 2.2157E+01,-2.0458E+01, 2.8784E+00,
     &        -4.4228E+00, 1.9416E+01,-1.5663E+01, 6.5339E+00,
     &        -7.9988E+00, 1.4137E+01, 1.6251E+00, 6.4890E-01,
     &         4.8511E+00, 2.1505E+00, 2.9129E+00,-6.7762E-01,
     &         5.7748E-01, 3.7354E+00, 1.0259E+00, 1.5804E+00,
     &         1.5189E+00/
C     1500km equinox
      DATA (FA(3,1,J),J=1,49)/
     &         1.4780E+00,-5.4689E-09,-3.5681E-01, 3.5690E-07,
     &         1.4442E+00,-1.8771E-07,-5.8029E-01, 6.3736E-01,
     &         8.5859E-08, 1.7747E+00,-1.8960E-07,-9.6585E-03,
     &        -7.3912E-09,-6.7418E-01,-2.0098E-08,-2.3251E-01,
     &         4.3772E-08, 8.6224E-02, 1.5699E-08, 3.0123E-01,
     &        -2.8897E-08,-1.0286E-01, 7.3823E-09, 3.5984E-02,
     &         9.9977E-01,-2.5975E-08, 2.2399E-02,-1.5372E-08,
     &         2.9522E-02, 1.1931E-01,-4.4525E-09, 4.1555E-02,
     &         5.0431E-09, 6.6187E-02, 1.3181E-08, 6.1906E-02,
     &        -8.3984E-10, 5.8869E-02,-9.2211E-09,-7.8035E-03,
     &        -7.4955E-02, 3.8595E-08, 2.1260E-02, 3.5597E-02,
     &         5.3006E-09, 4.0952E-02, 2.2709E-08, 1.8248E-02,
     &        -1.7679E-02/
      DATA (FB(3,1,J),J=1,49)/
     &        -2.5247E+02,-1.0611E-05, 3.5396E+01,-8.7667E-05,
     &        -2.9634E+02, 1.6567E-05, 7.7489E+01,-1.1799E+02,
     &        -1.3620E-05,-3.1233E+02, 3.1358E-05,-1.0114E+01,
     &        -4.9641E-06, 1.0363E+02, 4.2123E-06, 2.7824E+01,
     &        -9.7994E-06,-1.9069E+01,-2.8885E-06,-7.4787E+01,
     &         7.6758E-06, 1.0608E+01,-6.8638E-07,-1.1534E+01,
     &        -1.8312E+02, 1.1865E-06,-9.6891E+00, 3.8221E-06,
     &        -7.1519E+00,-2.7741E+01,-5.9749E-06,-9.3219E+00,
     &         1.9756E-06,-1.6897E+01,-3.0522E-07,-8.7396E+00,
     &         1.0363E-07,-2.1515E+01, 1.1544E-06, 1.3571E+00,
     &         1.5544E+01,-3.6035E-06,-2.9642E+00,-8.9441E+00,
     &        -1.5169E-06,-8.5483E+00,-1.6971E-06,-8.4912E+00,
     &         3.1723E+00/
C     1500km June solstice
      DATA (FA(3,2,J),J=1,49)/
     &         1.3888E+00, 1.1103E+00, 1.6445E+00, 7.3508E-01,
     &         9.9423E-02,-1.2668E-01, 1.1793E+00, 3.2611E-01,
     &        -1.3932E-01, 3.4714E-01,-4.0398E-02, 2.8188E-01,
     &        -2.1840E-01, 3.0676E-01, 1.6201E-01,-1.4507E-01,
     &         3.3787E-01,-4.6930E-02, 5.4924E-02, 3.9874E-01,
     &         6.9870E-02, 2.3651E-02,-1.0188E-01, 3.1284E-02,
     &         1.0411E+00,-4.1114E-01,-1.0548E-01,-2.3342E-02,
     &         9.1528E-03, 9.2067E-02,-1.0666E-01, 2.6649E-02,
     &        -3.7639E-02,-1.8572E-01,-6.6661E-02, 9.4229E-02,
     &         3.1840E-02, 5.8198E-03, 4.8141E-03, 9.4962E-03,
     &        -1.1103E-01,-2.1740E-02,-7.2465E-04,-3.3437E-02,
     &        -1.6689E-02,-7.6956E-02,-1.0285E-02,-5.7708E-02,
     &        -1.0310E-01/
      DATA (FB(3,2,J),J=1,49)/
     &        -2.8005E+02,-9.8261E+01,-3.9983E+02,-2.6619E+01,
     &         8.2338E+00, 1.7867E+01,-1.7785E+02,-1.0122E+02,
     &         9.1687E+01,-8.7297E+01,-2.8501E+00,-3.9830E+01,
     &         4.5134E+01,-1.0669E+02,-2.5633E+01, 7.1774E+00,
     &        -7.4302E+01, 1.5876E+01,-1.7359E+00,-9.1679E+01,
     &        -1.9696E+01, 3.0117E+00, 2.0649E+01,-9.3364E+00,
     &        -2.2670E+02, 9.7904E+01, 1.5046E+01,-3.3399E+00,
     &        -8.7702E-01,-1.2437E+01, 2.2864E+01,-3.6244E+00,
     &         6.7245E+00, 1.6524E+01, 2.3854E+01,-2.3351E+01,
     &        -7.1407E+00,-1.8966E+00, 3.3737E+00,-3.0866E+00,
     &         9.1835E+00, 1.9951E+00,-4.0653E-01, 1.9179E-01,
     &         5.1555E+00, 8.6789E+00, 2.9229E+00, 8.9559E+00,
     &         2.1825E+01/
C     2500km equinox
      DATA (FA(4,1,J),J=1,49)/
     &         1.4513E+00,-2.7903E-08,-2.1232E+00, 1.2079E-07,
     &         2.8524E-01,-4.0135E-08, 6.8231E-01, 4.3500E-01,
     &         1.2651E-08, 5.6992E-01,-4.2850E-08, 1.5039E-01,
     &        -1.3229E-08, 9.4290E-02,-2.4997E-08,-7.7275E-01,
     &         5.4290E-08,-1.2859E-01, 9.4636E-09, 5.2854E-01,
     &        -2.1479E-09, 9.2855E-02,-2.7594E-08, 7.4358E-03,
     &        -4.5033E-01,-7.4883E-10,-3.9305E-02, 2.2454E-08,
     &        -4.4181E-02, 5.3266E-02, 8.3007E-09,-1.8869E-02,
     &         2.7783E-10,-5.2278E-02, 2.5128E-08, 5.6681E-02,
     &         3.0310E-09,-1.1503E-01, 3.5058E-08, 2.0314E-02,
     &         4.4499E-02, 1.0183E-09, 1.6406E-02, 6.9291E-04,
     &         6.8229E-09,-2.7379E-02, 5.8450E-09,-1.4324E-02,
     &        -1.4532E-02/
	DATA (FB(4,1,J),J=1,49)/
     &        -4.2157E+02,-1.2843E-05, 1.1677E+02,-1.9182E-05,
     &         6.6617E+00,-2.7718E-05,-1.0527E+02,-1.7184E+01,
     &        -3.4177E-07,-7.2191E+01,-1.1358E-07,-1.8024E+01,
     &        -1.2578E-07,-6.6518E+01, 6.2438E-06, 2.3027E+02,
     &        -1.7359E-05, 4.0800E+01, 2.1467E-06,-1.3715E+02,
     &        -8.5554E-07,-1.7205E+01, 5.0757E-06, 2.2927E-01,
     &         8.0476E+01,-2.7589E-06, 3.3827E+00,-4.0660E-06,
     &         1.3065E+01,-2.0229E+00, 2.1920E-06, 1.0875E+01,
     &        -6.1136E-07, 7.2010E+00,-5.4154E-06,-8.7107E+00,
     &        -4.2033E-07, 2.4655E+01,-7.7856E-06,-4.6298E+00,
     &        -1.6797E+01, 1.3570E-06,-3.2055E+00,-5.4947E-01,
     &         1.2722E-06, 8.1156E+00, 5.5588E-06, 2.0961E+00,
     &         6.3166E+00/
C     2500km June solstice
      DATA (FA(4,2,J),J=1,49)/
     &         8.6854E-01,-9.9343E-02, 1.7241E-02, 4.1379E-01,
     &         1.0034E+00,-7.1819E-01,-1.0619E+00,-4.4765E-01,
     &        -1.0826E+00,-6.5641E-04,-2.3379E-01,-4.1201E-01,
     &         8.2089E-02, 2.2647E+00,-1.0331E-01, 1.3969E-01,
     &         3.4386E-01,-1.4873E-01, 4.8438E-02,-2.2364E-01,
     &         3.3408E-03,-5.7226E-02,-8.7379E-02, 1.0073E-01,
     &         1.6683E-01,-1.3735E-01, 1.9385E-02,-2.7082E-02,
     &         3.1018E-02, 6.7087E-02,-7.9098E-03, 4.7972E-02,
     &        -4.3783E-02, 3.1339E-01, 4.1214E-02, 8.1151E-03,
     &        -2.7117E-02, 3.1667E-02,-1.3346E-02, 8.2864E-03,
     &         2.0433E-01, 9.0147E-03, 1.4602E-02, 5.6125E-02,
     &        -5.2173E-03, 2.8963E-02,-1.2959E-02, 3.1247E-02,
     &        -3.5943E-02/
	DATA (FB(4,2,J),J=1,49)/
     &        -1.9899E+02, 8.3014E+01,-1.2364E+02,-4.9417E+01,
     &        -1.7956E+02, 1.8431E+02, 3.0699E+02, 2.7139E+01,
     &         2.1287E+02, 2.3659E+01, 4.2878E+01, 8.0452E+01,
     &        -2.8811E+01,-4.1889E+02, 1.1639E+01,-4.1313E+00,
     &        -7.5002E+01, 3.4022E+01,-2.2607E+01, 1.8021E+01,
     &         8.1737E+00, 1.4083E+01, 1.9836E+01,-1.8668E+01,
     &        -6.2033E+01, 1.0904E+01,-1.3000E+00, 3.8715E+00,
     &        -7.8479E+00, 2.1208E+01,-5.9507E+00,-1.3782E+01,
     &         7.2326E+00,-5.3504E+01,-5.7353E+00,-1.3774E+00,
     &         6.5094E+00,-7.5963E+00, 3.8696E+00,-2.0070E-01,
     &        -3.8873E+01,-2.7285E+00,-2.3107E+00,-9.2363E+00,
     &         1.1762E+00,-4.0574E+00, 3.3439E+00,-7.0163E+00,
     &         1.0312E+01/
C/////////coefficients - seasonal correction//////////////////////
C     550km March equinox
      DATA (SZ(1,1,J),J=1,25)/
     &        -2.2484E+01, 1.5678E+01,-1.9782E+02, 1.8137E+02,
     &        -1.1841E+02,-4.6499E+01,-8.0932E+01, 2.8705E+01,
     &        -1.5150E+01, 4.0453E+01,-1.3051E+02, 2.4204E+01,
     &        -8.7547E+00, 1.6474E+01, 9.2847E-01, 5.0067E+00,
     &        -1.6276E+01,-1.7811E+01, 3.3205E+00, 1.5727E+00,
     &         4.4872E+00, 1.1533E+01,-2.8452E+00, 8.4677E+00,
     &         1.0316E+01/
C     550km June solstice
      DATA (SZ(1,2,J),J=1,25)/
     &         8.1616E+01,-7.8931E+01,-1.4877E+02,-2.1824E+01,
     &        -2.2731E+01,-4.4445E+01,-1.3629E+00,-5.1986E+00,
     &         9.5949E+00, 1.1326E+02,-2.9675E+01,-4.1540E+01,
     &        -8.2913E+00,-7.5447E+01,-2.8678E+00, 2.2539E+01,
     &        -4.3198E+01,-6.1286E+00, 1.0387E+01, 2.3967E+01,
     &         4.4365E+00,-1.0083E+01,-6.7061E+00, 1.4691E+00,
     &         3.1579E+00/
C     550km December solstice
      DATA (SZ(1,3,J),J=1,25)/
     &         3.3939E+01, 4.1603E+01, 6.3171E+01, 2.8139E+01,
     &        -1.2545E+01, 2.6427E+01,-5.9703E+01,-5.2340E+00,
     &        -1.4020E+01,-6.3531E-01, 3.6480E+01, 3.6464E+00,
     &         5.6044E+00, 1.9248E+01,-1.1710E+00, 4.0883E+00,
     &         3.0011E+01,-4.8281E+00,-3.2089E+00, 9.7707E+00,
     &        -1.4347E+00,-3.2377E+00,-3.2303E+00, 8.3354E+00,
     &         2.8745E+00/
C     550km September equinox
      DATA (SZ(1,4,J),J=1,25)/
     &        -3.2521E+01, 7.7815E+01,-9.9172E+01, 1.1771E+02,
     &        -4.9189E+01, 4.2987E+01, 6.1923E+00, 1.9022E+01,
     &        -1.4961E+00, 5.6301E+01, 3.3056E+01,-3.4998E+00,
     &         2.5603E+01,-4.1210E+01,-5.9928E-01,-6.5170E+00,
     &        -3.0348E+01,-2.9433E-01,-2.9917E+00, 1.4373E+01,
     &        -1.0131E+00,-1.8499E+00,-2.0904E+00, 1.1991E+00,
     &         1.2403E-01/
C     900km March equinox
      DATA (SZ(2,1,J),J=1,25)/
     &         1.1725E+01,-4.5645E+01, 4.5733E+00, 1.8517E+01,
     &        -2.3715E+01,-1.5863E+01, 2.5084E+01,-8.8654E+00,
     &        -4.2437E+00, 2.2447E+01, 2.0916E+01,-2.5716E+01,
     &        -6.0094E+00, 2.1711E+01,-1.2222E+01, 1.4226E-01,
     &         5.0453E+00,-5.2144E+00, 1.2274E+01,-2.9295E+00,
     &         5.3619E-02, 5.8705E+00, 1.2787E+00, 3.4613E+00,
     &         2.0811E+00/
C     900km June solstice
      DATA (SZ(2,2,J),J=1,25)/
     &         6.6929E+01,-6.3062E+01,-3.1518E+01, 3.9008E+01,
     &         2.2092E+00,-1.1085E+01,-2.8826E+01, 1.1331E+01,
     &        -3.1950E+00, 2.9916E+01,-4.7622E+00,-1.4363E+01,
     &        -4.0448E+00,-1.4279E+01,-9.1323E+00, 1.6311E+00,
     &         1.0317E+00,-1.4682E+01, 3.6067E+00,-9.6292E-01,
     &         3.7949E+00, 3.1022E+00,-4.6328E-01, 9.0868E+00,
     &         4.5608E+00/
C     900km December solstice
      DATA (SZ(2,3,J),J=1,25)/
     &         8.4350E+01, 1.0359E+01, 3.5955E+01,-5.3957E+01,
     &        -5.5573E+01, 6.2484E+01,-1.5365E+01, 5.6723E+00,
     &        -6.6484E+00, 7.8126E+01, 4.9952E+01,-2.9937E+00,
     &         7.2634E+00,-1.0773E+01, 2.0048E+00,-2.9070E-01,
     &        -1.7277E+01,-4.1386E+00,-1.6600E+00, 2.2237E+01,
     &        -3.1530E+00,-1.4685E+01, 1.1209E+00, 4.0532E+00,
     &         1.5677E+00/
C     900km September equinox
      DATA (SZ(2,4,J),J=1,25)/
     &         8.0799E+01,-1.0934E+02, 5.4753E+01, 2.3566E+01,
     &        -6.4691E+01, 1.1268E+00, 6.9659E+00,-1.1639E+01,
     &        -9.2820E+00, 1.1194E+02,-8.7659E+01, 4.6876E+01,
     &        -2.0595E+01,-4.1123E+01, 2.4208E+01,-1.5497E+01,
     &        -4.5482E+01, 1.3202E+01,-1.4486E+01,-2.7499E+00,
     &        -5.8915E+00,-9.0391E-02,-2.8128E-01, 1.9866E+00,
     &         1.3860E+00/
C     1500km March equinox
      DATA (SZ(3,1,J),J=1,25)/
     &         4.8197E+01, 1.5085E+01,-2.5638E+01, 1.1104E+01,
     &        -1.9587E+01, 4.8883E+01, 1.2754E+01,-7.4101E+00,
     &        -1.7884E+01,-9.7165E+00, 3.8258E+01, 3.6539E+00,
     &        -4.9290E+00, 1.0793E+02, 9.0909E+00, 3.3659E+00,
     &        -8.4915E+00, 4.6583E+01, 6.6691E+00, 2.6471E+01,
     &         1.6831E+00,-1.1973E+01, 7.0796E+00, 5.3906E+00,
     &         2.6667E-01/
C     1500km June solstice
      DATA (SZ(3,2,J),J=1,25)/
     &         6.6565E+01,-7.8329E+01, 2.6828E+01,-3.0595E+01,
     &         1.8690E+01, 9.4627E+00,-2.9049E+01, 2.9074E+01,
     &         2.4002E+00,-8.8067E+00, 3.1262E+01,-3.6726E-01,
     &         9.7701E+00, 3.2131E+01,-8.6902E-01,-1.3888E+00,
     &         3.8983E+01,-1.5296E+01,-6.0608E+00, 1.6429E+01,
     &        -5.6030E+00, 2.0101E+01,-7.1151E+00, 5.1599E+00,
     &         4.3186E+00/
C     1500km December solstice
      DATA (SZ(3,3,J),J=1,25)/
     &         3.3717E-01, 1.1554E+02, 4.5506E+01,-7.5635E-01,
     &        -1.8256E+01,-6.5165E+00, 3.5243E+01,-4.1460E+01,
     &         4.8214E+00, 3.1778E+01, 5.2812E+01,-1.3524E+01,
     &        -7.4173E+00,-3.9910E+01, 8.4328E+00,-8.6133E-01,
     &        -1.4775E+01, 4.1764E+00,-7.7575E-01, 6.3293E+00,
     &         1.2135E+00,-7.7471E+00, 3.7529E+00,-8.6309E+00,
     &        -7.8509E+00/
C     1500km September equinox
      DATA (SZ(3,4,J),J=1,25)/
     &        -1.6095E+01, 9.9417E+01,-1.4653E+01,-4.6748E+01,
     &        -3.1115E+00,-5.0367E+01,-5.5260E+00, 3.1643E+00,
     &         1.8895E-01,-4.2743E+01, 1.5466E+01, 2.2751E+01,
     &         2.3019E+01,-1.2153E+01,-9.4305E+00, 7.7048E+00,
     &        -1.0472E+01,-1.0872E+01, 4.7621E+00,-1.5255E+00,
     &        -1.0996E+00,-2.4040E+00, 1.1287E+00,-6.4519E+00,
     &        -2.4907E-01/
C     2500km March equinox
      DATA (SZ(4,1,J),J=1,25)/
     &         1.6289E+02, 1.9716E+02, 2.7176E+02, 1.2047E+02,
     &        -3.3004E+01,-1.5213E+02,-6.3033E+01,-2.3628E+01,
     &         1.5250E+00,-2.8945E+01,-8.4696E+01,-1.6515E+01,
     &        -1.2776E+00, 4.2591E+00, 8.2797E+00,-8.3759E+00,
     &         5.5750E+01, 1.8242E+01,-2.7894E+00, 2.7438E+01,
     &        -2.1300E+00,-4.2789E+00,-2.6639E+00, 4.3236E+00,
     &        -2.3532E+00/
C     2500km June solstice
      DATA (SZ(4,2,J),J=1,25)/
     &         5.4078E+01, 1.0257E+02, 3.2942E+01,-2.7484E+01,
     &        -4.2371E+01, 3.8394E+01,-2.1161E+01, 4.3066E+00,
     &        -2.7098E+01, 1.0562E+02,-4.6081E+01, 1.8271E+01,
     &        -1.5616E+01, 6.8675E+00,-1.1678E-01, 2.9773E+00,
     &         6.5244E+00, 9.0964E+00, 4.4221E+00, 1.4783E+00,
     &         4.5843E-01,-1.2944E+01, 2.9291E+00,-3.6895E+00,
     &        -5.6245E+00/
C     2500km December solstice
      DATA (SZ(4,3,J),J=1,25)/
     &         1.1624E+02, 2.6277E+02, 1.2854E+02,-4.4443E+01,
     &        -1.0411E+02,-6.9986E+01,-8.9133E+01,-2.0989E+01,
     &        -7.9940E+00,-4.7922E+01, 1.1982E+01, 1.3529E+01,
     &         7.9148E+00, 2.2318E+01, 3.7615E+01, 7.5449E+00,
     &        -1.3719E+01,-1.2865E+01,-7.4193E+00,-1.5604E+01,
     &        -1.1663E+01,-2.1478E+00, 4.4852E+00,-1.2419E+01,
     &        -7.5830E+00/
C     2500km September equinox
      DATA (SZ(4,4,J),J=1,25)/
     &         2.0001E+02, 9.5915E+01, 1.6246E+02, 2.9653E+01,
     &        -6.3464E+00,-2.8476E+01,-9.0499E+01,-6.3960E+00,
     &        -1.9869E+00, 3.3675E+01, 8.2809E+01,-1.7643E+01,
     &         9.3427E-01, 1.5153E+01, 7.0991E+00, 9.2573E+00,
     &        -2.9729E+01,-2.1289E+01,-4.9093E+00,-1.4336E+00,
     &        -5.0410E+00,-6.0288E+00,-1.0345E+01, 6.9714E+00,
     &        -2.6930E+00/
C//////////////////////////////////////////////////////////////
      DTOR=3.1415926536/180.0
C     coefficients for mirroring
      DO 10 I=1,81
       D(1,3,I)=D(1,2,I)*MIRREQ(I)
       D(2,3,I)=D(2,2,I)*MIRREQ(I)
       D(3,3,I)=D(3,2,I)*MIRREQ(I)
10     D(4,3,I)=D(4,2,I)*MIRREQ(I)
      DO 20 I=1,49
       FA(1,3,I)=FA(1,2,I)*MF107(I)
       FB(1,3,I)=FB(1,2,I)*MF107(I)
       FA(2,3,I)=FA(2,2,I)*MF107(I)
       FB(2,3,I)=FB(2,2,I)*MF107(I)
       FA(3,3,I)=FA(3,2,I)*MF107(I)
       FB(3,3,I)=FB(3,2,I)*MF107(I)
       FA(4,3,I)=FA(4,2,I)*MF107(I)
20     FB(4,3,I)=FB(4,2,I)*MF107(I)
      IF (CRD .EQ. 1) THEN
C      calculation of INVDIP from FL, DIMO, BO, and DIPL
C      invariant latitude calculated by highly
C      accurate polynomial expansion
       A=(DIMO/B0)**(1.0D0/3.0D0)/FL
       ASA=A*(B(1)+B(2)*A+B(3)*A**2+B(4)*A**3+B(5)*A**4+
     &        B(6)*A**5+B(7)*A**6+B(8)*A**7)
       IF (ASA .GT. 1.0) ASA=1.0
C      invariant latitude (absolute value)
       RINVL=ACOS(SQRT(ASA))
       INVL=RINVL/DTOR
       RDIPL=DIPL*DTOR
       ALFA=SIN(ABS(RDIPL))**3
       BETA=COS(RINVL)**3
       INVDP=(ALFA*SIGN(1.0,DIPL)*INVL+BETA*DIPL)/(ALFA+BETA)
      ELSE IF	(CRD .EQ. 0) THEN
       INVDP=INVDIP
      ELSE
       RETURN
      END IF
      RMLT=MLT*DTOR*15.0
      RCOLAT=(90.0-INVDP)*DTOR
      CALL SPHARM_IK(C,8,8,RCOLAT,RMLT)
      CALL SPHARM_IK(CF107,6,6,RCOLAT,RMLT)
      CALL SPHARM_IK(CSZ,4,4,RCOLAT,RMLT)
C     21.3. - 20.6.
      IF ((DDD .GE. 79) .AND. (DDD .LT. 171)) THEN
       SEZA=1
       SEZB=2
       DDDA=79
       DDDB=171
       DDDD=DDD
      END IF
C     21.6. - 22.9.
      IF ((DDD .GE. 171) .AND. (DDD .LT. 265)) THEN
       SEZA=2
       SEZB=4
       DDDA=171
       DDDB=265
       DDDD=DDD
      END IF
C     23.9. - 20.12.
      IF ((DDD .GE. 265) .AND. (DDD .LT. 354)) THEN
       SEZA=4
       SEZB=3
       DDDA=265
       DDDB=354
       DDDD=DDD
      END IF
C     21.12. - 20.3.
      IF ((DDD .GE. 354) .OR. (DDD .LT. 79)) THEN
       SEZA=3
       SEZB=1
       DDDA=354
       DDDB=365+79
       DDDD=DDD
        IF (DDD .GE. 354) THEN
         DDDD=DDD
        ELSE
         DDDD=DDD+365
        END IF
      END IF
      SEZAI=MOD(SEZA-1,3)+1
      SEZBI=MOD(SEZB-1,3)+1
C     550km level
      T0A550=0.0
      T0B550=0.0
      T1A550=0.0
      T1B550=0.0
      T2A550=0.0
      T2B550=0.0
      T3A550=0.0
      T3B550=0.0
      DO 30 I=1,81
         T0A550=T0A550+C(I)*D(1,SEZAI,I)
30       T0B550=T0B550+C(I)*D(1,SEZBI,I)
      DO 40 I=1,49
         T1A550=T1A550+CF107(I)*FA(1,SEZAI,I)
40       T1B550=T1B550+CF107(I)*FA(1,SEZBI,I)
      DO 50 I=1,49
         T2A550=T2A550+CF107(I)*FB(1,SEZAI,I)
50       T2B550=T2B550+CF107(I)*FB(1,SEZBI,I)
      DO 60 I=1,25
         T3A550=T3A550+CSZ(I)*SZ(1,SEZA,I)
60       T3B550=T3B550+CSZ(I)*SZ(1,SEZB,I)
      T550A=T0A550+F107Y*(T1A550*F107+T2A550)+SEASY*T3A550
      T550B=T0B550+F107Y*(T1B550*F107+T2B550)+SEASY*T3B550
      T550=(T550B-T550A)/(DDDB-DDDA)*(DDDD-DDDA)+T550A
C     900km level
      T0A900=0.0
	T0B900=0.0
	T1A900=0.0
	T1B900=0.0
	T2A900=0.0
	T2B900=0.0
      T3A900=0.0
	T3B900=0.0
	DO 70 I=1,81
         T0A900=T0A900+C(I)*D(2,SEZAI,I)
70       T0B900=T0B900+C(I)*D(2,SEZBI,I)
	DO 80 I=1,49
         T1A900=T1A900+CF107(I)*FA(2,SEZAI,I)
80       T1B900=T1B900+CF107(I)*FA(2,SEZBI,I)
	DO 90 I=1,49
         T2A900=T2A900+CF107(I)*FB(2,SEZAI,I)
90       T2B900=T2B900+CF107(I)*FB(2,SEZBI,I)
	DO 100 I=1,25
         T3A900=T3A900+CSZ(I)*SZ(2,SEZA,I)
100      T3B900=T3B900+CSZ(I)*SZ(2,SEZB,I)
	T900A=T0A900+F107Y*(T1A900*F107+T2A900)+SEASY*T3A900
	T900B=T0B900+F107Y*(T1B900*F107+T2B900)+SEASY*T3B900
	T900=(T900B-T900A)/(DDDB-DDDA)*(DDDD-DDDA)+T900A
C     1500km level
      T0A150=0.0
      T0B150=0.0
	T1A150=0.0
	T1B150=0.0
	T2A150=0.0
	T2B150=0.0
      T3A150=0.0
	T3B150=0.0
	DO 110 I=1,81
         T0A150=T0A150+C(I)*D(3,SEZAI,I)
110      T0B150=T0B150+C(I)*D(3,SEZBI,I)
	DO 120 I=1,49
         T1A150=T1A150+CF107(I)*FA(3,SEZAI,I)
120      T1B150=T1B150+CF107(I)*FA(3,SEZBI,I)
	DO 130 I=1,49
         T2A150=T2A150+CF107(I)*FB(3,SEZAI,I)
130      T2B150=T2B150+CF107(I)*FB(3,SEZBI,I)
	DO 140 I=1,25
         T3A150=T3A150+CSZ(I)*SZ(3,SEZA,I)
140      T3B150=T3B150+CSZ(I)*SZ(3,SEZB,I)
	T150A=T0A150+F107Y*(T1A150*F107+T2A150)+SEASY*T3A150
	T150B=T0B150+F107Y*(T1B150*F107+T2B150)+SEASY*T3B150
	T1500=(T150B-T150A)/(DDDB-DDDA)*(DDDD-DDDA)+T150A
C     2500km level
      T0A250=0.0
	T0B250=0.0
	T1A250=0.0
	T1B250=0.0
	T2A250=0.0
	T2B250=0.0
      T3A250=0.0
	T3B250=0.0
      DO 150 I=1,81
         T0A250=T0A250+C(I)*D(4,SEZAI,I)
150      T0B250=T0B250+C(I)*D(4,SEZBI,I)
      DO 160 I=1,49
         T1A250=T1A250+CF107(I)*FA(4,SEZAI,I)
160      T1B250=T1B250+CF107(I)*FA(4,SEZBI,I)
      DO 170 I=1,49
         T2A250=T2A250+CF107(I)*FB(4,SEZAI,I)
170      T2B250=T2B250+CF107(I)*FB(4,SEZBI,I)
      DO 180 I=1,25
         T3A250=T3A250+CSZ(I)*SZ(4,SEZA,I)
180      T3B250=T3B250+CSZ(I)*SZ(4,SEZB,I)
      T250A=T0A250+F107Y*(T1A250*F107+T2A250)+SEASY*T3A250
      T250B=T0B250+F107Y*(T1B250*F107+T2B250)+SEASY*T3B250
      T2500=(T250B-T250A)/(DDDB-DDDA)*(DDDD-DDDA)+T250A
	TE(1)=T550
	TE(2)=T900
	TE(3)=T1500
	TE(4)=T2500
      RETURN
      END

	SUBROUTINE SPHARM_IK(C,L,M,COLAT,AZ)
C CALCULATES THE COEFFICIENTS OF THE SPHERICAL HARMONIC
C FROM IRI 95 MODEL
C NOTE: COEFFICIENTS CORRESPONDING TO COS, SIN SWAPPED!!!
      DIMENSION C(82)
      C(1)=1.
      K=2
      X=COS(COLAT)
      C(K)=X
      K=K+1
      DO 10 I=2,L
      C(K)=((2*I-1)*X*C(K-1)-(I-1)*C(K-2))/I
10    K=K+1
      Y=SIN(COLAT)
      DO 20 MT=1,M
      CAZ=COS(MT*AZ)
      SAZ=SIN(MT*AZ)
      C(K)=Y**MT
      K=K+1
      IF(MT.EQ.L) GOTO 16
      C(K)=C(K-1)*X*(2*MT+1)
      K=K+1
      IF((MT+1).EQ.L) GOTO 16
      DO 15 I=2+MT,L
      C(K)=((2*I-1)*X*C(K-1)-(I+MT-1)*C(K-2))/(I-MT)
15    K=K+1
16    N=L-MT+1
      DO 18 I=1,N
      C(K)=C(K-N)*SAZ
      C(K-N)=C(K-N)*CAZ
18    K=K+1
20    CONTINUE
      RETURN
      END