LCOV - code coverage report
Current view: top level - chemistry/utils - msise00.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 713 0.0 %
Date: 2024-12-17 17:57:11 Functions: 0 20 0.0 %

          Line data    Source code
       1           0 :       SUBROUTINE GTD7(IYD,SEC,ALT,GLAT,GLONG,STL,F107A,F107,AP,MASS,D,T)
       2             : !
       3             : !-----------------------------------------------------------------------
       4             : !     NRLMSISE-00
       5             : !     -----------
       6             : !        Neutral Atmosphere Empirical Model from the surface to lower
       7             : !        exosphere
       8             : !
       9             : !        NEW FEATURES:
      10             : !          *Extensive satellite drag database used in model generation
      11             : !          *Revised O2 (and O) in lower thermosphere
      12             : !          *Additional nonlinear solar activity term
      13             : !          *"ANOMALOUS OXYGEN" NUMBER DENSITY, OUTPUT D(9)
      14             : !           At high altitudes (> 500 km), hot atomic oxygen or ionized
      15             : !           oxygen can become appreciable for some ranges of subroutine
      16             : !           inputs, thereby affecting drag on satellites and debris. We
      17             : !           group these species under the term "anomalous oxygen," since
      18             : !           their individual variations are not presently separable with
      19             : !           the drag data used to define this model component.
      20             : !
      21             : !        SUBROUTINES FOR SPECIAL OUTPUTS:
      22             : !        
      23             : !        HIGH ALTITUDE DRAG: EFFECTIVE TOTAL MASS DENSITY 
      24             : !        (SUBROUTINE GTD7D, OUTPUT D(6))
      25             : !           For atmospheric drag calculations at altitudes above 500 km,
      26             : !           call SUBROUTINE GTD7D to compute the "effective total mass
      27             : !           density" by including contributions from "anomalous oxygen."
      28             : !           See "NOTES ON OUTPUT VARIABLES" below on D(6).
      29             : !
      30             : !        PRESSURE GRID (SUBROUTINE GHP7)
      31             : !          See subroutine GHP7 to specify outputs at a pressure level
      32             : !          rather than at an altitude.
      33             : !
      34             : !        OUTPUT IN M-3 and KG/M3:   CALL METERS(.TRUE.)
      35             : ! 
      36             : !     INPUT VARIABLES:
      37             : !        IYD - YEAR AND DAY AS YYDDD (day of year from 1 to 365 (or 366))
      38             : !              (Year ignored in current model)
      39             : !        SEC - UT(SEC)
      40             : !        ALT - ALTITUDE(KM)
      41             : !        GLAT - GEODETIC LATITUDE(DEG)
      42             : !        GLONG - GEODETIC LONGITUDE(DEG)
      43             : !        STL - LOCAL APPARENT SOLAR TIME(HRS; see Note below)
      44             : !        F107A - 81 day AVERAGE OF F10.7 FLUX (centered on day DDD)
      45             : !        F107 - DAILY F10.7 FLUX FOR PREVIOUS DAY
      46             : !        AP - MAGNETIC INDEX(DAILY) OR WHEN SW(9)=-1. :
      47             : !           - ARRAY CONTAINING:
      48             : !             (1) DAILY AP
      49             : !             (2) 3 HR AP INDEX FOR CURRENT TIME
      50             : !             (3) 3 HR AP INDEX FOR 3 HRS BEFORE CURRENT TIME
      51             : !             (4) 3 HR AP INDEX FOR 6 HRS BEFORE CURRENT TIME
      52             : !             (5) 3 HR AP INDEX FOR 9 HRS BEFORE CURRENT TIME
      53             : !             (6) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 12 TO 33 HRS PRIOR
      54             : !                    TO CURRENT TIME
      55             : !             (7) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 36 TO 57 HRS PRIOR
      56             : !                    TO CURRENT TIME
      57             : !        MASS - MASS NUMBER (ONLY DENSITY FOR SELECTED GAS IS
      58             : !                 CALCULATED.  MASS 0 IS TEMPERATURE.  MASS 48 FOR ALL.
      59             : !                 MASS 17 IS Anomalous O ONLY.)
      60             : !
      61             : !     NOTES ON INPUT VARIABLES: 
      62             : !        UT, Local Time, and Longitude are used independently in the
      63             : !        model and are not of equal importance for every situation.  
      64             : !        For the most physically realistic calculation these three
      65             : !        variables should be consistent (STL=SEC/3600+GLONG/15).
      66             : !        The Equation of Time departures from the above formula
      67             : !        for apparent local time can be included if available but
      68             : !        are of minor importance.
      69             : !
      70             : !        F107 and F107A values used to generate the model correspond
      71             : !        to the 10.7 cm radio flux at the actual distance of the Earth
      72             : !        from the Sun rather than the radio flux at 1 AU. The following
      73             : !        site provides both classes of values:
      74             : !        ftp://ftp.ngdc.noaa.gov/STP/SOLAR_DATA/SOLAR_RADIO/FLUX/
      75             : !
      76             : !        F107, F107A, and AP effects are neither large nor well
      77             : !        established below 80 km and these parameters should be set to
      78             : !        150., 150., and 4. respectively.
      79             : !
      80             : !     OUTPUT VARIABLES:
      81             : !        D(1) - HE NUMBER DENSITY(CM-3)
      82             : !        D(2) - O NUMBER DENSITY(CM-3)
      83             : !        D(3) - N2 NUMBER DENSITY(CM-3)
      84             : !        D(4) - O2 NUMBER DENSITY(CM-3)
      85             : !        D(5) - AR NUMBER DENSITY(CM-3)                       
      86             : !        D(6) - TOTAL MASS DENSITY(GM/CM3)
      87             : !        D(7) - H NUMBER DENSITY(CM-3)
      88             : !        D(8) - N NUMBER DENSITY(CM-3)
      89             : !        D(9) - Anomalous oxygen NUMBER DENSITY(CM-3)
      90             : !        T(1) - EXOSPHERIC TEMPERATURE
      91             : !        T(2) - TEMPERATURE AT ALT
      92             : !
      93             : !     NOTES ON OUTPUT VARIABLES:
      94             : !        TO GET OUTPUT IN M-3 and KG/M3:   CALL METERS(.TRUE.) 
      95             : !
      96             : !        O, H, and N are set to zero below 72.5 km
      97             : !
      98             : !        T(1), Exospheric temperature, is set to global average for
      99             : !        altitudes below 120 km. The 120 km gradient is left at global
     100             : !        average value for altitudes below 72 km.
     101             : !
     102             : !        D(6), TOTAL MASS DENSITY, is NOT the same for subroutines GTD7 
     103             : !        and GTD7D
     104             : !
     105             : !          SUBROUTINE GTD7 -- D(6) is the sum of the mass densities of the
     106             : !          species labeled by indices 1-5 and 7-8 in output variable D.
     107             : !          This includes He, O, N2, O2, Ar, H, and N but does NOT include
     108             : !          anomalous oxygen (species index 9).
     109             : !
     110             : !          SUBROUTINE GTD7D -- D(6) is the "effective total mass density
     111             : !          for drag" and is the sum of the mass densities of all species
     112             : !          in this model, INCLUDING anomalous oxygen.
     113             : !        
     114             : !     SWITCHES: The following is for test and special purposes:
     115             : !          
     116             : !        TO TURN ON AND OFF PARTICULAR VARIATIONS CALL TSELEC(SW),
     117             : !        WHERE SW IS A 25 ELEMENT ARRAY CONTAINING 0. FOR OFF, 1. 
     118             : !        FOR ON, OR 2. FOR MAIN EFFECTS OFF BUT CROSS TERMS ON
     119             : !        FOR THE FOLLOWING VARIATIONS
     120             : !               1 - F10.7 EFFECT ON MEAN  2 - TIME INDEPENDENT
     121             : !               3 - SYMMETRICAL ANNUAL    4 - SYMMETRICAL SEMIANNUAL
     122             : !               5 - ASYMMETRICAL ANNUAL   6 - ASYMMETRICAL SEMIANNUAL
     123             : !               7 - DIURNAL               8 - SEMIDIURNAL
     124             : !               9 - DAILY AP             10 - ALL UT/LONG EFFECTS
     125             : !              11 - LONGITUDINAL         12 - UT AND MIXED UT/LONG
     126             : !              13 - MIXED AP/UT/LONG     14 - TERDIURNAL
     127             : !              15 - DEPARTURES FROM DIFFUSIVE EQUILIBRIUM
     128             : !              16 - ALL TINF VAR         17 - ALL TLB VAR
     129             : !              18 - ALL TN1 VAR           19 - ALL S VAR
     130             : !              20 - ALL TN2 VAR           21 - ALL NLB VAR
     131             : !              22 - ALL TN3 VAR           23 - TURBO SCALE HEIGHT VAR
     132             : !
     133             : !        To get current values of SW: CALL TRETRV(SW)
     134             : !-----------------------------------------------------------------------
     135             : !
     136           0 :       use shr_kind_mod, only : r8 => shr_kind_r8
     137             :       implicit none
     138             : !
     139             : !-------------------------------Commons---------------------------------
     140             : !
     141             :       real(r8) tlb, s, db04, db16, db28, db32, db40, db48, db01, &
     142             :        za, t0, z0, g0, rl, dd, db14, tr12
     143             :       COMMON/GTS3C/TLB,S,DB04,DB16,DB28,DB32,DB40,DB48,DB01,ZA,T0,Z0 &
     144             :        ,G0,RL,DD,DB14,TR12
     145             : 
     146             :       real(r8) tn1, tn2, tn3, tgn1, tgn2, tgn3
     147             :       COMMON/MESO7/TN1(5),TN2(4),TN3(5),TGN1(2),TGN2(2),TGN3(2)
     148             : 
     149             :       real(r8) ptm, pdm
     150             :       COMMON/LOWER7/PTM(10),PDM(10,8)
     151             : 
     152             :       real(r8) pt, pd, ps, pdl, ptl, pma, sam
     153             :       COMMON/PARM7/PT(150),PD(150,9),PS(150),PDL(25,2),PTL(100,4), &
     154             :        PMA(100,10),SAM(100)
     155             : 
     156             :       character*4 isd, ist, nam
     157             :       COMMON/DATIM7/ISD(3),IST(2),NAM(2)
     158             : 
     159             :       character*4 ISDATE, ISTIME, NAME
     160             :       COMMON/DATIME/ISDATE(3),ISTIME(2),NAME(2)
     161             : 
     162             :       integer isw
     163             :       real(r8) sw, swc
     164             :       COMMON/CSW/SW(25),SWC(25),ISW
     165             : 
     166             :       real(r8) pavgm
     167             :       COMMON/MAVG7/PAVGM(10)
     168             : 
     169             :       real(r8) dm04, dm16, dm28, dm32, dm40, dm01, dm14
     170             :       COMMON/DMIX/DM04,DM16,DM28,DM32,DM40,DM01,DM14
     171             : 
     172             :       real(r8) gsurf, re
     173             :       COMMON/PARMB/GSURF,RE
     174             : 
     175             :       integer imr
     176             :       COMMON/METSEL/IMR
     177             : !
     178             : !------------------------------Arguments--------------------------------
     179             : !
     180             :       integer iyd, mass
     181             :       real(r8) sec, alt, glat, glong, stl, f107a, f107
     182             :       real(r8) D(9),T(2),AP(7)
     183             : !
     184             : !---------------------------Local variables-----------------------------
     185             : !
     186             :       integer i, j, mssx
     187             :       real(r8) dmc, dm28m, tz, dz28, dmr, v1
     188             :       real(r8) altt, xlat, xmm
     189             :       real(r8) DS(9),TS(2)
     190             : 
     191             :       integer mn3
     192             :       real(r8) ZN3(5)
     193             :       DATA MN3/5/,ZN3/32.5_r8,20._r8,15._r8,10._r8,0._r8/
     194             : 
     195             :       integer mn2
     196             :       real(r8) ZN2(4)
     197             :       DATA MN2/4/,ZN2/72.5_r8,55._r8,45._r8,32.5_r8/
     198             : 
     199             :       integer mssl
     200             :       real(r8) zmix, alast
     201             :       DATA ZMIX/62.5_r8/,ALAST/99999._r8/,MSSL/-999/
     202             : 
     203             :       real(r8) SV(25)
     204             :       DATA SV/25*1._r8/
     205             : 
     206             :       SAVE
     207             : !
     208             : !-------------------------External Functions----------------------------
     209             : !
     210             :       EXTERNAL GTD7BK
     211             : 
     212             :       real(r8) densm, glob7s, vtst7
     213             :       external densm, glob7s, vtst7
     214             : !
     215             : !-----------------------------------------------------------------------
     216             : !
     217           0 :       IF(ISW.NE.64999) CALL TSELEC(SV)
     218             : !      Put identification data into common/datime/
     219           0 :       DO 1 I=1,3
     220           0 :         ISDATE(I)=ISD(I)
     221           0 :     1 CONTINUE
     222           0 :       DO 2 I=1,2
     223           0 :         ISTIME(I)=IST(I)
     224           0 :         NAME(I)=NAM(I)
     225           0 :     2 CONTINUE
     226             : !
     227             : !        Test for changed input
     228           0 :       V1=VTST7(IYD,SEC,GLAT,GLONG,STL,F107A,F107,AP,1)
     229             : !       Latitude variation of gravity (none for SW(2)=0)
     230           0 :       XLAT=GLAT
     231           0 :       IF(SW(2).EQ.0) XLAT=45._r8
     232           0 :       CALL GLATF(XLAT,GSURF,RE)
     233             : !
     234           0 :       XMM=PDM(5,3)
     235             : !
     236             : !       THERMOSPHERE/MESOSPHERE (above ZN2(1))
     237           0 :       ALTT=MAX(ALT,ZN2(1))
     238           0 :       MSSX=MASS
     239             : !       Only calculate N2 in thermosphere if alt in mixed region
     240           0 :       IF(ALT.LT.ZMIX.AND.MASS.GT.0) MSSX=28
     241             : !       Only calculate thermosphere if input parameters changed
     242             : !         or altitude above ZN2(1) in mesosphere
     243           0 :       IF(V1.EQ.1._r8.OR.ALT.GT.ZN2(1).OR.ALAST.GT.ZN2(1).OR.MSSX.NE.MSSL) &
     244             :        THEN
     245           0 :         CALL GTS7(IYD,SEC,ALTT,GLAT,GLONG,STL,F107A,F107,AP,MSSX,DS,TS)
     246           0 :         DM28M=DM28
     247             : !         metric adjustment
     248           0 :         IF(IMR.EQ.1) DM28M=DM28*1.E6_r8
     249           0 :         MSSL=MSSX
     250             :       ENDIF
     251           0 :       T(1)=TS(1)
     252           0 :       T(2)=TS(2)
     253           0 :       IF(ALT.GE.ZN2(1)) THEN
     254           0 :         DO 5 J=1,9
     255           0 :           D(J)=DS(J)
     256           0 :     5   CONTINUE
     257             :         GOTO 10
     258             :       ENDIF
     259             : !
     260             : !       LOWER MESOSPHERE/UPPER STRATOSPHERE [between ZN3(1) and ZN2(1)]
     261             : !         Temperature at nodes and gradients at end nodes
     262             : !         Inverse temperature a linear function of spherical harmonics
     263             : !         Only calculate nodes if input changed
     264           0 :        IF(V1.EQ.1._r8.OR.ALAST.GE.ZN2(1)) THEN
     265           0 :         TGN2(1)=TGN1(2)
     266           0 :         TN2(1)=TN1(5)
     267           0 :         TN2(2)=PMA(1,1)*PAVGM(1)/(1._r8-SW(20)*GLOB7S(PMA(1,1)))
     268           0 :         TN2(3)=PMA(1,2)*PAVGM(2)/(1._r8-SW(20)*GLOB7S(PMA(1,2)))
     269           0 :         TN2(4)=PMA(1,3)*PAVGM(3)/(1._r8-SW(20)*SW(22)*GLOB7S(PMA(1,3)))
     270             :         TGN2(2)=PAVGM(9)*PMA(1,10)*(1._r8+SW(20)*SW(22)*GLOB7S(PMA(1,10))) &
     271           0 :         *TN2(4)*TN2(4)/(PMA(1,3)*PAVGM(3))**2
     272           0 :         TN3(1)=TN2(4)
     273             :        ENDIF
     274           0 :        IF(ALT.GE.ZN3(1)) GOTO 6
     275             : !
     276             : !       LOWER STRATOSPHERE AND TROPOSPHERE [below ZN3(1)]
     277             : !         Temperature at nodes and gradients at end nodes
     278             : !         Inverse temperature a linear function of spherical harmonics
     279             : !         Only calculate nodes if input changed
     280           0 :         IF(V1.EQ.1._r8.OR.ALAST.GE.ZN3(1)) THEN
     281           0 :          TGN3(1)=TGN2(2)
     282           0 :          TN3(2)=PMA(1,4)*PAVGM(4)/(1._r8-SW(22)*GLOB7S(PMA(1,4)))
     283           0 :          TN3(3)=PMA(1,5)*PAVGM(5)/(1._r8-SW(22)*GLOB7S(PMA(1,5)))
     284           0 :          TN3(4)=PMA(1,6)*PAVGM(6)/(1._r8-SW(22)*GLOB7S(PMA(1,6)))
     285           0 :          TN3(5)=PMA(1,7)*PAVGM(7)/(1._r8-SW(22)*GLOB7S(PMA(1,7)))
     286             :          TGN3(2)=PMA(1,8)*PAVGM(8)*(1._r8+SW(22)*GLOB7S(PMA(1,8))) &
     287           0 :          *TN3(5)*TN3(5)/(PMA(1,7)*PAVGM(7))**2
     288             :         ENDIF
     289             :     6   CONTINUE
     290           0 :         IF(MASS.EQ.0) GOTO 50
     291             : !          LINEAR TRANSITION TO FULL MIXING BELOW ZN2(1)
     292           0 :         DMC=0
     293           0 :         IF(ALT.GT.ZMIX) DMC=1._r8-(ZN2(1)-ALT)/(ZN2(1)-ZMIX)
     294           0 :         DZ28=DS(3)
     295             : !      ***** N2 DENSITY ****
     296           0 :         DMR=DS(3)/DM28M-1._r8
     297           0 :         D(3)=DENSM(ALT,DM28M,XMM,TZ,MN3,ZN3,TN3,TGN3,MN2,ZN2,TN2,TGN2)
     298           0 :         D(3)=D(3)*(1._r8+DMR*DMC)
     299             : !      ***** HE DENSITY ****
     300           0 :         D(1)=0
     301           0 :         IF(MASS.NE.4.AND.MASS.NE.48) GOTO 204
     302           0 :           DMR=DS(1)/(DZ28*PDM(2,1))-1._r8
     303           0 :           D(1)=D(3)*PDM(2,1)*(1._r8+DMR*DMC)
     304             :   204   CONTINUE
     305             : !      **** O DENSITY ****
     306           0 :         D(2)=0
     307           0 :         D(9)=0
     308             :   216   CONTINUE
     309             : !      ***** O2 DENSITY ****
     310           0 :         D(4)=0
     311           0 :         IF(MASS.NE.32.AND.MASS.NE.48) GOTO 232
     312           0 :           DMR=DS(4)/(DZ28*PDM(2,4))-1._r8
     313           0 :           D(4)=D(3)*PDM(2,4)*(1._r8+DMR*DMC)
     314             :   232   CONTINUE
     315             : !      ***** AR DENSITY ****
     316           0 :         D(5)=0
     317           0 :         IF(MASS.NE.40.AND.MASS.NE.48) GOTO 240
     318           0 :           DMR=DS(5)/(DZ28*PDM(2,5))-1._r8
     319           0 :           D(5)=D(3)*PDM(2,5)*(1._r8+DMR*DMC)
     320             :   240   CONTINUE
     321             : !      ***** HYDROGEN DENSITY ****
     322           0 :         D(7)=0
     323             : !      ***** ATOMIC NITROGEN DENSITY ****
     324           0 :         D(8)=0
     325             : !
     326             : !       TOTAL MASS DENSITY
     327             : !
     328           0 :         IF(MASS.EQ.48) THEN
     329             :          D(6) = 1.66E-24_r8*(4._r8*D(1)+16._r8*D(2)+28._r8*D(3)+32._r8*D(4)+40._r8*D(5)+ &
     330           0 :              D(7)+14._r8*D(8))  
     331           0 :          IF(IMR.EQ.1) D(6)=D(6)/1000._r8
     332             :          ENDIF
     333           0 :          T(2)=TZ
     334             :    10 CONTINUE
     335           0 :       GOTO 90
     336             :    50 CONTINUE
     337           0 :       DD=DENSM(ALT,1._r8,0._r8,TZ,MN3,ZN3,TN3,TGN3,MN2,ZN2,TN2,TGN2)                
     338           0 :       T(2)=TZ
     339             :    90 CONTINUE
     340           0 :       ALAST=ALT
     341           0 :       RETURN
     342             :       END SUBROUTINE GTD7
     343             : 
     344             : !================================================================================================
     345             : 
     346           0 :       SUBROUTINE GTD7D(IYD,SEC,ALT,GLAT,GLONG,STL,F107A,F107,AP,MASS, &
     347             :        D,T)
     348             : !
     349             : !-----------------------------------------------------------------------
     350             : !     NRLMSISE-00
     351             : !     -----------
     352             : !        This subroutine provides Effective Total Mass Density for
     353             : !        output D(6) which includes contributions from "anomalous
     354             : !        oxygen" which can affect satellite drag above 500 km.  This
     355             : !        subroutine is part of the distribution package for the 
     356             : !        Neutral Atmosphere Empirical Model from the surface to lower
     357             : !        exosphere.  See subroutine GTD7 for more extensive comments.
     358             : !
     359             : !     INPUT VARIABLES:
     360             : !        IYD - YEAR AND DAY AS YYDDD (day of year from 1 to 365 (or 366))
     361             : !              (Year ignored in current model)
     362             : !        SEC - UT(SEC)
     363             : !        ALT - ALTITUDE(KM)
     364             : !        GLAT - GEODETIC LATITUDE(DEG)
     365             : !        GLONG - GEODETIC LONGITUDE(DEG)
     366             : !        STL - LOCAL APPARENT SOLAR TIME(HRS; see Note below)
     367             : !        F107A - 81 day AVERAGE OF F10.7 FLUX (centered on day DDD)
     368             : !        F107 - DAILY F10.7 FLUX FOR PREVIOUS DAY
     369             : !        AP - MAGNETIC INDEX(DAILY) OR WHEN SW(9)=-1. :
     370             : !           - ARRAY CONTAINING:
     371             : !             (1) DAILY AP
     372             : !             (2) 3 HR AP INDEX FOR CURRENT TIME
     373             : !             (3) 3 HR AP INDEX FOR 3 HRS BEFORE CURRENT TIME
     374             : !             (4) 3 HR AP INDEX FOR 6 HRS BEFORE CURRENT TIME
     375             : !             (5) 3 HR AP INDEX FOR 9 HRS BEFORE CURRENT TIME
     376             : !             (6) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 12 TO 33 HRS PRIOR
     377             : !                    TO CURRENT TIME
     378             : !             (7) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 36 TO 57 HRS PRIOR
     379             : !                    TO CURRENT TIME
     380             : !        MASS - MASS NUMBER (ONLY DENSITY FOR SELECTED GAS IS
     381             : !                 CALCULATED.  MASS 0 IS TEMPERATURE.  MASS 48 FOR ALL.
     382             : !                 MASS 17 IS Anomalous O ONLY.)
     383             : !
     384             : !     NOTES ON INPUT VARIABLES: 
     385             : !        UT, Local Time, and Longitude are used independently in the
     386             : !        model and are not of equal importance for every situation.  
     387             : !        For the most physically realistic calculation these three
     388             : !        variables should be consistent (STL=SEC/3600+GLONG/15).
     389             : !        The Equation of Time departures from the above formula
     390             : !        for apparent local time can be included if available but
     391             : !        are of minor importance.
     392             : !
     393             : !        F107 and F107A values used to generate the model correspond
     394             : !        to the 10.7 cm radio flux at the actual distance of the Earth
     395             : !        from the Sun rather than the radio flux at 1 AU.
     396             : !
     397             : !     OUTPUT VARIABLES:
     398             : !        D(1) - HE NUMBER DENSITY(CM-3)
     399             : !        D(2) - O NUMBER DENSITY(CM-3)
     400             : !        D(3) - N2 NUMBER DENSITY(CM-3)
     401             : !        D(4) - O2 NUMBER DENSITY(CM-3)
     402             : !        D(5) - AR NUMBER DENSITY(CM-3)                       
     403             : !        D(6) - TOTAL MASS DENSITY(GM/CM3) [includes anomalous oxygen]
     404             : !        D(7) - H NUMBER DENSITY(CM-3)
     405             : !        D(8) - N NUMBER DENSITY(CM-3)
     406             : !        D(9) - Anomalous oxygen NUMBER DENSITY(CM-3)
     407             : !        T(1) - EXOSPHERIC TEMPERATURE
     408             : !        T(2) - TEMPERATURE AT ALT
     409             : !-----------------------------------------------------------------------
     410             : !
     411             :       use shr_kind_mod, only : r8 => shr_kind_r8
     412             :       implicit none
     413             : !
     414             : !-------------------------------Commons---------------------------------
     415             : !
     416             :       integer imr
     417             :       COMMON/METSEL/IMR
     418             : !
     419             : !------------------------------Arguments--------------------------------
     420             : !
     421             :       integer iyd, mass
     422             :       real(r8) sec, alt, glat, glong, stl, f107a, f107
     423             :       real(r8) D(9),T(2),AP(7)
     424             : !
     425             : !---------------------------Local variables-----------------------------
     426             : !
     427             :       real(r8) DS(9),TS(2)
     428             : !
     429             : !-----------------------------------------------------------------------
     430             : !
     431           0 :       CALL GTD7(IYD,SEC,ALT,GLAT,GLONG,STL,F107A,F107,AP,MASS,D,T)
     432             : !       TOTAL MASS DENSITY
     433             : !
     434           0 :         IF(MASS.EQ.48) THEN
     435             :          D(6) = 1.66E-24_r8*(4._r8*D(1)+16._r8*D(2)+28._r8*D(3)+32._r8*D(4)+40._r8*D(5)+ &
     436           0 :              D(7)+14._r8*D(8)+16._r8*D(9))  
     437           0 :          IF(IMR.EQ.1) D(6)=D(6)/1000._r8
     438             :          ENDIF
     439           0 :       RETURN
     440             :       END SUBROUTINE GTD7D
     441             : 
     442             : !================================================================================================
     443             : 
     444           0 :       SUBROUTINE GHP7(IYD,SEC,ALT,GLAT,GLONG,STL,F107A,F107,AP, &
     445             :         D,T,PRESS)
     446             : !         
     447             : !-----------------------------------------------------------------------
     448             : !       FIND ALTITUDE OF PRESSURE SURFACE (PRESS) FROM GTD7
     449             : !     INPUT:
     450             : !        IYD - YEAR AND DAY AS YYDDD
     451             : !        SEC - UT(SEC)
     452             : !        GLAT - GEODETIC LATITUDE(DEG)
     453             : !        GLONG - GEODETIC LONGITUDE(DEG)
     454             : !        STL - LOCAL APPARENT SOLAR TIME(HRS)
     455             : !        F107A - 3 MONTH AVERAGE OF F10.7 FLUX
     456             : !        F107 - DAILY F10.7 FLUX FOR PREVIOUS DAY
     457             : !        AP - MAGNETIC INDEX(DAILY) OR WHEN SW(9)=-1. :
     458             : !           - ARRAY CONTAINING:
     459             : !             (1) DAILY AP
     460             : !             (2) 3 HR AP INDEX FOR CURRENT TIME
     461             : !             (3) 3 HR AP INDEX FOR 3 HRS BEFORE CURRENT TIME
     462             : !             (4) 3 HR AP INDEX FOR 6 HRS BEFORE CURRENT TIME
     463             : !             (5) 3 HR AP INDEX FOR 9 HRS BEFORE CURRENT TIME
     464             : !             (6) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 12 TO 33 HRS PRIOR
     465             : !                    TO CURRENT TIME
     466             : !             (7) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 36 TO 59 HRS PRIOR
     467             : !                    TO CURRENT TIME
     468             : !        PRESS - PRESSURE LEVEL(MB)
     469             : !     OUTPUT:
     470             : !        ALT - ALTITUDE(KM) 
     471             : !        D(1) - HE NUMBER DENSITY(CM-3)
     472             : !        D(2) - O NUMBER DENSITY(CM-3)
     473             : !        D(3) - N2 NUMBER DENSITY(CM-3)
     474             : !        D(4) - O2 NUMBER DENSITY(CM-3)
     475             : !        D(5) - AR NUMBER DENSITY(CM-3)
     476             : !        D(6) - TOTAL MASS DENSITY(GM/CM3)
     477             : !        D(7) - H NUMBER DENSITY(CM-3)
     478             : !        D(8) - N NUMBER DENSITY(CM-3)
     479             : !        D(9) - HOT O NUMBER DENSITY(CM-3)
     480             : !        T(1) - EXOSPHERIC TEMPERATURE
     481             : !        T(2) - TEMPERATURE AT ALT
     482             : !-----------------------------------------------------------------------
     483             : !
     484             :       use shr_kind_mod, only : r8 => shr_kind_r8
     485             :       use cam_logfile,  only : iulog
     486             :       implicit none
     487             : !
     488             : !-------------------------------Commons---------------------------------
     489             : !
     490             :       real(r8) gsurf, re
     491             :       COMMON/PARMB/GSURF,RE
     492             : 
     493             :       integer imr
     494             :       COMMON/METSEL/IMR
     495             : !
     496             : !------------------------------Arguments--------------------------------
     497             : !
     498             :       integer iyd
     499             :       real(r8) sec, alt, glat, glong, stl, f107a, f107, press
     500             :       real(r8) D(9),T(2),AP(7)
     501             : !
     502             : !---------------------------Local variables-----------------------------
     503             : !
     504             :       integer l, iday
     505             :       real(r8) p, xn, diff, sh, g, xm, z, zi, pl, cl, ca, cd, cl2
     506             : 
     507             :       real(r8) bm, rgas
     508             :       DATA BM/1.3806E-19_r8/,RGAS/831.4_r8/
     509             : 
     510             :       integer ltest
     511             :       real(r8) test
     512             :       DATA TEST/.00043_r8/,LTEST/12/
     513             : 
     514             :       SAVE
     515             : !
     516             : !-----------------------------------------------------------------------
     517             : !
     518           0 :       PL=LOG10(PRESS)
     519             : !      Initial altitude estimate
     520           0 :       IF(PL.GE.-5._r8) THEN
     521           0 :          IF(PL.GT.2.5_r8) ZI=18.06_r8*(3.00_r8-PL)
     522           0 :          IF(PL.GT..75_r8.AND.PL.LE.2.5_r8) ZI=14.98_r8*(3.08_r8-PL)
     523           0 :          IF(PL.GT.-1._r8.AND.PL.LE..75_r8) ZI=17.8_r8*(2.72_r8-PL)
     524           0 :          IF(PL.GT.-2._r8.AND.PL.LE.-1._r8) ZI=14.28_r8*(3.64_r8-PL)
     525           0 :          IF(PL.GT.-4._r8.AND.PL.LE.-2._r8) ZI=12.72_r8*(4.32_r8-PL)
     526           0 :          IF(PL.LE.-4._r8) ZI=25.3_r8*(.11_r8-PL)
     527           0 :          IDAY=MOD(IYD,1000)
     528           0 :          CL=GLAT/90._r8
     529           0 :          CL2=CL*CL
     530           0 :          IF(IDAY.LT.182) CD=1._r8-IDAY/91.25_r8
     531           0 :          IF(IDAY.GE.182) CD=IDAY/91.25_r8-3._r8
     532           0 :          CA=0
     533           0 :          IF(PL.GT.-1.11_r8.AND.PL.LE.-.23_r8) CA=1.0_r8
     534           0 :          IF(PL.GT.-.23_r8) CA=(2.79_r8-PL)/(2.79_r8+.23_r8)
     535           0 :          IF(PL.LE.-1.11_r8.AND.PL.GT.-3._r8) CA=(-2.93_r8-PL)/(-2.93_r8+1.11_r8)
     536           0 :          Z=ZI-4.87_r8*CL*CD*CA-1.64_r8*CL2*CA+.31_r8*CA*CL
     537             :       ENDIF
     538           0 :       IF(PL.LT.-5._r8) Z=22._r8*(PL+4._r8)**2+110
     539             : !      ITERATION LOOP
     540           0 :       L=0
     541             :    10 CONTINUE
     542           0 :         L=L+1
     543           0 :         CALL GTD7(IYD,SEC,Z,GLAT,GLONG,STL,F107A,F107,AP,48,D,T)
     544           0 :         XN=D(1)+D(2)+D(3)+D(4)+D(5)+D(7)+D(8)
     545           0 :         P=BM*XN*T(2)
     546           0 :         IF(IMR.EQ.1) P=P*1.E-6_r8
     547           0 :         DIFF=PL-LOG10(P)
     548           0 :         IF(ABS(DIFF).LT.TEST .OR. L.EQ.LTEST) GOTO 20
     549           0 :         XM=D(6)/XN/1.66E-24_r8
     550           0 :         IF(IMR.EQ.1) XM = XM*1.E3_r8
     551           0 :         G=GSURF/(1._r8+Z/RE)**2
     552           0 :         SH=RGAS*T(2)/(XM*G)
     553             : !         New altitude estimate using scale height
     554           0 :         IF(L.LT.6) THEN
     555           0 :           Z=Z-SH*DIFF*2.302_r8
     556             :         ELSE
     557           0 :           Z=Z-SH*DIFF
     558             :         ENDIF
     559           0 :         GOTO 10
     560             :    20 CONTINUE
     561           0 :       IF(L.EQ.LTEST) write(iulog,100) PRESS,DIFF
     562             :   100 FORMAT(1X,29HGHP7 NOT CONVERGING FOR PRESS, 1PE12.2,E12.2)
     563           0 :       ALT=Z
     564           0 :       RETURN
     565             :       END SUBROUTINE GHP7
     566             : 
     567             : !================================================================================================
     568             : 
     569           0 :       SUBROUTINE GLATF(LAT,GV,REFF)
     570             : !         
     571             : !-----------------------------------------------------------------------
     572             : !      CALCULATE LATITUDE VARIABLE GRAVITY (GV) AND EFFECTIVE
     573             : !      RADIUS (REFF)
     574             : !-----------------------------------------------------------------------
     575             : !
     576             :       use shr_kind_mod, only : r8 => shr_kind_r8
     577             :       implicit none
     578             : !
     579             : !------------------------------Arguments--------------------------------
     580             : !
     581             :       REAL(r8) LAT
     582             :       real(r8) gv, reff
     583             : !
     584             : !---------------------------Local variables-----------------------------
     585             : !
     586             :       real(r8) c2
     587             : 
     588             :       real(r8) dgtr
     589             :       DATA DGTR/1.74533E-2_r8/
     590             : 
     591             :       SAVE
     592             : !
     593             : !-----------------------------------------------------------------------
     594             : !
     595           0 :       C2 = COS(2._r8*DGTR*LAT)
     596           0 :       GV = 980.616_r8*(1._r8-.0026373_r8*C2)
     597           0 :       REFF = 2._r8*GV/(3.085462E-6_r8 + 2.27E-9_r8*C2)*1.E-5_r8
     598           0 :       RETURN
     599             :       END SUBROUTINE GLATF
     600             : 
     601             : !================================================================================================
     602             : 
     603           0 :       FUNCTION VTST7(IYD,SEC,GLAT,GLONG,STL,F107A,F107,AP,IC)
     604             : !         
     605             : !-----------------------------------------------------------------------
     606             : !       Test if geophysical variables or switches changed and save
     607             : !       Return 0 if unchanged and 1 if changed
     608             : !-----------------------------------------------------------------------
     609             : !
     610             :       use shr_kind_mod, only : r8 => shr_kind_r8
     611             :       implicit none
     612             : !
     613             : !-----------------------------Return Value------------------------------
     614             : !
     615             :       real(r8) vtst7
     616             : !
     617             : !-------------------------------Commons---------------------------------
     618             : !
     619             :       integer isw
     620             :       real(r8) sw, swc
     621             :       COMMON/CSW/SW(25),SWC(25),ISW
     622             : !
     623             : !------------------------------Arguments--------------------------------
     624             : !
     625             :       integer iyd, ic
     626             :       real(r8) sec, glat, glong, stl, f107a, f107
     627             :       real(r8) AP(7)
     628             : !
     629             : !---------------------------Local variables-----------------------------
     630             : !
     631             :       integer i
     632             : 
     633             :       integer IYDL(2)
     634             :       real(r8) SECL(2),GLATL(2),GLL(2)
     635             :       DATA IYDL/2*-999/,SECL/2*-999._r8/,GLATL/2*-999._r8/,GLL/2*-999._r8/
     636             : 
     637             :       real(r8) STLL(2),FAL(2),FL(2),APL(7,2)
     638             :       DATA STLL/2*-999._r8/,FAL/2*-999._r8/,FL/2*-999._r8/,APL/14*-999._r8/
     639             : 
     640             :       real(r8) SWL(25,2),SWCL(25,2)
     641             :       DATA SWL/50*-999._r8/,SWCL/50*-999._r8/
     642             : 
     643             :       SAVE
     644             : !
     645             : !-----------------------------------------------------------------------
     646             : !
     647           0 :       VTST7=0
     648           0 :       IF(IYD.NE.IYDL(IC)) GOTO 10
     649           0 :       IF(SEC.NE.SECL(IC)) GOTO 10
     650           0 :       IF(GLAT.NE.GLATL(IC)) GOTO 10
     651           0 :       IF(GLONG.NE.GLL(IC)) GOTO 10
     652           0 :       IF(STL.NE.STLL(IC)) GOTO 10
     653           0 :       IF(F107A.NE.FAL(IC)) GOTO 10
     654           0 :       IF(F107.NE.FL(IC)) GOTO 10
     655           0 :       DO 5 I=1,7
     656           0 :         IF(AP(I).NE.APL(I,IC)) GOTO 10
     657           0 :     5 CONTINUE
     658           0 :       DO 7 I=1,25
     659           0 :         IF(SW(I).NE.SWL(I,IC)) GOTO 10
     660           0 :         IF(SWC(I).NE.SWCL(I,IC)) GOTO 10
     661           0 :     7 CONTINUE
     662           0 :       GOTO 20
     663             :    10 CONTINUE
     664           0 :       VTST7=1
     665           0 :       IYDL(IC)=IYD
     666           0 :       SECL(IC)=SEC
     667           0 :       GLATL(IC)=GLAT
     668           0 :       GLL(IC)=GLONG
     669           0 :       STLL(IC)=STL
     670           0 :       FAL(IC)=F107A
     671           0 :       FL(IC)=F107
     672           0 :       DO 15 I=1,7
     673           0 :         APL(I,IC)=AP(I)
     674           0 :    15 CONTINUE
     675           0 :       DO 16 I=1,25
     676           0 :         SWL(I,IC)=SW(I)
     677           0 :         SWCL(I,IC)=SWC(I)
     678           0 :    16 CONTINUE
     679             :    20 CONTINUE
     680             :       RETURN
     681             :       END FUNCTION VTST7
     682             : 
     683             : !================================================================================================
     684             : 
     685           0 :       SUBROUTINE GTS7(IYD,SEC,ALT,GLAT,GLONG,STL,F107A,F107,AP,MASS,D,T)
     686             : !         
     687             : !-----------------------------------------------------------------------
     688             : !     Thermospheric portion of NRLMSISE-00
     689             : !     See GTD7 for more extensive comments
     690             : !
     691             : !        OUTPUT IN M-3 and KG/M3:   CALL METERS(.TRUE.)
     692             : ! 
     693             : !     INPUT VARIABLES:
     694             : !        IYD - YEAR AND DAY AS YYDDD (day of year from 1 to 365 (or 366))
     695             : !              (Year ignored in current model)
     696             : !        SEC - UT(SEC)
     697             : !        ALT - ALTITUDE(KM) (>72.5 km)
     698             : !        GLAT - GEODETIC LATITUDE(DEG)
     699             : !        GLONG - GEODETIC LONGITUDE(DEG)
     700             : !        STL - LOCAL APPARENT SOLAR TIME(HRS; see Note below)
     701             : !        F107A - 81 day AVERAGE OF F10.7 FLUX (centered on day DDD)
     702             : !        F107 - DAILY F10.7 FLUX FOR PREVIOUS DAY
     703             : !        AP - MAGNETIC INDEX(DAILY) OR WHEN SW(9)=-1. :
     704             : !           - ARRAY CONTAINING:
     705             : !             (1) DAILY AP
     706             : !             (2) 3 HR AP INDEX FOR CURRENT TIME
     707             : !             (3) 3 HR AP INDEX FOR 3 HRS BEFORE CURRENT TIME
     708             : !             (4) 3 HR AP INDEX FOR 6 HRS BEFORE CURRENT TIME
     709             : !             (5) 3 HR AP INDEX FOR 9 HRS BEFORE CURRENT TIME
     710             : !             (6) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 12 TO 33 HRS PRIOR
     711             : !                    TO CURRENT TIME
     712             : !             (7) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 36 TO 57 HRS PRIOR
     713             : !                    TO CURRENT TIME
     714             : !        MASS - MASS NUMBER (ONLY DENSITY FOR SELECTED GAS IS
     715             : !                 CALCULATED.  MASS 0 IS TEMPERATURE.  MASS 48 FOR ALL.
     716             : !                 MASS 17 IS Anomalous O ONLY.)
     717             : !
     718             : !     NOTES ON INPUT VARIABLES: 
     719             : !        UT, Local Time, and Longitude are used independently in the
     720             : !        model and are not of equal importance for every situation.  
     721             : !        For the most physically realistic calculation these three
     722             : !        variables should be consistent (STL=SEC/3600+GLONG/15).
     723             : !        The Equation of Time departures from the above formula
     724             : !        for apparent local time can be included if available but
     725             : !        are of minor importance.
     726             : !
     727             : !        F107 and F107A values used to generate the model correspond
     728             : !        to the 10.7 cm radio flux at the actual distance of the Earth
     729             : !        from the Sun rather than the radio flux at 1 AU. The following
     730             : !        site provides both classes of values:
     731             : !        ftp://ftp.ngdc.noaa.gov/STP/SOLAR_DATA/SOLAR_RADIO/FLUX/
     732             : !
     733             : !        F107, F107A, and AP effects are neither large nor well
     734             : !        established below 80 km and these parameters should be set to
     735             : !        150., 150., and 4. respectively.
     736             : !
     737             : !     OUTPUT VARIABLES:
     738             : !        D(1) - HE NUMBER DENSITY(CM-3)
     739             : !        D(2) - O NUMBER DENSITY(CM-3)
     740             : !        D(3) - N2 NUMBER DENSITY(CM-3)
     741             : !        D(4) - O2 NUMBER DENSITY(CM-3)
     742             : !        D(5) - AR NUMBER DENSITY(CM-3)                       
     743             : !        D(6) - TOTAL MASS DENSITY(GM/CM3) [Anomalous O NOT included]
     744             : !        D(7) - H NUMBER DENSITY(CM-3)
     745             : !        D(8) - N NUMBER DENSITY(CM-3)
     746             : !        D(9) - Anomalous oxygen NUMBER DENSITY(CM-3)
     747             : !        T(1) - EXOSPHERIC TEMPERATURE
     748             : !        T(2) - TEMPERATURE AT ALT
     749             : !-----------------------------------------------------------------------
     750             : !
     751           0 :       use shr_kind_mod, only : r8 => shr_kind_r8
     752             :       use cam_logfile,  only : iulog
     753             :       implicit none
     754             : !
     755             : !-------------------------------Commons---------------------------------
     756             : !
     757             :       real(r8) tlb, s, db04, db16, db28, db32, db40, db48, db01
     758             :       real(r8) za, t0, z0, g0, rl, dd, db14, tr12
     759             :       COMMON/GTS3C/TLB,S,DB04,DB16,DB28,DB32,DB40,DB48,DB01,ZA,T0,Z0 &
     760             :        ,G0,RL,DD,DB14,TR12
     761             : 
     762             :       real(r8) tn1, tn2, tn3, tgn1, tgn2, tgn3
     763             :       COMMON/MESO7/TN1(5),TN2(4),TN3(5),TGN1(2),TGN2(2),TGN3(2)
     764             : 
     765             :       real(r8) ptm, pdm
     766             :       COMMON/LOWER7/PTM(10),PDM(10,8)
     767             : 
     768             :       real(r8) pt, pd, ps, pdl, ptl, pma, sam
     769             :       COMMON/PARM7/PT(150),PD(150,9),PS(150),PDL(25,2),PTL(100,4), &
     770             :        PMA(100,10),SAM(100)
     771             : 
     772             :       integer isw
     773             :       real(r8) sw, swc
     774             :       COMMON/CSW/SW(25),SWC(25),ISW
     775             : 
     776             :       real(r8) tinfg, gb, rout, tt
     777             :       COMMON/TTEST/TINFG,GB,ROUT,TT(15)
     778             : 
     779             :       real(r8) dm04, dm16, dm28, dm32, dm40, dm01, dm14
     780             :       COMMON/DMIX/DM04,DM16,DM28,DM32,DM40,DM01,DM14
     781             : 
     782             :       integer imr
     783             :       COMMON/METSEL/IMR
     784             : !
     785             : !------------------------------Arguments--------------------------------
     786             : !
     787             :       integer iyd, mass
     788             :       real(r8) sec, alt, glat, glong, stl, f107a, f107
     789             :       real(r8) D(9),T(2),AP(*)
     790             : !
     791             : !---------------------------Local variables-----------------------------
     792             : !
     793             :       integer i, j
     794             :       real(r8) zh01, b01, g1, hc40, zc40, hcc01, zcc01, zc01
     795             :       real(r8) zhm01, hc01, hcc32, zcc32, zc32, zhm32, hc32
     796             :       real(r8) b40, zhm40, zh40, rc32, g40, t2, zsht, tho
     797             :       real(r8) g16h, db16h, ddum, zmho, zsho, b14, zhm14
     798             :       real(r8) zh14, rc01, g14, zcc14, rc14, hcc14, hc14, zc14
     799             :       real(r8) b32, xmm, z, zhf, g28, day, xmd, b28, zhm28
     800             :       real(r8) zh28, v2
     801             :       real(r8) tinf, yrd, hc16, zc16, zhm16, zh16, b16
     802             :       real(r8) g32, zh32, rc16, hcc16, zcc16, zh04, b04, g4, tz
     803             :       real(r8) g16, hc04, zhm04, zc04
     804             : 
     805             :       integer mt(11)
     806             :       DATA MT/48,0,4,16,28,32,40,1,49,14,17/
     807             : 
     808             :       real(r8) altl(8)
     809             :       DATA ALTL/200._r8,300._r8,160._r8,250._r8,240._r8,450._r8,320._r8,450._r8/
     810             : 
     811             :       integer mn1
     812             :       real(r8) ZN1(5)
     813             :       DATA MN1/5/,ZN1/120._r8,110._r8,100._r8,90._r8,72.5_r8/
     814             : 
     815             :       real(r8) dgtr, dr, alast
     816             :       DATA DGTR/1.74533E-2_r8/,DR/1.72142E-2_r8/,ALAST/-999._r8/
     817             : 
     818             :       real(r8) ALPHA(9)
     819             :       DATA ALPHA/-0.38_r8,0._r8,0._r8,0._r8,0.17_r8,0._r8,-0.38_r8,0._r8,0._r8/
     820             : 
     821             :       SAVE
     822             : !
     823             : !-------------------------External Functions----------------------------
     824             : !
     825             :       real(r8) ccor, dnet, densu, globe7, glob7s, scalh, vtst7
     826             :       external ccor, dnet, densu, globe7, glob7s, scalh, vtst7
     827             : !
     828             : !-----------------------------------------------------------------------
     829             : !
     830             : !        Test for changed input
     831           0 :       V2=VTST7(IYD,SEC,GLAT,GLONG,STL,F107A,F107,AP,2)
     832             : !
     833           0 :       YRD=IYD
     834           0 :       ZA=PDL(16,2)
     835           0 :       ZN1(1)=ZA
     836           0 :       DO 2 J=1,9
     837           0 :         D(J)=0._r8
     838           0 :     2 CONTINUE
     839             : !        TINF VARIATIONS NOT IMPORTANT BELOW ZA OR ZN1(1)
     840           0 :       IF(ALT.GT.ZN1(1)) THEN
     841           0 :         IF(V2.EQ.1._r8.OR.ALAST.LE.ZN1(1)) TINF=PTM(1)*PT(1) &
     842           0 :         *(1._r8+SW(16)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PT))
     843             :       ELSE
     844           0 :         TINF=PTM(1)*PT(1)
     845             :       ENDIF
     846           0 :       T(1)=TINF
     847             : !          GRADIENT VARIATIONS NOT IMPORTANT BELOW ZN1(5)
     848           0 :       IF(ALT.GT.ZN1(5)) THEN
     849           0 :         IF(V2.EQ.1.OR.ALAST.LE.ZN1(5)) G0=PTM(4)*PS(1) &
     850           0 :          *(1._r8+SW(19)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PS))
     851             :       ELSE
     852           0 :         G0=PTM(4)*PS(1)
     853             :       ENDIF
     854             : !      Calculate these temperatures only if input changed
     855           0 :       IF(V2.EQ.1._r8 .OR. ALT.LT.300._r8) &
     856             :         TLB=PTM(2)*(1._r8+SW(17)*GLOBE7(YRD,SEC,GLAT,GLONG,STL, &
     857           0 :         F107A,F107,AP,PD(1,4)))*PD(1,4)
     858           0 :        S=G0/(TINF-TLB)
     859             : !       Lower thermosphere temp variations not significant for
     860             : !        density above 300 km
     861           0 :        IF(ALT.LT.300._r8) THEN
     862           0 :         IF(V2.EQ.1._r8.OR.ALAST.GE.300._r8) THEN
     863           0 :          TN1(2)=PTM(7)*PTL(1,1)/(1._r8-SW(18)*GLOB7S(PTL(1,1)))
     864           0 :          TN1(3)=PTM(3)*PTL(1,2)/(1._r8-SW(18)*GLOB7S(PTL(1,2)))
     865           0 :          TN1(4)=PTM(8)*PTL(1,3)/(1._r8-SW(18)*GLOB7S(PTL(1,3)))
     866           0 :          TN1(5)=PTM(5)*PTL(1,4)/(1._r8-SW(18)*SW(20)*GLOB7S(PTL(1,4)))
     867             :          TGN1(2)=PTM(9)*PMA(1,9)*(1._r8+SW(18)*SW(20)*GLOB7S(PMA(1,9))) &
     868           0 :          *TN1(5)*TN1(5)/(PTM(5)*PTL(1,4))**2
     869             :         ENDIF
     870             :        ELSE
     871           0 :         TN1(2)=PTM(7)*PTL(1,1)
     872           0 :         TN1(3)=PTM(3)*PTL(1,2)
     873           0 :         TN1(4)=PTM(8)*PTL(1,3)
     874           0 :         TN1(5)=PTM(5)*PTL(1,4)
     875             :         TGN1(2)=PTM(9)*PMA(1,9) &
     876           0 :         *TN1(5)*TN1(5)/(PTM(5)*PTL(1,4))**2
     877             :        ENDIF
     878             : !
     879           0 :       Z0=ZN1(4)
     880           0 :       T0=TN1(4)
     881           0 :       TR12=1._r8
     882             : !
     883           0 :       IF(MASS.EQ.0) GO TO 50
     884             : !       N2 variation factor at Zlb
     885             :       G28=SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,  &
     886           0 :        AP,PD(1,3))
     887           0 :       DAY=MOD(YRD,1000._r8)
     888             : !        VARIATION OF TURBOPAUSE HEIGHT
     889             :       ZHF=PDL(25,2) &
     890           0 :           *(1._r8+SW(5)*PDL(25,1)*SIN(DGTR*GLAT)*COS(DR*(DAY-PT(14))))
     891           0 :       YRD=IYD
     892           0 :       T(1)=TINF
     893           0 :       XMM=PDM(5,3)
     894           0 :       Z=ALT
     895             : !
     896           0 :       DO 10 J = 1,11
     897           0 :       IF(MASS.EQ.MT(J))   GO TO 15
     898           0 :    10 CONTINUE
     899           0 :       write(iulog,100) MASS
     900           0 :       GO TO 90
     901           0 :    15 IF(Z.GT.ALTL(6).AND.MASS.NE.28.AND.MASS.NE.48) GO TO 17
     902             : !
     903             : !       **** N2 DENSITY ****
     904             : !
     905             : !      Diffusive density at Zlb
     906           0 :       DB28 = PDM(1,3)*EXP(G28)*PD(1,3)
     907             : !      Diffusive density at Alt
     908             :       D(3)=DENSU(Z,DB28,TINF,TLB, 28._r8,ALPHA(3),T(2),PTM(6),S,MN1,ZN1, &
     909           0 :        TN1,TGN1)
     910           0 :       DD=D(3)
     911             : !      Turbopause
     912           0 :       ZH28=PDM(3,3)*ZHF
     913           0 :       ZHM28=PDM(4,3)*PDL(6,2) 
     914           0 :       XMD=28._r8-XMM
     915             : !      Mixed density at Zlb
     916             :       B28=DENSU(ZH28,DB28,TINF,TLB,XMD,ALPHA(3)-1._r8,TZ,PTM(6),S,MN1, &
     917           0 :        ZN1,TN1,TGN1)
     918           0 :       IF(Z.GT.ALTL(3).OR.SW(15).EQ.0._r8) GO TO 17
     919             : !      Mixed density at Alt
     920             :       DM28=DENSU(Z,B28,TINF,TLB,XMM,ALPHA(3),TZ,PTM(6),S,MN1, &
     921           0 :        ZN1,TN1,TGN1)
     922             : !      Net density at Alt
     923           0 :       D(3)=DNET(D(3),DM28,ZHM28,XMM,28._r8)
     924             :    17 CONTINUE
     925           0 :       GO TO (20,50,20,25,90,35,40,45,25,48,46),  J
     926             :    20 CONTINUE
     927             : !
     928             : !       **** HE DENSITY ****
     929             : !
     930             : !       Density variation factor at Zlb
     931           0 :       G4 = SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PD(1,1))
     932             : !      Diffusive density at Zlb
     933           0 :       DB04 = PDM(1,1)*EXP(G4)*PD(1,1)
     934             : !      Diffusive density at Alt
     935             :       D(1)=DENSU(Z,DB04,TINF,TLB, 4._r8,ALPHA(1),T(2),PTM(6),S,MN1,ZN1, &
     936           0 :        TN1,TGN1)
     937           0 :       DD=D(1)
     938           0 :       IF(Z.GT.ALTL(1).OR.SW(15).EQ.0._r8) GO TO 24
     939             : !      Turbopause
     940           0 :       ZH04=PDM(3,1)
     941             : !      Mixed density at Zlb
     942             :       B04=DENSU(ZH04,DB04,TINF,TLB,4._r8-XMM,ALPHA(1)-1._r8, &
     943           0 :         T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
     944             : !      Mixed density at Alt
     945           0 :       DM04=DENSU(Z,B04,TINF,TLB,XMM,0._r8,T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
     946           0 :       ZHM04=ZHM28
     947             : !      Net density at Alt
     948           0 :       D(1)=DNET(D(1),DM04,ZHM04,XMM,4._r8)
     949             : !      Correction to specified mixing ratio at ground
     950           0 :       RL=LOG(B28*PDM(2,1)/B04)
     951           0 :       ZC04=PDM(5,1)*PDL(1,2)
     952           0 :       HC04=PDM(6,1)*PDL(2,2)
     953             : !      Net density corrected at Alt
     954           0 :       D(1)=D(1)*CCOR(Z,RL,HC04,ZC04)
     955             :    24 CONTINUE
     956           0 :       IF(MASS.NE.48)   GO TO 90
     957             :    25 CONTINUE
     958             : !
     959             : !      **** O DENSITY ****
     960             : !
     961             : !       Density variation factor at Zlb
     962           0 :       G16= SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PD(1,2))
     963             : !      Diffusive density at Zlb
     964           0 :       DB16 =  PDM(1,2)*EXP(G16)*PD(1,2)
     965             : !       Diffusive density at Alt
     966             :       D(2)=DENSU(Z,DB16,TINF,TLB, 16._r8,ALPHA(2),T(2),PTM(6),S,MN1, &
     967           0 :        ZN1,TN1,TGN1)
     968           0 :       DD=D(2)
     969           0 :       IF(Z.GT.ALTL(2).OR.SW(15).EQ.0._r8) GO TO 34
     970             : !  Corrected from PDM(3,1) to PDM(3,2)  12/2/85
     971             : !       Turbopause
     972           0 :       ZH16=PDM(3,2)
     973             : !      Mixed density at Zlb
     974             :       B16=DENSU(ZH16,DB16,TINF,TLB,16-XMM,ALPHA(2)-1._r8, &
     975           0 :         T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
     976             : !      Mixed density at Alt
     977           0 :       DM16=DENSU(Z,B16,TINF,TLB,XMM,0._r8,T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
     978           0 :       ZHM16=ZHM28
     979             : !      Net density at Alt
     980           0 :       D(2)=DNET(D(2),DM16,ZHM16,XMM,16._r8)
     981             : !   3/16/99 Change form to match O2 departure from diff equil near 150
     982             : !   km and add dependence on F10.7
     983             : !      RL=LOG(B28*PDM(2,2)*ABS(PDL(17,2))/B16)
     984           0 :       RL=PDM(2,2)*PDL(17,2)*(1._r8+SW(1)*PDL(24,1)*(F107A-150._r8))
     985           0 :       HC16=PDM(6,2)*PDL(4,2)
     986           0 :       ZC16=PDM(5,2)*PDL(3,2)
     987           0 :       D(2)=D(2)*CCOR(Z,RL,HC16,ZC16)
     988             : !       Chemistry correction
     989           0 :       HCC16=PDM(8,2)*PDL(14,2)
     990           0 :       ZCC16=PDM(7,2)*PDL(13,2)
     991           0 :       RC16=PDM(4,2)*PDL(15,2)
     992             : !      Net density corrected at Alt
     993           0 :       D(2)=D(2)*CCOR(Z,RC16,HCC16,ZCC16)
     994             :    34 CONTINUE
     995           0 :       IF(MASS.NE.48.AND.MASS.NE.49) GO TO 90
     996             :    35 CONTINUE
     997             : !
     998             : !       **** O2 DENSITY ****
     999             : !
    1000             : !       Density variation factor at Zlb
    1001           0 :       G32= SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PD(1,5))
    1002             : !      Diffusive density at Zlb
    1003           0 :       DB32 = PDM(1,4)*EXP(G32)*PD(1,5)
    1004             : !       Diffusive density at Alt
    1005             :       D(4)=DENSU(Z,DB32,TINF,TLB, 32._r8,ALPHA(4),T(2),PTM(6),S,MN1, &
    1006           0 :        ZN1,TN1,TGN1)
    1007           0 :       IF(MASS.EQ.49) THEN
    1008           0 :          DD=DD+2._r8*D(4)
    1009             :       ELSE
    1010           0 :          DD=D(4)
    1011             :       ENDIF
    1012           0 :       IF(SW(15).EQ.0._r8) GO TO 39
    1013           0 :       IF(Z.GT.ALTL(4)) GO TO 38
    1014             : !       Turbopause
    1015           0 :       ZH32=PDM(3,4)
    1016             : !      Mixed density at Zlb
    1017             :       B32=DENSU(ZH32,DB32,TINF,TLB,32._r8-XMM,ALPHA(4)-1._r8, &
    1018           0 :         T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1019             : !      Mixed density at Alt
    1020           0 :       DM32=DENSU(Z,B32,TINF,TLB,XMM,0._r8,T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1021           0 :       ZHM32=ZHM28
    1022             : !      Net density at Alt
    1023           0 :       D(4)=DNET(D(4),DM32,ZHM32,XMM,32._r8)
    1024             : !       Correction to specified mixing ratio at ground
    1025           0 :       RL=LOG(B28*PDM(2,4)/B32)
    1026           0 :       HC32=PDM(6,4)*PDL(8,2)
    1027           0 :       ZC32=PDM(5,4)*PDL(7,2)
    1028           0 :       D(4)=D(4)*CCOR(Z,RL,HC32,ZC32)
    1029             :    38 CONTINUE
    1030             : !      Correction for general departure from diffusive equilibrium above Zlb
    1031           0 :       HCC32=PDM(8,4)*PDL(23,2)
    1032           0 :       ZCC32=PDM(7,4)*PDL(22,2)
    1033           0 :       RC32=PDM(4,4)*PDL(24,2)*(1._r8+SW(1)*PDL(24,1)*(F107A-150._r8))
    1034             : !      Net density corrected at Alt
    1035           0 :       D(4)=D(4)*CCOR(Z,RC32,HCC32,ZCC32)
    1036             :    39 CONTINUE
    1037           0 :       IF(MASS.NE.48)   GO TO 90
    1038             :    40 CONTINUE
    1039             : !
    1040             : !       **** AR DENSITY ****
    1041             : !
    1042             : !       Density variation factor at Zlb
    1043           0 :       G40= SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PD(1,6))
    1044             : !      Diffusive density at Zlb
    1045           0 :       DB40 = PDM(1,5)*EXP(G40)*PD(1,6)
    1046             : !       Diffusive density at Alt
    1047             :       D(5)=DENSU(Z,DB40,TINF,TLB, 40._r8,ALPHA(5),T(2),PTM(6),S,MN1, &
    1048           0 :        ZN1,TN1,TGN1)
    1049           0 :       DD=D(5)
    1050           0 :       IF(Z.GT.ALTL(5).OR.SW(15).EQ.0._r8) GO TO 44
    1051             : !       Turbopause
    1052           0 :       ZH40=PDM(3,5)
    1053             : !      Mixed density at Zlb
    1054             :       B40=DENSU(ZH40,DB40,TINF,TLB,40._r8-XMM,ALPHA(5)-1._r8, &
    1055           0 :         T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1056             : !      Mixed density at Alt
    1057           0 :       DM40=DENSU(Z,B40,TINF,TLB,XMM,0._r8,T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1058           0 :       ZHM40=ZHM28
    1059             : !      Net density at Alt
    1060           0 :       D(5)=DNET(D(5),DM40,ZHM40,XMM,40._r8)
    1061             : !       Correction to specified mixing ratio at ground
    1062           0 :       RL=LOG(B28*PDM(2,5)/B40)
    1063           0 :       HC40=PDM(6,5)*PDL(10,2)
    1064           0 :       ZC40=PDM(5,5)*PDL(9,2)
    1065             : !      Net density corrected at Alt
    1066           0 :       D(5)=D(5)*CCOR(Z,RL,HC40,ZC40)
    1067             :    44 CONTINUE
    1068           0 :       IF(MASS.NE.48)   GO TO 90
    1069             :    45 CONTINUE
    1070             : !
    1071             : !        **** HYDROGEN DENSITY ****
    1072             : !
    1073             : !       Density variation factor at Zlb
    1074           0 :       G1 = SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PD(1,7))
    1075             : !      Diffusive density at Zlb
    1076           0 :       DB01 = PDM(1,6)*EXP(G1)*PD(1,7)
    1077             : !       Diffusive density at Alt
    1078             :       D(7)=DENSU(Z,DB01,TINF,TLB,1._r8,ALPHA(7),T(2),PTM(6),S,MN1, &
    1079           0 :        ZN1,TN1,TGN1)
    1080           0 :       DD=D(7)
    1081           0 :       IF(Z.GT.ALTL(7).OR.SW(15).EQ.0._r8) GO TO 47
    1082             : !       Turbopause
    1083           0 :       ZH01=PDM(3,6)
    1084             : !      Mixed density at Zlb
    1085             :       B01=DENSU(ZH01,DB01,TINF,TLB,1._r8-XMM,ALPHA(7)-1._r8, &
    1086           0 :         T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1087             : !      Mixed density at Alt
    1088           0 :       DM01=DENSU(Z,B01,TINF,TLB,XMM,0._r8,T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1089           0 :       ZHM01=ZHM28
    1090             : !      Net density at Alt
    1091           0 :       D(7)=DNET(D(7),DM01,ZHM01,XMM,1._r8)
    1092             : !       Correction to specified mixing ratio at ground
    1093           0 :       RL=LOG(B28*PDM(2,6)*ABS(PDL(18,2))/B01)
    1094           0 :       HC01=PDM(6,6)*PDL(12,2)
    1095           0 :       ZC01=PDM(5,6)*PDL(11,2)
    1096           0 :       D(7)=D(7)*CCOR(Z,RL,HC01,ZC01)
    1097             : !       Chemistry correction
    1098           0 :       HCC01=PDM(8,6)*PDL(20,2)
    1099           0 :       ZCC01=PDM(7,6)*PDL(19,2)
    1100           0 :       RC01=PDM(4,6)*PDL(21,2)
    1101             : !      Net density corrected at Alt
    1102           0 :       D(7)=D(7)*CCOR(Z,RC01,HCC01,ZCC01)
    1103             :    47 CONTINUE
    1104           0 :       IF(MASS.NE.48)   GO TO 90
    1105             :    48 CONTINUE
    1106             : !
    1107             : !        **** ATOMIC NITROGEN DENSITY ****
    1108             : !
    1109             : !       Density variation factor at Zlb
    1110           0 :       G14 = SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PD(1,8))
    1111             : !      Diffusive density at Zlb
    1112           0 :       DB14 = PDM(1,7)*EXP(G14)*PD(1,8)
    1113             : !       Diffusive density at Alt
    1114             :       D(8)=DENSU(Z,DB14,TINF,TLB,14._r8,ALPHA(8),T(2),PTM(6),S,MN1, &
    1115           0 :        ZN1,TN1,TGN1)
    1116           0 :       DD=D(8)
    1117           0 :       IF(Z.GT.ALTL(8).OR.SW(15).EQ.0._r8) GO TO 49
    1118             : !       Turbopause
    1119           0 :       ZH14=PDM(3,7)
    1120             : !      Mixed density at Zlb
    1121             :       B14=DENSU(ZH14,DB14,TINF,TLB,14._r8-XMM,ALPHA(8)-1._r8, &
    1122           0 :         T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1123             : !      Mixed density at Alt
    1124           0 :       DM14=DENSU(Z,B14,TINF,TLB,XMM,0._r8,T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1125           0 :       ZHM14=ZHM28
    1126             : !      Net density at Alt
    1127           0 :       D(8)=DNET(D(8),DM14,ZHM14,XMM,14._r8)
    1128             : !       Correction to specified mixing ratio at ground
    1129           0 :       RL=LOG(B28*PDM(2,7)*ABS(PDL(3,1))/B14)
    1130           0 :       HC14=PDM(6,7)*PDL(2,1)
    1131           0 :       ZC14=PDM(5,7)*PDL(1,1)
    1132           0 :       D(8)=D(8)*CCOR(Z,RL,HC14,ZC14)
    1133             : !       Chemistry correction
    1134           0 :       HCC14=PDM(8,7)*PDL(5,1)
    1135           0 :       ZCC14=PDM(7,7)*PDL(4,1)
    1136           0 :       RC14=PDM(4,7)*PDL(6,1)
    1137             : !      Net density corrected at Alt
    1138           0 :       D(8)=D(8)*CCOR(Z,RC14,HCC14,ZCC14)
    1139             :    49 CONTINUE
    1140           0 :       IF(MASS.NE.48) GO TO 90
    1141             :    46 CONTINUE
    1142             : !
    1143             : !        **** Anomalous OXYGEN DENSITY ****
    1144             : !
    1145           0 :       G16H = SW(21)*GLOBE7(YRD,SEC,GLAT,GLONG,STL,F107A,F107,AP,PD(1,9))
    1146           0 :       DB16H = PDM(1,8)*EXP(G16H)*PD(1,9)
    1147           0 :       THO=PDM(10,8)*PDL(7,1)
    1148             :       DD=DENSU(Z,DB16H,THO,THO,16._r8,ALPHA(9),T2,PTM(6),S,MN1, &
    1149           0 :        ZN1,TN1,TGN1)
    1150           0 :       ZSHT=PDM(6,8)
    1151           0 :       ZMHO=PDM(5,8)
    1152           0 :       ZSHO=SCALH(ZMHO,16._r8,THO)
    1153           0 :       D(9)=DD*EXP(-ZSHT/ZSHO*(EXP(-(Z-ZMHO)/ZSHT)-1._r8))
    1154           0 :       IF(MASS.NE.48) GO TO 90
    1155             : !
    1156             : !       TOTAL MASS DENSITY
    1157             : !
    1158             :       D(6) = 1.66E-24_r8*(4._r8*D(1)+16._r8*D(2)+28._r8*D(3)+32._r8*D(4)+40._r8*D(5)+ &
    1159           0 :              D(7)+14._r8*D(8))
    1160             :       DB48=1.66E-24_r8*(4._r8*DB04+16._r8*DB16+28._r8*DB28+32._r8*DB32+40._r8*DB40+DB01+ &
    1161           0 :               14._r8*DB14)
    1162           0 :       GO TO 90
    1163             : !       TEMPERATURE AT ALTITUDE
    1164             :    50 CONTINUE
    1165           0 :       Z=ABS(ALT)
    1166           0 :       DDUM  = DENSU(Z,1._r8, TINF,TLB,0._r8,0._r8,T(2),PTM(6),S,MN1,ZN1,TN1,TGN1)
    1167             :    90 CONTINUE
    1168             : !       ADJUST DENSITIES FROM CGS TO KGM
    1169           0 :       IF(IMR.EQ.1) THEN
    1170           0 :         DO 95 I=1,9
    1171           0 :           D(I)=D(I)*1.E6_r8
    1172           0 :    95   CONTINUE
    1173           0 :         D(6)=D(6)/1000._r8
    1174             :       ENDIF
    1175           0 :       ALAST=ALT
    1176           0 :       RETURN
    1177             :   100 FORMAT(1X,'MASS', I5, '  NOT VALID')
    1178             :       END SUBROUTINE GTS7
    1179             : 
    1180             : !================================================================================================
    1181             : 
    1182           0 :       SUBROUTINE METERS(METER)
    1183             : !         
    1184             : !-----------------------------------------------------------------------
    1185             : !      Convert outputs to Kg & Meters if METER true
    1186             : !-----------------------------------------------------------------------
    1187             : !
    1188             :       use shr_kind_mod, only : r8 => shr_kind_r8
    1189             :       implicit none
    1190             : !
    1191             : !-------------------------------Commons---------------------------------
    1192             : !
    1193             :       integer imr
    1194             :       COMMON/METSEL/IMR
    1195             : !
    1196             : !------------------------------Arguments--------------------------------
    1197             : !
    1198             :       LOGICAL METER
    1199             : 
    1200             :       SAVE
    1201             : !
    1202             : !-----------------------------------------------------------------------
    1203             : !
    1204           0 :       IMR=0
    1205           0 :       IF(METER) IMR=1
    1206           0 :       END SUBROUTINE METERS
    1207             : 
    1208             : !================================================================================================
    1209             : 
    1210           0 :       FUNCTION SCALH(ALT,XM,TEMP)
    1211             : !         
    1212             : !-----------------------------------------------------------------------
    1213             : !      Calculate scale height (km)
    1214             : !-----------------------------------------------------------------------
    1215             : !
    1216           0 :       use shr_kind_mod, only : r8 => shr_kind_r8
    1217             :       implicit none
    1218             : !
    1219             : !-----------------------------Return Value------------------------------
    1220             : !
    1221             :       real(r8) scalh
    1222             : !
    1223             : !-------------------------------Commons---------------------------------
    1224             : !
    1225             :       real(r8) gsurf, re
    1226             :       COMMON/PARMB/GSURF,RE
    1227             : !
    1228             : !------------------------------Arguments--------------------------------
    1229             : !
    1230             :       real(r8) alt, xm, temp
    1231             : !
    1232             : !---------------------------Local variables-----------------------------
    1233             : !
    1234             :       real(r8) g
    1235             : 
    1236             :       real(r8) rgas
    1237             :       DATA RGAS/831.4_r8/
    1238             : 
    1239             :       SAVE
    1240             : !
    1241             : !-----------------------------------------------------------------------
    1242             : !
    1243           0 :       G=GSURF/(1._r8+ALT/RE)**2
    1244           0 :       SCALH=RGAS*TEMP/(G*XM)
    1245             :       RETURN
    1246             :       END FUNCTION SCALH
    1247             : 
    1248             : !================================================================================================
    1249             : 
    1250           0 :       FUNCTION GLOBE7(YRD,SEC,LAT,LONG,TLOC,F107A,F107,AP,P)
    1251             : !         
    1252             : !-----------------------------------------------------------------------
    1253             : !       CALCULATE G(L) FUNCTION 
    1254             : !       Upper Thermosphere Parameters
    1255             : !-----------------------------------------------------------------------
    1256             : !
    1257             :       use shr_kind_mod, only : r8 => shr_kind_r8
    1258             :       implicit none
    1259             : !
    1260             : !-----------------------------Return Value------------------------------
    1261             : !
    1262             :       real(r8) globe7
    1263             : !
    1264             : !-------------------------------Commons---------------------------------
    1265             : !
    1266             :       real(r8) tinf, gb, rout, t
    1267             :       COMMON/TTEST/TINF,GB,ROUT,T(15)
    1268             : 
    1269             :       integer isw
    1270             :       real(r8) sw, swc
    1271             :       COMMON/CSW/SW(25),SWC(25),ISW
    1272             : 
    1273             :       integer iyr
    1274             :       real(r8) plg, ctloc, stloc, c2tloc, s2tloc, c3tloc, s3tloc
    1275             :       real(r8) day, df, dfa, apd, apdf, apt, xlong
    1276             :       COMMON/LPOLY/PLG(9,4),CTLOC,STLOC,C2TLOC,S2TLOC,C3TLOC,S3TLOC, &
    1277             :        DAY,DF,DFA,APD,APDF,APT(4),XLONG,IYR
    1278             : !
    1279             : !------------------------------Arguments--------------------------------
    1280             : !
    1281             :       real(r8) yrd, sec, tloc, f107a, f107
    1282             :       REAL(r8) LAT, LONG
    1283             :       real(r8) P(*),AP(*)
    1284             : !
    1285             : !---------------------------Local variables-----------------------------
    1286             : !
    1287             :       integer i, j
    1288             :       real(r8) t72, t81, t71, f1, f2, exp1, p45, t82, p44, c2, c4, s, c
    1289             :       real(r8) cd32, cd39, cd18, s2, cd14
    1290             : 
    1291             :       real(r8) dgtr, dr, xl, tll
    1292             :       DATA DGTR/1.74533E-2_r8/,DR/1.72142E-2_r8/, XL/1000._r8/,TLL/1000._r8/
    1293             : 
    1294             :       real(r8) sw9, dayl, p14, p18, p32
    1295             :       DATA SW9/1._r8/,DAYL/-1._r8/,P14/-1000._r8/,P18/-1000._r8/,P32/-1000._r8/
    1296             : 
    1297             :       integer nsw
    1298             :       real(r8) hr, sr, sv(25), p39
    1299             :       DATA HR/.2618_r8/,SR/7.2722E-5_r8/,SV/25*1._r8/,NSW/14/,P39/-1000._r8/
    1300             : 
    1301             :       SAVE
    1302             : !
    1303             : !-------------------------Statement Functions----------------------------
    1304             : !
    1305             :       real(r8) g0, sumex, sg0, a, ex
    1306             : !       3hr Magnetic activity functions
    1307             : !      Eq. A24d
    1308             :       G0(A)=(A-4._r8+(P(26)-1._r8)*(A-4._r8+(EXP(-ABS(P(25))*(A-4._r8))-1._r8)/ABS(P(25 &
    1309             :       ))))
    1310             : 
    1311             : !       Eq. A24c
    1312             :       SUMEX(EX)=1._r8+(1._r8-EX**19)/(1._r8-EX)*EX**(.5_r8)
    1313             : !       Eq. A24a
    1314             :       SG0(EX)=(G0(AP(2))+(G0(AP(3))*EX+G0(AP(4))*EX*EX+G0(AP(5))*EX**3 &
    1315             :        +(G0(AP(6))*EX**4+G0(AP(7))*EX**12)*(1._r8-EX**8)/(1._r8-EX)) &
    1316             :        )/SUMEX(EX)
    1317             : !
    1318             : !-----------------------------------------------------------------------
    1319             : !
    1320           0 :       IF(ISW.NE.64999) CALL TSELEC(SV)
    1321           0 :       DO 10 J=1,14
    1322           0 :        T(J)=0
    1323           0 :    10 CONTINUE
    1324           0 :       IF(SW(9).GT.0) SW9=1._r8
    1325           0 :       IF(SW(9).LT.0) SW9=-1._r8
    1326           0 :       IYR = YRD/1000._r8
    1327           0 :       DAY = YRD - IYR*1000._r8
    1328           0 :       XLONG=LONG
    1329             : !      Eq. A22 (remainder of code)
    1330           0 :       IF(XL.EQ.LAT)   GO TO 15
    1331             : !          CALCULATE LEGENDRE POLYNOMIALS
    1332           0 :       C = SIN(LAT*DGTR)
    1333           0 :       S = COS(LAT*DGTR)
    1334           0 :       C2 = C*C
    1335           0 :       C4 = C2*C2
    1336           0 :       S2 = S*S
    1337           0 :       PLG(2,1) = C
    1338           0 :       PLG(3,1) = 0.5_r8*(3._r8*C2 -1._r8)
    1339           0 :       PLG(4,1) = 0.5_r8*(5._r8*C*C2-3._r8*C)
    1340           0 :       PLG(5,1) = (35._r8*C4 - 30._r8*C2 + 3._r8)/8._r8
    1341           0 :       PLG(6,1) = (63._r8*C2*C2*C - 70._r8*C2*C + 15._r8*C)/8._r8
    1342           0 :       PLG(7,1) = (11._r8*C*PLG(6,1) - 5._r8*PLG(5,1))/6._r8
    1343             : !     PLG(8,1) = (13.*C*PLG(7,1) - 6.*PLG(6,1))/7.
    1344           0 :       PLG(2,2) = S
    1345           0 :       PLG(3,2) = 3._r8*C*S
    1346           0 :       PLG(4,2) = 1.5_r8*(5._r8*C2-1._r8)*S
    1347           0 :       PLG(5,2) = 2.5_r8*(7._r8*C2*C-3._r8*C)*S
    1348           0 :       PLG(6,2) = 1.875_r8*(21._r8*C4 - 14._r8*C2 +1._r8)*S
    1349           0 :       PLG(7,2) = (11._r8*C*PLG(6,2)-6._r8*PLG(5,2))/5._r8
    1350             : !     PLG(8,2) = (13.*C*PLG(7,2)-7.*PLG(6,2))/6.
    1351             : !     PLG(9,2) = (15.*C*PLG(8,2)-8.*PLG(7,2))/7.
    1352           0 :       PLG(3,3) = 3._r8*S2
    1353           0 :       PLG(4,3) = 15._r8*S2*C
    1354           0 :       PLG(5,3) = 7.5_r8*(7._r8*C2 -1._r8)*S2
    1355           0 :       PLG(6,3) = 3._r8*C*PLG(5,3)-2._r8*PLG(4,3)
    1356           0 :       PLG(7,3)=(11._r8*C*PLG(6,3)-7._r8*PLG(5,3))/4._r8
    1357           0 :       PLG(8,3)=(13._r8*C*PLG(7,3)-8._r8*PLG(6,3))/5._r8
    1358           0 :       PLG(4,4) = 15._r8*S2*S
    1359           0 :       PLG(5,4) = 105._r8*S2*S*C 
    1360           0 :       PLG(6,4)=(9._r8*C*PLG(5,4)-7._r8*PLG(4,4))/2._r8
    1361           0 :       PLG(7,4)=(11._r8*C*PLG(6,4)-8._r8*PLG(5,4))/3._r8
    1362           0 :       XL=LAT
    1363             :    15 CONTINUE
    1364           0 :       IF(TLL.EQ.TLOC)   GO TO 16
    1365           0 :       IF(SW(7).EQ.0.AND.SW(8).EQ.0.AND.SW(14).EQ.0) GOTO 16
    1366           0 :       STLOC = SIN(HR*TLOC)
    1367           0 :       CTLOC = COS(HR*TLOC)
    1368           0 :       S2TLOC = SIN(2._r8*HR*TLOC)
    1369           0 :       C2TLOC = COS(2._r8*HR*TLOC)
    1370           0 :       S3TLOC = SIN(3._r8*HR*TLOC)
    1371           0 :       C3TLOC = COS(3._r8*HR*TLOC)
    1372           0 :       TLL = TLOC
    1373             :    16 CONTINUE
    1374           0 :       IF(DAY.NE.DAYL.OR.P(14).NE.P14) CD14=COS(DR*(DAY-P(14)))
    1375           0 :       IF(DAY.NE.DAYL.OR.P(18).NE.P18) CD18=COS(2._r8*DR*(DAY-P(18)))
    1376           0 :       IF(DAY.NE.DAYL.OR.P(32).NE.P32) CD32=COS(DR*(DAY-P(32)))
    1377           0 :       IF(DAY.NE.DAYL.OR.P(39).NE.P39) CD39=COS(2._r8*DR*(DAY-P(39)))
    1378           0 :       DAYL = DAY
    1379           0 :       P14 = P(14)
    1380           0 :       P18 = P(18)
    1381           0 :       P32 = P(32)
    1382           0 :       P39 = P(39)
    1383             : !         F10.7 EFFECT
    1384           0 :       DF = F107 - F107A
    1385           0 :       DFA=F107A-150._r8
    1386             :       T(1) =  P(20)*DF*(1._r8+P(60)*DFA) + P(21)*DF*DF + P(22)*DFA &
    1387           0 :        + P(30)*DFA**2
    1388           0 :       F1 = 1._r8 + (P(48)*DFA +P(20)*DF+P(21)*DF*DF)*SWC(1)
    1389           0 :       F2 = 1._r8 + (P(50)*DFA+P(20)*DF+P(21)*DF*DF)*SWC(1)
    1390             : !        TIME INDEPENDENT
    1391             :       T(2) = &
    1392             :         (P(2)*PLG(3,1) + P(3)*PLG(5,1)+P(23)*PLG(7,1)) &
    1393             :        +(P(15)*PLG(3,1))*DFA*SWC(1) &
    1394           0 :        +P(27)*PLG(2,1)
    1395             : !        SYMMETRICAL ANNUAL
    1396             :       T(3) = &
    1397           0 :        (P(19) )*CD32
    1398             : !        SYMMETRICAL SEMIANNUAL
    1399             :       T(4) = &
    1400           0 :        (P(16)+P(17)*PLG(3,1))*CD18
    1401             : !        ASYMMETRICAL ANNUAL
    1402             :       T(5) =  F1* &
    1403           0 :         (P(10)*PLG(2,1)+P(11)*PLG(4,1))*CD14
    1404             : !         ASYMMETRICAL SEMIANNUAL
    1405           0 :       T(6) =    P(38)*PLG(2,1)*CD39
    1406             : !        DIURNAL
    1407           0 :       IF(SW(7).EQ.0) GOTO 200
    1408           0 :       T71 = (P(12)*PLG(3,2))*CD14*SWC(5)
    1409           0 :       T72 = (P(13)*PLG(3,2))*CD14*SWC(5)
    1410             :       T(7) = F2* &
    1411             :        ((P(4)*PLG(2,2) + P(5)*PLG(4,2) + P(28)*PLG(6,2) &
    1412             :        + T71)*CTLOC &
    1413             :        + (P(7)*PLG(2,2) + P(8)*PLG(4,2) +P(29)*PLG(6,2) &
    1414           0 :        + T72)*STLOC)
    1415             :   200 CONTINUE
    1416             : !        SEMIDIURNAL
    1417           0 :       IF(SW(8).EQ.0) GOTO 210
    1418           0 :       T81 = (P(24)*PLG(4,3)+P(36)*PLG(6,3))*CD14*SWC(5) 
    1419           0 :       T82 = (P(34)*PLG(4,3)+P(37)*PLG(6,3))*CD14*SWC(5)
    1420             :       T(8) = F2* &
    1421             :        ((P(6)*PLG(3,3) + P(42)*PLG(5,3) + T81)*C2TLOC &
    1422           0 :        +(P(9)*PLG(3,3) + P(43)*PLG(5,3) + T82)*S2TLOC)
    1423             :   210 CONTINUE
    1424             : !        TERDIURNAL
    1425           0 :       IF(SW(14).EQ.0) GOTO 220
    1426             :       T(14) = F2* &
    1427             :        ((P(40)*PLG(4,4)+(P(94)*PLG(5,4)+P(47)*PLG(7,4))*CD14*SWC(5))* &
    1428             :        S3TLOC &
    1429             :        +(P(41)*PLG(4,4)+(P(95)*PLG(5,4)+P(49)*PLG(7,4))*CD14*SWC(5))* &
    1430           0 :        C3TLOC)
    1431             :   220 CONTINUE
    1432             : !          MAGNETIC ACTIVITY BASED ON DAILY AP
    1433             : 
    1434           0 :       IF(SW9.EQ.-1._r8) GO TO 30
    1435           0 :       APD=(AP(1)-4._r8)
    1436           0 :       P44=P(44)
    1437           0 :       P45=P(45)
    1438           0 :       IF(P44.LT.0) P44=1.E-5_r8
    1439           0 :       APDF = APD+(P45-1._r8)*(APD+(EXP(-P44  *APD)-1._r8)/P44)
    1440           0 :       IF(SW(9).EQ.0) GOTO 40
    1441             :       T(9)=APDF*(P(33)+P(46)*PLG(3,1)+P(35)*PLG(5,1)+ &
    1442             :        (P(101)*PLG(2,1)+P(102)*PLG(4,1)+P(103)*PLG(6,1))*CD14*SWC(5)+ &
    1443             :        (P(122)*PLG(2,2)+P(123)*PLG(4,2)+P(124)*PLG(6,2))*SWC(7)* &
    1444           0 :        COS(HR*(TLOC-P(125))))
    1445           0 :       GO TO 40
    1446             :    30 CONTINUE
    1447           0 :       IF(P(52).EQ.0) GO TO 40
    1448           0 :       EXP1 = EXP(-10800._r8*ABS(P(52))/(1._r8+P(139)*(45._r8-ABS(LAT))))
    1449           0 :       IF(EXP1.GT..99999_r8) EXP1=.99999_r8
    1450           0 :       IF(P(25).LT.1.E-4_r8) P(25)=1.E-4_r8
    1451           0 :       APT(1)=SG0(EXP1)
    1452             : !      APT(2)=SG2(EXP1)
    1453             : !      APT(3)=SG0(EXP2)
    1454             : !      APT(4)=SG2(EXP2)
    1455           0 :       IF(SW(9).EQ.0) GOTO 40
    1456             :       T(9) = APT(1)*(P(51)+P(97)*PLG(3,1)+P(55)*PLG(5,1)+ &
    1457             :        (P(126)*PLG(2,1)+P(127)*PLG(4,1)+P(128)*PLG(6,1))*CD14*SWC(5)+ &
    1458             :        (P(129)*PLG(2,2)+P(130)*PLG(4,2)+P(131)*PLG(6,2))*SWC(7)* &
    1459           0 :        COS(HR*(TLOC-P(132))))
    1460             :   40  CONTINUE
    1461           0 :       IF(SW(10).EQ.0.OR.LONG.LE.-1000._r8) GO TO 49
    1462             : !        LONGITUDINAL
    1463           0 :       IF(SW(11).EQ.0) GOTO 230
    1464             :       T(11)= (1._r8+P(81)*DFA*SWC(1))* &
    1465             :       ((P(65)*PLG(3,2)+P(66)*PLG(5,2)+P(67)*PLG(7,2) &
    1466             :        +P(104)*PLG(2,2)+P(105)*PLG(4,2)+P(106)*PLG(6,2) &
    1467             :        +SWC(5)*(P(110)*PLG(2,2)+P(111)*PLG(4,2)+P(112)*PLG(6,2))*CD14)* &
    1468             :            COS(DGTR*LONG) &
    1469             :        +(P(91)*PLG(3,2)+P(92)*PLG(5,2)+P(93)*PLG(7,2) &
    1470             :        +P(107)*PLG(2,2)+P(108)*PLG(4,2)+P(109)*PLG(6,2) &
    1471             :        +SWC(5)*(P(113)*PLG(2,2)+P(114)*PLG(4,2)+P(115)*PLG(6,2))*CD14)* &
    1472           0 :         SIN(DGTR*LONG))
    1473             :   230 CONTINUE
    1474             : !        UT AND MIXED UT,LONGITUDE
    1475           0 :       IF(SW(12).EQ.0) GOTO 240
    1476             :       T(12)=(1._r8+P(96)*PLG(2,1))*(1._r8+P(82)*DFA*SWC(1))* &
    1477             :       (1._r8+P(120)*PLG(2,1)*SWC(5)*CD14)* &
    1478             :       ((P(69)*PLG(2,1)+P(70)*PLG(4,1)+P(71)*PLG(6,1))* &
    1479           0 :            COS(SR*(SEC-P(72))))
    1480             :       T(12)=T(12)+SWC(11)* &
    1481             :        (P(77)*PLG(4,3)+P(78)*PLG(6,3)+P(79)*PLG(8,3))* &
    1482           0 :            COS(SR*(SEC-P(80))+2._r8*DGTR*LONG)*(1._r8+P(138)*DFA*SWC(1))
    1483             :   240 CONTINUE
    1484             : !        UT,LONGITUDE MAGNETIC ACTIVITY
    1485           0 :       IF(SW(13).EQ.0) GOTO 48
    1486           0 :       IF(SW9.EQ.-1._r8) GO TO 45
    1487             :       T(13)= APDF*SWC(11)*(1._r8+P(121)*PLG(2,1))* &
    1488             :       ((P( 61)*PLG(3,2)+P( 62)*PLG(5,2)+P( 63)*PLG(7,2))* &
    1489             :            COS(DGTR*(LONG-P( 64)))) &
    1490             :        +APDF*SWC(11)*SWC(5)* &
    1491             :        (P(116)*PLG(2,2)+P(117)*PLG(4,2)+P(118)*PLG(6,2))* &
    1492             :            CD14*COS(DGTR*(LONG-P(119))) &
    1493             :        + APDF*SWC(12)* &
    1494             :        (P( 84)*PLG(2,1)+P( 85)*PLG(4,1)+P( 86)*PLG(6,1))* &
    1495           0 :            COS(SR*(SEC-P( 76)))
    1496           0 :       GOTO 48
    1497             :    45 CONTINUE
    1498           0 :       IF(P(52).EQ.0) GOTO 48
    1499             :       T(13)=APT(1)*SWC(11)*(1._r8+P(133)*PLG(2,1))* &
    1500             :       ((P(53)*PLG(3,2)+P(99)*PLG(5,2)+P(68)*PLG(7,2))* &
    1501             :            COS(DGTR*(LONG-P(98)))) &
    1502             :        +APT(1)*SWC(11)*SWC(5)* &
    1503             :        (P(134)*PLG(2,2)+P(135)*PLG(4,2)+P(136)*PLG(6,2))* &
    1504             :            CD14*COS(DGTR*(LONG-P(137))) &
    1505             :        +APT(1)*SWC(12)* &
    1506             :        (P(56)*PLG(2,1)+P(57)*PLG(4,1)+P(58)*PLG(6,1))* &
    1507           0 :            COS(SR*(SEC-P(59)))
    1508             :    48 CONTINUE
    1509             : !  PARMS NOT USED: 83, 90,100,140-150
    1510             :    49 CONTINUE
    1511           0 :       TINF=P(31)
    1512           0 :       DO 50 I = 1,NSW
    1513           0 :    50 TINF = TINF + ABS(SW(I))*T(I)
    1514           0 :       GLOBE7 = TINF
    1515             :       RETURN
    1516             :       END FUNCTION GLOBE7
    1517             : 
    1518             : !================================================================================================
    1519             : 
    1520           0 :       SUBROUTINE TSELEC(SV)
    1521             : !         
    1522             : !-----------------------------------------------------------------------
    1523             : !        SET SWITCHES
    1524             : !        Output in  COMMON/CSW/SW(25),SWC(25),ISW
    1525             : !        SW FOR MAIN TERMS, SWC FOR CROSS TERMS
    1526             : !  
    1527             : !        TO TURN ON AND OFF PARTICULAR VARIATIONS CALL TSELEC(SV),
    1528             : !        WHERE SV IS A 25 ELEMENT ARRAY CONTAINING 0. FOR OFF, 1. 
    1529             : !        FOR ON, OR 2. FOR MAIN EFFECTS OFF BUT CROSS TERMS ON
    1530             : !
    1531             : !        To get current values of SW: CALL TRETRV(SW)
    1532             : !-----------------------------------------------------------------------
    1533             : !
    1534             :       use shr_kind_mod, only : r8 => shr_kind_r8
    1535             :       implicit none
    1536             : !
    1537             : !-------------------------------Commons---------------------------------
    1538             : !
    1539             :       integer isw
    1540             :       real(r8) sw, swc
    1541             :       COMMON/CSW/SW(25),SWC(25),ISW
    1542             : !
    1543             : !------------------------------Arguments--------------------------------
    1544             : !
    1545             :       real(r8) SV(*), SVV(*)
    1546             : !
    1547             : !---------------------------Local variables-----------------------------
    1548             : !
    1549             :       integer i
    1550             :       real(r8) SAV(25)
    1551             : 
    1552             :       SAVE
    1553             : !
    1554             : !-----------------------------------------------------------------------
    1555             : !
    1556           0 :       DO 100 I = 1,25
    1557           0 :         SAV(I)=SV(I)
    1558           0 :         SW(I)=MOD(SV(I),2._r8)
    1559           0 :         IF(ABS(SV(I)).EQ.1.OR.ABS(SV(I)).EQ.2._r8) THEN
    1560           0 :           SWC(I)=1._r8
    1561             :         ELSE
    1562           0 :           SWC(I)=0._r8
    1563             :         ENDIF
    1564           0 :   100 CONTINUE
    1565           0 :       ISW=64999
    1566           0 :       RETURN
    1567           0 :       ENTRY TRETRV(SVV)
    1568           0 :       DO 200 I=1,25
    1569           0 :         SVV(I)=SAV(I)
    1570           0 :   200 CONTINUE
    1571             :       END SUBROUTINE TSELEC
    1572             : 
    1573             : !================================================================================================
    1574             : 
    1575           0 :       FUNCTION GLOB7S(P)
    1576             : !         
    1577             : !-----------------------------------------------------------------------
    1578             : !      VERSION OF GLOBE FOR LOWER ATMOSPHERE 10/26/99
    1579             : !-----------------------------------------------------------------------
    1580             : !
    1581           0 :       use shr_kind_mod, only : r8 => shr_kind_r8
    1582             :       use cam_logfile,  only : iulog
    1583             :       implicit none
    1584             : !
    1585             : !-----------------------------Return Value------------------------------
    1586             : !
    1587             :       real(r8) glob7s
    1588             : !
    1589             : !-------------------------------Commons---------------------------------
    1590             : !
    1591             :       integer iyr
    1592             :       real(r8) plg, ctloc, stloc, c2tloc, s2tloc, c3tloc, s3tloc
    1593             :       real(r8) day, df, dfa, apd, apdf, apt
    1594             :       REAL(r8) LONG
    1595             :       COMMON/LPOLY/PLG(9,4),CTLOC,STLOC,C2TLOC,S2TLOC,C3TLOC,S3TLOC, &
    1596             :        DAY,DF,DFA,APD,APDF,APT(4),LONG,IYR
    1597             : 
    1598             :       integer isw
    1599             :       real(r8) sw, swc
    1600             :       COMMON/CSW/SW(25),SWC(25),ISW
    1601             : !
    1602             : !------------------------------Arguments--------------------------------
    1603             : !
    1604             :       real(r8) P(*)
    1605             : !
    1606             : !---------------------------Local variables-----------------------------
    1607             : !
    1608             :       integer i, j
    1609             :       real(r8) t81, cd32, cd14, cd18, t72, cd39, t71, tt, t82
    1610             :       real(r8) T(14)
    1611             : 
    1612             :       real(r8) dr, dgtr, pset
    1613             :       DATA DR/1.72142E-2_r8/,DGTR/1.74533E-2_r8/,PSET/2._r8/
    1614             : 
    1615             :       real(r8) dayl, p32, p18, p14, p39
    1616             :       DATA DAYL/-1._r8/,P32,P18,P14,P39/4*-1000._r8/
    1617             : 
    1618             :       SAVE
    1619             : !
    1620             : !-----------------------------------------------------------------------
    1621             : !
    1622             : !       CONFIRM PARAMETER SET
    1623           0 :       IF(P(100).EQ.0) P(100)=PSET
    1624           0 :       IF(P(100).NE.PSET) THEN
    1625           0 :         write(iulog,900) PSET,P(100)
    1626             :   900   FORMAT(1X,'WRONG PARAMETER SET FOR GLOB7S',3F10.1)
    1627           0 :         STOP
    1628             :       ENDIF
    1629           0 :       DO 10 J=1,14
    1630           0 :         T(J)=0._r8
    1631           0 :    10 CONTINUE
    1632           0 :       IF(DAY.NE.DAYL.OR.P32.NE.P(32)) CD32=COS(DR*(DAY-P(32)))
    1633           0 :       IF(DAY.NE.DAYL.OR.P18.NE.P(18)) CD18=COS(2._r8*DR*(DAY-P(18)))       
    1634           0 :       IF(DAY.NE.DAYL.OR.P14.NE.P(14)) CD14=COS(DR*(DAY-P(14)))
    1635           0 :       IF(DAY.NE.DAYL.OR.P39.NE.P(39)) CD39=COS(2._r8*DR*(DAY-P(39)))
    1636           0 :       DAYL=DAY
    1637           0 :       P32=P(32)
    1638           0 :       P18=P(18)
    1639           0 :       P14=P(14)
    1640           0 :       P39=P(39)
    1641             : !
    1642             : !       F10.7
    1643           0 :       T(1)=P(22)*DFA
    1644             : !       TIME INDEPENDENT
    1645             :       T(2)=P(2)*PLG(3,1)+P(3)*PLG(5,1)+P(23)*PLG(7,1) &
    1646           0 :            +P(27)*PLG(2,1)+P(15)*PLG(4,1)+P(60)*PLG(6,1)
    1647             : !       SYMMETRICAL ANNUAL
    1648           0 :       T(3)=(P(19)+P(48)*PLG(3,1)+P(30)*PLG(5,1))*CD32
    1649             : !       SYMMETRICAL SEMIANNUAL
    1650           0 :       T(4)=(P(16)+P(17)*PLG(3,1)+P(31)*PLG(5,1))*CD18
    1651             : !       ASYMMETRICAL ANNUAL
    1652           0 :       T(5)=(P(10)*PLG(2,1)+P(11)*PLG(4,1)+P(21)*PLG(6,1))*CD14
    1653             : !       ASYMMETRICAL SEMIANNUAL
    1654           0 :       T(6)=(P(38)*PLG(2,1))*CD39
    1655             : !        DIURNAL
    1656           0 :       IF(SW(7).EQ.0) GOTO 200
    1657           0 :       T71 = P(12)*PLG(3,2)*CD14*SWC(5)
    1658           0 :       T72 = P(13)*PLG(3,2)*CD14*SWC(5)
    1659             :       T(7) =  &
    1660             :        ((P(4)*PLG(2,2) + P(5)*PLG(4,2) &
    1661             :        + T71)*CTLOC &
    1662             :        + (P(7)*PLG(2,2) + P(8)*PLG(4,2) &
    1663           0 :        + T72)*STLOC)
    1664             :   200 CONTINUE
    1665             : !        SEMIDIURNAL
    1666           0 :       IF(SW(8).EQ.0) GOTO 210
    1667           0 :       T81 = (P(24)*PLG(4,3)+P(36)*PLG(6,3))*CD14*SWC(5) 
    1668           0 :       T82 = (P(34)*PLG(4,3)+P(37)*PLG(6,3))*CD14*SWC(5)
    1669             :       T(8) =  &
    1670             :        ((P(6)*PLG(3,3) + P(42)*PLG(5,3) + T81)*C2TLOC &
    1671           0 :        +(P(9)*PLG(3,3) + P(43)*PLG(5,3) + T82)*S2TLOC)
    1672             :   210 CONTINUE
    1673             : !        TERDIURNAL
    1674           0 :       IF(SW(14).EQ.0) GOTO 220
    1675             :       T(14) = P(40)*PLG(4,4)*S3TLOC &
    1676           0 :        +P(41)*PLG(4,4)*C3TLOC
    1677             :   220 CONTINUE
    1678             : !       MAGNETIC ACTIVITY
    1679           0 :       IF(SW(9).EQ.0) GOTO 40
    1680           0 :       IF(SW(9).EQ.1) &
    1681           0 :        T(9)=APDF*(P(33)+P(46)*PLG(3,1)*SWC(2))
    1682           0 :       IF(SW(9).EQ.-1) &
    1683           0 :        T(9)=(P(51)*APT(1)+P(97)*PLG(3,1)*APT(1)*SWC(2))
    1684             :    40 CONTINUE
    1685           0 :       IF(SW(10).EQ.0.OR.SW(11).EQ.0.OR.LONG.LE.-1000._r8) GO TO 49
    1686             : !        LONGITUDINAL
    1687             :       T(11)= (1._r8+PLG(2,1)*(P(81)*SWC(5)*COS(DR*(DAY-P(82))) &
    1688             :                  +P(86)*SWC(6)*COS(2._r8*DR*(DAY-P(87)))) &
    1689             :               +P(84)*SWC(3)*COS(DR*(DAY-P(85))) &
    1690             :                  +P(88)*SWC(4)*COS(2._r8*DR*(DAY-P(89)))) &
    1691             :        *((P(65)*PLG(3,2)+P(66)*PLG(5,2)+P(67)*PLG(7,2) &
    1692             :          +P(75)*PLG(2,2)+P(76)*PLG(4,2)+P(77)*PLG(6,2) &
    1693             :           )*COS(DGTR*LONG) &
    1694             :         +(P(91)*PLG(3,2)+P(92)*PLG(5,2)+P(93)*PLG(7,2) &
    1695             :          +P(78)*PLG(2,2)+P(79)*PLG(4,2)+P(80)*PLG(6,2) &
    1696           0 :           )*SIN(DGTR*LONG))
    1697             :    49 CONTINUE
    1698           0 :       TT=0._r8
    1699           0 :       DO 50 I=1,14
    1700           0 :    50 TT=TT+ABS(SW(I))*T(I)
    1701           0 :       GLOB7S=TT
    1702             :       RETURN
    1703             :       END FUNCTION GLOB7S
    1704             : 
    1705             : !================================================================================================
    1706             : 
    1707           0 :       FUNCTION DENSU(ALT,DLB,TINF,TLB,XM,ALPHA,TZ,ZLB,S2, &
    1708           0 :         MN1,ZN1,TN1,TGN1)
    1709             : !         
    1710             : !-----------------------------------------------------------------------
    1711             : !       Calculate Temperature and Density Profiles for MSIS models
    1712             : !       New lower thermo polynomial 10/30/89
    1713             : !-----------------------------------------------------------------------
    1714             : !
    1715           0 :       use shr_kind_mod, only : r8 => shr_kind_r8
    1716             :       implicit none
    1717             : !
    1718             : !-----------------------------Return Value------------------------------
    1719             : !
    1720             :       real(r8) densu
    1721             : !
    1722             : !-------------------------------Commons---------------------------------
    1723             : !
    1724             :       real(r8) gsurf, re
    1725             :       COMMON/PARMB/GSURF,RE
    1726             : 
    1727             :       integer mp, ii, jg, lt, ierr, ifun, n, j
    1728             :       real(r8) qpb, dv
    1729             :       COMMON/LSQV/MP,II,JG,LT,QPB(50),IERR,IFUN,N,J,DV(60)
    1730             : !
    1731             : !------------------------------Arguments--------------------------------
    1732             : !
    1733             :       integer mn1
    1734             :       real(r8) alt, dlb, tinf, tlb, xm, alpha, tz, zlb, s2
    1735             :       real(r8) ZN1(MN1),TN1(MN1),TGN1(2)
    1736             : !
    1737             : !---------------------------Local variables-----------------------------
    1738             : !
    1739             :       integer k, mn
    1740             :       real(r8) densa, dta, expl, gamm, gamma, glb, ta, tt, t1, t2
    1741             :       real(r8) x, y, yd1, yd2, yi, z, za, zg, zg2, zgdif, z1, z2
    1742             :       real(r8) XS(5),YS(5),Y2OUT(5)
    1743             : 
    1744             :       real(r8) rgas
    1745             :       DATA RGAS/831.4_r8/
    1746             : 
    1747             :       SAVE
    1748             : !
    1749             : !-------------------------Statement Functions----------------------------
    1750             : !
    1751             :       real(r8) zeta, zz, zl
    1752             :       ZETA(ZZ,ZL)=(ZZ-ZL)*(RE+ZL)/(RE+ZZ)
    1753             : !
    1754             : !-----------------------------------------------------------------------
    1755             : !
    1756             : !CCCCCwrite(iulog,*) 'DB',ALT,DLB,TINF,TLB,XM,ALPHA,ZLB,S2,MN1,ZN1,TN1
    1757           0 :       DENSU=1._r8
    1758             : !        Joining altitude of Bates and spline
    1759           0 :       ZA=ZN1(1)
    1760           0 :       Z=MAX(ALT,ZA)
    1761             : !      Geopotential altitude difference from ZLB
    1762           0 :       ZG2=ZETA(Z,ZLB)
    1763             : !      Bates temperature
    1764           0 :       TT=TINF-(TINF-TLB)*EXP(-S2*ZG2)
    1765           0 :       TA=TT
    1766           0 :       TZ=TT
    1767           0 :       DENSU=TZ
    1768           0 :       IF(ALT.GE.ZA) GO TO 10
    1769             : !
    1770             : !       CALCULATE TEMPERATURE BELOW ZA
    1771             : !      Temperature gradient at ZA from Bates profile
    1772           0 :       DTA=(TINF-TA)*S2*((RE+ZLB)/(RE+ZA))**2
    1773           0 :       TGN1(1)=DTA 
    1774           0 :       TN1(1)=TA
    1775           0 :       Z=MAX(ALT,ZN1(MN1))
    1776           0 :       MN=MN1
    1777           0 :       Z1=ZN1(1)
    1778           0 :       Z2=ZN1(MN)
    1779           0 :       T1=TN1(1)
    1780           0 :       T2=TN1(MN)
    1781             : !      Geopotental difference from Z1
    1782           0 :       ZG=ZETA(Z,Z1)
    1783           0 :       ZGDIF=ZETA(Z2,Z1)
    1784             : !       Set up spline nodes
    1785           0 :       DO 20 K=1,MN
    1786           0 :         XS(K)=ZETA(ZN1(K),Z1)/ZGDIF
    1787           0 :         YS(K)=1._r8/TN1(K)
    1788           0 :    20 CONTINUE
    1789             : !        End node derivatives
    1790           0 :       YD1=-TGN1(1)/(T1*T1)*ZGDIF
    1791           0 :       YD2=-TGN1(2)/(T2*T2)*ZGDIF*((RE+Z2)/(RE+Z1))**2
    1792             : !       Calculate spline coefficients
    1793           0 :       CALL SPLINE(XS,YS,MN,YD1,YD2,Y2OUT)
    1794           0 :       X=ZG/ZGDIF
    1795           0 :       CALL SPLINT(XS,YS,Y2OUT,MN,X,Y)
    1796             : !       temperature at altitude
    1797           0 :       TZ=1._r8/Y
    1798           0 :       DENSU=TZ
    1799           0 :    10 IF(XM.EQ.0._r8) GO TO 50
    1800             : !
    1801             : !      CALCULATE DENSITY ABOVE ZA
    1802           0 :       GLB=GSURF/(1._r8+ZLB/RE)**2
    1803           0 :       GAMMA=XM*GLB/(S2*RGAS*TINF)
    1804           0 :       EXPL=EXP(-S2*GAMMA*ZG2)
    1805           0 :       IF(EXPL.GT.50.OR.TT.LE.0._r8) THEN
    1806           0 :         EXPL=50._r8
    1807             :       ENDIF
    1808             : !       Density at altitude
    1809           0 :       DENSA=DLB*(TLB/TT)**(1._r8+ALPHA+GAMMA)*EXPL
    1810           0 :       DENSU=DENSA
    1811           0 :       IF(ALT.GE.ZA) GO TO 50
    1812             : !
    1813             : !      CALCULATE DENSITY BELOW ZA
    1814           0 :       GLB=GSURF/(1._r8+Z1/RE)**2
    1815           0 :       GAMM=XM*GLB*ZGDIF/RGAS
    1816             : !       integrate spline temperatures
    1817           0 :       CALL SPLINI(XS,YS,Y2OUT,MN,X,YI)
    1818           0 :       EXPL=GAMM*YI
    1819           0 :       IF(EXPL.GT.50._r8.OR.TZ.LE.0._r8) THEN
    1820           0 :         EXPL=50._r8
    1821             :       ENDIF
    1822             : !       Density at altitude
    1823           0 :       DENSU=DENSU*(T1/TZ)**(1._r8+ALPHA)*EXP(-EXPL)
    1824             :    50 CONTINUE
    1825             :       RETURN
    1826             :       END FUNCTION DENSU
    1827             : 
    1828             : !================================================================================================
    1829             : 
    1830           0 :       FUNCTION DENSM(ALT,D0,XM,TZ,MN3,ZN3,TN3,TGN3,MN2,ZN2,TN2,TGN2)
    1831             : !         
    1832             : !-----------------------------------------------------------------------
    1833             : !       Calculate Temperature and Density Profiles for lower atmos.
    1834             : !-----------------------------------------------------------------------
    1835             : !
    1836             :       use shr_kind_mod, only : r8 => shr_kind_r8
    1837             :       implicit none
    1838             : !
    1839             : !-----------------------------Return Value------------------------------
    1840             : !
    1841             :       real(r8) densm
    1842             : !
    1843             : !-------------------------------Commons---------------------------------
    1844             : !
    1845             :       real(r8) gsurf, pe
    1846             :       COMMON/PARMB/GSURF,RE
    1847             : 
    1848             :       real(r8) taf
    1849             :       COMMON/FIT/TAF
    1850             : 
    1851             :       integer mp, ii, jg, ierr, ifun, n, j
    1852             :       real(r8) qpb, dv
    1853             :       COMMON/LSQV/MP,II,JG,LT,QPB(50),IERR,IFUN,N,J,DV(60)
    1854             : !
    1855             : !------------------------------Arguments--------------------------------
    1856             : !
    1857             :       integer mn3, mn2
    1858             :       real(r8) alt, d0, xm, tz
    1859             :       real(r8) ZN3(MN3),TN3(MN3),TGN3(2)
    1860             :       real(r8) ZN2(MN2),TN2(MN2),TGN2(2)
    1861             : !
    1862             : !---------------------------Local variables-----------------------------
    1863             : !
    1864             :       integer k, lt, mn
    1865             :       real(r8) x, yd1, yd2, y, yi, expl, glb, gamm, zgdif, z
    1866             :       real(r8) re, z1, z2, zg, t1, t2
    1867             :       real(r8) XS(10),YS(10),Y2OUT(10)
    1868             : 
    1869             :       real(r8) rgas
    1870             :       DATA RGAS/831.4_r8/
    1871             : 
    1872             :       SAVE
    1873             : !
    1874             : !-------------------------Statement Functions----------------------------
    1875             : !
    1876             :       real(r8) zeta, zz, zl
    1877             :       ZETA(ZZ,ZL)=(ZZ-ZL)*(RE+ZL)/(RE+ZZ)
    1878             : !
    1879             : !-----------------------------------------------------------------------
    1880             : !
    1881           0 :       DENSM=D0
    1882           0 :       IF(ALT.GT.ZN2(1)) GOTO 50
    1883             : !      STRATOSPHERE/MESOSPHERE TEMPERATURE
    1884           0 :       Z=MAX(ALT,ZN2(MN2))
    1885           0 :       MN=MN2
    1886           0 :       Z1=ZN2(1)
    1887           0 :       Z2=ZN2(MN)
    1888           0 :       T1=TN2(1)
    1889           0 :       T2=TN2(MN)
    1890           0 :       ZG=ZETA(Z,Z1)
    1891           0 :       ZGDIF=ZETA(Z2,Z1)
    1892             : !       Set up spline nodes
    1893           0 :       DO 210 K=1,MN
    1894           0 :         XS(K)=ZETA(ZN2(K),Z1)/ZGDIF
    1895           0 :         YS(K)=1._r8/TN2(K)
    1896           0 :   210 CONTINUE
    1897           0 :       YD1=-TGN2(1)/(T1*T1)*ZGDIF
    1898           0 :       YD2=-TGN2(2)/(T2*T2)*ZGDIF*((RE+Z2)/(RE+Z1))**2
    1899             : !       Calculate spline coefficients
    1900           0 :       CALL SPLINE(XS,YS,MN,YD1,YD2,Y2OUT)
    1901           0 :       X=ZG/ZGDIF
    1902           0 :       CALL SPLINT(XS,YS,Y2OUT,MN,X,Y)
    1903             : !       Temperature at altitude
    1904           0 :       TZ=1._r8/Y
    1905           0 :       IF(XM.EQ.0._r8) GO TO 20
    1906             : !
    1907             : !      CALCULATE STRATOSPHERE/MESOSPHERE DENSITY 
    1908           0 :       GLB=GSURF/(1._r8+Z1/RE)**2
    1909           0 :       GAMM=XM*GLB*ZGDIF/RGAS
    1910             : !       Integrate temperature profile
    1911           0 :       CALL SPLINI(XS,YS,Y2OUT,MN,X,YI)
    1912           0 :       EXPL=GAMM*YI
    1913           0 :       IF(EXPL.GT.50._r8) EXPL=50._r8
    1914             : !       Density at altitude
    1915           0 :       DENSM=DENSM*(T1/TZ)*EXP(-EXPL)
    1916             :    20 CONTINUE
    1917           0 :       IF(ALT.GT.ZN3(1)) GOTO 50
    1918             : !
    1919             : !      TROPOSPHERE/STRATOSPHERE TEMPERATURE
    1920           0 :       Z=ALT
    1921           0 :       MN=MN3
    1922           0 :       Z1=ZN3(1)
    1923           0 :       Z2=ZN3(MN)
    1924           0 :       T1=TN3(1)
    1925           0 :       T2=TN3(MN)
    1926           0 :       ZG=ZETA(Z,Z1)
    1927           0 :       ZGDIF=ZETA(Z2,Z1)
    1928             : !       Set up spline nodes
    1929           0 :       DO 220 K=1,MN
    1930           0 :         XS(K)=ZETA(ZN3(K),Z1)/ZGDIF
    1931           0 :         YS(K)=1._r8/TN3(K)
    1932           0 :   220 CONTINUE
    1933           0 :       YD1=-TGN3(1)/(T1*T1)*ZGDIF
    1934           0 :       YD2=-TGN3(2)/(T2*T2)*ZGDIF*((RE+Z2)/(RE+Z1))**2
    1935             : !       Calculate spline coefficients
    1936           0 :       CALL SPLINE(XS,YS,MN,YD1,YD2,Y2OUT)
    1937           0 :       X=ZG/ZGDIF
    1938           0 :       CALL SPLINT(XS,YS,Y2OUT,MN,X,Y)
    1939             : !       temperature at altitude
    1940           0 :       TZ=1._r8/Y
    1941           0 :       IF(XM.EQ.0._r8) GO TO 30
    1942             : !
    1943             : !      CALCULATE TROPOSPHERIC/STRATOSPHERE DENSITY 
    1944             : !     
    1945           0 :       GLB=GSURF/(1._r8+Z1/RE)**2
    1946           0 :       GAMM=XM*GLB*ZGDIF/RGAS
    1947             : !        Integrate temperature profile
    1948           0 :       CALL SPLINI(XS,YS,Y2OUT,MN,X,YI)
    1949           0 :       EXPL=GAMM*YI
    1950           0 :       IF(EXPL.GT.50._r8) EXPL=50._r8
    1951             : !        Density at altitude
    1952           0 :       DENSM=DENSM*(T1/TZ)*EXP(-EXPL)
    1953             :    30 CONTINUE
    1954             :    50 CONTINUE
    1955           0 :       IF(XM.EQ.0) DENSM=TZ
    1956             :       RETURN
    1957             :       END FUNCTION DENSM
    1958             : 
    1959             : !================================================================================================
    1960             : 
    1961           0 :       SUBROUTINE SPLINE(X,Y,N,YP1,YPN,Y2)
    1962             : !         
    1963             : !-----------------------------------------------------------------------
    1964             : !        CALCULATE 2ND DERIVATIVES OF CUBIC SPLINE INTERP FUNCTION
    1965             : !        ADAPTED FROM NUMERICAL RECIPES BY PRESS ET AL
    1966             : !        X,Y: ARRAYS OF TABULATED FUNCTION IN ASCENDING ORDER BY X
    1967             : !        N: SIZE OF ARRAYS X,Y
    1968             : !        YP1,YPN: SPECIFIED DERIVATIVES AT X(1) AND X(N); VALUES
    1969             : !                 >= 1E30 SIGNAL SIGNAL SECOND DERIVATIVE ZERO
    1970             : !        Y2: OUTPUT ARRAY OF SECOND DERIVATIVES
    1971             : !-----------------------------------------------------------------------
    1972             : !
    1973           0 :       use shr_kind_mod, only : r8 => shr_kind_r8
    1974             :       implicit none
    1975             : !
    1976             : !------------------------------Arguments--------------------------------
    1977             : !
    1978             :       integer n
    1979             :       real(r8) X(N),Y(N),Y2(N)
    1980             :       real(r8) yp1, ypn
    1981             : !
    1982             : !-----------------------------Parameters------------------------------
    1983             : !
    1984             :       integer nmax
    1985             :       PARAMETER (NMAX=100)
    1986             : !
    1987             : !---------------------------Local variables-----------------------------
    1988             : !
    1989             :       integer i, k
    1990             :       real(r8) qn, un, sig, p, U(NMAX)
    1991             : 
    1992             :       SAVE
    1993             : !
    1994             : !-----------------------------------------------------------------------
    1995             : !
    1996           0 :       IF(YP1.GT..99E30_r8) THEN
    1997           0 :         Y2(1)=0
    1998           0 :         U(1)=0
    1999             :       ELSE
    2000           0 :         Y2(1)=-.5_r8
    2001           0 :         U(1)=(3._r8/(X(2)-X(1)))*((Y(2)-Y(1))/(X(2)-X(1))-YP1)
    2002             :       ENDIF
    2003           0 :       DO 11 I=2,N-1
    2004           0 :         SIG=(X(I)-X(I-1))/(X(I+1)-X(I-1))
    2005           0 :         P=SIG*Y2(I-1)+2._r8
    2006           0 :         Y2(I)=(SIG-1._r8)/P
    2007           0 :         U(I)=(6._r8*((Y(I+1)-Y(I))/(X(I+1)-X(I))-(Y(I)-Y(I-1)) &
    2008           0 :           /(X(I)-X(I-1)))/(X(I+1)-X(I-1))-SIG*U(I-1))/P
    2009           0 :    11 CONTINUE
    2010           0 :       IF(YPN.GT..99E30_r8) THEN
    2011           0 :         QN=0
    2012           0 :         UN=0
    2013             :       ELSE
    2014           0 :         QN=.5_r8
    2015           0 :         UN=(3._r8/(X(N)-X(N-1)))*(YPN-(Y(N)-Y(N-1))/(X(N)-X(N-1)))
    2016             :       ENDIF
    2017           0 :       Y2(N)=(UN-QN*U(N-1))/(QN*Y2(N-1)+1._r8)
    2018           0 :       DO 12 K=N-1,1,-1
    2019           0 :         Y2(K)=Y2(K)*Y2(K+1)+U(K)
    2020           0 :    12 CONTINUE
    2021           0 :       RETURN
    2022             :       END SUBROUTINE SPLINE
    2023             : 
    2024             : !================================================================================================
    2025             : 
    2026           0 :       SUBROUTINE SPLINT(XA,YA,Y2A,N,X,Y)
    2027             : !         
    2028             : !-----------------------------------------------------------------------
    2029             : !        CALCULATE CUBIC SPLINE INTERP VALUE
    2030             : !        ADAPTED FROM NUMERICAL RECIPES BY PRESS ET AL.
    2031             : !        XA,YA: ARRAYS OF TABULATED FUNCTION IN ASCENDING ORDER BY X
    2032             : !        Y2A: ARRAY OF SECOND DERIVATIVES
    2033             : !        N: SIZE OF ARRAYS XA,YA,Y2A
    2034             : !        X: ABSCISSA FOR INTERPOLATION
    2035             : !        Y: OUTPUT VALUE
    2036             : !-----------------------------------------------------------------------
    2037             : !
    2038             :       use shr_kind_mod, only : r8 => shr_kind_r8
    2039             :       use cam_logfile,  only : iulog
    2040             :       implicit none
    2041             : !
    2042             : !------------------------------Arguments--------------------------------
    2043             : !
    2044             :       integer n
    2045             :       real(r8) XA(N),YA(N),Y2A(N)
    2046             :       real(r8) x, y
    2047             : !
    2048             : !---------------------------Local variables-----------------------------
    2049             : !
    2050             :       integer k, klo, khi
    2051             :       real(r8) a, b, h
    2052             : 
    2053             :       SAVE
    2054             : !
    2055             : !-----------------------------------------------------------------------
    2056             : !
    2057           0 :       KLO=1
    2058           0 :       KHI=N
    2059             :     1 CONTINUE
    2060           0 :       IF(KHI-KLO.GT.1) THEN
    2061           0 :         K=(KHI+KLO)/2
    2062           0 :         IF(XA(K).GT.X) THEN
    2063           0 :           KHI=K
    2064             :         ELSE
    2065           0 :           KLO=K
    2066             :         ENDIF
    2067             :         GOTO 1
    2068             :       ENDIF
    2069           0 :       H=XA(KHI)-XA(KLO)
    2070           0 :       IF(H.EQ.0) write(iulog,*) 'BAD XA INPUT TO SPLINT'
    2071           0 :       A=(XA(KHI)-X)/H
    2072           0 :       B=(X-XA(KLO))/H
    2073             :       Y=A*YA(KLO)+B*YA(KHI)+ &
    2074           0 :         ((A*A*A-A)*Y2A(KLO)+(B*B*B-B)*Y2A(KHI))*H*H/6._r8
    2075           0 :       RETURN
    2076             :       END SUBROUTINE SPLINT
    2077             : 
    2078             : !================================================================================================
    2079             : 
    2080           0 :       SUBROUTINE SPLINI(XA,YA,Y2A,N,X,YI)
    2081             : !         
    2082             : !-----------------------------------------------------------------------
    2083             : !       INTEGRATE CUBIC SPLINE FUNCTION FROM XA(1) TO X
    2084             : !        XA,YA: ARRAYS OF TABULATED FUNCTION IN ASCENDING ORDER BY X
    2085             : !        Y2A: ARRAY OF SECOND DERIVATIVES
    2086             : !        N: SIZE OF ARRAYS XA,YA,Y2A
    2087             : !        X: ABSCISSA ENDPOINT FOR INTEGRATION
    2088             : !        Y: OUTPUT VALUE
    2089             : !-----------------------------------------------------------------------
    2090             : !
    2091             :       use shr_kind_mod, only : r8 => shr_kind_r8
    2092             :       implicit none
    2093             : !
    2094             : !------------------------------Arguments--------------------------------
    2095             : !
    2096             :       integer n
    2097             :       real(r8) XA(N),YA(N),Y2A(N)
    2098             :       real(r8) x, yi
    2099             : !
    2100             : !---------------------------Local variables-----------------------------
    2101             : !
    2102             :       integer khi, klo
    2103             :       real(r8) a, b, a2, b2, h, xx
    2104             : 
    2105             :       SAVE
    2106             : !
    2107             : !-----------------------------------------------------------------------
    2108             : !
    2109           0 :       YI=0
    2110           0 :       KLO=1
    2111           0 :       KHI=2
    2112             :     1 CONTINUE
    2113           0 :       IF(X.GT.XA(KLO).AND.KHI.LE.N) THEN
    2114           0 :         XX=X
    2115           0 :         IF(KHI.LT.N) XX=MIN(X,XA(KHI))
    2116           0 :         H=XA(KHI)-XA(KLO)
    2117           0 :         A=(XA(KHI)-XX)/H
    2118           0 :         B=(XX-XA(KLO))/H
    2119           0 :         A2=A*A
    2120           0 :         B2=B*B
    2121             :         YI=YI+((1._r8-A2)*YA(KLO)/2._r8+B2*YA(KHI)/2._r8+ &
    2122             :            ((-(1._r8+A2*A2)/4._r8+A2/2._r8)*Y2A(KLO)+ &
    2123           0 :            (B2*B2/4._r8-B2/2._r8)*Y2A(KHI))*H*H/6._r8)*H
    2124           0 :         KLO=KLO+1
    2125           0 :         KHI=KHI+1
    2126           0 :         GOTO 1
    2127             :       ENDIF
    2128           0 :       RETURN
    2129             :       END SUBROUTINE SPLINI
    2130             : 
    2131             : !================================================================================================
    2132             : 
    2133           0 :       FUNCTION DNET(DD,DM,ZHM,XMM,XM)
    2134             : !         
    2135             : !-----------------------------------------------------------------------
    2136             : !       TURBOPAUSE CORRECTION FOR MSIS MODELS
    2137             : !         Root mean density
    2138             : !       8/20/80
    2139             : !          DD - diffusive density
    2140             : !          DM - full mixed density
    2141             : !          ZHM - transition scale length
    2142             : !          XMM - full mixed molecular weight
    2143             : !          XM  - species molecular weight
    2144             : !          DNET - combined density
    2145             : !-----------------------------------------------------------------------
    2146             : !
    2147           0 :       use shr_kind_mod, only : r8 => shr_kind_r8
    2148             :       use cam_logfile,  only : iulog
    2149             :       implicit none
    2150             : !
    2151             : !-----------------------------Return Value------------------------------
    2152             : !
    2153             :       real(r8) dnet
    2154             : !
    2155             : !------------------------------Arguments--------------------------------
    2156             : !
    2157             :       real(r8) dd, dm, zhm, xmm, xm
    2158             : !
    2159             : !---------------------------Local variables-----------------------------
    2160             : !
    2161             :       real(r8) a, ylog
    2162             : 
    2163             :       SAVE
    2164             : !
    2165             : !-----------------------------------------------------------------------
    2166             : !
    2167           0 :       A=ZHM/(XMM-XM)
    2168           0 :       IF(DM.GT.0.AND.DD.GT.0) GOTO 5
    2169           0 :         write(iulog,*) 'DNET LOG ERROR',DM,DD,XM
    2170           0 :         IF(DD.EQ.0.AND.DM.EQ.0) DD=1._r8
    2171           0 :         IF(DM.EQ.0) GOTO 10
    2172           0 :         IF(DD.EQ.0) GOTO 20
    2173             :     5 CONTINUE
    2174           0 :       YLOG=A*LOG(DM/DD)
    2175           0 :       IF(YLOG.LT.-10._r8) GO TO 10
    2176           0 :       IF(YLOG.GT.10._r8)  GO TO 20
    2177           0 :         DNET=DD*(1._r8+EXP(YLOG))**(1/A)
    2178           0 :         GO TO 50
    2179             :    10 CONTINUE
    2180           0 :         DNET=DD
    2181           0 :         GO TO 50
    2182             :    20 CONTINUE
    2183           0 :         DNET=DM
    2184           0 :         GO TO 50
    2185             :    50 CONTINUE
    2186             :       RETURN
    2187             :       END FUNCTION DNET
    2188             : 
    2189             : !================================================================================================
    2190             : 
    2191           0 :       FUNCTION  CCOR(ALT, R,H1,ZH)
    2192             : !         
    2193             : !-----------------------------------------------------------------------
    2194             : !        CHEMISTRY/DISSOCIATION CORRECTION FOR MSIS MODELS
    2195             : !        ALT - altitude
    2196             : !        R - target ratio
    2197             : !        H1 - transition scale length
    2198             : !        ZH - altitude of 1/2 R
    2199             : !-----------------------------------------------------------------------
    2200             : !
    2201             :       use shr_kind_mod, only : r8 => shr_kind_r8
    2202             :       implicit none
    2203             : !
    2204             : !-----------------------------Return Value------------------------------
    2205             : !
    2206             :       real(r8) ccor
    2207             : !
    2208             : !------------------------------Arguments--------------------------------
    2209             : !
    2210             :       real(r8) alt, r, h1, zh
    2211             : !
    2212             : !---------------------------Local variables-----------------------------
    2213             : !
    2214             :       real(r8) e, ex
    2215             : 
    2216             :       SAVE
    2217             : !
    2218             : !-----------------------------------------------------------------------
    2219             : !
    2220           0 :       E=(ALT-ZH)/H1
    2221           0 :       IF(E.GT.70._r8) GO TO 20
    2222           0 :       IF(E.LT.-70._r8) GO TO 10
    2223           0 :         EX=EXP(E)
    2224           0 :         CCOR=R/(1._r8+EX)
    2225           0 :         GO TO 50
    2226           0 :    10   CCOR=R
    2227           0 :         GO TO 50
    2228             :    20   CCOR=0._r8
    2229             :         GO TO 50
    2230             :    50 CONTINUE
    2231           0 :       CCOR=EXP(CCOR)
    2232             :        RETURN
    2233             :       END FUNCTION  CCOR
    2234             : 
    2235             : !================================================================================================
    2236             : 
    2237             :       BLOCK DATA GTD7BK
    2238             : !         
    2239             : !-----------------------------------------------------------------------
    2240             : !       NRLMSISE-00 13-APR-00   
    2241             : !-----------------------------------------------------------------------
    2242             : !
    2243             :       use shr_kind_mod, only : r8 => shr_kind_r8
    2244             :       implicit none 
    2245             : !
    2246             : !-------------------------------Commons---------------------------------
    2247             : !
    2248             :       real(r8) ptm, pdm
    2249             :       COMMON/LOWER7/PTM(10),PDM(10,8)
    2250             : 
    2251             :       real(r8) pavgm
    2252             :       COMMON/MAVG7/PAVGM(10)
    2253             : 
    2254             :       CHARACTER*4 ISDATE, ISTIME, NAME
    2255             :       COMMON/DATIM7/ISDATE(3),ISTIME(2),NAME(2)
    2256             :       DATA ISDATE/'13-A','PR-0','0   '/,ISTIME/'17:4','6:08'/
    2257             :       DATA NAME/'MSIS','E-00'/
    2258             : 
    2259             :       integer imr
    2260             :       COMMON/METSEL/IMR
    2261             :       DATA IMR/0/
    2262             : 
    2263             :       real(r8) pt1, pt2, pt3, pa1, pa2, pa3, &
    2264             :        pb1, pb2, pb3, pc1, pc2, pc3, &
    2265             :        pd1, pd2, pd3, pe1, pe2, pe3, &
    2266             :        pf1, pf2, pf3, pg1, pg2, pg3, &
    2267             :        ph1, ph2, ph3, pi1, pi2, pi3, &
    2268             :        pj1, pj2, pj3, pk1, pl1, pl2, &
    2269             :        pm1, pm2, pn1, pn2, po1, po2, &
    2270             :        pp1, pp2, pq1, pq2, pr1, pr2, &
    2271             :        ps1, ps2, pu1, pu2, pv1, pv2, &
    2272             :        pw1, pw2, px1, px2, py1, py2, &
    2273             :        pz1, pz2, paa1, paa2
    2274             :       COMMON/PARM7/PT1(50),PT2(50),PT3(50),PA1(50),PA2(50),PA3(50), &
    2275             :        PB1(50),PB2(50),PB3(50),PC1(50),PC2(50),PC3(50), &
    2276             :        PD1(50),PD2(50),PD3(50),PE1(50),PE2(50),PE3(50), &
    2277             :        PF1(50),PF2(50),PF3(50),PG1(50),PG2(50),PG3(50), &
    2278             :        PH1(50),PH2(50),PH3(50),PI1(50),PI2(50),PI3(50), &
    2279             :        PJ1(50),PJ2(50),PJ3(50),PK1(50),PL1(50),PL2(50), &
    2280             :        PM1(50),PM2(50),PN1(50),PN2(50),PO1(50),PO2(50), &
    2281             :        PP1(50),PP2(50),PQ1(50),PQ2(50),PR1(50),PR2(50), &
    2282             :        PS1(50),PS2(50),PU1(50),PU2(50),PV1(50),PV2(50), &
    2283             :        PW1(50),PW2(50),PX1(50),PX2(50),PY1(50),PY2(50), &
    2284             :        PZ1(50),PZ2(50),PAA1(50),PAA2(50)
    2285             : !         TEMPERATURE
    2286             :       DATA PT1/ &
    2287             :         9.86573E-01_r8, 1.62228E-02_r8, 1.55270E-02_r8,-1.04323E-01_r8,-3.75801E-03_r8, &
    2288             :        -1.18538E-03_r8,-1.24043E-01_r8, 4.56820E-03_r8, 8.76018E-03_r8,-1.36235E-01_r8, &
    2289             :        -3.52427E-02_r8, 8.84181E-03_r8,-5.92127E-03_r8,-8.61650E+00_r8, 0.00000E+00_r8, &
    2290             :         1.28492E-02_r8, 0.00000E+00_r8, 1.30096E+02_r8, 1.04567E-02_r8, 1.65686E-03_r8, &
    2291             :        -5.53887E-06_r8, 2.97810E-03_r8, 0.00000E+00_r8, 5.13122E-03_r8, 8.66784E-02_r8, &
    2292             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-7.27026E-06_r8, &
    2293             :         0.00000E+00_r8, 6.74494E+00_r8, 4.93933E-03_r8, 2.21656E-03_r8, 2.50802E-03_r8, &
    2294             :         0.00000E+00_r8, 0.00000E+00_r8,-2.08841E-02_r8,-1.79873E+00_r8, 1.45103E-03_r8, &
    2295             :         2.81769E-04_r8,-1.44703E-03_r8,-5.16394E-05_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2296             :         5.72562E-03_r8, 5.07493E-05_r8, 4.36148E-03_r8, 1.17863E-04_r8, 4.74364E-03_r8/
    2297             :       DATA PT2/ &
    2298             :         6.61278E-03_r8, 4.34292E-05_r8, 1.44373E-03_r8, 2.41470E-05_r8, 2.84426E-03_r8, &
    2299             :         8.56560E-04_r8, 2.04028E-03_r8, 0.00000E+00_r8,-3.15994E+03_r8,-2.46423E-03_r8, &
    2300             :         1.13843E-03_r8, 4.20512E-04_r8, 0.00000E+00_r8,-9.77214E+01_r8, 6.77794E-03_r8, &
    2301             :         5.27499E-03_r8, 1.14936E-03_r8, 0.00000E+00_r8,-6.61311E-03_r8,-1.84255E-02_r8, &
    2302             :        -1.96259E-02_r8, 2.98618E+04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2303             :         6.44574E+02_r8, 8.84668E-04_r8, 5.05066E-04_r8, 0.00000E+00_r8, 4.02881E+03_r8, &
    2304             :        -1.89503E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.21407E-04_r8, 2.06780E-03_r8, &
    2305             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2306             :        -1.20410E-02_r8,-3.63963E-03_r8, 9.92070E-05_r8,-1.15284E-04_r8,-6.33059E-05_r8, &
    2307             :        -6.05545E-01_r8, 8.34218E-03_r8,-9.13036E+01_r8, 3.71042E-04_r8, 0.00000E+00_r8/
    2308             :       DATA PT3/ &
    2309             :         4.19000E-04_r8, 2.70928E-03_r8, 3.31507E-03_r8,-4.44508E-03_r8,-4.96334E-03_r8, &
    2310             :        -1.60449E-03_r8, 3.95119E-03_r8, 2.48924E-03_r8, 5.09815E-04_r8, 4.05302E-03_r8, &
    2311             :         2.24076E-03_r8, 0.00000E+00_r8, 6.84256E-03_r8, 4.66354E-04_r8, 0.00000E+00_r8, &
    2312             :        -3.68328E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.46870E+02_r8, 0.00000E+00_r8, &
    2313             :         0.00000E+00_r8, 1.09501E-03_r8, 4.65156E-04_r8, 5.62583E-04_r8, 3.21596E+00_r8, &
    2314             :         6.43168E-04_r8, 3.14860E-03_r8, 3.40738E-03_r8, 1.78481E-03_r8, 9.62532E-04_r8, &
    2315             :         5.58171E-04_r8, 3.43731E+00_r8,-2.33195E-01_r8, 5.10289E-04_r8, 0.00000E+00_r8, &
    2316             :         0.00000E+00_r8,-9.25347E+04_r8, 0.00000E+00_r8,-1.99639E-03_r8, 0.00000E+00_r8, &
    2317             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2318             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2319             : !         HE DENSITY
    2320             :       DATA PA1/ &
    2321             :         1.09979E+00_r8,-4.88060E-02_r8,-1.97501E-01_r8,-9.10280E-02_r8,-6.96558E-03_r8, &
    2322             :         2.42136E-02_r8, 3.91333E-01_r8,-7.20068E-03_r8,-3.22718E-02_r8, 1.41508E+00_r8, &
    2323             :         1.68194E-01_r8, 1.85282E-02_r8, 1.09384E-01_r8,-7.24282E+00_r8, 0.00000E+00_r8, &
    2324             :         2.96377E-01_r8,-4.97210E-02_r8, 1.04114E+02_r8,-8.61108E-02_r8,-7.29177E-04_r8, &
    2325             :         1.48998E-06_r8, 1.08629E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.31090E-02_r8, &
    2326             :         1.12818E-01_r8,-5.75005E-02_r8,-1.29919E-02_r8,-1.78849E-02_r8,-2.86343E-06_r8, &
    2327             :         0.00000E+00_r8,-1.51187E+02_r8,-6.65902E-03_r8, 0.00000E+00_r8,-2.02069E-03_r8, &
    2328             :         0.00000E+00_r8, 0.00000E+00_r8, 4.32264E-02_r8,-2.80444E+01_r8,-3.26789E-03_r8, &
    2329             :         2.47461E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 9.82100E-02_r8, 1.22714E-01_r8, &
    2330             :        -3.96450E-02_r8, 0.00000E+00_r8,-2.76489E-03_r8, 0.00000E+00_r8, 1.87723E-03_r8/
    2331             :       DATA PA2/ &
    2332             :        -8.09813E-03_r8, 4.34428E-05_r8,-7.70932E-03_r8, 0.00000E+00_r8,-2.28894E-03_r8, &
    2333             :        -5.69070E-03_r8,-5.22193E-03_r8, 6.00692E-03_r8,-7.80434E+03_r8,-3.48336E-03_r8, &
    2334             :        -6.38362E-03_r8,-1.82190E-03_r8, 0.00000E+00_r8,-7.58976E+01_r8,-2.17875E-02_r8, &
    2335             :        -1.72524E-02_r8,-9.06287E-03_r8, 0.00000E+00_r8, 2.44725E-02_r8, 8.66040E-02_r8, &
    2336             :         1.05712E-01_r8, 3.02543E+04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2337             :        -6.01364E+03_r8,-5.64668E-03_r8,-2.54157E-03_r8, 0.00000E+00_r8, 3.15611E+02_r8, &
    2338             :        -5.69158E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8,-4.47216E-03_r8,-4.49523E-03_r8, &
    2339             :         4.64428E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2340             :         4.51236E-02_r8, 2.46520E-02_r8, 6.17794E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2341             :        -3.62944E-01_r8,-4.80022E-02_r8,-7.57230E+01_r8,-1.99656E-03_r8, 0.00000E+00_r8/
    2342             :       DATA PA3/ &
    2343             :        -5.18780E-03_r8,-1.73990E-02_r8,-9.03485E-03_r8, 7.48465E-03_r8, 1.53267E-02_r8, &
    2344             :         1.06296E-02_r8, 1.18655E-02_r8, 2.55569E-03_r8, 1.69020E-03_r8, 3.51936E-02_r8, &
    2345             :        -1.81242E-02_r8, 0.00000E+00_r8,-1.00529E-01_r8,-5.10574E-03_r8, 0.00000E+00_r8, &
    2346             :         2.10228E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.73255E+02_r8, 5.07833E-01_r8, &
    2347             :        -2.41408E-01_r8, 8.75414E-03_r8, 2.77527E-03_r8,-8.90353E-05_r8,-5.25148E+00_r8, &
    2348             :        -5.83899E-03_r8,-2.09122E-02_r8,-9.63530E-03_r8, 9.77164E-03_r8, 4.07051E-03_r8, &
    2349             :         2.53555E-04_r8,-5.52875E+00_r8,-3.55993E-01_r8,-2.49231E-03_r8, 0.00000E+00_r8, &
    2350             :         0.00000E+00_r8, 2.86026E+01_r8, 0.00000E+00_r8, 3.42722E-04_r8, 0.00000E+00_r8, &
    2351             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2352             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2353             : !         O DENSITY
    2354             :       DATA PB1/ &
    2355             :         1.02315E+00_r8,-1.59710E-01_r8,-1.06630E-01_r8,-1.77074E-02_r8,-4.42726E-03_r8, &
    2356             :         3.44803E-02_r8, 4.45613E-02_r8,-3.33751E-02_r8,-5.73598E-02_r8, 3.50360E-01_r8, &
    2357             :         6.33053E-02_r8, 2.16221E-02_r8, 5.42577E-02_r8,-5.74193E+00_r8, 0.00000E+00_r8, &
    2358             :         1.90891E-01_r8,-1.39194E-02_r8, 1.01102E+02_r8, 8.16363E-02_r8, 1.33717E-04_r8, &
    2359             :         6.54403E-06_r8, 3.10295E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 5.38205E-02_r8, &
    2360             :         1.23910E-01_r8,-1.39831E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8,-3.95915E-06_r8, &
    2361             :         0.00000E+00_r8,-7.14651E-01_r8,-5.01027E-03_r8, 0.00000E+00_r8,-3.24756E-03_r8, &
    2362             :         0.00000E+00_r8, 0.00000E+00_r8, 4.42173E-02_r8,-1.31598E+01_r8,-3.15626E-03_r8, &
    2363             :         1.24574E-03_r8,-1.47626E-03_r8,-1.55461E-03_r8, 6.40682E-02_r8, 1.34898E-01_r8, &
    2364             :        -2.42415E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 6.13666E-04_r8/
    2365             :       DATA PB2/ &
    2366             :        -5.40373E-03_r8, 2.61635E-05_r8,-3.33012E-03_r8, 0.00000E+00_r8,-3.08101E-03_r8, &
    2367             :        -2.42679E-03_r8,-3.36086E-03_r8, 0.00000E+00_r8,-1.18979E+03_r8,-5.04738E-02_r8, &
    2368             :        -2.61547E-03_r8,-1.03132E-03_r8, 1.91583E-04_r8,-8.38132E+01_r8,-1.40517E-02_r8, &
    2369             :        -1.14167E-02_r8,-4.08012E-03_r8, 1.73522E-04_r8,-1.39644E-02_r8,-6.64128E-02_r8, &
    2370             :        -6.85152E-02_r8,-1.34414E+04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2371             :         6.07916E+02_r8,-4.12220E-03_r8,-2.20996E-03_r8, 0.00000E+00_r8, 1.70277E+03_r8, &
    2372             :        -4.63015E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.25360E-03_r8,-2.96204E-03_r8, &
    2373             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2374             :         3.92786E-02_r8, 1.31186E-02_r8,-1.78086E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2375             :        -3.90083E-01_r8,-2.84741E-02_r8,-7.78400E+01_r8,-1.02601E-03_r8, 0.00000E+00_r8/
    2376             :       DATA PB3/ &
    2377             :        -7.26485E-04_r8,-5.42181E-03_r8,-5.59305E-03_r8, 1.22825E-02_r8, 1.23868E-02_r8, &
    2378             :         6.68835E-03_r8,-1.03303E-02_r8,-9.51903E-03_r8, 2.70021E-04_r8,-2.57084E-02_r8, &
    2379             :        -1.32430E-02_r8, 0.00000E+00_r8,-3.81000E-02_r8,-3.16810E-03_r8, 0.00000E+00_r8, &
    2380             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2381             :         0.00000E+00_r8,-9.05762E-04_r8,-2.14590E-03_r8,-1.17824E-03_r8, 3.66732E+00_r8, &
    2382             :        -3.79729E-04_r8,-6.13966E-03_r8,-5.09082E-03_r8,-1.96332E-03_r8,-3.08280E-03_r8, &
    2383             :        -9.75222E-04_r8, 4.03315E+00_r8,-2.52710E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2384             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2385             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2386             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2387             : !         N2 DENSITY
    2388             :       DATA PC1/ &
    2389             :         1.16112E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.33725E-02_r8, 0.00000E+00_r8, &
    2390             :         3.48637E-02_r8,-5.44368E-03_r8, 0.00000E+00_r8,-6.73940E-02_r8, 1.74754E-01_r8, &
    2391             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.74712E+02_r8, 0.00000E+00_r8, &
    2392             :         1.26733E-01_r8, 0.00000E+00_r8, 1.03154E+02_r8, 5.52075E-02_r8, 0.00000E+00_r8, &
    2393             :         0.00000E+00_r8, 8.13525E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.66784E-02_r8, &
    2394             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2395             :         0.00000E+00_r8,-2.50482E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2396             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.48894E-03_r8, &
    2397             :         6.16053E-04_r8,-5.79716E-04_r8, 2.95482E-03_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2398             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2399             :       DATA PC2/ &
    2400             :         0.00000E+00_r8, 2.47425E-05_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2401             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2402             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2403             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2404             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2405             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2406             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2407             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2408             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2409             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2410             :       DATA PC3/ &
    2411             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2412             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2413             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2414             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2415             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2416             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2417             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2418             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2419             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2420             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2421             : !         TLB
    2422             :       DATA PD1/ &
    2423             :         9.44846E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8,-3.08617E-02_r8, 0.00000E+00_r8, &
    2424             :        -2.44019E-02_r8, 6.48607E-03_r8, 0.00000E+00_r8, 3.08181E-02_r8, 4.59392E-02_r8, &
    2425             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.74712E+02_r8, 0.00000E+00_r8, &
    2426             :         2.13260E-02_r8, 0.00000E+00_r8,-3.56958E+02_r8, 0.00000E+00_r8, 1.82278E-04_r8, &
    2427             :         0.00000E+00_r8, 3.07472E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.66784E-02_r8, &
    2428             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2429             :         0.00000E+00_r8, 0.00000E+00_r8, 3.83054E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2430             :        -1.93065E-03_r8,-1.45090E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2431             :         0.00000E+00_r8,-1.23493E-03_r8, 1.36736E-03_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2432             :         3.71469E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2433             :       DATA PD2/ &
    2434             :         5.10250E-03_r8, 2.47425E-05_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2435             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2436             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2437             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2438             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2439             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2440             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2441             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2442             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2443             :         0.00000E+00_r8, 3.68756E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2444             :       DATA PD3/ &
    2445             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2446             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2447             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2448             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2449             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2450             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2451             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2452             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2453             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2454             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2455             : !         O2 DENSITY
    2456             :       DATA PE1/ &
    2457             :         1.38720E+00_r8, 1.44816E-01_r8, 0.00000E+00_r8, 6.07767E-02_r8, 0.00000E+00_r8, &
    2458             :         2.94777E-02_r8, 7.46900E-02_r8, 0.00000E+00_r8,-9.23822E-02_r8, 8.57342E-02_r8, &
    2459             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.38636E+01_r8, 0.00000E+00_r8, &
    2460             :         7.71653E-02_r8, 0.00000E+00_r8, 8.18751E+01_r8, 1.87736E-02_r8, 0.00000E+00_r8, &
    2461             :         0.00000E+00_r8, 1.49667E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.66784E-02_r8, &
    2462             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2463             :         0.00000E+00_r8,-3.67874E+02_r8, 5.48158E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2464             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2465             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2466             :         1.22631E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2467             :       DATA PE2/ &
    2468             :         8.17187E-03_r8, 3.71617E-05_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2469             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2470             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.10826E-03_r8, &
    2471             :        -3.13640E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2472             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2473             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2474             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2475             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2476             :        -7.35742E-02_r8,-5.00266E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2477             :         0.00000E+00_r8, 1.94965E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2478             :       DATA PE3/ &
    2479             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2480             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2481             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2482             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2483             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2484             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2485             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2486             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2487             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2488             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2489             : !         AR DENSITY
    2490             :       DATA PF1/ &
    2491             :         1.04761E+00_r8, 2.00165E-01_r8, 2.37697E-01_r8, 3.68552E-02_r8, 0.00000E+00_r8, &
    2492             :         3.57202E-02_r8,-2.14075E-01_r8, 0.00000E+00_r8,-1.08018E-01_r8,-3.73981E-01_r8, &
    2493             :         0.00000E+00_r8, 3.10022E-02_r8,-1.16305E-03_r8,-2.07596E+01_r8, 0.00000E+00_r8, &
    2494             :         8.64502E-02_r8, 0.00000E+00_r8, 9.74908E+01_r8, 5.16707E-02_r8, 0.00000E+00_r8, &
    2495             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.66784E-02_r8, &
    2496             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2497             :         0.00000E+00_r8, 3.46193E+02_r8, 1.34297E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2498             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-3.48509E-03_r8, &
    2499             :        -1.54689E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2500             :         1.47753E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2501             :       DATA PF2/ &
    2502             :         1.89320E-02_r8, 3.68181E-05_r8, 1.32570E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2503             :         3.59719E-03_r8, 7.44328E-03_r8,-1.00023E-03_r8,-6.50528E+03_r8, 0.00000E+00_r8, &
    2504             :         1.03485E-02_r8,-1.00983E-03_r8,-4.06916E-03_r8,-6.60864E+01_r8,-1.71533E-02_r8, &
    2505             :         1.10605E-02_r8, 1.20300E-02_r8,-5.20034E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2506             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2507             :        -2.62769E+03_r8, 7.13755E-03_r8, 4.17999E-03_r8, 0.00000E+00_r8, 1.25910E+04_r8, &
    2508             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.23595E-03_r8, 4.60217E-03_r8, &
    2509             :         5.71794E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2510             :        -3.18353E-02_r8,-2.35526E-02_r8,-1.36189E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2511             :         0.00000E+00_r8, 2.03522E-02_r8,-6.67837E+01_r8,-1.09724E-03_r8, 0.00000E+00_r8/
    2512             :       DATA PF3/ &
    2513             :        -1.38821E-02_r8, 1.60468E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2514             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.51574E-02_r8, &
    2515             :        -5.44470E-04_r8, 0.00000E+00_r8, 7.28224E-02_r8, 6.59413E-02_r8, 0.00000E+00_r8, &
    2516             :        -5.15692E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8,-3.70367E+03_r8, 0.00000E+00_r8, &
    2517             :         0.00000E+00_r8, 1.36131E-02_r8, 5.38153E-03_r8, 0.00000E+00_r8, 4.76285E+00_r8, &
    2518             :        -1.75677E-02_r8, 2.26301E-02_r8, 0.00000E+00_r8, 1.76631E-02_r8, 4.77162E-03_r8, &
    2519             :         0.00000E+00_r8, 5.39354E+00_r8, 0.00000E+00_r8,-7.51710E-03_r8, 0.00000E+00_r8, &
    2520             :         0.00000E+00_r8,-8.82736E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2521             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2522             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2523             : !          H DENSITY
    2524             :       DATA PG1/ &
    2525             :         1.26376E+00_r8,-2.14304E-01_r8,-1.49984E-01_r8, 2.30404E-01_r8, 2.98237E-02_r8, &
    2526             :         2.68673E-02_r8, 2.96228E-01_r8, 2.21900E-02_r8,-2.07655E-02_r8, 4.52506E-01_r8, &
    2527             :         1.20105E-01_r8, 3.24420E-02_r8, 4.24816E-02_r8,-9.14313E+00_r8, 0.00000E+00_r8, &
    2528             :         2.47178E-02_r8,-2.88229E-02_r8, 8.12805E+01_r8, 5.10380E-02_r8,-5.80611E-03_r8, &
    2529             :         2.51236E-05_r8,-1.24083E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.66784E-02_r8, &
    2530             :         1.58727E-01_r8,-3.48190E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.89885E-05_r8, &
    2531             :         0.00000E+00_r8, 1.53595E+02_r8,-1.68604E-02_r8, 0.00000E+00_r8, 1.01015E-02_r8, &
    2532             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.84552E-04_r8, &
    2533             :        -1.22181E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2534             :        -1.04927E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-5.91313E-03_r8/
    2535             :       DATA PG2/ &
    2536             :        -2.30501E-02_r8, 3.14758E-05_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.26956E-02_r8, &
    2537             :         8.35489E-03_r8, 3.10513E-04_r8, 0.00000E+00_r8, 3.42119E+03_r8,-2.45017E-03_r8, &
    2538             :        -4.27154E-04_r8, 5.45152E-04_r8, 1.89896E-03_r8, 2.89121E+01_r8,-6.49973E-03_r8, &
    2539             :        -1.93855E-02_r8,-1.48492E-02_r8, 0.00000E+00_r8,-5.10576E-02_r8, 7.87306E-02_r8, &
    2540             :         9.51981E-02_r8,-1.49422E+04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2541             :         2.65503E+02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2542             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 6.37110E-03_r8, 3.24789E-04_r8, &
    2543             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2544             :         6.14274E-02_r8, 1.00376E-02_r8,-8.41083E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2545             :         0.00000E+00_r8,-1.27099E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2546             :       DATA PG3/ &
    2547             :        -3.94077E-03_r8,-1.28601E-02_r8,-7.97616E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2548             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2549             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2550             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2551             :         0.00000E+00_r8,-6.71465E-03_r8,-1.69799E-03_r8, 1.93772E-03_r8, 3.81140E+00_r8, &
    2552             :        -7.79290E-03_r8,-1.82589E-02_r8,-1.25860E-02_r8,-1.04311E-02_r8,-3.02465E-03_r8, &
    2553             :         2.43063E-03_r8, 3.63237E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2554             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2555             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2556             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2557             : !          N DENSITY
    2558             :       DATA PH1/ &
    2559             :         7.09557E+01_r8,-3.26740E-01_r8, 0.00000E+00_r8,-5.16829E-01_r8,-1.71664E-03_r8, &
    2560             :         9.09310E-02_r8,-6.71500E-01_r8,-1.47771E-01_r8,-9.27471E-02_r8,-2.30862E-01_r8, &
    2561             :        -1.56410E-01_r8, 1.34455E-02_r8,-1.19717E-01_r8, 2.52151E+00_r8, 0.00000E+00_r8, &
    2562             :        -2.41582E-01_r8, 5.92939E-02_r8, 4.39756E+00_r8, 9.15280E-02_r8, 4.41292E-03_r8, &
    2563             :         0.00000E+00_r8, 8.66807E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.66784E-02_r8, &
    2564             :         1.58727E-01_r8, 9.74701E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2565             :         0.00000E+00_r8, 6.70217E+01_r8,-1.31660E-03_r8, 0.00000E+00_r8,-1.65317E-02_r8, &
    2566             :         0.00000E+00_r8, 0.00000E+00_r8, 8.50247E-02_r8, 2.77428E+01_r8, 4.98658E-03_r8, &
    2567             :         6.15115E-03_r8, 9.50156E-03_r8,-2.12723E-02_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2568             :        -2.38645E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.37380E-03_r8/
    2569             :       DATA PH2/ &
    2570             :        -8.41918E-03_r8, 2.80145E-05_r8, 7.12383E-03_r8, 0.00000E+00_r8,-1.66209E-02_r8, &
    2571             :         1.03533E-04_r8,-1.68898E-02_r8, 0.00000E+00_r8, 3.64526E+03_r8, 0.00000E+00_r8, &
    2572             :         6.54077E-03_r8, 3.69130E-04_r8, 9.94419E-04_r8, 8.42803E+01_r8,-1.16124E-02_r8, &
    2573             :        -7.74414E-03_r8,-1.68844E-03_r8, 1.42809E-03_r8,-1.92955E-03_r8, 1.17225E-01_r8, &
    2574             :        -2.41512E-02_r8, 1.50521E+04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2575             :         1.60261E+03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2576             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-3.54403E-04_r8,-1.87270E-02_r8, &
    2577             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2578             :         2.76439E-02_r8, 6.43207E-03_r8,-3.54300E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2579             :         0.00000E+00_r8,-2.80221E-02_r8, 8.11228E+01_r8,-6.75255E-04_r8, 0.00000E+00_r8/
    2580             :       DATA PH3/ &
    2581             :        -1.05162E-02_r8,-3.48292E-03_r8,-6.97321E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2582             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2583             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2584             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2585             :         0.00000E+00_r8,-1.45546E-03_r8,-1.31970E-02_r8,-3.57751E-03_r8,-1.09021E+00_r8, &
    2586             :        -1.50181E-02_r8,-7.12841E-03_r8,-6.64590E-03_r8,-3.52610E-03_r8,-1.87773E-02_r8, &
    2587             :        -2.22432E-03_r8,-3.93895E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2588             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2589             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2590             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2591             : !        HOT O DENSITY
    2592             :       DATA PI1/ &
    2593             :         6.04050E-02_r8, 1.57034E+00_r8, 2.99387E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2594             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.51018E+00_r8, &
    2595             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-8.61650E+00_r8, 1.26454E-02_r8, &
    2596             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2597             :         0.00000E+00_r8, 5.50878E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.66784E-02_r8, &
    2598             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2599             :         0.00000E+00_r8, 0.00000E+00_r8, 6.23881E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2600             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2601             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2602             :        -9.45934E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2603             :       DATA PI2/ &
    2604             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2605             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2606             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2607             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2608             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2609             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2610             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2611             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2612             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2613             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2614             :       DATA PI3/ &
    2615             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2616             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2617             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2618             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2619             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2620             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2621             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2622             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2623             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2624             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2625             : !          S PARAM  
    2626             :       DATA PJ1/ &
    2627             :         9.56827E-01_r8, 6.20637E-02_r8, 3.18433E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2628             :         3.94900E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8,-9.24882E-03_r8,-7.94023E-03_r8, &
    2629             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.74712E+02_r8, 0.00000E+00_r8, &
    2630             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2631             :         0.00000E+00_r8, 2.74677E-03_r8, 0.00000E+00_r8, 1.54951E-02_r8, 8.66784E-02_r8, &
    2632             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2633             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-6.99007E-04_r8, 0.00000E+00_r8, &
    2634             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2635             :         0.00000E+00_r8, 1.24362E-02_r8,-5.28756E-03_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2636             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2637             :       DATA PJ2/ &
    2638             :         0.00000E+00_r8, 2.47425E-05_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2639             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2640             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2641             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2642             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2643             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2644             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2645             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2646             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2647             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2648             :       DATA PJ3/ &
    2649             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2650             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2651             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2652             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2653             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2654             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2655             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2656             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2657             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2658             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2659             : !          TURBO
    2660             :       DATA PK1/ &
    2661             :         1.09930E+00_r8, 3.90631E+00_r8, 3.07165E+00_r8, 9.86161E-01_r8, 1.63536E+01_r8, &
    2662             :         4.63830E+00_r8, 1.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2663             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2664             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2665             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.93318E-02_r8, 1.18339E-01_r8, &
    2666             :         1.22732E+00_r8, 1.02669E-01_r8, 1.17681E+00_r8, 2.12185E+00_r8, 1.00000E+00_r8, &
    2667             :         1.00000E+00_r8, 1.08607E+00_r8, 1.34836E+00_r8, 1.10016E+00_r8, 7.34129E-01_r8, &
    2668             :         1.15241E+00_r8, 2.22784E+00_r8, 7.95907E-01_r8, 4.03601E+00_r8, 4.39732E+00_r8, &
    2669             :         1.23435E+02_r8,-4.52411E-02_r8, 1.68986E-06_r8, 7.44294E-01_r8, 1.03604E+00_r8, &
    2670             :         1.72783E+02_r8, 1.17681E+00_r8, 2.12185E+00_r8,-7.83697E-01_r8, 9.49154E-01_r8/
    2671             : !         LOWER BOUNDARY
    2672             :       DATA PTM/ &
    2673             :         1.04130E+03_r8, 3.86000E+02_r8, 1.95000E+02_r8, 1.66728E+01_r8, 2.13000E+02_r8, &
    2674             :         1.20000E+02_r8, 2.40000E+02_r8, 1.87000E+02_r8,-2.00000E+00_r8, 0.00000E+00_r8/
    2675             :       DATA PDM/ &
    2676             :         2.45600E+07_r8, 6.71072E-06_r8, 1.00000E+02_r8, 0.00000E+00_r8, 1.10000E+02_r8, &
    2677             :         1.00000E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2678             : !
    2679             :         8.59400E+10_r8, 1.00000E+00_r8, 1.05000E+02_r8,-8.00000E+00_r8, 1.10000E+02_r8, &
    2680             :         1.00000E+01_r8, 9.00000E+01_r8, 2.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2681             : !
    2682             :         2.81000E+11_r8, 0.00000E+00_r8, 1.05000E+02_r8, 2.80000E+01_r8, 2.89500E+01_r8, &
    2683             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2684             : !
    2685             :         3.30000E+10_r8, 2.68270E-01_r8, 1.05000E+02_r8, 1.00000E+00_r8, 1.10000E+02_r8, &
    2686             :         1.00000E+01_r8, 1.10000E+02_r8,-1.00000E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2687             : !
    2688             :         1.33000E+09_r8, 1.19615E-02_r8, 1.05000E+02_r8, 0.00000E+00_r8, 1.10000E+02_r8, &
    2689             :         1.00000E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2690             : !
    2691             :         1.76100E+05_r8, 1.00000E+00_r8, 9.50000E+01_r8,-8.00000E+00_r8, 1.10000E+02_r8, &
    2692             :         1.00000E+01_r8, 9.00000E+01_r8, 2.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2693             : !
    2694             :         1.00000E+07_r8, 1.00000E+00_r8, 1.05000E+02_r8,-8.00000E+00_r8, 1.10000E+02_r8, &
    2695             :         1.00000E+01_r8, 9.00000E+01_r8, 2.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2696             : !
    2697             :         1.00000E+06_r8, 1.00000E+00_r8, 1.05000E+02_r8,-8.00000E+00_r8, 5.50000E+02_r8, &
    2698             :         7.60000E+01_r8, 9.00000E+01_r8, 2.00000E+00_r8, 0.00000E+00_r8, 4.00000E+03_r8/
    2699             : !         TN1(2)
    2700             :       DATA PL1/ &
    2701             :         1.00858E+00_r8, 4.56011E-02_r8,-2.22972E-02_r8,-5.44388E-02_r8, 5.23136E-04_r8, &
    2702             :        -1.88849E-02_r8, 5.23707E-02_r8,-9.43646E-03_r8, 6.31707E-03_r8,-7.80460E-02_r8, &
    2703             :        -4.88430E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8,-7.60250E+00_r8, 0.00000E+00_r8, &
    2704             :        -1.44635E-02_r8,-1.76843E-02_r8,-1.21517E+02_r8, 2.85647E-02_r8, 0.00000E+00_r8, &
    2705             :         0.00000E+00_r8, 6.31792E-04_r8, 0.00000E+00_r8, 5.77197E-03_r8, 8.66784E-02_r8, &
    2706             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2707             :         0.00000E+00_r8,-8.90272E+03_r8, 3.30611E-03_r8, 3.02172E-03_r8, 0.00000E+00_r8, &
    2708             :        -2.13673E-03_r8,-3.20910E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.76034E-03_r8, &
    2709             :         2.82487E-03_r8,-2.97592E-04_r8,-4.21534E-03_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2710             :         8.96456E-03_r8, 0.00000E+00_r8,-1.08596E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2711             :       DATA PL2/ &
    2712             :         5.57917E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2713             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2714             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2715             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2716             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2717             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2718             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2719             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2720             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2721             :         0.00000E+00_r8, 9.65405E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2722             : !         TN1(3)
    2723             :       DATA PM1/ &
    2724             :         9.39664E-01_r8, 8.56514E-02_r8,-6.79989E-03_r8, 2.65929E-02_r8,-4.74283E-03_r8, &
    2725             :         1.21855E-02_r8,-2.14905E-02_r8, 6.49651E-03_r8,-2.05477E-02_r8,-4.24952E-02_r8, &
    2726             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.19148E+01_r8, 0.00000E+00_r8, &
    2727             :         1.18777E-02_r8,-7.28230E-02_r8,-8.15965E+01_r8, 1.73887E-02_r8, 0.00000E+00_r8, &
    2728             :         0.00000E+00_r8, 0.00000E+00_r8,-1.44691E-02_r8, 2.80259E-04_r8, 8.66784E-02_r8, &
    2729             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2730             :         0.00000E+00_r8, 2.16584E+02_r8, 3.18713E-03_r8, 7.37479E-03_r8, 0.00000E+00_r8, &
    2731             :        -2.55018E-03_r8,-3.92806E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.89757E-03_r8, &
    2732             :        -1.33549E-03_r8, 1.02661E-03_r8, 3.53775E-04_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2733             :        -9.17497E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2734             :       DATA PM2/ &
    2735             :         3.56082E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2736             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2737             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2738             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2739             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2740             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2741             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2742             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2743             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2744             :         0.00000E+00_r8,-1.00902E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2745             : !         TN1(4)
    2746             :       DATA PN1/ &
    2747             :         9.85982E-01_r8,-4.55435E-02_r8, 1.21106E-02_r8, 2.04127E-02_r8,-2.40836E-03_r8, &
    2748             :         1.11383E-02_r8,-4.51926E-02_r8, 1.35074E-02_r8,-6.54139E-03_r8, 1.15275E-01_r8, &
    2749             :         1.28247E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8,-5.30705E+00_r8, 0.00000E+00_r8, &
    2750             :        -3.79332E-02_r8,-6.24741E-02_r8, 7.71062E-01_r8, 2.96315E-02_r8, 0.00000E+00_r8, &
    2751             :         0.00000E+00_r8, 0.00000E+00_r8, 6.81051E-03_r8,-4.34767E-03_r8, 8.66784E-02_r8, &
    2752             :         1.58727E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2753             :         0.00000E+00_r8, 1.07003E+01_r8,-2.76907E-03_r8, 4.32474E-04_r8, 0.00000E+00_r8, &
    2754             :         1.31497E-03_r8,-6.47517E-04_r8, 0.00000E+00_r8,-2.20621E+01_r8,-1.10804E-03_r8, &
    2755             :        -8.09338E-04_r8, 4.18184E-04_r8, 4.29650E-03_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2756             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2757             :       DATA PN2/ &
    2758             :        -4.04337E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2759             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2760             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-9.52550E-04_r8, &
    2761             :         8.56253E-04_r8, 4.33114E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2762             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.21223E-03_r8, &
    2763             :         2.38694E-04_r8, 9.15245E-04_r8, 1.28385E-03_r8, 8.67668E-04_r8,-5.61425E-06_r8, &
    2764             :         1.04445E+00_r8, 3.41112E+01_r8, 0.00000E+00_r8,-8.40704E-01_r8,-2.39639E+02_r8, &
    2765             :         7.06668E-01_r8,-2.05873E+01_r8,-3.63696E-01_r8, 2.39245E+01_r8, 0.00000E+00_r8, &
    2766             :        -1.06657E-03_r8,-7.67292E-04_r8, 1.54534E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2767             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2768             : !         TN1(5) TN2(1)
    2769             :       DATA PO1/ &
    2770             :         1.00320E+00_r8, 3.83501E-02_r8,-2.38983E-03_r8, 2.83950E-03_r8, 4.20956E-03_r8, &
    2771             :         5.86619E-04_r8, 2.19054E-02_r8,-1.00946E-02_r8,-3.50259E-03_r8, 4.17392E-02_r8, &
    2772             :        -8.44404E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 4.96949E+00_r8, 0.00000E+00_r8, &
    2773             :        -7.06478E-03_r8,-1.46494E-02_r8, 3.13258E+01_r8,-1.86493E-03_r8, 0.00000E+00_r8, &
    2774             :        -1.67499E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 5.12686E-04_r8, 8.66784E-02_r8, &
    2775             :         1.58727E-01_r8,-4.64167E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2776             :         4.37353E-03_r8,-1.99069E+02_r8, 0.00000E+00_r8,-5.34884E-03_r8, 0.00000E+00_r8, &
    2777             :         1.62458E-03_r8, 2.93016E-03_r8, 2.67926E-03_r8, 5.90449E+02_r8, 0.00000E+00_r8, &
    2778             :         0.00000E+00_r8,-1.17266E-03_r8,-3.58890E-04_r8, 8.47001E-02_r8, 1.70147E-01_r8, &
    2779             :         0.00000E+00_r8, 0.00000E+00_r8, 1.38673E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2780             :       DATA PO2/ &
    2781             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2782             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2783             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.60571E-03_r8, &
    2784             :         6.28078E-04_r8, 5.05469E-05_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2785             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.57829E-03_r8, &
    2786             :        -4.00855E-04_r8, 5.04077E-05_r8,-1.39001E-03_r8,-2.33406E-03_r8,-4.81197E-04_r8, &
    2787             :         1.46758E+00_r8, 6.20332E+00_r8, 0.00000E+00_r8, 3.66476E-01_r8,-6.19760E+01_r8, &
    2788             :         3.09198E-01_r8,-1.98999E+01_r8, 0.00000E+00_r8,-3.29933E+02_r8, 0.00000E+00_r8, &
    2789             :        -1.10080E-03_r8,-9.39310E-05_r8, 1.39638E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2790             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2791             : !          TN2(2)
    2792             :       DATA PP1/ &
    2793             :         9.81637E-01_r8,-1.41317E-03_r8, 3.87323E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2794             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-3.58707E-02_r8, &
    2795             :        -8.63658E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.02226E+00_r8, 0.00000E+00_r8, &
    2796             :        -8.69424E-03_r8,-1.91397E-02_r8, 8.76779E+01_r8, 4.52188E-03_r8, 0.00000E+00_r8, &
    2797             :         2.23760E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2798             :         0.00000E+00_r8,-7.07572E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2799             :        -4.11210E-03_r8, 3.50060E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2800             :         0.00000E+00_r8, 0.00000E+00_r8,-8.36657E-03_r8, 1.61347E+01_r8, 0.00000E+00_r8, &
    2801             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2802             :         0.00000E+00_r8, 0.00000E+00_r8,-1.45130E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2803             :       DATA PP2/ &
    2804             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2805             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2806             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.24152E-03_r8, &
    2807             :         6.43365E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2808             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.33255E-03_r8, &
    2809             :         2.42657E-03_r8, 1.60666E-03_r8,-1.85728E-03_r8,-1.46874E-03_r8,-4.79163E-06_r8, &
    2810             :         1.22464E+00_r8, 3.53510E+01_r8, 0.00000E+00_r8, 4.49223E-01_r8,-4.77466E+01_r8, &
    2811             :         4.70681E-01_r8, 8.41861E+00_r8,-2.88198E-01_r8, 1.67854E+02_r8, 0.00000E+00_r8, &
    2812             :         7.11493E-04_r8, 6.05601E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2813             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2814             : !          TN2(3)
    2815             :       DATA PQ1/ &
    2816             :         1.00422E+00_r8,-7.11212E-03_r8, 5.24480E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2817             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-5.28914E-02_r8, &
    2818             :        -2.41301E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.12219E+01_r8,-1.03830E-02_r8, &
    2819             :        -3.28077E-03_r8, 1.65727E-02_r8, 1.68564E+00_r8,-6.68154E-03_r8, 0.00000E+00_r8, &
    2820             :         1.45155E-02_r8, 0.00000E+00_r8, 8.42365E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2821             :         0.00000E+00_r8,-4.34645E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.16780E-02_r8, &
    2822             :         0.00000E+00_r8,-1.38459E+02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2823             :         0.00000E+00_r8, 0.00000E+00_r8, 7.04573E-03_r8,-4.73204E+01_r8, 0.00000E+00_r8, &
    2824             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2825             :         0.00000E+00_r8, 0.00000E+00_r8, 1.08767E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2826             :       DATA PQ2/ &
    2827             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2828             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-8.08279E-03_r8, &
    2829             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 5.21769E-04_r8, &
    2830             :        -2.27387E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2831             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.26769E-03_r8, &
    2832             :         3.16901E-03_r8, 4.60316E-04_r8,-1.01431E-04_r8, 1.02131E-03_r8, 9.96601E-04_r8, &
    2833             :         1.25707E+00_r8, 2.50114E+01_r8, 0.00000E+00_r8, 4.24472E-01_r8,-2.77655E+01_r8, &
    2834             :         3.44625E-01_r8, 2.75412E+01_r8, 0.00000E+00_r8, 7.94251E+02_r8, 0.00000E+00_r8, &
    2835             :         2.45835E-03_r8, 1.38871E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2836             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2837             : !          TN2(4) TN3(1)
    2838             :       DATA PR1/ &
    2839             :         1.01890E+00_r8,-2.46603E-02_r8, 1.00078E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2840             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-6.70977E-02_r8, &
    2841             :        -4.02286E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.29466E+01_r8,-7.47019E-03_r8, &
    2842             :         2.26580E-03_r8, 2.63931E-02_r8, 3.72625E+01_r8,-6.39041E-03_r8, 0.00000E+00_r8, &
    2843             :         9.58383E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2844             :         0.00000E+00_r8,-1.85291E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2845             :         0.00000E+00_r8, 1.39717E+02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2846             :         0.00000E+00_r8, 0.00000E+00_r8, 9.19771E-03_r8,-3.69121E+02_r8, 0.00000E+00_r8, &
    2847             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2848             :         0.00000E+00_r8, 0.00000E+00_r8,-1.57067E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2849             :       DATA PR2/ &
    2850             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2851             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-7.07265E-03_r8, &
    2852             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.92953E-03_r8, &
    2853             :        -2.77739E-03_r8,-4.40092E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2854             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.47280E-03_r8, &
    2855             :         2.95035E-04_r8,-1.81246E-03_r8, 2.81945E-03_r8, 4.27296E-03_r8, 9.78863E-04_r8, &
    2856             :         1.40545E+00_r8,-6.19173E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-7.93632E+01_r8, &
    2857             :         4.44643E-01_r8,-4.03085E+02_r8, 0.00000E+00_r8, 1.15603E+01_r8, 0.00000E+00_r8, &
    2858             :         2.25068E-03_r8, 8.48557E-04_r8,-2.98493E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2859             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2860             : !          TN3(2)
    2861             :       DATA PS1/ &
    2862             :         9.75801E-01_r8, 3.80680E-02_r8,-3.05198E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2863             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.85575E-02_r8, &
    2864             :         5.04057E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.76046E+02_r8, 1.44594E-02_r8, &
    2865             :        -1.48297E-03_r8,-3.68560E-03_r8, 3.02185E+01_r8,-3.23338E-03_r8, 0.00000E+00_r8, &
    2866             :         1.53569E-02_r8, 0.00000E+00_r8,-1.15558E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2867             :         0.00000E+00_r8, 4.89620E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.00616E-02_r8, &
    2868             :        -8.21324E-03_r8,-1.57757E+02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2869             :         0.00000E+00_r8, 0.00000E+00_r8, 6.63564E-03_r8, 4.58410E+01_r8, 0.00000E+00_r8, &
    2870             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2871             :         0.00000E+00_r8, 0.00000E+00_r8,-2.51280E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2872             :       DATA PS2/ &
    2873             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2874             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 9.91215E-03_r8, &
    2875             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-8.73148E-04_r8, &
    2876             :        -1.29648E-03_r8,-7.32026E-05_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2877             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-4.68110E-03_r8, &
    2878             :        -4.66003E-03_r8,-1.31567E-03_r8,-7.39390E-04_r8, 6.32499E-04_r8,-4.65588E-04_r8, &
    2879             :        -1.29785E+00_r8,-1.57139E+02_r8, 0.00000E+00_r8, 2.58350E-01_r8,-3.69453E+01_r8, &
    2880             :         4.10672E-01_r8, 9.78196E+00_r8,-1.52064E-01_r8,-3.85084E+03_r8, 0.00000E+00_r8, &
    2881             :        -8.52706E-04_r8,-1.40945E-03_r8,-7.26786E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2882             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2883             : !          TN3(3)
    2884             :       DATA PU1/ &
    2885             :         9.60722E-01_r8, 7.03757E-02_r8,-3.00266E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2886             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.22671E-02_r8, &
    2887             :         4.10423E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.63070E+02_r8, 1.06073E-02_r8, &
    2888             :         5.40747E-04_r8, 7.79481E-03_r8, 1.44908E+02_r8, 1.51484E-04_r8, 0.00000E+00_r8, &
    2889             :         1.97547E-02_r8, 0.00000E+00_r8,-1.41844E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2890             :         0.00000E+00_r8, 5.77884E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 9.74319E-03_r8, &
    2891             :         0.00000E+00_r8,-2.88015E+03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2892             :         0.00000E+00_r8, 0.00000E+00_r8,-4.44902E-03_r8,-2.92760E+01_r8, 0.00000E+00_r8, &
    2893             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2894             :         0.00000E+00_r8, 0.00000E+00_r8, 2.34419E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2895             :       DATA PU2/ &
    2896             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2897             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 5.36685E-03_r8, &
    2898             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-4.65325E-04_r8, &
    2899             :        -5.50628E-04_r8, 3.31465E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2900             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.06179E-03_r8, &
    2901             :        -3.08575E-03_r8,-7.93589E-04_r8,-1.08629E-04_r8, 5.95511E-04_r8,-9.05050E-04_r8, &
    2902             :         1.18997E+00_r8, 4.15924E+01_r8, 0.00000E+00_r8,-4.72064E-01_r8,-9.47150E+02_r8, &
    2903             :         3.98723E-01_r8, 1.98304E+01_r8, 0.00000E+00_r8, 3.73219E+03_r8, 0.00000E+00_r8, &
    2904             :        -1.50040E-03_r8,-1.14933E-03_r8,-1.56769E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2905             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2906             : !          TN3(4)
    2907             :       DATA PV1/ &
    2908             :         1.03123E+00_r8,-7.05124E-02_r8, 8.71615E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2909             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-3.82621E-02_r8, &
    2910             :        -9.80975E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.89286E+01_r8, 9.57341E-03_r8, &
    2911             :         0.00000E+00_r8, 0.00000E+00_r8, 8.66153E+01_r8, 7.91938E-04_r8, 0.00000E+00_r8, &
    2912             :         0.00000E+00_r8, 0.00000E+00_r8, 4.68917E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2913             :         0.00000E+00_r8, 7.86638E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 9.90827E-03_r8, &
    2914             :         0.00000E+00_r8, 6.55573E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2915             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-4.00200E+01_r8, 0.00000E+00_r8, &
    2916             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2917             :         0.00000E+00_r8, 0.00000E+00_r8, 7.07457E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2918             :       DATA PV2/ &
    2919             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2920             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 5.72268E-03_r8, &
    2921             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.04970E-04_r8, &
    2922             :         1.21560E-03_r8,-8.05579E-06_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2923             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.49941E-03_r8, &
    2924             :        -4.57256E-04_r8,-1.59311E-04_r8, 2.96481E-04_r8,-1.77318E-03_r8,-6.37918E-04_r8, &
    2925             :         1.02395E+00_r8, 1.28172E+01_r8, 0.00000E+00_r8, 1.49903E-01_r8,-2.63818E+01_r8, &
    2926             :         0.00000E+00_r8, 4.70628E+01_r8,-2.22139E-01_r8, 4.82292E-02_r8, 0.00000E+00_r8, &
    2927             :        -8.67075E-04_r8,-5.86479E-04_r8, 5.32462E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2928             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2929             : !          TN3(5) SURFACE TEMP TSL
    2930             :       DATA PW1/ &
    2931             :         1.00828E+00_r8,-9.10404E-02_r8,-2.26549E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2932             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-2.32420E-02_r8, &
    2933             :        -9.08925E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.36105E+01_r8, 0.00000E+00_r8, &
    2934             :         0.00000E+00_r8, 0.00000E+00_r8,-1.24957E+01_r8,-5.87939E-03_r8, 0.00000E+00_r8, &
    2935             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2936             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2937             :         0.00000E+00_r8, 2.79765E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2938             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.01237E+03_r8, 0.00000E+00_r8, &
    2939             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2940             :         0.00000E+00_r8, 0.00000E+00_r8,-1.75553E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2941             :       DATA PW2/ &
    2942             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2943             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2944             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.29699E-03_r8, &
    2945             :         1.26659E-03_r8, 2.68402E-04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2946             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.17894E-03_r8, &
    2947             :         1.48746E-03_r8, 1.06478E-04_r8, 1.34743E-04_r8,-2.20939E-03_r8,-6.23523E-04_r8, &
    2948             :         6.36539E-01_r8, 1.13621E+01_r8, 0.00000E+00_r8,-3.93777E-01_r8, 2.38687E+03_r8, &
    2949             :         0.00000E+00_r8, 6.61865E+02_r8,-1.21434E-01_r8, 9.27608E+00_r8, 0.00000E+00_r8, &
    2950             :         1.68478E-04_r8, 1.24892E-03_r8, 1.71345E-03_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2951             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2952             : !          TGN3(2) SURFACE GRAD TSLG
    2953             :       DATA PX1/ &
    2954             :         1.57293E+00_r8,-6.78400E-01_r8, 6.47500E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2955             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-7.62974E-02_r8, &
    2956             :        -3.60423E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 1.28358E+02_r8, 0.00000E+00_r8, &
    2957             :         0.00000E+00_r8, 0.00000E+00_r8, 4.68038E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2958             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2959             :         0.00000E+00_r8,-1.67898E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2960             :         0.00000E+00_r8, 2.90994E+04_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2961             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.15706E+01_r8, 0.00000E+00_r8, &
    2962             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2963             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2964             :       DATA PX2/ &
    2965             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2966             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2967             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2968             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2969             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2970             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2971             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2972             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2973             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2974             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2975             : !          TGN2(1) TGN1(2)
    2976             :       DATA PY1/ &
    2977             :         8.60028E-01_r8, 3.77052E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2978             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.17570E+00_r8, &
    2979             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 7.77757E-03_r8, 0.00000E+00_r8, &
    2980             :         0.00000E+00_r8, 0.00000E+00_r8, 1.01024E+02_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2981             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2982             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2983             :         0.00000E+00_r8, 6.54251E+02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2984             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2985             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2986             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    2987             :       DATA PY2/ &
    2988             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2989             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2990             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2991             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2992             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.56959E-02_r8, &
    2993             :         1.91001E-02_r8, 3.15971E-02_r8, 1.00982E-02_r8,-6.71565E-03_r8, 2.57693E-03_r8, &
    2994             :         1.38692E+00_r8, 2.82132E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.81511E+02_r8, &
    2995             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2996             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    2997             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    2998             : !          TGN3(1) TGN2(2)
    2999             :       DATA PZ1/ &
    3000             :         1.06029E+00_r8,-5.25231E-02_r8, 3.73034E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3001             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.31072E-02_r8, &
    3002             :        -3.88409E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8,-1.65295E+02_r8,-2.13801E-01_r8, &
    3003             :        -4.38916E-02_r8,-3.22716E-01_r8,-8.82393E+01_r8, 1.18458E-01_r8, 0.00000E+00_r8, &
    3004             :        -4.35863E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3005             :         0.00000E+00_r8,-1.19782E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3006             :         0.00000E+00_r8, 2.62229E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3007             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8,-5.37443E+01_r8, 0.00000E+00_r8, &
    3008             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3009             :         0.00000E+00_r8, 0.00000E+00_r8,-4.55788E-01_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    3010             :       DATA PZ2/ &
    3011             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3012             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3013             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 3.84009E-02_r8, &
    3014             :         3.96733E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3015             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 5.05494E-02_r8, &
    3016             :         7.39617E-02_r8, 1.92200E-02_r8,-8.46151E-03_r8,-1.34244E-02_r8, 1.96338E-02_r8, &
    3017             :         1.50421E+00_r8, 1.88368E+01_r8, 0.00000E+00_r8, 0.00000E+00_r8,-5.13114E+01_r8, &
    3018             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3019             :         5.11923E-02_r8, 3.61225E-02_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3020             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 2.00000E+00_r8/
    3021             : !          SEMIANNUAL MULT SAM
    3022             :       DATA PAA1/ &
    3023             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3024             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3025             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3026             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3027             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3028             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3029             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3030             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3031             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, &
    3032             :         1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8, 1.00000E+00_r8/
    3033             :       DATA PAA2/ &
    3034             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3035             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3036             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3037             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3038             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3039             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3040             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3041             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3042             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, &
    3043             :         0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8, 0.00000E+00_r8/
    3044             : !         MIDDLE ATMOSPHERE AVERAGES
    3045             :       DATA PAVGM/ &
    3046             :         2.61000E+02_r8, 2.64000E+02_r8, 2.29000E+02_r8, 2.17000E+02_r8, 2.17000E+02_r8, &
    3047             :         2.23000E+02_r8, 2.86760E+02_r8,-2.93940E+00_r8, 2.50000E+00_r8, 0.00000E+00_r8/
    3048             : 
    3049             :       END BLOCK DATA GTD7BK
    3050             : 
    3051             : !================================================================================================
    3052             : 

Generated by: LCOV version 1.14