standard WRF version 3.0.1.1
[wrffire.git] / wrfv2_fire / phys / module_ra_rrtm.F
blobe12e164177af237cec55b079425608093ad7c821
2 MODULE module_ra_rrtm
4 ! Parameters
6       INTEGER, PRIVATE :: IDATA
7       INTEGER, PARAMETER :: MG=16 
8       INTEGER, PARAMETER :: NBANDS=16
9       INTEGER, PARAMETER :: NGPT=140
10       INTEGER, PARAMETER :: NG1=8
11       INTEGER, PARAMETER :: NG2=14
12       INTEGER, PARAMETER :: NG3=16
13       INTEGER, PARAMETER :: NG4=14
14       INTEGER, PARAMETER :: NG5=16 
15       INTEGER, PARAMETER :: NG6=8
16       INTEGER, PARAMETER :: NG7=12
17       INTEGER, PARAMETER :: NG8=8
18       INTEGER, PARAMETER :: NG9=12
19       INTEGER, PARAMETER :: NG10=6 
20       INTEGER, PARAMETER :: NG11=8
21       INTEGER, PARAMETER :: NG12=8
22       INTEGER, PARAMETER :: NG13=4
23       INTEGER, PARAMETER :: NG14=2
24       INTEGER, PARAMETER :: NG15=2
25       INTEGER, PARAMETER :: NG16=2
26       INTEGER, PARAMETER :: MAXINPX=35
27       INTEGER, PARAMETER :: MAXXSEC=4
29       INTEGER, PARAMETER :: NMOL = 6
30       REAL, PARAMETER :: ONEMINUS = 1. - 1.E-6
32 ! var
34       REAL    , SAVE    :: FLUXFAC
35       INTEGER , SAVE    :: NLAYERS
37 ! data 1
39       REAL,SAVE ::  abscoefL1(5,13,MG),    abscoefH1(5,13:59,MG),   &
40                     SELFREF1(10,MG)
41       REAL,SAVE ::  abscoefL2(5,13,MG),    abscoefH2(5,13:59,MG),   &
42                     SELFREF2(10,MG)
43       REAL,SAVE ::  abscoefL3(10,5,13,MG), abscoefH3(5,5,13:59,MG), &
44                     SELFREF3(10,MG)
45       REAL,SAVE ::  abscoefL4(9,5,13,MG),  abscoefH4(6,5,13:59,MG), &
46                     SELFREF4(10,MG)
47       REAL,SAVE ::  abscoefL5(9,5,13,MG),  abscoefH5(5,5,13:59,MG), &
48                     SELFREF5(10,MG)
49       REAL,SAVE ::  abscoefL6(5,13,MG),    SELFREF6(10,MG)
50       REAL,SAVE ::  abscoefL7(9,5,13,MG),  abscoefH7(5,13:59,MG),   &
51                     SELFREF7(10,MG)
52       REAL,SAVE ::  abscoefL8(5,7,MG),     abscoefH8(5,7:59,MG),    &
53                     SELFREF8(10,MG)
54       REAL,SAVE ::  abscoefL9(11,5,13,MG), abscoefH9(5,13:59,MG),   &
55                     SELFREF9(10,MG)
56       REAL,SAVE ::  abscoefL10(5,13,MG),   abscoefH10(5,13:59,MG)  
57       REAL,SAVE ::  abscoefL11(5,13,MG),   abscoefH11(5,13:59,MG),  &
58                     SELFREF11(10,MG)
59       REAL,SAVE ::  abscoefL12(9,5,13,MG), SELFREF12(10,MG)
60       REAL,SAVE ::  abscoefL13(9,5,13,MG), SELFREF13(10,MG)
61       REAL,SAVE ::  abscoefL14(5,13,MG),   abscoefH14(5,13:59,MG),  &
62                     SELFREF14(10,MG)
63       REAL,SAVE ::  abscoefL15(9,5,13,MG), SELFREF15(10,MG)
64       REAL,SAVE ::  abscoefL16(9,5,13,MG), SELFREF16(10,MG)
67 ! data 2
69       INTEGER,SAVE ::  NGM(MG*NBANDS), NGC(NBANDS), NGS(NBANDS),       &
70                     NGN(NGPT), NGB(NGPT)
71       REAL,SAVE ::  WT(MG)
73 ! data 3
75       REAL,SAVE ::  FRACREFA1(MG), FRACREFB1(MG), FORREF1(MG)   
76       REAL,SAVE ::  FRACREFA2(MG,13), FRACREFB2(MG), FORREF2(MG)
77       REAL,SAVE ::  FRACREFA3(MG,10), FRACREFB3(MG,5)        
78       REAL,SAVE ::  FORREF3(MG), ABSN2OA3(MG), ABSN2OB3(MG)   
79       REAL,SAVE ::  FRACREFA4(MG,9), FRACREFB4(MG,6)        
80       REAL,SAVE ::  FRACREFA5(MG,9), FRACREFB5(MG,5), CCL45(MG) 
81       REAL,SAVE ::  FRACREFA6(MG), ABSCO26(MG), CFC11ADJ6(MG), CFC126(MG)    
82       REAL,SAVE ::  FRACREFA7(MG,9), FRACREFB7(MG), ABSCO27(MG)        
83       REAL,SAVE ::  FRACREFA8(MG), FRACREFB8(MG), ABSCO2A8(MG), ABSCO2B8(MG)
84       REAL,SAVE ::  ABSN2OA8(MG), ABSN2OB8(MG), CFC128(MG), CFC22ADJ8(MG)  
85       REAL,SAVE ::  FRACREFA9(MG,9), FRACREFB9(MG), ABSN2O9(3*MG)
86       REAL,SAVE ::  FRACREFA10(MG), FRACREFB10(MG)        
87       REAL,SAVE ::  FRACREFA11(MG), FRACREFB11(MG)        
88       REAL,SAVE ::  FRACREFA12(MG,9)        
89       REAL,SAVE ::  FRACREFA13(MG,9)        
90       REAL,SAVE ::  FRACREFA14(MG), FRACREFB14(MG)
91       REAL,SAVE ::  FRACREFA15(MG,9)
92       REAL,SAVE ::  FRACREFA16(MG,9)
94 ! data 4
96       INTEGER,SAVE :: NXMOL, IXINDX(MAXINPX)
98 ! data 5 
100       REAL,SAVE    :: WAVENUM1(NBANDS),WAVENUM2(NBANDS),DELWAVE(NBANDS)
102 ! data 6
104       INTEGER,SAVE :: NG(NBANDS),NSPA(NBANDS),NSPB(NBANDS)
105       REAL,   SAVE :: HEATFAC
106       REAL,   SAVE :: PREF(59),PREFLOG(59),TREF(59)
108 ! data 7 
110       REAL,   SAVE :: TOTPLNK(181,NBANDS), TOTPLK16(181)
112 ! data
114       REAL,    SAVE :: TAU(0:5000),TF(0:5000),TRANS(0:5000)
116       REAL,    SAVE :: ABSA1(5*13,NG1), ABSB1(5*(59-13+1),NG1),         &
117                        SELFREFC1(10,NG1), FORREFC1(NG1)
118       REAL,    SAVE :: ABSA2(5*13,NG2), ABSB2(5*(59-13+1),NG2),         &
119                        SELFREFC2(10,NG2), FORREFC2(NG2)
120       REAL,    SAVE :: ABSA3(10*5*13,NG3), ABSB3(5*5*(59-13+1),NG3),    &     
121                        SELFREFC3(10,NG3), FORREFC3(NG3),                &
122                        ABSN2OAC3(NG3), ABSN2OBC3(NG3)        
123       REAL,    SAVE :: ABSA4(9*5*13,NG4), ABSB4(6*5*(59-13+1),NG4),     &
124                        SELFREFC4(10,NG4)        
125       REAL,    SAVE :: ABSA5(9*5*13,NG5), ABSB5(5*5*(59-13+1),NG5),     &
126                        SELFREFC5(10,NG5), CCL4C5(NG5)        
127       REAL,    SAVE :: ABSA6(5*13,NG6), SELFREFC6(10,NG6),              &        
128                        ABSCO2C6(NG6), CFC11ADJC6(NG6), CFC12C6(NG6)  
129       REAL,    SAVE :: ABSA7(9*5*13,NG7), ABSB7(5*(59-13+1),NG7),       &  
130                        SELFREFC7(10,NG7), ABSCO2C7(NG7)        
131       REAL,    SAVE :: ABSA8(5*7,NG8), ABSB8(5*(59-7+1),NG8),           &
132                        SELFREFC8(10,NG8),                               &
133                        ABSCO2AC8(NG8), ABSCO2BC8(NG8),                  &
134                        ABSN2OAC8(NG8), ABSN2OBC8(NG8),                  &       
135                        CFC12C8(NG8), CFC22ADJC8(NG8)      
136       REAL,    SAVE :: ABSA9(11*5*13,NG9), ABSB9(5*(59-13+1),NG9),      &
137                        SELFREFC9(10,NG9), ABSN2OC9(3*NG9)
138       REAL,    SAVE :: ABSA10(5*13,NG10), ABSB10(5*(59-13+1),NG10)
139       REAL,    SAVE :: ABSA11(5*13,NG11), ABSB11(5*(59-13+1),NG11),     &
140                        SELFREFC11(10,NG11)
141       REAL,    SAVE :: ABSA12(9*5*13,NG12), SELFREFC12(10,NG12)
142       REAL,    SAVE :: ABSA13(9*5*13,NG13), SELFREFC13(10,NG13)
143       REAL,    SAVE :: ABSA14(5*13,NG14), ABSB14(5*(59-13+1),NG14),    &
144                        SELFREFC14(10,NG14)
145       REAL,    SAVE :: ABSA15(9*5*13,NG15), SELFREFC15(10,NG15)
146       REAL,    SAVE :: ABSA16(9*5*13,NG16), SELFREFC16(10,NG16)
148       REAL,    SAVE :: FRACREFAC1(NG1), FRACREFBC1(NG1)
149       REAL,    SAVE :: FRACREFAC2(NG2,13), FRACREFBC2(NG2)
150       REAL,    SAVE :: FRACREFAC3(NG3,10), FRACREFBC3(NG3,5)
151       REAL,    SAVE :: FRACREFAC4(NG4,9), FRACREFBC4(NG4,6)
152       REAL,    SAVE :: FRACREFAC5(NG5,9), FRACREFBC5(NG5,5)      
153       REAL,    SAVE :: FRACREFAC6(NG6)                              
154       REAL,    SAVE :: FRACREFAC7(NG7,9), FRACREFBC7(NG7)    
155       REAL,    SAVE :: FRACREFAC8(NG8), FRACREFBC8(NG8)  
156       REAL,    SAVE :: FRACREFAC9(NG9,9), FRACREFBC9(NG9)      
157       REAL,    SAVE :: FRACREFAC10(NG10), FRACREFBC10(NG10)       
158       REAL,    SAVE :: FRACREFAC11(NG11), FRACREFBC11(NG11)  
159       REAL,    SAVE :: FRACREFAC12(NG12,9)                     
160       REAL,    SAVE :: FRACREFAC13(NG13,9)           
161       REAL,    SAVE :: FRACREFAC14(NG14), FRACREFBC14(NG14)    
162       REAL,    SAVE :: FRACREFAC15(NG15,9)                      
163       REAL,    SAVE :: FRACREFAC16(NG16,9)                 
164       
165       REAL,    SAVE :: CORR1(0:200),CORR2(0:200)
166       REAL,    SAVE :: BPADE
167       REAL,    SAVE :: RWGT(MG*NBANDS)
169 !----------------------------------------------------------------------------
171 ! start data 2
172                                                                                  
173 !     Arrays for the g-point reduction from 256 to 140 for the 16 LW bands:      
174 !     This mapping from 256 to 140 points has been carefully selected to         
175 !     minimize the effect on the resulting fluxes and cooling rates, and         
176 !     caution should be used if the mapping is modified.                         
177 !                                                                                
178 !     NGPT    The total number of new g-points                                   
179 !     NGC     The number of new g-points in each band                            
180 !     NGM     The index of each new g-point relative to the original             
181 !             16 g-points for each band.                                         
182 !     NGN     The number of original g-points that are combined to make          
183 !             each new g-point in each band.                                     
184 !     NGB     The band index for each new g-point.                               
185 !     WT      RRTM weights for 16 g-points.                                      
186                                                                                  
187 ! Data Statements                                                                
188       DATA NGC  /8,14,16,14,16,8,12,8,12,6,8,8,4,2,2,2/                          
189       DATA NGS  /8,22,38,52,68,76,88,96,108,114,122,130,134,136,138,140/         
190       DATA NGM  /1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8, &             ! Band 1            
191                  1,2,3,4,5,6,7,8,9,10,11,12,13,13,14,14, &      ! Band 2            
192                  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, &      ! Band 3            
193                  1,2,3,4,5,6,7,8,9,10,11,12,13,14,14,14, &      ! Band 4            
194                  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, &      ! Band 5            
195                  1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8, &             ! Band 6            
196                  1,1,2,2,3,4,5,6,7,8,9,10,11,11,12,12, &        ! Band 7            
197                  1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8, &             ! Band 8            
198                  1,2,3,4,5,6,7,8,9,9,10,10,11,11,12,12, &       ! Band 9            
199                  1,1,2,2,3,3,4,4,5,5,5,5,6,6,6,6, &             ! Band 10           
200                  1,2,3,3,4,4,5,5,6,6,7,7,7,8,8,8, &             ! Band 11           
201                  1,2,3,4,5,5,6,6,7,7,7,7,8,8,8,8, &             ! Band 12           
202                  1,1,1,2,2,2,3,3,3,3,4,4,4,4,4,4, &             ! Band 13           
203                  1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2, &             ! Band 14           
204                  1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2, &             ! Band 15           
205                  1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2/               ! Band 16           
206       DATA NGN  /2,2,2,2,2,2,2,2, &                             ! Band 1            
207                  1,1,1,1,1,1,1,1,1,1,1,1,2,2, &                 ! Band 2            
208                  16*1, &                                        ! Band 3            
209                  1,1,1,1,1,1,1,1,1,1,1,1,1,3, &                 ! Band 4            
210                  16*1, &                                        ! Band 5            
211                  2,2,2,2,2,2,2,2, &                             ! Band 6            
212                  2,2,1,1,1,1,1,1,1,1,2,2, &                     ! Band 7            
213                  2,2,2,2,2,2,2,2, &                             ! Band 8            
214                  1,1,1,1,1,1,1,1,2,2,2,2, &                     ! Band 9            
215                  2,2,2,2,4,4, &                                 ! Band 10           
216                  1,1,2,2,2,2,3,3, &                             ! Band 11           
217                  1,1,1,1,2,2,4,4, &                             ! Band 12           
218                  3,3,4,6, &                                     ! Band 13           
219                  8,8, &                                         ! Band 14           
220                  8,8, &                                         ! Band 15           
221                  8,8/                                           ! Band 16           
222       DATA NGB  /8*1, &                                         ! Band 1            
223                  14*2, &                                        ! Band 2            
224                  16*3, &                                        ! Band 3            
225                  14*4, &                                        ! Band 4            
226                  16*5, &                                        ! Band 5            
227                  8*6, &                                         ! Band 6            
228                  12*7, &                                        ! Band 7            
229                  8*8, &                                         ! Band 8            
230                  12*9, &                                        ! Band 9            
231                  6*10, &                                        ! Band 10           
232                  8*11, &                                        ! Band 11           
233                  8*12, &                                        ! Band 12           
234                  4*13, &                                        ! Band 13           
235                  2*14, &                                        ! Band 14           
236                  2*15, &                                        ! Band 15           
237                  2*16/                                       ! Band 16           
238       DATA WT/ &                                                                  
239            0.1527534276,0.1491729617,0.1420961469,0.1316886544, &                   
240            0.1181945205,0.1019300893,0.0832767040,0.0626720116, &                   
241            0.0424925,0.0046269894,0.0038279891,0.0030260086, &                      
242            0.0022199750,0.0014140010,0.000533,0.000075/                          
245 ! end of data 2
247 !-----------------------------------------------------------------------
249 ! start data 3
251                                                                                  
252 ! Data
254       DATA FRACREFA1/ &                                                            
255           0.08452097,0.17952873,0.16214369,0.13602182, &                            
256           0.12760490,0.10302561,0.08392423,0.06337652, &                            
257           0.04206551,0.00487497,0.00410743,0.00344421, &                            
258           0.00285731,0.00157327,0.00080648,0.00012406/                           
259       DATA FRACREFB1/ &                                                            
260           0.15492001,0.17384727,0.15165100,0.12675308, &                            
261           0.10986247,0.09006091,0.07584465,0.05990077, &                            
262           0.04113461,0.00438638,0.00374754,0.00313924, &                            
263           0.00234381,0.00167167,0.00062744,0.00010889/                           
264                                                                                  
265       DATA FORREF1/   &                                                            
266          -4.50470E-02,-1.18908E-01,-7.21730E-02,-2.83862E-02, &                     
267          -3.01961E-02,-1.56877E-02,-1.53684E-02,-1.29135E-02, &                     
268          -1.27963E-02,-1.81742E-03, 4.40008E-05, 1.05260E-02, &                     
269           2.17290E-02, 1.65571E-02, 7.60751E-02, 1.47405E-01/                    
271                                                                                  
272 ! Data                                                                           
273                                                                                  
274 !     The ith set of reference fractions are from the ith reference              
275 !     pressure level.                                                            
277       DATA FRACREFA2/ &
278           0.18068060,0.16803175,0.15140158,0.12221480, 0.10240850,0.09330297,0.07518960,0.05611294, &
279           0.03781487,0.00387192,0.00321285,0.00244440, 0.00179546,0.00107704,0.00038798,0.00005060, &
280           0.17927621,0.16731168,0.15129538,0.12328085, 0.10243484,0.09354796,0.07538418,0.05633071, &
281           0.03810832,0.00398347,0.00320262,0.00250029, 0.00178666,0.00111127,0.00039438,0.00005169, &
282           0.17762886,0.16638555,0.15115446,0.12470623, 0.10253213,0.09383459,0.07560240,0.05646568, &
283           0.03844077,0.00409142,0.00322521,0.00254918, 0.00179296,0.00113652,0.00040169,0.00005259, &
284           0.17566043,0.16539773,0.15092199,0.12571971, 0.10340609,0.09426189,0.07559051,0.05678188, &
285           0.03881499,0.00414102,0.00328551,0.00258795, 0.00181648,0.00115145,0.00040969,0.00005357, &
286           0.17335825,0.16442548,0.15070701,0.12667464, 0.10452303,0.09450833,0.07599410,0.05706393, &
287           0.03910370,0.00417880,0.00335256,0.00261708, 0.00185491,0.00116627,0.00041759,0.00005464, &
288           0.17082544,0.16321516,0.15044247,0.12797612, 0.10574646,0.09470057,0.07647423,0.05738756, &
289           0.03935621,0.00423789,0.00342651,0.00264549, 0.00190188,0.00118281,0.00042592,0.00005583, &
290           0.16809277,0.16193336,0.15013184,0.12937409, 0.10720784,0.09485368,0.07692636,0.05771774, &
291           0.03966988,0.00427754,0.00349696,0.00268946, 0.00193536,0.00120222,0.00043462,0.00005712, &
292           0.16517997,0.16059248,0.14984852,0.13079269, 0.10865030,0.09492947,0.07759736,0.05812201, &
293           0.03997169,0.00432356,0.00355308,0.00274031, 0.00197243,0.00122401,0.00044359,0.00005849, &
294           0.16209179,0.15912023,0.14938223,0.13198245, 0.11077233,0.09487948,0.07831636,0.05863440, &
295           0.04028239,0.00436804,0.00360407,0.00279885, 0.00200364,0.00124861,0.00045521,0.00005996, &
296           0.15962425,0.15789343,0.14898103,0.13275230, 0.11253940,0.09503502,0.07884382,0.05908009, &
297           0.04053524,0.00439971,0.00364269,0.00284965, 0.00202758,0.00127076,0.00046408,0.00006114, &
298           0.15926200,0.15770932,0.14891729,0.13283882, 0.11276010,0.09507311,0.07892222,0.05919230, &
299           0.04054824,0.00440833,0.00365575,0.00286459, 0.00203786,0.00128405,0.00046504,0.00006146, &
300           0.15926351,0.15770483,0.14891177,0.13279966, 0.11268171,0.09515216,0.07890341,0.05924807, &
301           0.04052851,0.00440870,0.00365425,0.00286878, 0.00205747,0.00128916,0.00046589,0.00006221, &
302           0.15937765,0.15775780,0.14892603,0.13273248, 0.11252731,0.09521657,0.07885858,0.05927679, &
303           0.04050184,0.00440285,0.00365748,0.00286791, 0.00207507,0.00129193,0.00046679,0.00006308/
304 !     From P = 0.432 mb.                                                         
305       DATA FRACREFB2/ &                                                             
306           0.17444289,0.16467269,0.15021490,0.12460902, &                         
307           0.10400643,0.09481928,0.07590704,0.05752856, &                         
308           0.03931715,0.00428572,0.00349352,0.00278938, &                         
309           0.00203448,0.00130037,0.00051560,0.00006255/                           
310                                                                                  
311       DATA FORREF2/ &                                                               
312          -2.34550E-03,-8.42698E-03,-2.01816E-02,-5.66701E-02, &                  
313          -8.93189E-02,-6.37487E-02,-4.56455E-02,-4.41417E-02, &                  
314          -4.48605E-02,-4.74696E-02,-5.16648E-02,-5.63099E-02, &                  
315          -4.74781E-02,-3.84704E-02,-2.49905E-02, 2.02114E-03/                    
316                                                                                  
317 ! Data                                                                           
318                                                                                  
319       DATA FRACREFA3/ &                                                             
320 !     From P = 1053.6 mb.                                                        
321           0.15116400,0.14875700,0.14232300,0.13234501, 0.11881600,0.10224100,0.08345580,0.06267490, &                         
322           0.04250650,0.00462650,0.00382259,0.00302600, 0.00222004,0.00141397,0.00053379,0.00007421, &                         
323           0.15266000,0.14888400,0.14195900,0.13179500, 0.11842700,0.10209000,0.08336130,0.06264370, &                         
324           0.04247660,0.00461946,0.00381536,0.00302601, 0.00222004,0.00141397,0.00053302,0.00007498, &                         
325           0.15282799,0.14903000,0.14192399,0.13174300, 0.11835300,0.10202700,0.08329830,0.06264830, &                         
326           0.04246910,0.00460242,0.00381904,0.00301573, 0.00222004,0.00141397,0.00053379,0.00007421, &                         
327           0.15298399,0.14902800,0.14193401,0.13173500, 0.11833300,0.10195800,0.08324730,0.06264770, &                         
328           0.04246490,0.00460489,0.00381123,0.00301893, 0.00221093,0.00141397,0.00053379,0.00007421, &                         
329           0.15307599,0.14907201,0.14198899,0.13169800, 0.11827300,0.10192300,0.08321600,0.06263490, &                         
330           0.04245600,0.00460846,0.00380836,0.00301663, 0.00221402,0.00141167,0.00052807,0.00007376, &                         
331           0.15311401,0.14915401,0.14207301,0.13167299, 0.11819300,0.10188900,0.08318760,0.06261960, &                         
332           0.04243890,0.00461584,0.00380929,0.00300815, 0.00221736,0.00140588,0.00052776,0.00007376, &                         
333           0.15316001,0.14925499,0.14213000,0.13170999, 0.11807700,0.10181400,0.08317400,0.06260300, &                         
334           0.04242720,0.00461520,0.00381381,0.00301285, 0.00220275,0.00140371,0.00052776,0.00007376, &                         
335           0.15321200,0.14940999,0.14222500,0.13164200, 0.11798200,0.10174500,0.08317500,0.06253640, &                         
336           0.04243130,0.00461724,0.00381534,0.00300320, 0.00220091,0.00140364,0.00052852,0.00007300, &                         
337           0.15312800,0.14973100,0.14234400,0.13168900, 0.11795200,0.10156100,0.08302990,0.06252240, &                         
338           0.04240980,0.00461035,0.00381381,0.00300176, 0.00220160,0.00140284,0.00052774,0.00007376, &                         
339           0.15292500,0.14978001,0.14242400,0.13172600, 0.11798800,0.10156400,0.08303050,0.06251670, &                         
340           0.04240970,0.00461302,0.00381452,0.00300250, 0.00220126,0.00140324,0.00052850,0.00007300/                           
341       DATA FRACREFB3/ &                                                             
342 !     From P = 64.1 mb.                                                          
343           0.16340201,0.15607700,0.14601400,0.13182700, &                         
344           0.11524700,0.09666570,0.07825360,0.05849780, &                         
345           0.03949650,0.00427980,0.00353719,0.00279303, &                         
346           0.00204788,0.00130139,0.00049055,0.00006904, &                         
347           0.15762900,0.15494700,0.14659800,0.13267800, &                         
348           0.11562700,0.09838360,0.07930420,0.05962700, &                         
349           0.04036360,0.00438053,0.00361463,0.00285723, &                         
350           0.00208345,0.00132135,0.00050528,0.00008003, &                         
351           0.15641500,0.15394500,0.14633600,0.13180400, &                         
352           0.11617100,0.09924170,0.08000510,0.06021420, &                         
353           0.04082730,0.00441694,0.00365364,0.00287723, &                         
354           0.00210914,0.00135784,0.00054651,0.00008003, &                         
355           0.15482700,0.15286300,0.14392500,0.13244100, &                         
356           0.11712000,0.09994920,0.08119200,0.06104360, &                         
357           0.04135600,0.00446685,0.00368377,0.00290767, &                         
358           0.00215445,0.00142865,0.00056142,0.00008003, &                         
359           0.15975100,0.15653500,0.14214399,0.12892200, &                         
360           0.11508400,0.09906020,0.08087940,0.06078190, &                         
361           0.04140530,0.00452724,0.00374558,0.00295328, &                         
362           0.00218509,0.00138644,0.00056018,0.00008003/                           
363                                                                                  
364       DATA ABSN2OA3/ &                                                              
365           1.50387E-01,2.91407E-01,6.28803E-01,9.65619E-01, &                     
366           1.15054E-00,2.23424E-00,1.83392E-00,1.39033E-00, &                     
367           4.28457E-01,2.73502E-01,1.84307E-01,1.61325E-01, &                     
368           7.66314E-02,1.33862E-01,6.71196E-07,1.59293E-06/                       
369       DATA ABSN2OB3/ &                                                              
370           9.37044E-05,1.23318E-03,7.91720E-03,5.33005E-02, &                     
371           1.72343E-01,4.29571E-01,1.01288E+00,3.83863E+00, &                     
372           1.15312E+01,1.08383E+00,2.24847E+00,1.51268E+00, &                     
373           3.33177E-01,7.82102E-01,3.44631E-01,1.61039E-03/                       
374       DATA FORREF3/ &                                                               
375           1.76842E-04, 1.77913E-04, 1.25186E-04, 1.07912E-04, &                  
376           1.05217E-04, 7.48726E-05, 1.11701E-04, 7.68921E-05, &                  
377           9.87242E-05, 9.85711E-05, 6.16557E-05,-1.61291E-05, &                  
378          -1.26794E-04,-1.19011E-04,-2.67814E-04, 6.95005E-05/                    
379                                                                                  
380 ! Data                                                                           
381                                                                                  
382       DATA FRACREFA4/ &                                                             
383 !     From P =                                                                   
384           0.15579100,0.14918099,0.14113800,0.13127001, &                         
385           0.11796300,0.10174300,0.08282370,0.06238150, &                         
386           0.04213440,0.00458968,0.00377949,0.00298736, &                         
387           0.00220743,0.00140644,0.00053024,0.00007459, &                         
388           0.15292799,0.15004000,0.14211500,0.13176700, &                         
389           0.11821100,0.10186300,0.08288040,0.06241390, &                         
390           0.04220720,0.00459006,0.00377919,0.00298743, &                         
391           0.00220743,0.00140644,0.00053024,0.00007459, &                         
392           0.14386199,0.15125300,0.14650001,0.13377000, &                         
393           0.11895900,0.10229400,0.08312110,0.06239520, &                         
394           0.04225560,0.00459428,0.00378865,0.00298860, &                         
395           0.00220743,0.00140644,0.00053024,0.00007459, &                         
396           0.14359100,0.14561599,0.14479300,0.13740200, &                         
397           0.12150100,0.10315400,0.08355480,0.06247240, &                         
398           0.04230980,0.00459916,0.00378373,0.00300063, &                         
399           0.00221111,0.00140644,0.00053024,0.00007459, &                         
400           0.14337599,0.14451601,0.14238000,0.13520500, &                         
401           0.12354200,0.10581200,0.08451810,0.06262440, &                         
402           0.04239590,0.00460297,0.00378701,0.00300466, &                         
403           0.00221899,0.00141020,0.00053024,0.00007459, &                         
404           0.14322001,0.14397401,0.14117201,0.13401900, &                         
405           0.12255500,0.10774100,0.08617650,0.06296420, &                         
406           0.04249590,0.00463406,0.00378241,0.00302037, &                         
407           0.00221583,0.00141103,0.00053814,0.00007991, &                         
408           0.14309500,0.14364301,0.14043900,0.13348100, &                         
409           0.12211600,0.10684700,0.08820590,0.06374610, &                         
410           0.04264730,0.00464231,0.00384022,0.00303427, &                         
411           0.00221825,0.00140943,0.00055564,0.00007991, &                         
412           0.15579100,0.14918099,0.14113800,0.13127001, &                         
413           0.11796300,0.10174300,0.08282370,0.06238150, &                         
414           0.04213440,0.00458968,0.00377949,0.00298736, &                         
415           0.00220743,0.00140644,0.00053024,0.00007459, &                         
416           0.15937001,0.15159500,0.14242800,0.13078900, &                         
417           0.11671300,0.10035700,0.08143450,0.06093850, &                         
418           0.04105320,0.00446233,0.00369844,0.00293784, &                         
419           0.00216425,0.00143403,0.00054571,0.00007991/                           
420       DATA FRACREFB4/ &                                                             
421 !     From P = 1.17 mb.                                                          
422           0.15558299,0.14930600,0.14104301,0.13124099, &                         
423           0.11792900,0.10159200,0.08314130,0.06240450, &                         
424           0.04217020,0.00459313,0.00379798,0.00299835, &                         
425           0.00218950,0.00140615,0.00053010,0.00007457, &                         
426           0.15592700,0.14918999,0.14095700,0.13115700, &                         
427           0.11788900,0.10158000,0.08313780,0.06240240, &                         
428           0.04217000,0.00459313,0.00379798,0.00299835, &                         
429           0.00218950,0.00140615,0.00053010,0.00007457, &                         
430           0.15949000,0.15014900,0.14162201,0.13080800, &                         
431           0.11713500,0.10057100,0.08170080,0.06128110, &                         
432           0.04165600,0.00459202,0.00379835,0.00299717, &                         
433           0.00218958,0.00140616,0.00053010,0.00007457, &                         
434           0.15967900,0.15038200,0.14196999,0.13074800, &                         
435           0.11701700,0.10053000,0.08160790,0.06122690, &                         
436           0.04128310,0.00456598,0.00379486,0.00299457, &                         
437           0.00219016,0.00140619,0.00053011,0.00007456, &                         
438           0.15989800,0.15057300,0.14207700,0.13068600, &                         
439           0.11682900,0.10053900,0.08163610,0.06121870, &                         
440           0.04121690,0.00449061,0.00371235,0.00294207, &                         
441           0.00217778,0.00139877,0.00053011,0.00007455, &                         
442           0.15950100,0.15112500,0.14199100,0.13071300, &                         
443           0.11680800,0.10054600,0.08179050,0.06120910, &                         
444           0.04126050,0.00444324,0.00366843,0.00289369, &                         
445           0.00211550,0.00134746,0.00050874,0.00007863/                           
446                                                                                  
447 ! Data                                                                           
448                                                                                  
449       DATA FRACREFA5/ &                                                             
450 !     From P = 387.6 mb.                                                         
451           0.13966499,0.14138900,0.13763399,0.13076700, &                         
452           0.12299100,0.10747700,0.08942000,0.06769200, &                         
453           0.04587610,0.00501173,0.00415809,0.00328398, &                         
454           0.00240015,0.00156222,0.00059104,0.00008323, &                         
455           0.13958199,0.14332899,0.13785399,0.13205400, &                         
456           0.12199700,0.10679600,0.08861080,0.06712320, &                         
457           0.04556030,0.00500863,0.00416315,0.00328629, &                         
458           0.00240023,0.00156220,0.00059104,0.00008323, &                         
459           0.13907100,0.14250501,0.13889600,0.13297300, &                         
460           0.12218700,0.10683800,0.08839260,0.06677310, &                         
461           0.04538570,0.00495402,0.00409863,0.00328219, &                         
462           0.00240805,0.00156266,0.00059104,0.00008323, &                         
463           0.13867700,0.14190100,0.13932300,0.13327099, &                         
464           0.12280800,0.10692500,0.08844510,0.06658510, &                         
465           0.04519340,0.00492276,0.00408832,0.00323856, &                         
466           0.00239289,0.00155698,0.00059104,0.00008323, &                         
467           0.13845000,0.14158800,0.13929300,0.13295600, &                         
468           0.12348300,0.10736700,0.08859480,0.06650610, &                         
469           0.04498230,0.00491335,0.00406968,0.00322901, &                         
470           0.00234666,0.00155235,0.00058813,0.00008323, &                         
471           0.13837101,0.14113200,0.13930500,0.13283101, &                         
472           0.12349200,0.10796400,0.08890490,0.06646480, &                         
473           0.04485990,0.00489554,0.00405264,0.00320313, &                         
474           0.00234742,0.00151159,0.00058438,0.00008253, &                         
475           0.13834500,0.14093500,0.13896500,0.13262001, &                         
476           0.12326900,0.10828900,0.08950050,0.06674610, &                         
477           0.04476560,0.00489624,0.00400962,0.00317423, &                         
478           0.00233479,0.00148249,0.00058590,0.00008253, &                         
479           0.13831300,0.14069000,0.13871400,0.13247600, &                         
480           0.12251400,0.10831300,0.08977090,0.06776920, &                         
481           0.04498390,0.00484111,0.00398948,0.00316069, &                         
482           0.00229741,0.00150104,0.00058608,0.00008253, &                         
483           0.14027201,0.14420401,0.14215700,0.13446601, &                         
484           0.12303700,0.10596100,0.08650370,0.06409570, &                         
485           0.04312310,0.00471110,0.00393954,0.00310850, &                         
486           0.00229588,0.00146366,0.00058194,0.00008253/                           
487       DATA FRACREFB5/ &                                                             
488 !     From P = 1.17 mb.                                                          
489           0.14339100,0.14358699,0.13935301,0.13306700, &                         
490           0.12135700,0.10590600,0.08688240,0.06553220, &                         
491           0.04446740,0.00483580,0.00399413,0.00316225, &                         
492           0.00233007,0.00149135,0.00056246,0.00008059, &                         
493           0.14330500,0.14430299,0.14053699,0.13355300, &                         
494           0.12151200,0.10529100,0.08627630,0.06505230, &                         
495           0.04385850,0.00476555,0.00395010,0.00313878, &                         
496           0.00232273,0.00149354,0.00056246,0.00008059, &                         
497           0.14328399,0.14442700,0.14078601,0.13390100, &                         
498           0.12132600,0.10510600,0.08613660,0.06494630, &                         
499           0.04381310,0.00475378,0.00394166,0.00313076, &                         
500           0.00231235,0.00149159,0.00056301,0.00008059, &                         
501           0.14326900,0.14453100,0.14114200,0.13397101, &                         
502           0.12127200,0.10493400,0.08601380,0.06483360, &                         
503           0.04378900,0.00474655,0.00393549,0.00312583, &                         
504           0.00230686,0.00148433,0.00056502,0.00008059, &                         
505           0.14328900,0.14532700,0.14179000,0.13384600, &                         
506           0.12093700,0.10461500,0.08573010,0.06461340, &                         
507           0.04366570,0.00473087,0.00392539,0.00311238, &                         
508           0.00229865,0.00147572,0.00056517,0.00007939/                           
509                                                                                  
510       DATA CCL45/ &                                                                 
511            26.1407,  53.9776,  63.8085,  36.1701, &                              
512            15.4099, 10.23116,  4.82948,  5.03836, &                              
513            1.75558,0.,0.,0., &                                                   
514            0.,0.,0.,0./                                                          
515                                                                                  
516 ! Data                                                                           
517                                                                                  
518       DATA FRACREFA6/ &                                                             
519 !     From P = 706 mb.                                                           
520           0.13739009,0.14259538,0.14033118,0.13547136, &                         
521           0.12569460,0.11028396,0.08626066,0.06245148, &                         
522           0.04309394,0.00473551,0.00403920,0.00321695, &                         
523           0.00232470,0.00147662,0.00056095,0.00007373/                           
524                                                                                  
525       DATA CFC11ADJ6/ &                                                             
526            0.,  0., 36.7627,  150.757,   &                                      
527            81.4109, 74.9112, 56.9325, 49.3226, &                                 
528            57.1074, 66.1202, 109.557, 89.0562, &                                 
529            149.865, 196.140, 258.393, 80.9923/                                   
530       DATA CFC126/ &                                                                
531            62.8368, 43.2626, 26.7549, 22.2487, &                                 
532            23.5029, 34.8323, 26.2335, 23.2306, &                                 
533            18.4062, 13.9534, 22.6268, 24.2604, &                                 
534            30.0088, 26.3634, 15.8237, 57.5050/                                   
535       DATA ABSCO26/ &                                                               
536            7.44852E-05, 6.29208E-05, 7.34031E-05, 6.65218E-05, &                 
537            7.87511E-05, 1.22489E-04, 3.39785E-04, 9.33040E-04, &                 
538            1.54323E-03, 4.07220E-04, 4.34332E-04, 8.76418E-05, &                 
539            9.80381E-05, 3.51680E-05, 5.31766E-05, 1.01542E-05/                   
540                                                                                  
541 ! Data                                                                           
542                                                                                  
543       DATA FRACREFA7/ &                                                             
544           0.16461779, 0.14889984, 0.14233345, 0.13156526, &                      
545           0.11679733, 0.09988949, 0.08078653, 0.06006384, &                      
546           0.04028391, 0.00435899, 0.00359173, 0.00281707, &                      
547           0.00206767, 0.00135012, 0.00050720, 0.00007146, &                      
548           0.16442357, 0.14944240, 0.14245804, 0.13111183, &                      
549           0.11688625, 0.09983791, 0.08085148, 0.05993948, &                      
550           0.04028057, 0.00435939, 0.00358708, 0.00284036, &                      
551           0.00208869, 0.00133256, 0.00049260, 0.00006931, &                      
552           0.16368519, 0.15018989, 0.14262174, 0.13084342, &                      
553           0.11682195, 0.09996257, 0.08074036, 0.05985692, &                      
554           0.04045362, 0.00436208, 0.00358257, 0.00287122, &                      
555           0.00211004, 0.00133804, 0.00049260, 0.00006931, &                      
556           0.16274056, 0.15133780, 0.14228874, 0.13081114, &                      
557           0.11688486, 0.09979610, 0.08073687, 0.05996741, &                      
558           0.04040616, 0.00439869, 0.00368910, 0.00293041, &                      
559           0.00211604, 0.00133536, 0.00049260, 0.00006931, &                      
560           0.16176532, 0.15207882, 0.14226955, 0.13079646, &                      
561           0.11688191, 0.09966998, 0.08066384, 0.06020275, &                      
562           0.04047901, 0.00446696, 0.00377456, 0.00294410, &                      
563           0.00211082, 0.00133536, 0.00049260, 0.00006931, &                      
564           0.15993737, 0.15305527, 0.14259829, 0.13078023, &                      
565           0.11686983, 0.09980131, 0.08058286, 0.06031430, &                      
566           0.04082833, 0.00450509, 0.00377574, 0.00294823, &                      
567           0.00210977, 0.00133302, 0.00049260, 0.00006931, &                      
568           0.15371189, 0.15592396, 0.14430280, 0.13076764, &                      
569           0.11720382, 0.10023471, 0.08066396, 0.06073554, &                      
570           0.04121581, 0.00451202, 0.00377832, 0.00294609, &                      
571           0.00210943, 0.00133336, 0.00049260, 0.00006931, &                      
572           0.14262275, 0.14572631, 0.14560597, 0.13736825, &                      
573           0.12271351, 0.10419556, 0.08294533, 0.06199794, &                      
574           0.04157615, 0.00452842, 0.00377704, 0.00293852, &                      
575           0.00211034, 0.00133278, 0.00049259, 0.00006931, &                      
576           0.14500433, 0.14590444, 0.14430299, 0.13770708, &                      
577           0.12288283, 0.10350952, 0.08269450, 0.06130579, &                      
578           0.04144571, 0.00452096, 0.00377382, 0.00294532, &                      
579           0.00210943, 0.00133228, 0.00049260, 0.00006931/                        
580       DATA FRACREFB7/ &                                                             
581           0.15355594,0.15310939,0.14274909,0.13129812, &                         
582           0.11736792,0.10118213,0.08215259,0.06165591, &                         
583           0.04164486,0.00451141,0.00372837,0.00294095, &                         
584           0.00215259,0.00136792,0.00051233,0.00007075/                           
585                                                                                  
586       DATA ABSCO27/ &                                                               
587           9.30038E-05, 1.74061E-04, 2.09293E-04, 2.52360E-04, &                  
588           3.13404E-04, 4.16619E-04, 6.27394E-04, 1.29386E-03, &                  
589           4.05192E-03, 3.97050E-03, 7.00634E-04, 6.06617E-04, &                  
590           7.66978E-04, 6.70661E-04, 7.89971E-04, 7.55709E-04/                    
591                                                                                  
592 ! Data                                                                           
593                                                                                  
594       DATA FRACREFA8/ &                                                             
595 !     From P = 1053.6 mb.                                                        
596           0.15309700,0.15450300,0.14458799,0.13098200, &                         
597           0.11817900,0.09953490,0.08132080,0.06139960, &                         
598           0.04132010,0.00446788,0.00372533,0.00294053, &                         
599           0.00211371,0.00128122,0.00048050,0.00006759/                           
600       DATA FRACREFB8/ &                                                             
601 !     From P = 28.9 mb.                                                          
602           0.14105400,0.14728899,0.14264800,0.13331699, &                         
603           0.12034100,0.10467000,0.08574980,0.06469390, &                         
604           0.04394640,0.00481284,0.00397375,0.00315006, &                         
605           0.00228636,0.00144606,0.00054604,0.00007697/                           
606                                                                                  
607       DATA CFC128/ &                                                                
608            85.4027, 89.4696, 74.0959, 67.7480, &                                 
609            61.2444, 59.9073, 60.8296, 63.0998, &                                 
610            59.6110, 64.0735, 57.2622, 58.9721, &                                 
611            43.5505, 26.1192, 32.7023, 32.8667/                                   
612       DATA CFC22ADJ8/ &                                                             
613 !     Original CFC22 is multiplied by 1.485 to account for the 780-850 cm-1      
614 !     and 1290-1335 cm-1 bands.                                                  
615            135.335, 89.6642, 76.2375, 65.9748, &                                 
616            63.1164, 60.2935, 64.0299, 75.4264, &                                 
617            51.3018, 7.07911, 5.86928, 0.398693, &                                
618            2.82885, 9.12751, 6.28271, 0./                                        
619       DATA ABSCO2A8/ &                                                              
620            1.11233E-05, 3.92400E-05, 6.62059E-05, 8.51687E-05, &                 
621            7.79035E-05, 1.34058E-04, 2.82553E-04, 5.41741E-04, &                 
622            1.47029E-05, 2.34982E-05, 6.91094E-08, 8.48917E-08, &                 
623            6.58783E-08, 4.64849E-08, 3.62742E-08, 3.62742E-08/                   
624       DATA ABSCO2B8/ &                                                              
625            4.10977E-09, 5.65200E-08, 1.70800E-07, 4.16840E-07, &                 
626            9.53684E-07, 2.36468E-06, 7.29502E-06, 4.93883E-05, &                 
627            5.10440E-04, 9.75248E-04, 1.36495E-03, 2.40451E-03, &                 
628            4.50277E-03, 2.24486E-02, 4.06756E-02, 2.17447E-10/                   
629       DATA ABSN2OA8/ &                                                              
630            1.28527E-02,5.28651E-02,1.01668E-01,1.57224E-01, &                    
631            2.76947E-01,4.93048E-01,6.71387E-01,3.48809E-01, &                    
632            4.19840E-01,3.13558E-01,2.44432E-01,2.05108E-01, &                    
633            1.21423E-01,1.22158E-01,1.49702E-01,1.47799E-01/                      
634       DATA ABSN2OB8/ &                                                              
635            3.15864E-03,4.87347E-03,8.63235E-03,2.16053E-02, &                    
636            3.63699E-02,7.89149E-02,3.53807E-01,1.27140E-00, &                    
637            2.31464E-00,7.75834E-02,5.15063E-02,4.07059E-02, &                    
638            5.91947E-02,5.83546E-02,3.12716E-01,1.47456E-01/                      
639                                                                                  
640 !  Data                                                                          
641                                                                                  
642       DATA FRACREFA9/ &                                                             
643 !     From P = 1053.6 mb.                                                        
644           0.16898900,0.15898301,0.13575301,0.12600900, &                         
645           0.11545800,0.09879170,0.08106830,0.06063440, &                         
646           0.03988780,0.00421760,0.00346635,0.00278779, &                         
647           0.00206225,0.00132324,0.00050033,0.00007038, &                         
648           0.18209399,0.15315101,0.13571000,0.12504999, &                         
649           0.11379100,0.09680810,0.08008570,0.05970280, &                         
650           0.03942860,0.00413383,0.00343186,0.00275558, &                         
651           0.00204657,0.00130219,0.00045454,0.00005664, &                         
652           0.18459500,0.15512000,0.13395500,0.12576801, &                         
653           0.11276800,0.09645190,0.07956650,0.05903340, &                         
654           0.03887050,0.00412226,0.00339453,0.00273518, &                         
655           0.00196922,0.00119411,0.00040263,0.00005664, &                         
656           0.18458800,0.15859900,0.13278100,0.12589300, &                         
657           0.11272700,0.09599660,0.07903030,0.05843600, &                         
658           0.03843400,0.00405181,0.00337980,0.00263818, &                         
659           0.00186869,0.00111807,0.00040263,0.00005664, &                         
660           0.18459301,0.16176100,0.13235000,0.12528200, &                         
661           0.11237100,0.09618840,0.07833760,0.05800770, &                         
662           0.03787610,0.00408253,0.00330363,0.00250445, &                         
663           0.00176725,0.00111753,0.00040263,0.00005664, &                         
664           0.18454400,0.16505300,0.13221300,0.12476600, &                         
665           0.11158300,0.09618120,0.07797340,0.05740380, &                         
666           0.03742820,0.00392691,0.00312208,0.00246306, &                         
667           0.00176735,0.00111721,0.00040263,0.00005664, &                         
668           0.18452001,0.16697501,0.13445500,0.12391300, &                         
669           0.11059100,0.09596890,0.07761050,0.05643200, &                         
670           0.03686520,0.00377086,0.00309351,0.00246297, &                         
671           0.00176765,0.00111700,0.00040263,0.00005664, &                         
672           0.18460999,0.16854499,0.13922299,0.12266400, &                         
673           0.10962200,0.09452030,0.07653800,0.05551340, &                         
674           0.03609660,0.00377043,0.00309367,0.00246304, &                         
675           0.00176749,0.00111689,0.00040263,0.00005664, &                         
676           0.18312500,0.16787501,0.14720701,0.12766500, &                         
677           0.10890900,0.08935530,0.07310870,0.05443140, &                         
678           0.03566380,0.00376446,0.00309521,0.00246510, &                         
679           0.00176139,0.00111543,0.00040263,0.00005664/                           
680       DATA FRACREFB9/ &                                                             
681 !     From P = 0.071 mb.                                                         
682           0.20148601,0.15252700,0.13376500,0.12184600, &                         
683           0.10767800,0.09307410,0.07674570,0.05876940, &                         
684           0.04001480,0.00424612,0.00346896,0.00269954, &                         
685           0.00196864,0.00122562,0.00043628,0.00004892/                           
686                                                                                  
687       DATA ABSN2O9/ &                                                               
688 !     From P = 952 mb.                                                           
689            3.26267E-01,2.42869E-00,1.15455E+01,7.39478E-00, &                    
690            5.16550E-00,2.54474E-00,3.53082E-00,3.82278E-00, &                    
691            1.81297E-00,6.65313E-01,1.23652E-01,1.83895E-03, &                    
692            1.70592E-03,2.68434E-09,0.,0., &                                      
693 !     From P = 620 mb.                                                           
694            2.08632E-01,1.11865E+00,4.95975E+00,8.10907E+00, &                    
695            1.10408E+01,5.45460E+00,4.18611E+00,3.53422E+00, &                    
696            2.54164E+00,3.65093E-01,5.84480E-01,2.26918E-01, &                    
697            1.36230E-03,5.54400E-10,6.83703E-10,0., &                             
698 !     From P = 313 mb.                                                           
699            6.20022E-02,2.69521E-01,9.81928E-01,1.65004E-00, &                    
700            3.08089E-00,5.38696E-00,1.14600E+01,2.41211E+01, &                    
701            1.69655E+01,1.37556E-00,5.43254E-01,3.52079E-01, &                    
702            4.31888E-01,4.82523E-06,5.74747E-11,0./                               
703                                                                                  
704 ! Data                                                                           
705                                                                                  
706       DATA FRACREFA10/ &                                                             
707 !     From P = 473 mb.                                                           
708           0.16271301,0.15141940,0.14065412,0.12899506, &                         
709           0.11607002,0.10142808,0.08116794,0.06104711, &                         
710           0.04146209,0.00447386,0.00372902,0.00287258, &                         
711           0.00206028,0.00134634,0.00049232,0.00006927/                           
712       DATA FRACREFB10/ &                                                             
713 !     From P = 1.17 mb.                                                          
714           0.16571465,0.15262246,0.14036226,0.12620729, &                         
715           0.11477834,0.09967982,0.08155201,0.06159503, &                         
716           0.04196607,0.00453940,0.00376881,0.00300437, &                         
717           0.00223034,0.00139432,0.00051516,0.00007095/                           
718                                                                                  
719 ! Data                                                                           
720                                                                                  
721       DATA FRACREFA11/ &                                                             
722 !     From P = 473 mb.                                                           
723           0.14152819,0.13811260,0.14312185,0.13705885, &                         
724           0.11944738,0.10570189,0.08866373,0.06565409, &                         
725           0.04428961,0.00481540,0.00387058,0.00329187, &                         
726           0.00238294,0.00150971,0.00049287,0.00005980/                           
727       DATA FRACREFB11/ &                                                             
728 !     From P = 1.17 mb.                                                          
729           0.10874039,0.15164889,0.15149839,0.14515044, &                         
730           0.12486220,0.10725017,0.08715712,0.06463144, &                         
731           0.04332319,0.00441193,0.00393819,0.00305960, &                         
732           0.00224221,0.00145100,0.00055586,0.00007934/                           
733                                                                                  
734 ! Data                                                                           
735                                                                                  
736       DATA FRACREFA12/ &                                                             
737 !     From P = 706.3 mb.                                                         
738           0.21245100,0.15164700,0.14486700,0.13075501, &                         
739           0.11629600,0.09266050,0.06579930,0.04524000, &                         
740           0.03072870,0.00284297,0.00234660,0.00185208, &                         
741           0.00133978,0.00082214,0.00031016,0.00004363, &                         
742           0.14703900,0.16937999,0.15605700,0.14159000, &                         
743           0.12088500,0.10058500,0.06809110,0.05131470, &                         
744           0.03487040,0.00327281,0.00250183,0.00190024, &                         
745           0.00133978,0.00082214,0.00031016,0.00004363, &                         
746           0.13689300,0.16610400,0.15723500,0.14299500, &                         
747           0.12399400,0.09907820,0.07169690,0.05367370, &                         
748           0.03671630,0.00378148,0.00290510,0.00221076, &                         
749           0.00142810,0.00093527,0.00031016,0.00004363, &                         
750           0.13054299,0.16273800,0.15874299,0.14279599, &                         
751           0.12674300,0.09664900,0.07462200,0.05620080, &                         
752           0.03789090,0.00411690,0.00322920,0.00245036, &                         
753           0.00178303,0.00098595,0.00040802,0.00010150, &                         
754           0.12828299,0.15824600,0.15688400,0.14449100, &                         
755           0.12787800,0.09517830,0.07679350,0.05890820, &                         
756           0.03883570,0.00442304,0.00346796,0.00255333, &                         
757           0.00212519,0.00116168,0.00067065,0.00010150, &                         
758           0.12649800,0.15195100,0.15646499,0.14569700, &                         
759           0.12669300,0.09653520,0.07887920,0.06106920, &                         
760           0.04043910,0.00430390,0.00364453,0.00314360, &                         
761           0.00203206,0.00187787,0.00067075,0.00010150, &                         
762           0.12500300,0.14460599,0.15672199,0.14724600, &                         
763           0.11978900,0.10190200,0.08196710,0.06315770, &                         
764           0.04240100,0.00433645,0.00404097,0.00329466, &                         
765           0.00288491,0.00187803,0.00067093,0.00010150, &                         
766           0.12317200,0.14118700,0.15242000,0.13794300, &                         
767           0.12119200,0.10655400,0.08808350,0.06521370, &                         
768           0.04505680,0.00485949,0.00477105,0.00401468, &                         
769           0.00288491,0.00187786,0.00067110,0.00010150, &                         
770           0.10193600,0.11693000,0.13236099,0.14053200, &                         
771           0.13749801,0.12193100,0.10221000,0.07448910, &                         
772           0.05205320,0.00572312,0.00476882,0.00403380, &                         
773           0.00288871,0.00187396,0.00067218,0.00010150/                           
774                                                                                  
775 ! Data                                                                           
776                                                                                  
777       DATA FRACREFA13/ &                                                             
778 !     From P = 706.3 mb.                                                         
779           0.17683899,0.17319500,0.15712699,0.13604601, &                         
780           0.10776200,0.08750010,0.06808820,0.04905150, &                         
781           0.03280360,0.00350836,0.00281864,0.00219862, &                         
782           0.00160943,0.00101885,0.00038147,0.00005348, &                         
783           0.17535400,0.16999300,0.15610200,0.13589200, &                         
784           0.10842100,0.08988550,0.06943920,0.04974900, &                         
785           0.03323400,0.00352752,0.00289402,0.00231003, &                         
786           0.00174659,0.00101884,0.00038147,0.00005348, &                         
787           0.17409500,0.16846400,0.15641899,0.13503000, &                         
788           0.10838600,0.08985800,0.07092720,0.05075710, &                         
789           0.03364180,0.00354241,0.00303507,0.00243391, &                         
790           0.00177502,0.00114638,0.00043585,0.00005348, &                         
791           0.17248300,0.16778600,0.15543500,0.13496999, &                         
792           0.10826300,0.09028740,0.07156720,0.05187120, &                         
793           0.03424890,0.00363933,0.00324715,0.00255030, &                         
794           0.00187380,0.00116978,0.00051229,0.00009768, &                         
795           0.17061099,0.16715799,0.15405200,0.13471501, &                         
796           0.10896400,0.09069460,0.07229760,0.05218280, &                         
797           0.03555340,0.00379576,0.00330240,0.00274693, &                         
798           0.00201587,0.00119598,0.00061885,0.00009768, &                         
799           0.16789700,0.16629100,0.15270300,0.13360199, &                         
800           0.11047200,0.09151080,0.07325000,0.05261450, &                         
801           0.03657990,0.00450092,0.00349537,0.00283321, &                         
802           0.00208396,0.00140354,0.00066587,0.00009768, &                         
803           0.16412200,0.16387400,0.15211500,0.13062200, &                         
804           0.11325100,0.09348130,0.07381380,0.05434740, &                         
805           0.03803160,0.00481346,0.00393592,0.00296633, &                         
806           0.00222532,0.00163762,0.00066648,0.00009768, &                         
807           0.15513401,0.15768200,0.14850400,0.13330200, &                         
808           0.11446500,0.09868230,0.07642050,0.05624170, &                         
809           0.04197810,0.00502288,0.00429452,0.00315347, &                         
810           0.00263559,0.00171772,0.00066860,0.00009768, &                         
811           0.15732600,0.15223300,0.14271900,0.13563600, &                         
812           0.11859600,0.10274200,0.07934560,0.05763410, &                         
813           0.03921740,0.00437741,0.00337921,0.00280212, &                         
814           0.00200156,0.00124812,0.00064664,0.00009768/                           
815                                                                                  
816 ! Data                                                                           
817                                                                                  
818       DATA FRACREFA14/ &                                                             
819 !     From P = 1053.6 mb.                                                        
820           0.18446200,0.16795200,0.14949700,0.12036000, &                         
821           0.10440100,0.09024280,0.07435880,0.05629380, &                         
822           0.03825420,0.00417276,0.00345278,0.00272949, &                         
823           0.00200378,0.00127404,0.00050721,0.00004141/                           
824       DATA FRACREFB14/ &                                                             
825 !     From P = 0.64 mb.                                                          
826           0.19128500,0.16495700,0.14146100,0.11904500, &                         
827           0.10350200,0.09151190,0.07604270,0.05806020, &                         
828           0.03979950,0.00423959,0.00357439,0.00287559, &                         
829           0.00198860,0.00116529,0.00043616,0.00005987/                           
830                                                                                  
831 ! Data                                                                           
832                                                                                  
833       DATA FRACREFA15/ &                                                             
834 !     From P = 1053.6 mb.                                                        
835           0.11287100,0.12070200,0.12729000,0.12858100, &                         
836           0.12743001,0.11961800,0.10290400,0.07888980, &                         
837           0.05900120,0.00667979,0.00552926,0.00436993, &                         
838           0.00320611,0.00204765,0.00077371,0.00010894, &                         
839           0.13918801,0.16353001,0.16155800,0.14090499, &                         
840           0.11322300,0.08757720,0.07225720,0.05173390, &                         
841           0.04731360,0.00667979,0.00552926,0.00436993, &                         
842           0.00320611,0.00204765,0.00077371,0.00010894, &                         
843           0.14687300,0.17853101,0.15664500,0.13351700, &                         
844           0.10791200,0.08684320,0.07158090,0.05198410, &                         
845           0.04340110,0.00667979,0.00552926,0.00436993, &                         
846           0.00320611,0.00204765,0.00077371,0.00010894, &                         
847           0.15760700,0.17759100,0.15158001,0.13193300, &                         
848           0.10742800,0.08693760,0.07159490,0.05196250, &                         
849           0.04065270,0.00667979,0.00552926,0.00436993, &                         
850           0.00320611,0.00204765,0.00077371,0.00010894, &                         
851           0.16646700,0.17299300,0.15018500,0.13138700, &                         
852           0.10735900,0.08713110,0.07130330,0.05279420, &                         
853           0.03766730,0.00667979,0.00552926,0.00436993, &                         
854           0.00320611,0.00204765,0.00077371,0.00010894, &                         
855           0.17546000,0.16666500,0.14969499,0.13105400, &                         
856           0.10782500,0.08718610,0.07156770,0.05308320, &                         
857           0.03753960,0.00432465,0.00509623,0.00436993, &                         
858           0.00320611,0.00204765,0.00077371,0.00010894, &                         
859           0.18378501,0.16064601,0.14940400,0.13146400, &                         
860           0.10810300,0.08775740,0.07115360,0.05400040, &                         
861           0.03689970,0.00388333,0.00323610,0.00353414, &                         
862           0.00320611,0.00204765,0.00077371,0.00010894, &                         
863           0.18966800,0.15744300,0.14993000,0.13152599, &                         
864           0.10899200,0.08858690,0.07142920,0.05399600, &                         
865           0.03433460,0.00374886,0.00302066,0.00240653, &                         
866           0.00199205,0.00204765,0.00077371,0.00010894, &                         
867           0.11887100,0.12479600,0.12569501,0.12839900, &                         
868           0.12473500,0.12012800,0.11086700,0.08493590, &                         
869           0.05063770,0.00328723,0.00266849,0.00210232, &                         
870           0.00152114,0.00095635,0.00035374,0.00004980/                           
871                                                                                  
872 ! Data                                                                           
873                                                                                  
874       DATA FRACREFA16/ &                                                             
875 !     From P = 862.6 mb.                                                         
876           0.17356300,0.18880001,0.17704099,0.13661300, &                         
877           0.10691600,0.08222480,0.05939860,0.04230810, &                         
878           0.02526330,0.00244532,0.00193541,0.00150415, &                         
879           0.00103528,0.00067068,0.00024951,0.00003348, &                         
880           0.17779499,0.19837400,0.16557600,0.13470000, &                         
881           0.11013600,0.08342720,0.05987030,0.03938700, &                         
882           0.02293650,0.00238849,0.00192400,0.00149921, &                         
883           0.00103539,0.00067150,0.00024822,0.00003348, &                         
884           0.18535601,0.19407199,0.16053200,0.13300700, &                         
885           0.10779000,0.08408500,0.06480450,0.04070160, &                         
886           0.02203590,0.00227779,0.00189074,0.00146888, &                         
887           0.00103147,0.00066770,0.00024751,0.00003348, &                         
888           0.19139200,0.18917400,0.15748601,0.13240699, &                         
889           0.10557300,0.08383260,0.06724060,0.04364450, &                         
890           0.02175820,0.00225436,0.00184421,0.00143153, &                         
891           0.00103027,0.00066066,0.00024222,0.00003148, &                         
892           0.19547801,0.18539500,0.15442000,0.13114899, &                         
893           0.10515600,0.08350350,0.06909780,0.04671630, &                         
894           0.02168820,0.00224400,0.00182009,0.00139098, &                         
895           0.00102582,0.00065367,0.00023202,0.00003148, &                         
896           0.19757500,0.18266800,0.15208900,0.12897800, &                         
897           0.10637200,0.08391220,0.06989830,0.04964120, &                         
898           0.02155800,0.00224310,0.00177358,0.00138184, &                         
899           0.00101538,0.00063370,0.00023227,0.00003148, &                         
900           0.20145500,0.17692900,0.14940600,0.12690400, &                         
901           0.10828800,0.08553720,0.07004940,0.05153430, &                         
902           0.02268740,0.00216943,0.00178603,0.00137754, &                         
903           0.00098344,0.00063165,0.00023218,0.00003148, &                         
904           0.20383500,0.17047501,0.14570600,0.12679300, &                         
905           0.11043100,0.08719150,0.07045440,0.05345420, &                         
906           0.02448340,0.00215839,0.00175893,0.00138296, &                         
907           0.00098318,0.00063188,0.00023199,0.00003148, &                         
908           0.18680701,0.15961801,0.15092900,0.13049100, &                         
909           0.11418400,0.09380540,0.07093450,0.05664280, &                         
910           0.02938410,0.00217751,0.00176766,0.00138275, &                         
911           0.00098377,0.00063181,0.00023193,0.00003148/                           
912                
915 ! end of data 3
918 !-----------------------------------------------------------------------
920 ! start data 4
922       DATA NXMOL  /2/
923       DATA IXINDX /0,2,3,0,31*0/
924                                                                   
926 ! end of data 4
928 !-----------------------------------------------------------------------
930 ! start data 5
931                                                                   
932 !     
933 !  Longwave spectral band data                                                   
935       DATA WAVENUM1(1) /10./, WAVENUM2(1) /250./, DELWAVE(1) /240./              
936       DATA WAVENUM1(2) /250./, WAVENUM2(2) /500./, DELWAVE(2) /250./             
937       DATA WAVENUM1(3) /500./, WAVENUM2(3) /630./, DELWAVE(3) /130./             
938       DATA WAVENUM1(4) /630./, WAVENUM2(4) /700./, DELWAVE(4) /70./              
939       DATA WAVENUM1(5) /700./, WAVENUM2(5) /820./, DELWAVE(5) /120./             
940       DATA WAVENUM1(6) /820./, WAVENUM2(6) /980./, DELWAVE(6) /160./             
941       DATA WAVENUM1(7) /980./, WAVENUM2(7) /1080./, DELWAVE(7) /100./            
942       DATA WAVENUM1(8) /1080./, WAVENUM2(8) /1180./, DELWAVE(8) /100./           
943       DATA WAVENUM1(9) /1180./, WAVENUM2(9) /1390./, DELWAVE(9) /210./           
944       DATA WAVENUM1(10) /1390./,WAVENUM2(10) /1480./,DELWAVE(10) /90./           
945       DATA WAVENUM1(11) /1480./,WAVENUM2(11) /1800./,DELWAVE(11) /320./          
946       DATA WAVENUM1(12) /1800./,WAVENUM2(12) /2080./,DELWAVE(12) /280./          
947       DATA WAVENUM1(13) /2080./,WAVENUM2(13) /2250./,DELWAVE(13) /170./          
948       DATA WAVENUM1(14) /2250./,WAVENUM2(14) /2380./,DELWAVE(14) /130./          
949       DATA WAVENUM1(15) /2380./,WAVENUM2(15) /2600./,DELWAVE(15) /220./          
950       DATA WAVENUM1(16) /2600./,WAVENUM2(16) /3000./,DELWAVE(16) /400./          
951                                                                                  
953 ! end of data 5
955 !-----------------------------------------------------------------------
957 ! start data 6
959               
960       DATA NG  /16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16/                 
961       DATA NSPA /1, 1,10, 9, 9, 1, 9, 1,11, 1, 1, 9, 9, 1, 9, 9/                 
962       DATA NSPB /1, 1, 5, 6, 5, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0/                 
963                                                                                  
964 !     HEATFAC is the factor by which one must multiply delta-flux/               
965 !     delta-pressure, with flux in w/m-2 and pressure in mbar, to get            
966 !     the heating rate in units of degrees/day.  It is equal to                  
967 !           (g)x(#sec/day)x(1e-5)/(specific heat of air at const. p)             
968 !        =  (9.8066)(3600)(1e-5)/(1.004)                                         
970       DATA HEATFAC /8.4391/                                                      
971                                                                            
972 !     These pressures are chosen such that the ln of the first pressure          
973 !     has only a few non-zero digits (i.e. ln(PREF(1)) = 6.96000) and            
974 !     each subsequent ln(pressure) differs from the previous one by 0.2.         
976       DATA PREF / &                                                                 
977           1.05363E+03,8.62642E+02,7.06272E+02,5.78246E+02,4.73428E+02, & 
978           3.87610E+02,3.17348E+02,2.59823E+02,2.12725E+02,1.74164E+02, & 
979           1.42594E+02,1.16746E+02,9.55835E+01,7.82571E+01,6.40715E+01, & 
980           5.24573E+01,4.29484E+01,3.51632E+01,2.87892E+01,2.35706E+01, & 
981           1.92980E+01,1.57998E+01,1.29358E+01,1.05910E+01,8.67114E+00, & 
982           7.09933E+00,5.81244E+00,4.75882E+00,3.89619E+00,3.18993E+00, & 
983           2.61170E+00,2.13828E+00,1.75067E+00,1.43333E+00,1.17351E+00, & 
984           9.60789E-01,7.86628E-01,6.44036E-01,5.27292E-01,4.31710E-01, & 
985           3.53455E-01,2.89384E-01,2.36928E-01,1.93980E-01,1.58817E-01, & 
986           1.30029E-01,1.06458E-01,8.71608E-02,7.13612E-02,5.84256E-02, & 
987           4.78349E-02,3.91639E-02,3.20647E-02,2.62523E-02,2.14936E-02, & 
988           1.75975E-02,1.44076E-02,1.17959E-02,9.65769E-03/                       
989       DATA PREFLOG / &                                                              
990            6.9600E+00, 6.7600E+00, 6.5600E+00, 6.3600E+00, 6.1600E+00, & 
991            5.9600E+00, 5.7600E+00, 5.5600E+00, 5.3600E+00, 5.1600E+00, & 
992            4.9600E+00, 4.7600E+00, 4.5600E+00, 4.3600E+00, 4.1600E+00, & 
993            3.9600E+00, 3.7600E+00, 3.5600E+00, 3.3600E+00, 3.1600E+00, & 
994            2.9600E+00, 2.7600E+00, 2.5600E+00, 2.3600E+00, 2.1600E+00, & 
995            1.9600E+00, 1.7600E+00, 1.5600E+00, 1.3600E+00, 1.1600E+00, & 
996            9.6000E-01, 7.6000E-01, 5.6000E-01, 3.6000E-01, 1.6000E-01, & 
997           -4.0000E-02,-2.4000E-01,-4.4000E-01,-6.4000E-01,-8.4000E-01, & 
998           -1.0400E+00,-1.2400E+00,-1.4400E+00,-1.6400E+00,-1.8400E+00, & 
999           -2.0400E+00,-2.2400E+00,-2.4400E+00,-2.6400E+00,-2.8400E+00, & 
1000           -3.0400E+00,-3.2400E+00,-3.4400E+00,-3.6400E+00,-3.8400E+00, & 
1001           -4.0400E+00,-4.2400E+00,-4.4400E+00,-4.6400E+00/                       
1002 !     These are the temperatures associated with the respective                  
1003 !     pressures for the MLS standard atmosphere.                                 
1004       DATA TREF / &                                                                 
1005            2.9420E+02, 2.8799E+02, 2.7894E+02, 2.6925E+02, 2.5983E+02, & 
1006            2.5017E+02, 2.4077E+02, 2.3179E+02, 2.2306E+02, 2.1578E+02, & 
1007            2.1570E+02, 2.1570E+02, 2.1570E+02, 2.1706E+02, 2.1858E+02, & 
1008            2.2018E+02, 2.2174E+02, 2.2328E+02, 2.2479E+02, 2.2655E+02, & 
1009            2.2834E+02, 2.3113E+02, 2.3401E+02, 2.3703E+02, 2.4022E+02, & 
1010            2.4371E+02, 2.4726E+02, 2.5085E+02, 2.5457E+02, 2.5832E+02, & 
1011            2.6216E+02, 2.6606E+02, 2.6999E+02, 2.7340E+02, 2.7536E+02, & 
1012            2.7568E+02, 2.7372E+02, 2.7163E+02, 2.6955E+02, 2.6593E+02, & 
1013            2.6211E+02, 2.5828E+02, 2.5360E+02, 2.4854E+02, 2.4348E+02, & 
1014            2.3809E+02, 2.3206E+02, 2.2603E+02, 2.2000E+02, 2.1435E+02, & 
1015            2.0887E+02, 2.0340E+02, 1.9792E+02, 1.9290E+02, 1.8809E+02, & 
1016            1.8329E+02, 1.7849E+02, 1.7394E+02, 1.7212E+02/                       
1017                                                                                  
1019 ! end of data 6
1021 !-----------------------------------------------------------------------
1023 ! start data 7
1025       DATA (TOTPLNK(IDATA, 1),IDATA=1,50)/ &                                                
1026       1.13735E-06,1.15150E-06,1.16569E-06,1.17992E-06,1.19419E-06, & 
1027       1.20850E-06,1.22285E-06,1.23723E-06,1.25164E-06,1.26610E-06, & 
1028       1.28059E-06,1.29511E-06,1.30967E-06,1.32426E-06,1.33889E-06, & 
1029       1.35355E-06,1.36824E-06,1.38296E-06,1.39772E-06,1.41250E-06, & 
1030       1.42732E-06,1.44217E-06,1.45704E-06,1.47195E-06,1.48689E-06, & 
1031       1.50185E-06,1.51684E-06,1.53186E-06,1.54691E-06,1.56198E-06, & 
1032       1.57709E-06,1.59222E-06,1.60737E-06,1.62255E-06,1.63776E-06, & 
1033       1.65299E-06,1.66825E-06,1.68352E-06,1.69883E-06,1.71416E-06, & 
1034       1.72951E-06,1.74488E-06,1.76028E-06,1.77570E-06,1.79114E-06, & 
1035       1.80661E-06,1.82210E-06,1.83760E-06,1.85313E-06,1.86868E-06/               
1036       DATA (TOTPLNK(IDATA, 1),IDATA=51,100)/ &                                              
1037       1.88425E-06,1.89985E-06,1.91546E-06,1.93109E-06,1.94674E-06, & 
1038       1.96241E-06,1.97811E-06,1.99381E-06,2.00954E-06,2.02529E-06, & 
1039       2.04105E-06,2.05684E-06,2.07264E-06,2.08846E-06,2.10429E-06, & 
1040       2.12015E-06,2.13602E-06,2.15190E-06,2.16781E-06,2.18373E-06, & 
1041       2.19966E-06,2.21562E-06,2.23159E-06,2.24758E-06,2.26358E-06, & 
1042       2.27959E-06,2.29562E-06,2.31167E-06,2.32773E-06,2.34381E-06, & 
1043       2.35990E-06,2.37601E-06,2.39212E-06,2.40825E-06,2.42440E-06, & 
1044       2.44056E-06,2.45673E-06,2.47292E-06,2.48912E-06,2.50533E-06, & 
1045       2.52157E-06,2.53781E-06,2.55406E-06,2.57032E-06,2.58660E-06, & 
1046       2.60289E-06,2.61919E-06,2.63550E-06,2.65183E-06,2.66817E-06/               
1047       DATA (TOTPLNK(IDATA, 1),IDATA=101,150)/ &                                             
1048       2.68452E-06,2.70088E-06,2.71726E-06,2.73364E-06,2.75003E-06, & 
1049       2.76644E-06,2.78286E-06,2.79929E-06,2.81572E-06,2.83218E-06, & 
1050       2.84864E-06,2.86510E-06,2.88159E-06,2.89807E-06,2.91458E-06, & 
1051       2.93109E-06,2.94762E-06,2.96415E-06,2.98068E-06,2.99724E-06, & 
1052       3.01379E-06,3.03036E-06,3.04693E-06,3.06353E-06,3.08013E-06, & 
1053       3.09674E-06,3.11335E-06,3.12998E-06,3.14661E-06,3.16324E-06, & 
1054       3.17989E-06,3.19656E-06,3.21323E-06,3.22991E-06,3.24658E-06, & 
1055       3.26328E-06,3.27998E-06,3.29669E-06,3.31341E-06,3.33013E-06, & 
1056       3.34686E-06,3.36360E-06,3.38034E-06,3.39709E-06,3.41387E-06, & 
1057       3.43063E-06,3.44742E-06,3.46420E-06,3.48099E-06,3.49779E-06/               
1058       DATA (TOTPLNK(IDATA, 1),IDATA=151,181)/ &                                             
1059       3.51461E-06,3.53141E-06,3.54824E-06,3.56506E-06,3.58191E-06, & 
1060       3.59875E-06,3.61559E-06,3.63244E-06,3.64931E-06,3.66617E-06, & 
1061       3.68305E-06,3.69992E-06,3.71682E-06,3.73372E-06,3.75061E-06, & 
1062       3.76753E-06,3.78443E-06,3.80136E-06,3.81829E-06,3.83522E-06, & 
1063       3.85215E-06,3.86910E-06,3.88605E-06,3.90301E-06,3.91997E-06, & 
1064       3.93694E-06,3.95390E-06,3.97087E-06,3.98788E-06,4.00485E-06, & 
1065       4.02187E-06/                                                               
1066       DATA (TOTPLNK(IDATA, 2),IDATA=1,50)/ &                                                
1067       2.13441E-06,2.18076E-06,2.22758E-06,2.27489E-06,2.32268E-06, & 
1068       2.37093E-06,2.41966E-06,2.46886E-06,2.51852E-06,2.56864E-06, & 
1069       2.61922E-06,2.67026E-06,2.72175E-06,2.77370E-06,2.82609E-06, & 
1070       2.87893E-06,2.93221E-06,2.98593E-06,3.04008E-06,3.09468E-06, & 
1071       3.14970E-06,3.20515E-06,3.26103E-06,3.31732E-06,3.37404E-06, & 
1072       3.43118E-06,3.48873E-06,3.54669E-06,3.60506E-06,3.66383E-06, & 
1073       3.72301E-06,3.78259E-06,3.84256E-06,3.90293E-06,3.96368E-06, & 
1074       4.02483E-06,4.08636E-06,4.14828E-06,4.21057E-06,4.27324E-06, & 
1075       4.33629E-06,4.39971E-06,4.46350E-06,4.52765E-06,4.59217E-06, & 
1076       4.65705E-06,4.72228E-06,4.78787E-06,4.85382E-06,4.92011E-06/               
1077       DATA (TOTPLNK(IDATA, 2),IDATA=51,100)/ &                                              
1078       4.98675E-06,5.05374E-06,5.12106E-06,5.18873E-06,5.25674E-06, & 
1079       5.32507E-06,5.39374E-06,5.46274E-06,5.53207E-06,5.60172E-06, & 
1080       5.67169E-06,5.74198E-06,5.81259E-06,5.88352E-06,5.95475E-06, & 
1081       6.02629E-06,6.09815E-06,6.17030E-06,6.24276E-06,6.31552E-06, & 
1082       6.38858E-06,6.46192E-06,6.53557E-06,6.60950E-06,6.68373E-06, & 
1083       6.75824E-06,6.83303E-06,6.90810E-06,6.98346E-06,7.05909E-06, & 
1084       7.13500E-06,7.21117E-06,7.28763E-06,7.36435E-06,7.44134E-06, & 
1085       7.51859E-06,7.59611E-06,7.67388E-06,7.75192E-06,7.83021E-06, & 
1086       7.90875E-06,7.98755E-06,8.06660E-06,8.14589E-06,8.22544E-06, & 
1087       8.30522E-06,8.38526E-06,8.46553E-06,8.54604E-06,8.62679E-06/               
1088       DATA (TOTPLNK(IDATA, 2),IDATA=101,150)/ &                                             
1089       8.70777E-06,8.78899E-06,8.87043E-06,8.95211E-06,9.03402E-06, & 
1090       9.11616E-06,9.19852E-06,9.28109E-06,9.36390E-06,9.44692E-06, & 
1091       9.53015E-06,9.61361E-06,9.69729E-06,9.78117E-06,9.86526E-06, & 
1092       9.94957E-06,1.00341E-05,1.01188E-05,1.02037E-05,1.02888E-05, & 
1093       1.03742E-05,1.04597E-05,1.05454E-05,1.06313E-05,1.07175E-05, & 
1094       1.08038E-05,1.08903E-05,1.09770E-05,1.10639E-05,1.11509E-05, & 
1095       1.12382E-05,1.13257E-05,1.14133E-05,1.15011E-05,1.15891E-05, & 
1096       1.16773E-05,1.17656E-05,1.18542E-05,1.19429E-05,1.20317E-05, & 
1097       1.21208E-05,1.22100E-05,1.22994E-05,1.23890E-05,1.24787E-05, & 
1098       1.25686E-05,1.26587E-05,1.27489E-05,1.28393E-05,1.29299E-05/               
1099       DATA (TOTPLNK(IDATA, 2),IDATA=151,181)/ &                                             
1100       1.30206E-05,1.31115E-05,1.32025E-05,1.32937E-05,1.33850E-05, & 
1101       1.34765E-05,1.35682E-05,1.36600E-05,1.37520E-05,1.38441E-05, & 
1102       1.39364E-05,1.40288E-05,1.41213E-05,1.42140E-05,1.43069E-05, & 
1103       1.43999E-05,1.44930E-05,1.45863E-05,1.46797E-05,1.47733E-05, & 
1104       1.48670E-05,1.49608E-05,1.50548E-05,1.51489E-05,1.52431E-05, & 
1105       1.53375E-05,1.54320E-05,1.55267E-05,1.56214E-05,1.57164E-05, & 
1106       1.58114E-05/                                                               
1107       DATA (TOTPLNK(IDATA, 3),IDATA=1,50)/ &                                                
1108       1.34822E-06,1.39134E-06,1.43530E-06,1.48010E-06,1.52574E-06, & 
1109       1.57222E-06,1.61956E-06,1.66774E-06,1.71678E-06,1.76666E-06, & 
1110       1.81741E-06,1.86901E-06,1.92147E-06,1.97479E-06,2.02898E-06, & 
1111       2.08402E-06,2.13993E-06,2.19671E-06,2.25435E-06,2.31285E-06, & 
1112       2.37222E-06,2.43246E-06,2.49356E-06,2.55553E-06,2.61837E-06, & 
1113       2.68207E-06,2.74664E-06,2.81207E-06,2.87837E-06,2.94554E-06, & 
1114       3.01356E-06,3.08245E-06,3.15221E-06,3.22282E-06,3.29429E-06, & 
1115       3.36662E-06,3.43982E-06,3.51386E-06,3.58876E-06,3.66451E-06, & 
1116       3.74112E-06,3.81857E-06,3.89688E-06,3.97602E-06,4.05601E-06, & 
1117       4.13685E-06,4.21852E-06,4.30104E-06,4.38438E-06,4.46857E-06/               
1118       DATA (TOTPLNK(IDATA, 3),IDATA=51,100)/ &                                              
1119       4.55358E-06,4.63943E-06,4.72610E-06,4.81359E-06,4.90191E-06, & 
1120       4.99105E-06,5.08100E-06,5.17176E-06,5.26335E-06,5.35573E-06, & 
1121       5.44892E-06,5.54292E-06,5.63772E-06,5.73331E-06,5.82970E-06, & 
1122       5.92688E-06,6.02485E-06,6.12360E-06,6.22314E-06,6.32346E-06, & 
1123       6.42455E-06,6.52641E-06,6.62906E-06,6.73247E-06,6.83664E-06, & 
1124       6.94156E-06,7.04725E-06,7.15370E-06,7.26089E-06,7.36883E-06, & 
1125       7.47752E-06,7.58695E-06,7.69712E-06,7.80801E-06,7.91965E-06, & 
1126       8.03201E-06,8.14510E-06,8.25891E-06,8.37343E-06,8.48867E-06, & 
1127       8.60463E-06,8.72128E-06,8.83865E-06,8.95672E-06,9.07548E-06, & 
1128       9.19495E-06,9.31510E-06,9.43594E-06,9.55745E-06,9.67966E-06/               
1129       DATA (TOTPLNK(IDATA, 3),IDATA=101,150)/ &                                             
1130       9.80254E-06,9.92609E-06,1.00503E-05,1.01752E-05,1.03008E-05, & 
1131       1.04270E-05,1.05539E-05,1.06814E-05,1.08096E-05,1.09384E-05, & 
1132       1.10679E-05,1.11980E-05,1.13288E-05,1.14601E-05,1.15922E-05, & 
1133       1.17248E-05,1.18581E-05,1.19920E-05,1.21265E-05,1.22616E-05, & 
1134       1.23973E-05,1.25337E-05,1.26706E-05,1.28081E-05,1.29463E-05, & 
1135       1.30850E-05,1.32243E-05,1.33642E-05,1.35047E-05,1.36458E-05, & 
1136       1.37875E-05,1.39297E-05,1.40725E-05,1.42159E-05,1.43598E-05, & 
1137       1.45044E-05,1.46494E-05,1.47950E-05,1.49412E-05,1.50879E-05, & 
1138       1.52352E-05,1.53830E-05,1.55314E-05,1.56803E-05,1.58297E-05, & 
1139       1.59797E-05,1.61302E-05,1.62812E-05,1.64327E-05,1.65848E-05/               
1140       DATA (TOTPLNK(IDATA, 3),IDATA=151,181)/ &                                             
1141       1.67374E-05,1.68904E-05,1.70441E-05,1.71982E-05,1.73528E-05, & 
1142       1.75079E-05,1.76635E-05,1.78197E-05,1.79763E-05,1.81334E-05, & 
1143       1.82910E-05,1.84491E-05,1.86076E-05,1.87667E-05,1.89262E-05, & 
1144       1.90862E-05,1.92467E-05,1.94076E-05,1.95690E-05,1.97309E-05, & 
1145       1.98932E-05,2.00560E-05,2.02193E-05,2.03830E-05,2.05472E-05, & 
1146       2.07118E-05,2.08768E-05,2.10423E-05,2.12083E-05,2.13747E-05, & 
1147       2.15414E-05/                                                               
1148       DATA (TOTPLNK(IDATA, 4),IDATA=1,50)/ &                                                
1149       8.90528E-07,9.24222E-07,9.58757E-07,9.94141E-07,1.03038E-06, & 
1150       1.06748E-06,1.10545E-06,1.14430E-06,1.18403E-06,1.22465E-06, & 
1151       1.26618E-06,1.30860E-06,1.35193E-06,1.39619E-06,1.44136E-06, & 
1152       1.48746E-06,1.53449E-06,1.58246E-06,1.63138E-06,1.68124E-06, & 
1153       1.73206E-06,1.78383E-06,1.83657E-06,1.89028E-06,1.94495E-06, & 
1154       2.00060E-06,2.05724E-06,2.11485E-06,2.17344E-06,2.23303E-06, & 
1155       2.29361E-06,2.35519E-06,2.41777E-06,2.48134E-06,2.54592E-06, & 
1156       2.61151E-06,2.67810E-06,2.74571E-06,2.81433E-06,2.88396E-06, & 
1157       2.95461E-06,3.02628E-06,3.09896E-06,3.17267E-06,3.24741E-06, & 
1158       3.32316E-06,3.39994E-06,3.47774E-06,3.55657E-06,3.63642E-06/               
1159       DATA (TOTPLNK(IDATA, 4),IDATA=51,100)/ &                                              
1160       3.71731E-06,3.79922E-06,3.88216E-06,3.96612E-06,4.05112E-06, & 
1161       4.13714E-06,4.22419E-06,4.31227E-06,4.40137E-06,4.49151E-06, & 
1162       4.58266E-06,4.67485E-06,4.76806E-06,4.86229E-06,4.95754E-06, & 
1163       5.05383E-06,5.15113E-06,5.24946E-06,5.34879E-06,5.44916E-06, & 
1164       5.55053E-06,5.65292E-06,5.75632E-06,5.86073E-06,5.96616E-06, & 
1165       6.07260E-06,6.18003E-06,6.28848E-06,6.39794E-06,6.50838E-06, & 
1166       6.61983E-06,6.73229E-06,6.84573E-06,6.96016E-06,7.07559E-06, & 
1167       7.19200E-06,7.30940E-06,7.42779E-06,7.54715E-06,7.66749E-06, & 
1168       7.78882E-06,7.91110E-06,8.03436E-06,8.15859E-06,8.28379E-06, & 
1169       8.40994E-06,8.53706E-06,8.66515E-06,8.79418E-06,8.92416E-06/               
1170       DATA (TOTPLNK(IDATA, 4),IDATA=101,150)/ &                                             
1171       9.05510E-06,9.18697E-06,9.31979E-06,9.45356E-06,9.58826E-06, & 
1172       9.72389E-06,9.86046E-06,9.99793E-06,1.01364E-05,1.02757E-05, & 
1173       1.04159E-05,1.05571E-05,1.06992E-05,1.08422E-05,1.09861E-05, & 
1174       1.11309E-05,1.12766E-05,1.14232E-05,1.15707E-05,1.17190E-05, & 
1175       1.18683E-05,1.20184E-05,1.21695E-05,1.23214E-05,1.24741E-05, & 
1176       1.26277E-05,1.27822E-05,1.29376E-05,1.30939E-05,1.32509E-05, & 
1177       1.34088E-05,1.35676E-05,1.37273E-05,1.38877E-05,1.40490E-05, & 
1178       1.42112E-05,1.43742E-05,1.45380E-05,1.47026E-05,1.48680E-05, & 
1179       1.50343E-05,1.52014E-05,1.53692E-05,1.55379E-05,1.57074E-05, & 
1180       1.58778E-05,1.60488E-05,1.62207E-05,1.63934E-05,1.65669E-05/               
1181       DATA (TOTPLNK(IDATA, 4),IDATA=151,181)/ &                                             
1182       1.67411E-05,1.69162E-05,1.70920E-05,1.72685E-05,1.74459E-05, & 
1183       1.76240E-05,1.78029E-05,1.79825E-05,1.81629E-05,1.83440E-05, & 
1184       1.85259E-05,1.87086E-05,1.88919E-05,1.90760E-05,1.92609E-05, & 
1185       1.94465E-05,1.96327E-05,1.98199E-05,2.00076E-05,2.01961E-05, & 
1186       2.03853E-05,2.05752E-05,2.07658E-05,2.09571E-05,2.11491E-05, & 
1187       2.13418E-05,2.15352E-05,2.17294E-05,2.19241E-05,2.21196E-05, & 
1188       2.23158E-05/                                                               
1189       DATA (TOTPLNK(IDATA, 5),IDATA=1,50)/ &                                                
1190       5.70230E-07,5.94788E-07,6.20085E-07,6.46130E-07,6.72936E-07, & 
1191       7.00512E-07,7.28869E-07,7.58019E-07,7.87971E-07,8.18734E-07, & 
1192       8.50320E-07,8.82738E-07,9.15999E-07,9.50110E-07,9.85084E-07, & 
1193       1.02093E-06,1.05765E-06,1.09527E-06,1.13378E-06,1.17320E-06, & 
1194       1.21353E-06,1.25479E-06,1.29698E-06,1.34011E-06,1.38419E-06, & 
1195       1.42923E-06,1.47523E-06,1.52221E-06,1.57016E-06,1.61910E-06, & 
1196       1.66904E-06,1.71997E-06,1.77192E-06,1.82488E-06,1.87886E-06, & 
1197       1.93387E-06,1.98991E-06,2.04699E-06,2.10512E-06,2.16430E-06, & 
1198       2.22454E-06,2.28584E-06,2.34821E-06,2.41166E-06,2.47618E-06, & 
1199       2.54178E-06,2.60847E-06,2.67626E-06,2.74514E-06,2.81512E-06/               
1200       DATA (TOTPLNK(IDATA, 5),IDATA=51,100)/ &                                              
1201       2.88621E-06,2.95841E-06,3.03172E-06,3.10615E-06,3.18170E-06, & 
1202       3.25838E-06,3.33618E-06,3.41511E-06,3.49518E-06,3.57639E-06, & 
1203       3.65873E-06,3.74221E-06,3.82684E-06,3.91262E-06,3.99955E-06, & 
1204       4.08763E-06,4.17686E-06,4.26725E-06,4.35880E-06,4.45150E-06, & 
1205       4.54537E-06,4.64039E-06,4.73659E-06,4.83394E-06,4.93246E-06, & 
1206       5.03215E-06,5.13301E-06,5.23504E-06,5.33823E-06,5.44260E-06, & 
1207       5.54814E-06,5.65484E-06,5.76272E-06,5.87177E-06,5.98199E-06, & 
1208       6.09339E-06,6.20596E-06,6.31969E-06,6.43460E-06,6.55068E-06, & 
1209       6.66793E-06,6.78636E-06,6.90595E-06,7.02670E-06,7.14863E-06, & 
1210       7.27173E-06,7.39599E-06,7.52142E-06,7.64802E-06,7.77577E-06/               
1211       DATA (TOTPLNK(IDATA, 5),IDATA=101,150)/ &                                             
1212       7.90469E-06,8.03477E-06,8.16601E-06,8.29841E-06,8.43198E-06, & 
1213       8.56669E-06,8.70256E-06,8.83957E-06,8.97775E-06,9.11706E-06, & 
1214       9.25753E-06,9.39915E-06,9.54190E-06,9.68580E-06,9.83085E-06, & 
1215       9.97704E-06,1.01243E-05,1.02728E-05,1.04224E-05,1.05731E-05, & 
1216       1.07249E-05,1.08779E-05,1.10320E-05,1.11872E-05,1.13435E-05, & 
1217       1.15009E-05,1.16595E-05,1.18191E-05,1.19799E-05,1.21418E-05, & 
1218       1.23048E-05,1.24688E-05,1.26340E-05,1.28003E-05,1.29676E-05, & 
1219       1.31361E-05,1.33056E-05,1.34762E-05,1.36479E-05,1.38207E-05, & 
1220       1.39945E-05,1.41694E-05,1.43454E-05,1.45225E-05,1.47006E-05, & 
1221       1.48797E-05,1.50600E-05,1.52413E-05,1.54236E-05,1.56070E-05/               
1222       DATA (TOTPLNK(IDATA, 5),IDATA=151,181)/ &                                             
1223       1.57914E-05,1.59768E-05,1.61633E-05,1.63509E-05,1.65394E-05, & 
1224       1.67290E-05,1.69197E-05,1.71113E-05,1.73040E-05,1.74976E-05, & 
1225       1.76923E-05,1.78880E-05,1.80847E-05,1.82824E-05,1.84811E-05, & 
1226       1.86808E-05,1.88814E-05,1.90831E-05,1.92857E-05,1.94894E-05, & 
1227       1.96940E-05,1.98996E-05,2.01061E-05,2.03136E-05,2.05221E-05, & 
1228       2.07316E-05,2.09420E-05,2.11533E-05,2.13657E-05,2.15789E-05, & 
1229       2.17931E-05/                                                               
1230       DATA (TOTPLNK(IDATA, 6),IDATA=1,50)/ &                                                
1231       2.73493E-07,2.87408E-07,3.01848E-07,3.16825E-07,3.32352E-07, & 
1232       3.48439E-07,3.65100E-07,3.82346E-07,4.00189E-07,4.18641E-07, & 
1233       4.37715E-07,4.57422E-07,4.77774E-07,4.98784E-07,5.20464E-07, & 
1234       5.42824E-07,5.65879E-07,5.89638E-07,6.14115E-07,6.39320E-07, & 
1235       6.65266E-07,6.91965E-07,7.19427E-07,7.47666E-07,7.76691E-07, & 
1236       8.06516E-07,8.37151E-07,8.68607E-07,9.00896E-07,9.34029E-07, & 
1237       9.68018E-07,1.00287E-06,1.03860E-06,1.07522E-06,1.11274E-06, & 
1238       1.15117E-06,1.19052E-06,1.23079E-06,1.27201E-06,1.31418E-06, & 
1239       1.35731E-06,1.40141E-06,1.44650E-06,1.49257E-06,1.53965E-06, & 
1240       1.58773E-06,1.63684E-06,1.68697E-06,1.73815E-06,1.79037E-06/               
1241       DATA (TOTPLNK(IDATA, 6),IDATA=51,100)/ &                                              
1242       1.84365E-06,1.89799E-06,1.95341E-06,2.00991E-06,2.06750E-06, & 
1243       2.12619E-06,2.18599E-06,2.24691E-06,2.30895E-06,2.37212E-06, & 
1244       2.43643E-06,2.50189E-06,2.56851E-06,2.63628E-06,2.70523E-06, & 
1245       2.77536E-06,2.84666E-06,2.91916E-06,2.99286E-06,3.06776E-06, & 
1246       3.14387E-06,3.22120E-06,3.29975E-06,3.37953E-06,3.46054E-06, & 
1247       3.54280E-06,3.62630E-06,3.71105E-06,3.79707E-06,3.88434E-06, & 
1248       3.97288E-06,4.06270E-06,4.15380E-06,4.24617E-06,4.33984E-06, & 
1249       4.43479E-06,4.53104E-06,4.62860E-06,4.72746E-06,4.82763E-06, & 
1250       4.92911E-06,5.03191E-06,5.13603E-06,5.24147E-06,5.34824E-06, & 
1251       5.45634E-06,5.56578E-06,5.67656E-06,5.78867E-06,5.90213E-06/               
1252       DATA (TOTPLNK(IDATA, 6),IDATA=101,150)/ &                                             
1253       6.01694E-06,6.13309E-06,6.25060E-06,6.36947E-06,6.48968E-06, & 
1254       6.61126E-06,6.73420E-06,6.85850E-06,6.98417E-06,7.11120E-06, & 
1255       7.23961E-06,7.36938E-06,7.50053E-06,7.63305E-06,7.76694E-06, & 
1256       7.90221E-06,8.03887E-06,8.17690E-06,8.31632E-06,8.45710E-06, & 
1257       8.59928E-06,8.74282E-06,8.88776E-06,9.03409E-06,9.18179E-06, & 
1258       9.33088E-06,9.48136E-06,9.63323E-06,9.78648E-06,9.94111E-06, & 
1259       1.00971E-05,1.02545E-05,1.04133E-05,1.05735E-05,1.07351E-05, & 
1260       1.08980E-05,1.10624E-05,1.12281E-05,1.13952E-05,1.15637E-05, & 
1261       1.17335E-05,1.19048E-05,1.20774E-05,1.22514E-05,1.24268E-05, & 
1262       1.26036E-05,1.27817E-05,1.29612E-05,1.31421E-05,1.33244E-05/               
1263       DATA (TOTPLNK(IDATA, 6),IDATA=151,181)/ &                                             
1264       1.35080E-05,1.36930E-05,1.38794E-05,1.40672E-05,1.42563E-05, & 
1265       1.44468E-05,1.46386E-05,1.48318E-05,1.50264E-05,1.52223E-05, & 
1266       1.54196E-05,1.56182E-05,1.58182E-05,1.60196E-05,1.62223E-05, & 
1267       1.64263E-05,1.66317E-05,1.68384E-05,1.70465E-05,1.72559E-05, & 
1268       1.74666E-05,1.76787E-05,1.78921E-05,1.81069E-05,1.83230E-05, & 
1269       1.85404E-05,1.87591E-05,1.89791E-05,1.92005E-05,1.94232E-05, & 
1270       1.96471E-05/                                                               
1271       DATA (TOTPLNK(IDATA, 7),IDATA=1,50)/ &                                                
1272       1.25349E-07,1.32735E-07,1.40458E-07,1.48527E-07,1.56954E-07, & 
1273       1.65748E-07,1.74920E-07,1.84481E-07,1.94443E-07,2.04814E-07, & 
1274       2.15608E-07,2.26835E-07,2.38507E-07,2.50634E-07,2.63229E-07, & 
1275       2.76301E-07,2.89864E-07,3.03930E-07,3.18508E-07,3.33612E-07, & 
1276       3.49253E-07,3.65443E-07,3.82195E-07,3.99519E-07,4.17428E-07, & 
1277       4.35934E-07,4.55050E-07,4.74785E-07,4.95155E-07,5.16170E-07, & 
1278       5.37844E-07,5.60186E-07,5.83211E-07,6.06929E-07,6.31355E-07, & 
1279       6.56498E-07,6.82373E-07,7.08990E-07,7.36362E-07,7.64501E-07, & 
1280       7.93420E-07,8.23130E-07,8.53643E-07,8.84971E-07,9.17128E-07, & 
1281       9.50123E-07,9.83969E-07,1.01868E-06,1.05426E-06,1.09073E-06/               
1282       DATA (TOTPLNK(IDATA, 7),IDATA=51,100)/ &                                              
1283       1.12810E-06,1.16638E-06,1.20558E-06,1.24572E-06,1.28680E-06, & 
1284       1.32883E-06,1.37183E-06,1.41581E-06,1.46078E-06,1.50675E-06, & 
1285       1.55374E-06,1.60174E-06,1.65078E-06,1.70087E-06,1.75200E-06, & 
1286       1.80421E-06,1.85749E-06,1.91186E-06,1.96732E-06,2.02389E-06, & 
1287       2.08159E-06,2.14040E-06,2.20035E-06,2.26146E-06,2.32372E-06, & 
1288       2.38714E-06,2.45174E-06,2.51753E-06,2.58451E-06,2.65270E-06, & 
1289       2.72210E-06,2.79272E-06,2.86457E-06,2.93767E-06,3.01201E-06, & 
1290       3.08761E-06,3.16448E-06,3.24261E-06,3.32204E-06,3.40275E-06, & 
1291       3.48476E-06,3.56808E-06,3.65271E-06,3.73866E-06,3.82595E-06, & 
1292       3.91456E-06,4.00453E-06,4.09584E-06,4.18851E-06,4.28254E-06/               
1293       DATA (TOTPLNK(IDATA, 7),IDATA=101,150)/ &                                             
1294       4.37796E-06,4.47475E-06,4.57293E-06,4.67249E-06,4.77346E-06, & 
1295       4.87583E-06,4.97961E-06,5.08481E-06,5.19143E-06,5.29948E-06, & 
1296       5.40896E-06,5.51989E-06,5.63226E-06,5.74608E-06,5.86136E-06, & 
1297       5.97810E-06,6.09631E-06,6.21597E-06,6.33713E-06,6.45976E-06, & 
1298       6.58388E-06,6.70950E-06,6.83661E-06,6.96521E-06,7.09531E-06, & 
1299       7.22692E-06,7.36005E-06,7.49468E-06,7.63084E-06,7.76851E-06, & 
1300       7.90773E-06,8.04846E-06,8.19072E-06,8.33452E-06,8.47985E-06, & 
1301       8.62674E-06,8.77517E-06,8.92514E-06,9.07666E-06,9.22975E-06, & 
1302       9.38437E-06,9.54057E-06,9.69832E-06,9.85762E-06,1.00185E-05, & 
1303       1.01810E-05,1.03450E-05,1.05106E-05,1.06777E-05,1.08465E-05/               
1304       DATA (TOTPLNK(IDATA, 7),IDATA=151,181)/ &                                             
1305       1.10168E-05,1.11887E-05,1.13621E-05,1.15372E-05,1.17138E-05, & 
1306       1.18920E-05,1.20718E-05,1.22532E-05,1.24362E-05,1.26207E-05, & 
1307       1.28069E-05,1.29946E-05,1.31839E-05,1.33749E-05,1.35674E-05, & 
1308       1.37615E-05,1.39572E-05,1.41544E-05,1.43533E-05,1.45538E-05, & 
1309       1.47558E-05,1.49595E-05,1.51647E-05,1.53716E-05,1.55800E-05, & 
1310       1.57900E-05,1.60017E-05,1.62149E-05,1.64296E-05,1.66460E-05, & 
1311       1.68640E-05/                                                               
1312       DATA (TOTPLNK(IDATA, 8),IDATA=1,50)/ &                                                
1313       6.74445E-08,7.18176E-08,7.64153E-08,8.12456E-08,8.63170E-08, & 
1314       9.16378E-08,9.72168E-08,1.03063E-07,1.09184E-07,1.15591E-07, & 
1315       1.22292E-07,1.29296E-07,1.36613E-07,1.44253E-07,1.52226E-07, & 
1316       1.60540E-07,1.69207E-07,1.78236E-07,1.87637E-07,1.97421E-07, & 
1317       2.07599E-07,2.18181E-07,2.29177E-07,2.40598E-07,2.52456E-07, & 
1318       2.64761E-07,2.77523E-07,2.90755E-07,3.04468E-07,3.18673E-07, & 
1319       3.33381E-07,3.48603E-07,3.64352E-07,3.80638E-07,3.97474E-07, & 
1320       4.14871E-07,4.32841E-07,4.51395E-07,4.70547E-07,4.90306E-07, & 
1321       5.10687E-07,5.31699E-07,5.53357E-07,5.75670E-07,5.98652E-07, & 
1322       6.22315E-07,6.46672E-07,6.71731E-07,6.97511E-07,7.24018E-07/               
1323       DATA (TOTPLNK(IDATA, 8),IDATA=51,100)/ &                                              
1324       7.51266E-07,7.79269E-07,8.08038E-07,8.37584E-07,8.67922E-07, & 
1325       8.99061E-07,9.31016E-07,9.63797E-07,9.97417E-07,1.03189E-06, & 
1326       1.06722E-06,1.10343E-06,1.14053E-06,1.17853E-06,1.21743E-06, & 
1327       1.25726E-06,1.29803E-06,1.33974E-06,1.38241E-06,1.42606E-06, & 
1328       1.47068E-06,1.51630E-06,1.56293E-06,1.61056E-06,1.65924E-06, & 
1329       1.70894E-06,1.75971E-06,1.81153E-06,1.86443E-06,1.91841E-06, & 
1330       1.97350E-06,2.02968E-06,2.08699E-06,2.14543E-06,2.20500E-06, & 
1331       2.26573E-06,2.32762E-06,2.39068E-06,2.45492E-06,2.52036E-06, & 
1332       2.58700E-06,2.65485E-06,2.72393E-06,2.79424E-06,2.86580E-06, & 
1333       2.93861E-06,3.01269E-06,3.08803E-06,3.16467E-06,3.24259E-06/               
1334       DATA (TOTPLNK(IDATA, 8),IDATA=101,150)/ &                                             
1335       3.32181E-06,3.40235E-06,3.48420E-06,3.56739E-06,3.65192E-06, & 
1336       3.73779E-06,3.82502E-06,3.91362E-06,4.00359E-06,4.09494E-06, & 
1337       4.18768E-06,4.28182E-06,4.37737E-06,4.47434E-06,4.57273E-06, & 
1338       4.67254E-06,4.77380E-06,4.87651E-06,4.98067E-06,5.08630E-06, & 
1339       5.19339E-06,5.30196E-06,5.41201E-06,5.52356E-06,5.63660E-06, & 
1340       5.75116E-06,5.86722E-06,5.98479E-06,6.10390E-06,6.22453E-06, & 
1341       6.34669E-06,6.47042E-06,6.59569E-06,6.72252E-06,6.85090E-06, & 
1342       6.98085E-06,7.11238E-06,7.24549E-06,7.38019E-06,7.51646E-06, & 
1343       7.65434E-06,7.79382E-06,7.93490E-06,8.07760E-06,8.22192E-06, & 
1344       8.36784E-06,8.51540E-06,8.66459E-06,8.81542E-06,8.96786E-06/               
1345       DATA (TOTPLNK(IDATA, 8),IDATA=151,181)/ &                                             
1346       9.12197E-06,9.27772E-06,9.43513E-06,9.59419E-06,9.75490E-06, & 
1347       9.91728E-06,1.00813E-05,1.02471E-05,1.04144E-05,1.05835E-05, & 
1348       1.07543E-05,1.09267E-05,1.11008E-05,1.12766E-05,1.14541E-05, & 
1349       1.16333E-05,1.18142E-05,1.19969E-05,1.21812E-05,1.23672E-05, & 
1350       1.25549E-05,1.27443E-05,1.29355E-05,1.31284E-05,1.33229E-05, & 
1351       1.35193E-05,1.37173E-05,1.39170E-05,1.41185E-05,1.43217E-05, & 
1352       1.45267E-05/                                                               
1353       DATA (TOTPLNK(IDATA, 9),IDATA=1,50)/ &                                                
1354       2.61522E-08,2.80613E-08,3.00838E-08,3.22250E-08,3.44899E-08, & 
1355       3.68841E-08,3.94129E-08,4.20820E-08,4.48973E-08,4.78646E-08, & 
1356       5.09901E-08,5.42799E-08,5.77405E-08,6.13784E-08,6.52001E-08, & 
1357       6.92126E-08,7.34227E-08,7.78375E-08,8.24643E-08,8.73103E-08, & 
1358       9.23832E-08,9.76905E-08,1.03240E-07,1.09039E-07,1.15097E-07, & 
1359       1.21421E-07,1.28020E-07,1.34902E-07,1.42075E-07,1.49548E-07, & 
1360       1.57331E-07,1.65432E-07,1.73860E-07,1.82624E-07,1.91734E-07, & 
1361       2.01198E-07,2.11028E-07,2.21231E-07,2.31818E-07,2.42799E-07, & 
1362       2.54184E-07,2.65983E-07,2.78205E-07,2.90862E-07,3.03963E-07, & 
1363       3.17519E-07,3.31541E-07,3.46039E-07,3.61024E-07,3.76507E-07/               
1364       DATA (TOTPLNK(IDATA, 9),IDATA=51,100)/ &                                              
1365       3.92498E-07,4.09008E-07,4.26050E-07,4.43633E-07,4.61769E-07, & 
1366       4.80469E-07,4.99744E-07,5.19606E-07,5.40067E-07,5.61136E-07, & 
1367       5.82828E-07,6.05152E-07,6.28120E-07,6.51745E-07,6.76038E-07, & 
1368       7.01010E-07,7.26674E-07,7.53041E-07,7.80124E-07,8.07933E-07, & 
1369       8.36482E-07,8.65781E-07,8.95845E-07,9.26683E-07,9.58308E-07, & 
1370       9.90732E-07,1.02397E-06,1.05803E-06,1.09292E-06,1.12866E-06, & 
1371       1.16526E-06,1.20274E-06,1.24109E-06,1.28034E-06,1.32050E-06, & 
1372       1.36158E-06,1.40359E-06,1.44655E-06,1.49046E-06,1.53534E-06, & 
1373       1.58120E-06,1.62805E-06,1.67591E-06,1.72478E-06,1.77468E-06, & 
1374       1.82561E-06,1.87760E-06,1.93066E-06,1.98479E-06,2.04000E-06/               
1375       DATA (TOTPLNK(IDATA, 9),IDATA=101,150)/ &                                             
1376       2.09631E-06,2.15373E-06,2.21228E-06,2.27196E-06,2.33278E-06, & 
1377       2.39475E-06,2.45790E-06,2.52222E-06,2.58773E-06,2.65445E-06, & 
1378       2.72238E-06,2.79152E-06,2.86191E-06,2.93354E-06,3.00643E-06, & 
1379       3.08058E-06,3.15601E-06,3.23273E-06,3.31075E-06,3.39009E-06, & 
1380       3.47074E-06,3.55272E-06,3.63605E-06,3.72072E-06,3.80676E-06, & 
1381       3.89417E-06,3.98297E-06,4.07315E-06,4.16474E-06,4.25774E-06, & 
1382       4.35217E-06,4.44802E-06,4.54532E-06,4.64406E-06,4.74428E-06, & 
1383       4.84595E-06,4.94911E-06,5.05376E-06,5.15990E-06,5.26755E-06, & 
1384       5.37671E-06,5.48741E-06,5.59963E-06,5.71340E-06,5.82871E-06, & 
1385       5.94559E-06,6.06403E-06,6.18404E-06,6.30565E-06,6.42885E-06/               
1386       DATA (TOTPLNK(IDATA, 9),IDATA=151,181)/ &                                             
1387       6.55364E-06,6.68004E-06,6.80806E-06,6.93771E-06,7.06898E-06, & 
1388       7.20190E-06,7.33646E-06,7.47267E-06,7.61056E-06,7.75010E-06, & 
1389       7.89133E-06,8.03423E-06,8.17884E-06,8.32514E-06,8.47314E-06, & 
1390       8.62284E-06,8.77427E-06,8.92743E-06,9.08231E-06,9.23893E-06, & 
1391       9.39729E-06,9.55741E-06,9.71927E-06,9.88291E-06,1.00483E-05, & 
1392       1.02155E-05,1.03844E-05,1.05552E-05,1.07277E-05,1.09020E-05, & 
1393       1.10781E-05/                                                               
1394       DATA (TOTPLNK(IDATA,10),IDATA=1,50)/ &                                                
1395       8.89300E-09,9.63263E-09,1.04235E-08,1.12685E-08,1.21703E-08, & 
1396       1.31321E-08,1.41570E-08,1.52482E-08,1.64090E-08,1.76428E-08, & 
1397       1.89533E-08,2.03441E-08,2.18190E-08,2.33820E-08,2.50370E-08, & 
1398       2.67884E-08,2.86402E-08,3.05969E-08,3.26632E-08,3.48436E-08, & 
1399       3.71429E-08,3.95660E-08,4.21179E-08,4.48040E-08,4.76294E-08, & 
1400       5.05996E-08,5.37201E-08,5.69966E-08,6.04349E-08,6.40411E-08, & 
1401       6.78211E-08,7.17812E-08,7.59276E-08,8.02670E-08,8.48059E-08, & 
1402       8.95508E-08,9.45090E-08,9.96873E-08,1.05093E-07,1.10733E-07, & 
1403       1.16614E-07,1.22745E-07,1.29133E-07,1.35786E-07,1.42711E-07, & 
1404       1.49916E-07,1.57410E-07,1.65202E-07,1.73298E-07,1.81709E-07/               
1405       DATA (TOTPLNK(IDATA,10),IDATA=51,100)/ &                                              
1406       1.90441E-07,1.99505E-07,2.08908E-07,2.18660E-07,2.28770E-07, & 
1407       2.39247E-07,2.50101E-07,2.61340E-07,2.72974E-07,2.85013E-07, & 
1408       2.97467E-07,3.10345E-07,3.23657E-07,3.37413E-07,3.51623E-07, & 
1409       3.66298E-07,3.81448E-07,3.97082E-07,4.13212E-07,4.29848E-07, & 
1410       4.47000E-07,4.64680E-07,4.82898E-07,5.01664E-07,5.20991E-07, & 
1411       5.40888E-07,5.61369E-07,5.82440E-07,6.04118E-07,6.26410E-07, & 
1412       6.49329E-07,6.72887E-07,6.97095E-07,7.21964E-07,7.47506E-07, & 
1413       7.73732E-07,8.00655E-07,8.28287E-07,8.56635E-07,8.85717E-07, & 
1414       9.15542E-07,9.46122E-07,9.77469E-07,1.00960E-06,1.04251E-06, & 
1415       1.07623E-06,1.11077E-06,1.14613E-06,1.18233E-06,1.21939E-06/               
1416       DATA (TOTPLNK(IDATA,10),IDATA=101,150)/ &                                             
1417       1.25730E-06,1.29610E-06,1.33578E-06,1.37636E-06,1.41785E-06, & 
1418       1.46027E-06,1.50362E-06,1.54792E-06,1.59319E-06,1.63942E-06, & 
1419       1.68665E-06,1.73487E-06,1.78410E-06,1.83435E-06,1.88564E-06, & 
1420       1.93797E-06,1.99136E-06,2.04582E-06,2.10137E-06,2.15801E-06, & 
1421       2.21576E-06,2.27463E-06,2.33462E-06,2.39577E-06,2.45806E-06, & 
1422       2.52153E-06,2.58617E-06,2.65201E-06,2.71905E-06,2.78730E-06, & 
1423       2.85678E-06,2.92749E-06,2.99946E-06,3.07269E-06,3.14720E-06, & 
1424       3.22299E-06,3.30007E-06,3.37847E-06,3.45818E-06,3.53923E-06, & 
1425       3.62161E-06,3.70535E-06,3.79046E-06,3.87695E-06,3.96481E-06, & 
1426       4.05409E-06,4.14477E-06,4.23687E-06,4.33040E-06,4.42538E-06/               
1427       DATA (TOTPLNK(IDATA,10),IDATA=151,181)/ &                                             
1428       4.52180E-06,4.61969E-06,4.71905E-06,4.81991E-06,4.92226E-06, & 
1429       5.02611E-06,5.13148E-06,5.23839E-06,5.34681E-06,5.45681E-06, & 
1430       5.56835E-06,5.68146E-06,5.79614E-06,5.91242E-06,6.03030E-06, & 
1431       6.14978E-06,6.27088E-06,6.39360E-06,6.51798E-06,6.64398E-06, & 
1432       6.77165E-06,6.90099E-06,7.03198E-06,7.16468E-06,7.29906E-06, & 
1433       7.43514E-06,7.57294E-06,7.71244E-06,7.85369E-06,7.99666E-06, & 
1434       8.14138E-06/                                                               
1435       DATA (TOTPLNK(IDATA,11),IDATA=1,50)/ &                                                
1436       2.53767E-09,2.77242E-09,3.02564E-09,3.29851E-09,3.59228E-09, & 
1437       3.90825E-09,4.24777E-09,4.61227E-09,5.00322E-09,5.42219E-09, & 
1438       5.87080E-09,6.35072E-09,6.86370E-09,7.41159E-09,7.99628E-09, & 
1439       8.61974E-09,9.28404E-09,9.99130E-09,1.07437E-08,1.15436E-08, & 
1440       1.23933E-08,1.32953E-08,1.42522E-08,1.52665E-08,1.63410E-08, & 
1441       1.74786E-08,1.86820E-08,1.99542E-08,2.12985E-08,2.27179E-08, & 
1442       2.42158E-08,2.57954E-08,2.74604E-08,2.92141E-08,3.10604E-08, & 
1443       3.30029E-08,3.50457E-08,3.71925E-08,3.94476E-08,4.18149E-08, & 
1444       4.42991E-08,4.69043E-08,4.96352E-08,5.24961E-08,5.54921E-08, & 
1445       5.86277E-08,6.19081E-08,6.53381E-08,6.89231E-08,7.26681E-08/               
1446       DATA (TOTPLNK(IDATA,11),IDATA=51,100)/ &                                              
1447       7.65788E-08,8.06604E-08,8.49187E-08,8.93591E-08,9.39879E-08, & 
1448       9.88106E-08,1.03834E-07,1.09063E-07,1.14504E-07,1.20165E-07, & 
1449       1.26051E-07,1.32169E-07,1.38525E-07,1.45128E-07,1.51982E-07, & 
1450       1.59096E-07,1.66477E-07,1.74132E-07,1.82068E-07,1.90292E-07, & 
1451       1.98813E-07,2.07638E-07,2.16775E-07,2.26231E-07,2.36015E-07, & 
1452       2.46135E-07,2.56599E-07,2.67415E-07,2.78592E-07,2.90137E-07, & 
1453       3.02061E-07,3.14371E-07,3.27077E-07,3.40186E-07,3.53710E-07, & 
1454       3.67655E-07,3.82031E-07,3.96848E-07,4.12116E-07,4.27842E-07, & 
1455       4.44039E-07,4.60713E-07,4.77876E-07,4.95537E-07,5.13706E-07, & 
1456       5.32392E-07,5.51608E-07,5.71360E-07,5.91662E-07,6.12521E-07/               
1457       DATA (TOTPLNK(IDATA,11),IDATA=101,150)/ &                                             
1458       6.33950E-07,6.55958E-07,6.78556E-07,7.01753E-07,7.25562E-07, & 
1459       7.49992E-07,7.75055E-07,8.00760E-07,8.27120E-07,8.54145E-07, & 
1460       8.81845E-07,9.10233E-07,9.39318E-07,9.69113E-07,9.99627E-07, & 
1461       1.03087E-06,1.06286E-06,1.09561E-06,1.12912E-06,1.16340E-06, & 
1462       1.19848E-06,1.23435E-06,1.27104E-06,1.30855E-06,1.34690E-06, & 
1463       1.38609E-06,1.42614E-06,1.46706E-06,1.50886E-06,1.55155E-06, & 
1464       1.59515E-06,1.63967E-06,1.68512E-06,1.73150E-06,1.77884E-06, & 
1465       1.82715E-06,1.87643E-06,1.92670E-06,1.97797E-06,2.03026E-06, & 
1466       2.08356E-06,2.13791E-06,2.19330E-06,2.24975E-06,2.30728E-06, & 
1467       2.36589E-06,2.42560E-06,2.48641E-06,2.54835E-06,2.61142E-06/               
1468       DATA (TOTPLNK(IDATA,11),IDATA=151,181)/ &                                             
1469       2.67563E-06,2.74100E-06,2.80754E-06,2.87526E-06,2.94417E-06, & 
1470       3.01429E-06,3.08562E-06,3.15819E-06,3.23199E-06,3.30704E-06, & 
1471       3.38336E-06,3.46096E-06,3.53984E-06,3.62002E-06,3.70151E-06, & 
1472       3.78433E-06,3.86848E-06,3.95399E-06,4.04084E-06,4.12907E-06, & 
1473       4.21868E-06,4.30968E-06,4.40209E-06,4.49592E-06,4.59117E-06, & 
1474       4.68786E-06,4.78600E-06,4.88561E-06,4.98669E-06,5.08926E-06, & 
1475       5.19332E-06/                                                               
1476       DATA (TOTPLNK(IDATA,12),IDATA=1,50)/ &                                                
1477       2.73921E-10,3.04500E-10,3.38056E-10,3.74835E-10,4.15099E-10, & 
1478       4.59126E-10,5.07214E-10,5.59679E-10,6.16857E-10,6.79103E-10, & 
1479       7.46796E-10,8.20335E-10,9.00144E-10,9.86671E-10,1.08039E-09, & 
1480       1.18180E-09,1.29142E-09,1.40982E-09,1.53757E-09,1.67529E-09, & 
1481       1.82363E-09,1.98327E-09,2.15492E-09,2.33932E-09,2.53726E-09, & 
1482       2.74957E-09,2.97710E-09,3.22075E-09,3.48145E-09,3.76020E-09, & 
1483       4.05801E-09,4.37595E-09,4.71513E-09,5.07672E-09,5.46193E-09, & 
1484       5.87201E-09,6.30827E-09,6.77205E-09,7.26480E-09,7.78794E-09, & 
1485       8.34304E-09,8.93163E-09,9.55537E-09,1.02159E-08,1.09151E-08, & 
1486       1.16547E-08,1.24365E-08,1.32625E-08,1.41348E-08,1.50554E-08/               
1487       DATA (TOTPLNK(IDATA,12),IDATA=51,100)/ &                                              
1488       1.60264E-08,1.70500E-08,1.81285E-08,1.92642E-08,2.04596E-08, & 
1489       2.17171E-08,2.30394E-08,2.44289E-08,2.58885E-08,2.74209E-08, & 
1490       2.90290E-08,3.07157E-08,3.24841E-08,3.43371E-08,3.62782E-08, & 
1491       3.83103E-08,4.04371E-08,4.26617E-08,4.49878E-08,4.74190E-08, & 
1492       4.99589E-08,5.26113E-08,5.53801E-08,5.82692E-08,6.12826E-08, & 
1493       6.44245E-08,6.76991E-08,7.11105E-08,7.46634E-08,7.83621E-08, & 
1494       8.22112E-08,8.62154E-08,9.03795E-08,9.47081E-08,9.92066E-08, & 
1495       1.03879E-07,1.08732E-07,1.13770E-07,1.18998E-07,1.24422E-07, & 
1496       1.30048E-07,1.35880E-07,1.41924E-07,1.48187E-07,1.54675E-07, & 
1497       1.61392E-07,1.68346E-07,1.75543E-07,1.82988E-07,1.90688E-07/               
1498       DATA (TOTPLNK(IDATA,12),IDATA=101,150)/ &                                             
1499       1.98650E-07,2.06880E-07,2.15385E-07,2.24172E-07,2.33247E-07, & 
1500       2.42617E-07,2.52289E-07,2.62272E-07,2.72571E-07,2.83193E-07, & 
1501       2.94147E-07,3.05440E-07,3.17080E-07,3.29074E-07,3.41430E-07, & 
1502       3.54155E-07,3.67259E-07,3.80747E-07,3.94631E-07,4.08916E-07, & 
1503       4.23611E-07,4.38725E-07,4.54267E-07,4.70245E-07,4.86666E-07, & 
1504       5.03541E-07,5.20879E-07,5.38687E-07,5.56975E-07,5.75751E-07, & 
1505       5.95026E-07,6.14808E-07,6.35107E-07,6.55932E-07,6.77293E-07, & 
1506       6.99197E-07,7.21656E-07,7.44681E-07,7.68278E-07,7.92460E-07, & 
1507       8.17235E-07,8.42614E-07,8.68606E-07,8.95223E-07,9.22473E-07, & 
1508       9.50366E-07,9.78915E-07,1.00813E-06,1.03802E-06,1.06859E-06/               
1509       DATA (TOTPLNK(IDATA,12),IDATA=151,181)/ &                                             
1510       1.09986E-06,1.13184E-06,1.16453E-06,1.19796E-06,1.23212E-06, & 
1511       1.26703E-06,1.30270E-06,1.33915E-06,1.37637E-06,1.41440E-06, & 
1512       1.45322E-06,1.49286E-06,1.53333E-06,1.57464E-06,1.61679E-06, & 
1513       1.65981E-06,1.70370E-06,1.74847E-06,1.79414E-06,1.84071E-06, & 
1514       1.88821E-06,1.93663E-06,1.98599E-06,2.03631E-06,2.08759E-06, & 
1515       2.13985E-06,2.19310E-06,2.24734E-06,2.30260E-06,2.35888E-06, & 
1516       2.41619E-06/                                                               
1517       DATA (TOTPLNK(IDATA,13),IDATA=1,50)/ &                                                
1518       4.53634E-11,5.11435E-11,5.75754E-11,6.47222E-11,7.26531E-11, & 
1519       8.14420E-11,9.11690E-11,1.01921E-10,1.13790E-10,1.26877E-10, & 
1520       1.41288E-10,1.57140E-10,1.74555E-10,1.93665E-10,2.14613E-10, & 
1521       2.37548E-10,2.62633E-10,2.90039E-10,3.19948E-10,3.52558E-10, & 
1522       3.88073E-10,4.26716E-10,4.68719E-10,5.14331E-10,5.63815E-10, & 
1523       6.17448E-10,6.75526E-10,7.38358E-10,8.06277E-10,8.79625E-10, & 
1524       9.58770E-10,1.04410E-09,1.13602E-09,1.23495E-09,1.34135E-09, & 
1525       1.45568E-09,1.57845E-09,1.71017E-09,1.85139E-09,2.00268E-09, & 
1526       2.16464E-09,2.33789E-09,2.52309E-09,2.72093E-09,2.93212E-09, & 
1527       3.15740E-09,3.39757E-09,3.65341E-09,3.92579E-09,4.21559E-09/               
1528       DATA (TOTPLNK(IDATA,13),IDATA=51,100)/ &                                              
1529       4.52372E-09,4.85115E-09,5.19886E-09,5.56788E-09,5.95928E-09, & 
1530       6.37419E-09,6.81375E-09,7.27917E-09,7.77168E-09,8.29256E-09, & 
1531       8.84317E-09,9.42487E-09,1.00391E-08,1.06873E-08,1.13710E-08, & 
1532       1.20919E-08,1.28515E-08,1.36514E-08,1.44935E-08,1.53796E-08, & 
1533       1.63114E-08,1.72909E-08,1.83201E-08,1.94008E-08,2.05354E-08, & 
1534       2.17258E-08,2.29742E-08,2.42830E-08,2.56545E-08,2.70910E-08, & 
1535       2.85950E-08,3.01689E-08,3.18155E-08,3.35373E-08,3.53372E-08, & 
1536       3.72177E-08,3.91818E-08,4.12325E-08,4.33727E-08,4.56056E-08, & 
1537       4.79342E-08,5.03617E-08,5.28915E-08,5.55270E-08,5.82715E-08, & 
1538       6.11286E-08,6.41019E-08,6.71951E-08,7.04119E-08,7.37560E-08/               
1539       DATA (TOTPLNK(IDATA,13),IDATA=101,150)/ &                                             
1540       7.72315E-08,8.08424E-08,8.45927E-08,8.84866E-08,9.25281E-08, & 
1541       9.67218E-08,1.01072E-07,1.05583E-07,1.10260E-07,1.15107E-07, & 
1542       1.20128E-07,1.25330E-07,1.30716E-07,1.36291E-07,1.42061E-07, & 
1543       1.48031E-07,1.54206E-07,1.60592E-07,1.67192E-07,1.74015E-07, & 
1544       1.81064E-07,1.88345E-07,1.95865E-07,2.03628E-07,2.11643E-07, & 
1545       2.19912E-07,2.28443E-07,2.37244E-07,2.46318E-07,2.55673E-07, & 
1546       2.65316E-07,2.75252E-07,2.85489E-07,2.96033E-07,3.06891E-07, & 
1547       3.18070E-07,3.29576E-07,3.41417E-07,3.53600E-07,3.66133E-07, & 
1548       3.79021E-07,3.92274E-07,4.05897E-07,4.19899E-07,4.34288E-07, & 
1549       4.49071E-07,4.64255E-07,4.79850E-07,4.95863E-07,5.12300E-07/               
1550       DATA (TOTPLNK(IDATA,13),IDATA=151,181)/ &                                             
1551       5.29172E-07,5.46486E-07,5.64250E-07,5.82473E-07,6.01164E-07, & 
1552       6.20329E-07,6.39979E-07,6.60122E-07,6.80767E-07,7.01922E-07, & 
1553       7.23596E-07,7.45800E-07,7.68539E-07,7.91826E-07,8.15669E-07, & 
1554       8.40076E-07,8.65058E-07,8.90623E-07,9.16783E-07,9.43544E-07, & 
1555       9.70917E-07,9.98912E-07,1.02754E-06,1.05681E-06,1.08673E-06, & 
1556       1.11731E-06,1.14856E-06,1.18050E-06,1.21312E-06,1.24645E-06, & 
1557       1.28049E-06/                                                               
1558       DATA (TOTPLNK(IDATA,14),IDATA=1,50)/ &                                                
1559       1.40113E-11,1.59358E-11,1.80960E-11,2.05171E-11,2.32266E-11, & 
1560       2.62546E-11,2.96335E-11,3.33990E-11,3.75896E-11,4.22469E-11, & 
1561       4.74164E-11,5.31466E-11,5.94905E-11,6.65054E-11,7.42522E-11, & 
1562       8.27975E-11,9.22122E-11,1.02573E-10,1.13961E-10,1.26466E-10, & 
1563       1.40181E-10,1.55206E-10,1.71651E-10,1.89630E-10,2.09265E-10, & 
1564       2.30689E-10,2.54040E-10,2.79467E-10,3.07128E-10,3.37190E-10, & 
1565       3.69833E-10,4.05243E-10,4.43623E-10,4.85183E-10,5.30149E-10, & 
1566       5.78755E-10,6.31255E-10,6.87910E-10,7.49002E-10,8.14824E-10, & 
1567       8.85687E-10,9.61914E-10,1.04385E-09,1.13186E-09,1.22631E-09, & 
1568       1.32761E-09,1.43617E-09,1.55243E-09,1.67686E-09,1.80992E-09/               
1569       DATA (TOTPLNK(IDATA,14),IDATA=51,100)/ &                                              
1570       1.95212E-09,2.10399E-09,2.26607E-09,2.43895E-09,2.62321E-09, & 
1571       2.81949E-09,3.02844E-09,3.25073E-09,3.48707E-09,3.73820E-09, & 
1572       4.00490E-09,4.28794E-09,4.58819E-09,4.90647E-09,5.24371E-09, & 
1573       5.60081E-09,5.97875E-09,6.37854E-09,6.80120E-09,7.24782E-09, & 
1574       7.71950E-09,8.21740E-09,8.74271E-09,9.29666E-09,9.88054E-09, & 
1575       1.04956E-08,1.11434E-08,1.18251E-08,1.25422E-08,1.32964E-08, & 
1576       1.40890E-08,1.49217E-08,1.57961E-08,1.67140E-08,1.76771E-08, & 
1577       1.86870E-08,1.97458E-08,2.08553E-08,2.20175E-08,2.32342E-08, & 
1578       2.45077E-08,2.58401E-08,2.72334E-08,2.86900E-08,3.02122E-08, & 
1579       3.18021E-08,3.34624E-08,3.51954E-08,3.70037E-08,3.88899E-08/               
1580       DATA (TOTPLNK(IDATA,14),IDATA=101,150)/ &                                             
1581       4.08568E-08,4.29068E-08,4.50429E-08,4.72678E-08,4.95847E-08, & 
1582       5.19963E-08,5.45058E-08,5.71161E-08,5.98309E-08,6.26529E-08, & 
1583       6.55857E-08,6.86327E-08,7.17971E-08,7.50829E-08,7.84933E-08, & 
1584       8.20323E-08,8.57035E-08,8.95105E-08,9.34579E-08,9.75488E-08, & 
1585       1.01788E-07,1.06179E-07,1.10727E-07,1.15434E-07,1.20307E-07, & 
1586       1.25350E-07,1.30566E-07,1.35961E-07,1.41539E-07,1.47304E-07, & 
1587       1.53263E-07,1.59419E-07,1.65778E-07,1.72345E-07,1.79124E-07, & 
1588       1.86122E-07,1.93343E-07,2.00792E-07,2.08476E-07,2.16400E-07, & 
1589       2.24568E-07,2.32988E-07,2.41666E-07,2.50605E-07,2.59813E-07, & 
1590       2.69297E-07,2.79060E-07,2.89111E-07,2.99455E-07,3.10099E-07/               
1591       DATA (TOTPLNK(IDATA,14),IDATA=151,181)/ &                                             
1592       3.21049E-07,3.32311E-07,3.43893E-07,3.55801E-07,3.68041E-07, & 
1593       3.80621E-07,3.93547E-07,4.06826E-07,4.20465E-07,4.34473E-07, & 
1594       4.48856E-07,4.63620E-07,4.78774E-07,4.94325E-07,5.10280E-07, & 
1595       5.26648E-07,5.43436E-07,5.60652E-07,5.78302E-07,5.96397E-07, & 
1596       6.14943E-07,6.33949E-07,6.53421E-07,6.73370E-07,6.93803E-07, & 
1597       7.14731E-07,7.36157E-07,7.58095E-07,7.80549E-07,8.03533E-07, & 
1598       8.27050E-07/                                                               
1599       DATA (TOTPLNK(IDATA,15),IDATA=1,50)/ &                                                
1600       3.90483E-12,4.47999E-12,5.13122E-12,5.86739E-12,6.69829E-12, & 
1601       7.63467E-12,8.68833E-12,9.87221E-12,1.12005E-11,1.26885E-11, & 
1602       1.43534E-11,1.62134E-11,1.82888E-11,2.06012E-11,2.31745E-11, & 
1603       2.60343E-11,2.92087E-11,3.27277E-11,3.66242E-11,4.09334E-11, & 
1604       4.56935E-11,5.09455E-11,5.67338E-11,6.31057E-11,7.01127E-11, & 
1605       7.78096E-11,8.62554E-11,9.55130E-11,1.05651E-10,1.16740E-10, & 
1606       1.28858E-10,1.42089E-10,1.56519E-10,1.72243E-10,1.89361E-10, & 
1607       2.07978E-10,2.28209E-10,2.50173E-10,2.73999E-10,2.99820E-10, & 
1608       3.27782E-10,3.58034E-10,3.90739E-10,4.26067E-10,4.64196E-10, & 
1609       5.05317E-10,5.49631E-10,5.97347E-10,6.48689E-10,7.03891E-10/               
1610       DATA (TOTPLNK(IDATA,15),IDATA=51,100)/ &                                              
1611       7.63201E-10,8.26876E-10,8.95192E-10,9.68430E-10,1.04690E-09, & 
1612       1.13091E-09,1.22079E-09,1.31689E-09,1.41957E-09,1.52922E-09, & 
1613       1.64623E-09,1.77101E-09,1.90401E-09,2.04567E-09,2.19647E-09, & 
1614       2.35690E-09,2.52749E-09,2.70875E-09,2.90127E-09,3.10560E-09, & 
1615       3.32238E-09,3.55222E-09,3.79578E-09,4.05375E-09,4.32682E-09, & 
1616       4.61574E-09,4.92128E-09,5.24420E-09,5.58536E-09,5.94558E-09, & 
1617       6.32575E-09,6.72678E-09,7.14964E-09,7.59526E-09,8.06470E-09, & 
1618       8.55897E-09,9.07916E-09,9.62638E-09,1.02018E-08,1.08066E-08, & 
1619       1.14420E-08,1.21092E-08,1.28097E-08,1.35446E-08,1.43155E-08, & 
1620       1.51237E-08,1.59708E-08,1.68581E-08,1.77873E-08,1.87599E-08/               
1621       DATA (TOTPLNK(IDATA,15),IDATA=101,150)/ &                                             
1622       1.97777E-08,2.08423E-08,2.19555E-08,2.31190E-08,2.43348E-08, & 
1623       2.56045E-08,2.69302E-08,2.83140E-08,2.97578E-08,3.12636E-08, & 
1624       3.28337E-08,3.44702E-08,3.61755E-08,3.79516E-08,3.98012E-08, & 
1625       4.17265E-08,4.37300E-08,4.58143E-08,4.79819E-08,5.02355E-08, & 
1626       5.25777E-08,5.50114E-08,5.75393E-08,6.01644E-08,6.28896E-08, & 
1627       6.57177E-08,6.86521E-08,7.16959E-08,7.48520E-08,7.81239E-08, & 
1628       8.15148E-08,8.50282E-08,8.86675E-08,9.24362E-08,9.63380E-08, & 
1629       1.00376E-07,1.04555E-07,1.08878E-07,1.13349E-07,1.17972E-07, & 
1630       1.22751E-07,1.27690E-07,1.32793E-07,1.38064E-07,1.43508E-07, & 
1631       1.49129E-07,1.54931E-07,1.60920E-07,1.67099E-07,1.73473E-07/               
1632       DATA (TOTPLNK(IDATA,15),IDATA=151,181)/ &                                             
1633       1.80046E-07,1.86825E-07,1.93812E-07,2.01014E-07,2.08436E-07, & 
1634       2.16082E-07,2.23957E-07,2.32067E-07,2.40418E-07,2.49013E-07, & 
1635       2.57860E-07,2.66963E-07,2.76328E-07,2.85961E-07,2.95868E-07, & 
1636       3.06053E-07,3.16524E-07,3.27286E-07,3.38345E-07,3.49707E-07, & 
1637       3.61379E-07,3.73367E-07,3.85676E-07,3.98315E-07,4.11287E-07, & 
1638       4.24602E-07,4.38265E-07,4.52283E-07,4.66662E-07,4.81410E-07, & 
1639       4.96535E-07/                                                               
1640       DATA (TOTPLNK(IDATA,16),IDATA=1,50)/ &                                                
1641       4.65378E-13,5.41927E-13,6.29913E-13,7.30869E-13,8.46510E-13, & 
1642       9.78750E-13,1.12972E-12,1.30181E-12,1.49764E-12,1.72016E-12, & 
1643       1.97260E-12,2.25858E-12,2.58206E-12,2.94744E-12,3.35955E-12, & 
1644       3.82372E-12,4.34581E-12,4.93225E-12,5.59010E-12,6.32711E-12, & 
1645       7.15171E-12,8.07317E-12,9.10159E-12,1.02480E-11,1.15244E-11, & 
1646       1.29438E-11,1.45204E-11,1.62697E-11,1.82084E-11,2.03545E-11, & 
1647       2.27278E-11,2.53494E-11,2.82424E-11,3.14313E-11,3.49431E-11, & 
1648       3.88064E-11,4.30522E-11,4.77139E-11,5.28273E-11,5.84308E-11, & 
1649       6.45658E-11,7.12764E-11,7.86103E-11,8.66176E-11,9.53534E-11, & 
1650       1.04875E-10,1.15245E-10,1.26528E-10,1.38796E-10,1.52123E-10/               
1651       DATA (TOTPLNK(IDATA,16),IDATA=51,100)/ &                                              
1652       1.66590E-10,1.82281E-10,1.99287E-10,2.17704E-10,2.37632E-10, & 
1653       2.59182E-10,2.82468E-10,3.07610E-10,3.34738E-10,3.63988E-10, & 
1654       3.95504E-10,4.29438E-10,4.65951E-10,5.05212E-10,5.47402E-10, & 
1655       5.92707E-10,6.41329E-10,6.93477E-10,7.49371E-10,8.09242E-10, & 
1656       8.73338E-10,9.41911E-10,1.01524E-09,1.09359E-09,1.17728E-09, & 
1657       1.26660E-09,1.36190E-09,1.46350E-09,1.57177E-09,1.68709E-09, & 
1658       1.80984E-09,1.94044E-09,2.07932E-09,2.22693E-09,2.38373E-09, & 
1659       2.55021E-09,2.72689E-09,2.91429E-09,3.11298E-09,3.32353E-09, & 
1660       3.54655E-09,3.78265E-09,4.03251E-09,4.29679E-09,4.57620E-09, & 
1661       4.87148E-09,5.18341E-09,5.51276E-09,5.86037E-09,6.22708E-09/               
1662       DATA (TOTPLNK(IDATA,16),IDATA=101,150)/ &                                             
1663       6.61381E-09,7.02145E-09,7.45097E-09,7.90336E-09,8.37967E-09, & 
1664       8.88092E-09,9.40827E-09,9.96280E-09,1.05457E-08,1.11583E-08, & 
1665       1.18017E-08,1.24773E-08,1.31865E-08,1.39306E-08,1.47111E-08, & 
1666       1.55295E-08,1.63872E-08,1.72860E-08,1.82274E-08,1.92132E-08, & 
1667       2.02450E-08,2.13247E-08,2.24541E-08,2.36352E-08,2.48699E-08, & 
1668       2.61602E-08,2.75082E-08,2.89161E-08,3.03860E-08,3.19203E-08, & 
1669       3.35213E-08,3.51913E-08,3.69330E-08,3.87486E-08,4.06411E-08, & 
1670       4.26129E-08,4.46668E-08,4.68058E-08,4.90325E-08,5.13502E-08, & 
1671       5.37617E-08,5.62703E-08,5.88791E-08,6.15915E-08,6.44107E-08, & 
1672       6.73404E-08,7.03841E-08,7.35453E-08,7.68278E-08,8.02355E-08/               
1673       DATA (TOTPLNK(IDATA,16),IDATA=151,181)/ &                                             
1674       8.37721E-08,8.74419E-08,9.12486E-08,9.51968E-08,9.92905E-08, & 
1675       1.03534E-07,1.07932E-07,1.12490E-07,1.17211E-07,1.22100E-07, & 
1676       1.27163E-07,1.32404E-07,1.37829E-07,1.43443E-07,1.49250E-07, & 
1677       1.55257E-07,1.61470E-07,1.67893E-07,1.74532E-07,1.81394E-07, & 
1678       1.88485E-07,1.95810E-07,2.03375E-07,2.11189E-07,2.19256E-07, & 
1679       2.27583E-07,2.36177E-07,2.45046E-07,2.54196E-07,2.63634E-07, & 
1680       2.73367E-07/                                                               
1681                                                                                  
1682       DATA (TOTPLK16(IDATA),IDATA=1,50)/ &                                                  
1683       4.46128E-13,5.19008E-13,6.02681E-13,6.98580E-13,8.08302E-13, & 
1684       9.33629E-13,1.07654E-12,1.23925E-12,1.42419E-12,1.63407E-12, & 
1685       1.87190E-12,2.14099E-12,2.44498E-12,2.78793E-12,3.17424E-12, & 
1686       3.60881E-12,4.09698E-12,4.64461E-12,5.25813E-12,5.94456E-12, & 
1687       6.71156E-12,7.56752E-12,8.52154E-12,9.58357E-12,1.07644E-11, & 
1688       1.20758E-11,1.35304E-11,1.51420E-11,1.69256E-11,1.88973E-11, & 
1689       2.10746E-11,2.34762E-11,2.61227E-11,2.90356E-11,3.22388E-11, & 
1690       3.57574E-11,3.96187E-11,4.38519E-11,4.84883E-11,5.35616E-11, & 
1691       5.91075E-11,6.51647E-11,7.17743E-11,7.89797E-11,8.68284E-11, & 
1692       9.53697E-11,1.04658E-10,1.14748E-10,1.25701E-10,1.37582E-10/               
1693       DATA (TOTPLK16(IDATA),IDATA=51,100)/ &                                                
1694       1.50457E-10,1.64400E-10,1.79487E-10,1.95799E-10,2.13422E-10, & 
1695       2.32446E-10,2.52970E-10,2.75094E-10,2.98925E-10,3.24578E-10, & 
1696       3.52172E-10,3.81833E-10,4.13695E-10,4.47897E-10,4.84588E-10, & 
1697       5.23922E-10,5.66063E-10,6.11182E-10,6.59459E-10,7.11081E-10, & 
1698       7.66251E-10,8.25172E-10,8.88065E-10,9.55155E-10,1.02668E-09, & 
1699       1.10290E-09,1.18406E-09,1.27044E-09,1.36233E-09,1.46002E-09, & 
1700       1.56382E-09,1.67406E-09,1.79108E-09,1.91522E-09,2.04686E-09, & 
1701       2.18637E-09,2.33416E-09,2.49063E-09,2.65622E-09,2.83136E-09, & 
1702       3.01653E-09,3.21221E-09,3.41890E-09,3.63712E-09,3.86740E-09, & 
1703       4.11030E-09,4.36641E-09,4.63631E-09,4.92064E-09,5.22003E-09/               
1704       DATA (TOTPLK16(IDATA),IDATA=101,150)/ &                                               
1705       5.53516E-09,5.86670E-09,6.21538E-09,6.58191E-09,6.96708E-09, & 
1706       7.37165E-09,7.79645E-09,8.24229E-09,8.71007E-09,9.20066E-09, & 
1707       9.71498E-09,1.02540E-08,1.08186E-08,1.14100E-08,1.20290E-08, & 
1708       1.26767E-08,1.33544E-08,1.40630E-08,1.48038E-08,1.55780E-08, & 
1709       1.63867E-08,1.72313E-08,1.81130E-08,1.90332E-08,1.99932E-08, & 
1710       2.09945E-08,2.20385E-08,2.31267E-08,2.42605E-08,2.54416E-08, & 
1711       2.66716E-08,2.79520E-08,2.92846E-08,3.06711E-08,3.21133E-08, & 
1712       3.36128E-08,3.51717E-08,3.67918E-08,3.84749E-08,4.02232E-08, & 
1713       4.20386E-08,4.39231E-08,4.58790E-08,4.79083E-08,5.00132E-08, & 
1714       5.21961E-08,5.44592E-08,5.68049E-08,5.92356E-08,6.17537E-08/               
1715       DATA (TOTPLK16(IDATA),IDATA=151,181)/ &                                               
1716       6.43617E-08,6.70622E-08,6.98578E-08,7.27511E-08,7.57449E-08, & 
1717       7.88419E-08,8.20449E-08,8.53568E-08,8.87805E-08,9.23190E-08, & 
1718       9.59753E-08,9.97526E-08,1.03654E-07,1.07682E-07,1.11841E-07, & 
1719       1.16134E-07,1.20564E-07,1.25135E-07,1.29850E-07,1.34712E-07, & 
1720       1.39726E-07,1.44894E-07,1.50221E-07,1.55711E-07,1.61367E-07, & 
1721       1.67193E-07,1.73193E-07,1.79371E-07,1.85732E-07,1.92279E-07, & 
1722       1.99016E-07/                                                               
1724                                                             
1725                 
1727 CONTAINS
1729 !------------------------------------------------------------------
1730    SUBROUTINE RRTMLWRAD(rthraten,glw,olr,emiss                    &
1731                        ,p8w,p3d,pi3d                              &
1732                        ,dz8w,tsk,t3d,t8w,rho3d,r,g                &
1733                        ,icloud, warm_rain                         &
1734                        ,ids,ide, jds,jde, kds,kde                 & 
1735                        ,ims,ime, jms,jme, kms,kme                 &
1736                        ,its,ite, jts,jte, kts,kte                 &
1737                        ,qv3d,qc3d,qr3d                            &
1738                        ,qi3d,qs3d,qg3d,cldfra3d                   &
1739                        ,f_qv,f_qc,f_qr,f_qi,f_qs,f_qg             &
1740                                                                   )
1741 !------------------------------------------------------------------
1742    IMPLICIT NONE
1743 !------------------------------------------------------------------
1744    LOGICAL, INTENT(IN )      ::        warm_rain
1746    INTEGER, INTENT(IN )      ::        ids,ide, jds,jde, kds,kde, &
1747                                        ims,ime, jms,jme, kms,kme, &
1748                                        its,ite, jts,jte, kts,kte
1750    INTEGER, INTENT(IN )      ::        ICLOUD
1752    REAL, DIMENSION( ims:ime, kms:kme, jms:jme )                 , &
1753          INTENT(IN   ) ::                                   dz8w, &
1754                                                              T3D, &
1755                                                              t8w, &
1756                                                              p8w, &
1757                                                              P3D, &
1758                                                             pi3D, &
1759                                                            rho3D
1761    REAL, DIMENSION( ims:ime, kms:kme, jms:jme )                 , &
1762          INTENT(INOUT)  ::                              RTHRATEN
1764    REAL, DIMENSION( ims:ime, jms:jme )                          , &
1765          INTENT(IN   )  ::                                 EMISS, &
1766                                                              TSK
1768    REAL, DIMENSION( ims:ime, jms:jme )                          , &
1769          INTENT(INOUT)  ::                                   GLW, &
1770                                                              OLR
1772    REAL, INTENT(IN  )   ::                                   R,G
1774 ! Optional
1776    REAL, DIMENSION( ims:ime, kms:kme, jms:jme )                 , &
1777          OPTIONAL                                               , &
1778          INTENT(IN   ) ::                                         &
1779                                                         CLDFRA3D, &
1780                                                             QV3D, &
1781                                                             QC3D, &
1782                                                             QR3D, &
1783                                                             QI3D, &
1784                                                             QS3D, &
1785                                                             QG3D
1787    LOGICAL, OPTIONAL, INTENT(IN )      ::        F_QV,F_QC,F_QR,F_QI,F_QS,F_QG
1789 !  LOCAL VARS
1791    REAL, DIMENSION( kts:kte+1 ) ::                          Pw1D, &
1792                                                             Tw1D, &
1793                                                             PHYD
1795    REAL, DIMENSION( kts:kte ) ::                          TTEN1D, &
1796                                                         CLDFRA1D, &
1797                                                             DZ1D, &
1798                                                              P1D, &
1799                                                          PHYDMID, &
1800                                                              T1D, &
1801                                                             QV1D, &
1802                                                             QC1D, &
1803                                                             QR1D, &
1804                                                             QI1D, &
1805                                                             QS1D, &
1806                                                             QG1D
1808     REAL   ::                              TSFC,GLW0,OLR0,EMISS0,FP
1810     INTEGER:: i,j,K,NK
1811     LOGICAL :: predicate
1813 !------------------------------------------------------------------
1815 !-----CALCULATE LONG WAVE RADIATION
1816 !                                                              
1817    j_loop: DO J=jts,jte
1818    i_loop: DO I=its,ite
1820 ! reverse vars 
1821 ! p1D pw1D are in mb
1823 ! NEED HYDROSTATIC PRESSURE HERE (MONOTONIC CHANGE WITH HEIGHT)
1824 ! PHYD REPLACES P8W, PHYDMID REPLACES P3D
1825          PHYD(kts) = p8w(I,kts,J)
1826 ! first guess
1827          DO K = KTS,KTE
1828             PHYD(K+1) = PHYD(K) - G*RHO3D(I,K,J)*DZ8W(I,K,J)
1829          ENDDO
1830 ! correction factor FP to match p8w(I,kts,J)-p8w(I,kte,J)
1831          FP = (p8w(I,kts,J)-p8w(I,kte,J))/(PHYD(KTS)-PHYD(KTE))
1832 ! final pass
1833          DO K = KTS,KTE
1834             PHYD(K+1) = PHYD(K) - G*RHO3D(I,K,J)*DZ8W(I,K,J)*FP
1835             PHYDMID(K)= 0.5*(PHYD(K)+PHYD(K+1))
1836          ENDDO
1838          do k=kts,kte+1
1839             NK=kme-k+kms
1840 !           Pw1D(K) = p8w(I,NK,J)/100.
1841             Pw1D(K) = PHYD(NK)/100.
1842             Tw1D(K) = t8w(I,NK,J)
1843          enddo
1845          DO K=kts,kte
1846             QV1D(K)=0.
1847             QC1D(K)=0.
1848             QR1D(K)=0.
1849             QI1D(K)=0.
1850             QS1D(K)=0.
1851             CLDFRA1D(k)=0.
1852          ENDDO
1854          DO K=kts,kte
1855             NK=kme-1-K+kms
1856             QV1D(K)=QV3D(I,NK,J)
1857             QV1D(K)=max(0.,QV1D(K))
1858          ENDDO
1860          DO K=kts,kte
1861             NK=kme-1-K+kms
1862             TTEN1D(K)=0.
1863             T1D(K)=T3D(I,NK,J)
1864 !           P1D(K)=P3D(I,NK,J)/100.
1865             P1D(K)=PHYDMID(NK)/100.
1866             DZ1D(K)=dz8w(I,NK,J)
1867          ENDDO
1869          IF (ICLOUD .ne. 0) THEN
1870             IF ( PRESENT( CLDFRA3D ) ) THEN
1871               DO K=kts,kte
1872                  NK=kme-1-K+kms
1873                  CLDFRA1D(k)=CLDFRA3D(I,NK,J)
1874               ENDDO
1875             ENDIF
1877             IF (PRESENT(F_QC) .AND. PRESENT(QC3D)) THEN
1878               IF ( F_QC) THEN
1879                  DO K=kts,kte
1880                     NK=kme-1-K+kms
1881                     QC1D(K)=QC3D(I,NK,J)
1882                     QC1D(K)=max(0.,QC1D(K))
1883                  ENDDO
1884               ENDIF
1885             ENDIF
1887             IF (PRESENT(F_QR) .AND. PRESENT(QR3D)) THEN
1888               IF ( F_QR) THEN
1889                  DO K=kts,kte
1890                     NK=kme-1-K+kms
1891                     QR1D(K)=QR3D(I,NK,J)
1892                     QR1D(K)=max(0.,QR1D(K))
1893                  ENDDO
1894               ENDIF
1895             ENDIF
1897 ! This logic is tortured because cannot test F_QI unless
1898 ! it is present, and order of evaluation of expressions
1899 ! is not specified in Fortran
1901             IF ( PRESENT ( F_QI ) ) THEN
1902               predicate = F_QI
1903             ELSE
1904               predicate = .FALSE.
1905             ENDIF
1907             IF (.NOT. predicate .and. .not. warm_rain) THEN
1908                DO K=kts,kte
1909                   IF (T1D(K) .lt. 273.15) THEN
1910                   QI1D(K)=QC1D(K)
1911                   QS1D(K)=QR1D(K)
1912                   QC1D(K)=0.
1913                   QR1D(K)=0.
1914                   ENDIF
1915                ENDDO
1916             ENDIF
1918             IF (PRESENT(F_QI) .AND. PRESENT(QI3D)) THEN
1919                DO K=kts,kte
1920                   NK=kme-1-K+kms
1921                   QI1D(K)=QI3D(I,NK,J)
1922                   QI1D(K)=max(0.,QI1D(K))
1923                ENDDO
1924             ENDIF
1926             IF (PRESENT(F_QS) .AND. PRESENT(QS3D)) THEN
1927                IF (F_QS) THEN
1928                   DO K=kts,kte
1929                      NK=kme-1-K+kms
1930                      QS1D(K)=QS3D(I,NK,J)
1931                      QS1D(K)=max(0.,QS1D(K))
1932                   ENDDO
1933                ENDIF
1934             ENDIF
1936             IF (PRESENT(F_QG) .AND. PRESENT(QG3D)) THEN
1937                IF (F_QG) THEN
1938                   DO K=kts,kte
1939                      NK=kme-1-K+kms
1940                      QG1D(K)=QG3D(I,NK,J)
1941                      QG1D(K)=max(0.,QG1D(K))
1942                   ENDDO
1943                ENDIF
1944             ENDIF
1946          ENDIF
1948          EMISS0=EMISS(I,J)
1949          GLW0=0. 
1950          OLR0=0. 
1951          TSFC=TSK(I,J)
1953          CALL RRTM(tten1d,glw0,olr0,tsfc,cldfra1d,t1d,tw1d,qv1d,qc1d,   &
1954                    qr1d,qi1d,qs1d,qg1d,p1d,pW1d,dz1d,              &
1955                    emiss0,r,g,                                     &
1956                    kts,kte                                         )
1958          GLW(I,J)=GLW0
1959          OLR(I,J)=OLR0
1961          DO K=kts,kte
1962             nk=kme-1-k+kms
1963             rthraten(i,k,j)=rthraten(i,k,j)+tten1d(nk)/pi3d(i,k,j)
1964          ENDDO
1966       END DO i_loop
1967    END DO j_loop                                           
1969 !-------------------------------------------------------------------
1971    END SUBROUTINE RRTMLWRAD
1974 !****************************************************************************    
1975 !*                                                                          *    
1976 !*                               RRTM                                       *    
1977 !*                                                                          *    
1978 !*                                                                          *    
1979 !*                                                                          *    
1980 !*                   RAPID RADIATIVE TRANSFER MODEL                         *    
1981 !*                                                                          *    
1982 !*                                                                          *    
1983 !*            ATMOSPHERIC AND ENVIRONMENTAL RESEARCH, INC.                  *    
1984 !*                        840 MEMORIAL DRIVE                                *    
1985 !*                        CAMBRIDGE, MA 02139                               *    
1986 !*                                                                          *    
1987 !*                                                                          *    
1988 !*                           ELI J. MLAWER                                  *    
1989 !*                         STEVEN J. TAUBMAN~                               *    
1990 !*                         SHEPARD A. CLOUGH                                *    
1991 !*                                                                          *    
1992 !*                                                                          *    
1993 !*                         ~currently at GFDL                               *    
1994 !*                                                                          *    
1995 !*                                                                          *    
1996 !*                                                                          *    
1997 !*                       email:  mlawer@aer.com                             *    
1998 !*                                                                          *    
1999 !*        The authors wish to acknowledge the contributions of the          *    
2000 !*        following people:  Patrick D. Brown, Michael J. Iacono,           *    
2001 !*        Ronald E. Farren, Luke Chen, Robert Bergstrom.                    *    
2002 !*                                                                          *    
2003 !****************************************************************************    
2004                                                                                  
2005 ! *** This version of RRTM has been altered to interface with the                
2006 ! *** NCAR MM5 mesoscale model for the calculation of longwave radiative         
2007 ! *** transfer (based on a code for interface with CCM model by M. J. Iacono)    
2008 ! *** J. Dudhia ; March, 1999                                                    
2009 !---------------------------------------------------------------------
2010    SUBROUTINE RRTM(TTEN,GLW,OLR,TSFC,CLDFRA,T,Tw,QV,QC,              &
2011                    QR,QI,QS,QG,P,Pw,DZ,                              &
2012                    EMISS,R,G,                                        &
2013                    kts,kte                                           )
2014 !---------------------------------------------------------------------
2015 ! *** This program is the driver for RRTM, the AER LW radiation model.           
2016 !     This routine:                                                              
2017 !     Calls MM5ATM to provide atmosphere in column and boundary values           
2018 !     a) calls GASABS to calculate gaseous optical depths                        
2019 !     b) calls SETCOEF to calculate various quantities needed for                
2020 !        the radiative transfer algorithm                                        
2021 !     c) calls RTRN (for both clear and cloudy columns) to do the                
2022 !        radiative transfer calculation                                          
2023 !     d) passes the necessary flux and cooling rate back to MM5                  
2024 !---------------------------------------------------------------------
2025       IMPLICIT NONE
2026 !---------------------------------------------------------------------
2028       INTEGER, INTENT(IN ) ::      kts, kte
2030       REAL, DIMENSION( kts:kte+1 ), INTENT(IN   ) ::             Pw, &
2031                                                                  Tw
2033       REAL, DIMENSION( kts:kte ), INTENT(IN   ) ::           CLDFRA, &
2034                                                                   T, &
2035                                                                   P, &
2036                                                                  DZ
2038       REAL, DIMENSION( kts:kte ), INTENT(INOUT) ::                   &
2039                                                                  QV
2040       REAL, DIMENSION( kts:kte ), INTENT(IN   ) ::                   &
2041                                                                  QC, &
2042                                                                  QR, &
2043                                                                  QI, &
2044                                                                  QS, &
2045                                                                  QG
2047       REAL, DIMENSION( kts:kte ), INTENT(INOUT)::              TTEN
2048 !   
2049       REAL, INTENT(IN  )   ::                           R, G, EMISS
2051       REAL, INTENT(INOUT)  ::                          TSFC,GLW,OLR
2053 ! LOCAL VAR
2055       INTEGER, DIMENSION( NGPT,kts:kte+1 ) ::                   ITR
2057       REAL,    DIMENSION( NGPT,kts:kte+1 ) ::                  PFRAC, &
2058                                                                TAUG
2060       REAL,    DIMENSION( 35,kts:kte+1 )       ::               WKL
2062       REAL,    DIMENSION( MAXXSEC,kts:kte+1 )  ::                WX
2064       REAL, DIMENSION( kts:kte )  ::                         O3PROF
2066       REAL, DIMENSION( kts:kte+1 )  ::                        PAVEL, &
2067                                                               TAVEL, &
2068                                                             CLDFRAC, &
2069                                                            TAUCLOUD, &   
2070                                                              COLDRY, & 
2071                                                              COLH2O, &
2072                                                              COLCO2, &
2073                                                               COLO3, &
2074                                                              COLN2O, &
2075                                                              COLCH4, &
2076                                                               COLO2, &
2077                                                             CO2MULT, &
2078                                                               FAC00, &
2079                                                               FAC01, &
2080                                                               FAC10, &
2081                                                               FAC11, &
2082                                                              FORFAC, &
2083                                                             SELFFAC, &
2084                                                            SELFFRAC
2085                                                 
2086 !                       
2087       INTEGER, DIMENSION( kts:kte+1 ) ::                    ICLDLYR, &
2088                                                                  JP, &
2089                                                                  JT, &
2090                                                                 JT1, &
2091                                                             INDSELF
2093       REAL, DIMENSION(   0:kte+1 )  ::                           PZ, &
2094                                                                  TZ, &
2095                                                            TOTDFLUX, &
2096                                                            TOTUFLUX, &
2097                                                                 HTR
2098 !     
2099       INTEGER ::  I,K,ktep1
2100       INTEGER ::  LAYTROP,LAYSWTCH,LAYLOW
2101       REAL    ::  TBOUND
2102       REAL, DIMENSION(NBANDS) ::  SEMISS
2105 !---------------------------------------------------------------------------
2106 ! RRTM Definitions                                                               
2107 !    NGPT                         ! Total number of g-point subintervals         
2108 !    MXLAY                        ! Maximum number of model layers               
2109 !    NBANDS                       ! Number of longwave spectral bands            
2110 !    PI                           ! Geometric constant                           
2111 !    FLUXFAC                      ! Radiance to flux conversion factor           
2112 !    HEATFAC                      ! Heating rate conversion factor               
2113 !    NG(NBANDS)                   ! Number of g-points per band for input        
2114 !                                   absorption coefficient data                  
2115 !    NSPA(NBANDS),NSPB(NBANDS)    ! Number of reference atmospheres per band     
2116 !    WAVENUM1(NBANDS)             ! Longwave band lower limit (wavenumbers)      
2117 !    WAVENUM2(NBANDS)             ! Longwave band upper limit (wavenumbers)      
2118 !    DELWAVE                      ! Longwave band width (wavenumbers)            
2119 !    NLAYERS                      ! Number of model layers (mkx+1)               
2120 !    PAVEL(MXLAY)                 ! Layer pressures (mb)                         
2121 !    PZ(0:MXLAY)                  ! Level (interface) pressures (mb)             
2122 !    TAVEL(MXLAY)                 ! Layer temperatures (K)                       
2123 !    TZ(0:MXLAY)                  ! Level (interface) temperatures(mb)           
2124 !    TBOUND                       ! Surface temperature (K)                      
2125 !    CLDFRAC(MXLAY)               ! Layer cloud fraction                         
2126 !    TAUCLOUD(MXLAY)              ! Layer cloud optical depth                    
2127 !    ITR(NGPT,MXLAY)              ! Integer look-up table index                  
2128 !    PFRAC(NGPT,MXLAY)            ! Planck fractions                             
2129 !    ICLDLYR(MXLAY)               ! Flag for cloudy layers                       
2130 !    TOTUFLUX(0:MXLAY)            ! Upward longwave flux (W/m2)                  
2131 !    TOTDFLUX(0:MXLAY)            ! Downward longwave flux (W/m2)                
2132 !    FNET(0:MXLAY)                ! Net longwave flux (W/m2)                     
2133 !    HTR(0:MXLAY)                 ! Longwave heating rate (K/day)                
2134 !    CLRNTTOA                     ! Clear-sky TOA outgoing flux (W/m2)           
2135 !    CLRNTSRF                     ! Clear-sky net surface flux (W/m2)            
2136 !    TOTUCLFL(0:MXLAY)            ! Clear-sky upward longwave flux (W/m2)        
2137 !    TOTDCLFL(0:MXLAY)            ! Clear-sky downward longwave flux (W/m2)      
2138 !    FNETC(0:MXLAY)               ! Clear-sky net longwave flux (W/m2)           
2139 !    HTRC(0:MXLAY)                ! Clear-sky longwave heating rate (K/day)      
2140 !                                                                                
2141 ! This compiler directive was added to insure private common block storage       
2142 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
2143 ! carry constants.                                                               
2144 !---------------------------------------------------------------------------
2146      ktep1=kte+1
2148 !    CLOUD EMISSIVITIES (M^2/G)                                                  
2149 !    THESE ARE CONSISTENT WITH LWRAD (ABCW=0.5*(ABUP+ABDOWN))                    
2150 !     
2151 !     ONEMINUS = 1. - 1.E-6                                                      
2152 !     PI   = 2.*ASIN(1.)                                                           
2153 !     FLUXFAC = PI   * 2.D4                     
2155       CALL INIRAD (O3PROF,Pw,kts,kte)
2156                                                                               
2157 !  Prepare atmospheric profile from CCM for use in RRTM, and define              
2158 !  other RRTM input parameters.  Arrays are passed back through the              
2159 !  existing RRTM commons and arrays.                                             
2160          
2161          CALL MM5ATM(CLDFRA,O3PROF,T,Tw,TSFC,QV,QC,QR,QI,QS,QG,    &
2162                      P,Pw,DZ,EMISS,R,G,                            &
2163                      PAVEL,TAVEL,PZ,TZ,CLDFRAC,TAUCLOUD,COLDRY,    &
2164                      WKL,WX,TBOUND,SEMISS,                         &
2165                      kts,kte                                       )
2167 !  Calculate information needed by the radiative transfer routine                
2168 !  that is specific to this atmosphere, especially some of the                   
2169 !  coefficients and indices needed to compute the optical depths                 
2170 !  by interpolating data from stored reference atmospheres.                      
2171                                                                                  
2172          CALL SETCOEF(kts,ktep1,                                   &
2173                       PAVEL,TAVEL,COLDRY,COLH2O,COLCO2,COLO3,      &
2174                       COLN2O,COLCH4,COLO2,CO2MULT,                 &
2175                       FAC00,FAC01,FAC10,FAC11,                     &
2176                       FORFAC,SELFFAC,SELFFRAC,                     &
2177                       JP,JT,JT1,INDSELF,WKL,LAYTROP,LAYSWTCH,LAYLOW)
2179          CALL GASABS(kts,ktep1,                                 &
2180                      COLDRY,COLH2O,COLCO2,COLO3,COLN2O,COLCH4,  &
2181                      COLO2,CO2MULT,                             &
2182                      FAC00,FAC01,FAC10,FAC11,                   &
2183                      FORFAC,SELFFAC,SELFFRAC,                   &
2184                      JP,JT,JT1,INDSELF,ITR,WX,PFRAC,TAUG,       &
2185                      LAYTROP,LAYSWTCH,LAYLOW                    )
2187 !  Check for cloud in column.  Use original CCM LW threshold: if total           
2188 !  clear sky fraction < 0.999, then column is cloudy, otherwise consider         
2189 !  it clear.  Also, set up flag array, icldlyr, for use in radiative             
2190 !  transfer.  Set icldlyr to one for each layer with cloud.  If tclrsf           
2191 !  is not available, icldlyr can be set from cldfrac alone.                      
2192                                                                                  
2193         do 1500 k = 1, nlayers                                                   
2194            if (cldfrac(k).gt.0.) then                                            
2195               icldlyr(k) = 1                                                     
2196            else                                                                  
2197               icldlyr(k) = 0                                                     
2198            endif                                                                 
2199  1500   continue                                                                 
2200                                                                                  
2201 !  Call the radiative transfer routine.                                          
2202                                                                                  
2203            CALL RTRN(kts,ktep1,                                  &
2204                      TAVEL, PZ, TZ, CLDFRAC, TAUCLOUD, TOTDFLUX, &
2205                      TOTUFLUX, HTR, ICLDLYR, ITR, PFRAC, TBOUND,SEMISS     )
2206                                                                                  
2207 !  Pass total sky up and down flux profiles to CCM output arrays and             
2208 !  convert from mks to cgs units for CCM.  Pass clear sky TOA and surface        
2209 !  net fluxes to CCM fields for diagnostics.  Pass total sky heating rate        
2210 !  profile to CCM output arrays and convert units to K/sec.  The vertical        
2211 !  array index (bottom to top in RRTM) is reversed for CCM fields.               
2212                                                                                  
2213 !          flntc(iiplon) = CLRNTTOA*1.e3                                         
2214 !          flnsc(iiplon) = CLRNTSRF*1.e3                                         
2215 !           do 2400 k = 0, NLAYERS-1                                             
2216 !              fulc(k+1) = TOTUCLFL(NLAYERS-1-k)*1.e3                            
2217 !              fdlc(k+1) = TOTDCLFL(NLAYERS-1-k)*1.e3                            
2218 !              ful(k+1) = TOTUFLUX(NLAYERS-1-k)*1.e3                             
2219 !              fdl(k+1) = TOTDFLUX(NLAYERS-1-k)*1.e3                             
2220 ! 2400      continue                                                             
2221            do 2450 k = 1, NLAYERS-1                                              
2222 !              qrlc(k) = HTRC(NLAYERS-1-k)/86400.                                
2223 !              qrl(k) = HTR(NLAYERS-1-k)/86400.                                  
2224               TTEN(K)=HTR(NLAYERS-1-k)/86400. 
2225  2450      continue                                                              
2226            GLW = TOTDFLUX(0)
2227            OLR = TOTUFLUX(NLAYERS)
2229    END SUBROUTINE RRTM
2232 !***************************************************************************     
2233    SUBROUTINE CMBGB1(abscoefL, abscoefH, SELFREF,                       &
2234                      FRACREFA, FRACREFB, FORREF,                        &
2235                      SELFREFC, FORREFC, FRACREFAC, FRACREFBC            )
2236 !***************************************************************************     
2237 !                                                                                
2238 !  Original version:       Michael J. Iacono; July, 1998                         
2239 !  Revision for NCAR CCM:  Michael J. Iacono; September, 1998                    
2240 !                                                                                
2241 !  The subroutines CMBGB1->CMBGB16 input the absorption coefficient              
2242 !  data for each band, which are defined for 16 g-points and 16 spectral         
2243 !  bands. The data are combined with appropriate weighting following the         
2244 !  g-point mapping arrays specified in RRTMINIT.  Plank fraction data            
2245 !  in arrays FRACREFA and FRACREFB are combined without weighting.  All          
2246 !  g-point reduced data are put into new arrays for use in RRTM.                 
2247 !                                                                                
2248 !  BAND 1:  10-250 cm-1 (low - H2O; high - H2O)                                  
2249 !***************************************************************************     
2250                                                                                  
2251 ! Input                                                                          
2252       REAL abscoefL(5,13,MG),abscoefH(5,13:59,MG)
2253       REAL SELFREF(10,MG)              
2254       REAL FRACREFA(MG), FRACREFB(MG), FORREF(MG)
2255 !     REAL RWGT(MG*NBANDS) 
2256 ! Output                                                                         
2257       REAL SELFREFC(10,NG1), FORREFC(NG1)
2258       REAL FRACREFAC(NG1), FRACREFBC(NG1)
2259                                                                                  
2260       DO 2000 JTJT = 1,5                                                           
2261          DO 2200 JPJP = 1,13                                                       
2262             IPRSM = 0                                                            
2263             DO 2400 IGC = 1,NGC(1)                                               
2264                SUMK = 0.                                                         
2265                DO 2600 IPR = 1, NGN(IGC)                                         
2266                   IPRSM = IPRSM + 1                                              
2267                   SUMK = SUMK + abscoefL(JTJT,JPJP,IPRSM)*RWGT(IPRSM)               
2268  2600          CONTINUE                                                          
2269                ABSA1(JTJT+(JPJP-1)*5,IGC) = SUMK
2270  2400       CONTINUE                                                             
2271  2200    CONTINUE                                                                
2272          DO 3200 JPJP = 13,59                                                      
2273             IPRSM = 0                                                            
2274             DO 3400 IGC = 1,NGC(1)                                               
2275                SUMK = 0.                                                         
2276                DO 3600 IPR = 1, NGN(IGC)                                         
2277                   IPRSM = IPRSM + 1                                              
2278                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM)
2279  3600          CONTINUE                                                          
2280                ABSB1(JTJT+(JPJP-13)*5,IGC) = SUMK                                             
2281  3400       CONTINUE                                                             
2282  3200    CONTINUE                                                                
2283  2000 CONTINUE                                                                   
2284                                                                                  
2285       DO 4000 JTJT = 1,10                                                          
2286          IPRSM = 0                                                               
2287          DO 4400 IGC = 1,NGC(1)                                                  
2288             SUMK = 0.                                                            
2289             DO 4600 IPR = 1, NGN(IGC)                                            
2290                IPRSM = IPRSM + 1                                                 
2291                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM)
2292  4600       CONTINUE                                                             
2293             SELFREFC(JTJT,IGC) = SUMK                                              
2294  4400    CONTINUE                                                                
2295  4000 CONTINUE                                                                   
2296                                                                                  
2297       IPRSM = 0                                                                  
2298       DO 5400 IGC = 1,NGC(1)                                                     
2299          SUMK = 0.                                                               
2300          SUMF1 = 0.                                                              
2301          SUMF2 = 0.                                                              
2302          DO 5600 IPR = 1, NGN(IGC)                                               
2303             IPRSM = IPRSM + 1                                                    
2304             SUMK = SUMK + FORREF(IPRSM)*RWGT(IPRSM)                              
2305             SUMF1= SUMF1+ FRACREFA(IPRSM)                                        
2306             SUMF2= SUMF2+ FRACREFB(IPRSM)                                        
2307  5600    CONTINUE                                                                
2308          FORREFC(IGC) = SUMK                                                     
2309          FRACREFAC(IGC) = SUMF1                                                  
2310          FRACREFBC(IGC) = SUMF2                                                  
2311  5400 CONTINUE                                                                   
2312                                                                                  
2313    END SUBROUTINE CMBGB1
2315 !***************************************************************************
2316   SUBROUTINE CMBGB2(abscoefL, abscoefH, SELFREF,                       &
2317                     FRACREFA, FRACREFB, FORREF,                        &
2318                     SELFREFC, FORREFC, FRACREFAC, FRACREFBC            )
2319 !***************************************************************************     
2320 !                                                                                
2321 !     BAND 2:  250-500 cm-1 (low - H2O; high - H2O)                              
2322 !***************************************************************************     
2323                                                                                  
2324 ! Input                                                                          
2325       REAL abscoefL(5,13,MG),abscoefH(5,13:59,MG)
2326       REAL SELFREF(10,MG)            
2327       REAL FRACREFA(MG,13), FRACREFB(MG), FORREF(MG)
2328 !     REAL RWGT(MG*NBANDS) 
2329 ! Output                                                                         
2330       REAL SELFREFC(10,NG2), FORREFC(NG2)
2331       REAL FRACREFAC(NG2,13), FRACREFBC(NG2)
2332                                                                                  
2333       DO 2000 JTJT = 1,5                                                           
2334          DO 2200 JPJP = 1,13                                                       
2335             IPRSM = 0                                                            
2336             DO 2400 IGC = 1,NGC(2)                                               
2337                SUMK = 0.                                                         
2338                DO 2600 IPR = 1, NGN(NGS(1)+IGC)                                  
2339                   IPRSM = IPRSM + 1                                              
2340                   SUMK = SUMK + abscoefL(JTJT,JPJP,IPRSM)*RWGT(IPRSM+16)
2341  2600          CONTINUE                                                          
2342                ABSA2(JTJT+(JPJP-1)*5,IGC) = SUMK  
2343  2400       CONTINUE                                                             
2344  2200    CONTINUE                                                                
2345          DO 3200 JPJP = 13,59                                                      
2346             IPRSM = 0                                                            
2347             DO 3400 IGC = 1,NGC(2)                                               
2348                SUMK = 0.                                                         
2349                DO 3600 IPR = 1, NGN(NGS(1)+IGC)                                  
2350                   IPRSM = IPRSM + 1                                              
2351                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM+16)
2352  3600          CONTINUE                                                          
2353                ABSB2(JTJT+(JPJP-13)*5,IGC) = SUMK
2354  3400       CONTINUE                                                             
2355  3200    CONTINUE                                                                
2356  2000 CONTINUE                                                                   
2357                                                                                  
2358       DO 4000 JTJT = 1,10                                                          
2359          IPRSM = 0                                                               
2360          DO 4400 IGC = 1,NGC(2)                                                  
2361             SUMK = 0.                                                            
2362             DO 4600 IPR = 1, NGN(NGS(1)+IGC)                                     
2363                IPRSM = IPRSM + 1                                                 
2364                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+16)
2365  4600       CONTINUE                                                             
2366             SELFREFC(JTJT,IGC) = SUMK                                              
2367  4400    CONTINUE                                                                
2368  4000 CONTINUE                                                                   
2369                                                                                  
2370       DO 5000 JPJP = 1,13                                                          
2371          IPRSM = 0                                                               
2372          DO 5400 IGC = 1,NGC(2)                                                  
2373             SUMF = 0.                                                            
2374             DO 5600 IPR = 1, NGN(NGS(1)+IGC)                                     
2375                IPRSM = IPRSM + 1                                                 
2376                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
2377  5600       CONTINUE                                                             
2378             FRACREFAC(IGC,JPJP) = SUMF                                             
2379  5400    CONTINUE                                                                
2380  5000 CONTINUE                                                                   
2381                                                                                  
2382       IPRSM = 0                                                                  
2383       DO 6400 IGC = 1,NGC(2)                                                     
2384          SUMK = 0.                                                               
2385          SUMF = 0.                                                               
2386          DO 6600 IPR = 1, NGN(NGS(1)+IGC)                                        
2387             IPRSM = IPRSM + 1                                                    
2388             SUMK = SUMK + FORREF(IPRSM)*RWGT(IPRSM+16)                           
2389             SUMF = SUMF + FRACREFB(IPRSM)                                        
2390  6600    CONTINUE                                                                
2391          FORREFC(IGC) = SUMK                                                     
2392          FRACREFBC(IGC) = SUMF                                                   
2393  6400 CONTINUE                                                                   
2394                                                                                  
2395    END SUBROUTINE CMBGB2
2397 !***************************************************************************
2398    SUBROUTINE CMBGB3(abscoefL, abscoefH, SELFREF,                       &
2399                      FRACREFA, FRACREFB, FORREF, ABSN2OA, ABSN2OB,      &
2400                      SELFREFC, FORREFC,                                 &
2401                      ABSN2OAC, ABSN2OBC, FRACREFAC, FRACREFBC           )
2402 !***************************************************************************     
2403 !                                                                                
2404 !     BAND 3:  500-630 cm-1 (low - H2O,CO2; high - H2O,CO2)                      
2405 !***************************************************************************     
2406                                                                                  
2407 ! Input                                                                          
2408       REAL abscoefL(10,5,13,MG),abscoefH(5,5,13:59,MG)
2409       REAL SELFREF(10,MG)   
2410       REAL FRACREFA(MG,10), FRACREFB(MG,5)
2411       REAL FORREF(MG), ABSN2OA(MG), ABSN2OB(MG)     
2412 !     REAL RWGT(MG*NBANDS) 
2413 ! Output                                                                         
2414       REAL SELFREFC(10,NG3), FORREFC(NG3),  &
2415            ABSN2OAC(NG3), ABSN2OBC(NG3) 
2416       REAL FRACREFAC(NG3,10), FRACREFBC(NG3,5) 
2417                                                                                  
2418       DO 2000 JN = 1,10                                                          
2419          DO 2000 JTJT = 1,5                                                        
2420             DO 2200 JPJP = 1,13                                                    
2421                IPRSM = 0                                                         
2422                DO 2400 IGC = 1,NGC(3)                                            
2423                  SUMK = 0.                                                       
2424                   DO 2600 IPR = 1, NGN(NGS(2)+IGC)                               
2425                      IPRSM = IPRSM + 1                                           
2426                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)* RWGT(IPRSM+32)
2427  2600             CONTINUE                                                       
2428                   ABSA3(JN+(JTJT-1)*10+(JPJP-1)*50,IGC) = SUMK  
2429  2400          CONTINUE                                                          
2430  2200       CONTINUE                                                             
2431  2000 CONTINUE                                                                   
2432       DO 3000 JN = 1,5                                                           
2433          DO 3000 JTJT = 1,5                                                        
2434             DO 3200 JPJP = 13,59                                                   
2435                IPRSM = 0                                                         
2436                DO 3400 IGC = 1,NGC(3)                                            
2437                   SUMK = 0.                                                      
2438                   DO 3600 IPR = 1, NGN(NGS(2)+IGC)                               
2439                      IPRSM = IPRSM + 1                                           
2440                      SUMK = SUMK + abscoefH(JN,JTJT,JPJP,IPRSM)* RWGT(IPRSM+32)
2441  3600             CONTINUE                                                       
2442                   ABSB3(JN+(JTJT-1)*5+(JPJP-13)*25,IGC) = SUMK
2443  3400          CONTINUE                                                          
2444  3200       CONTINUE                                                             
2445  3000 CONTINUE                                                                   
2446                                                                                  
2447       DO 4000 JTJT = 1,10                                                          
2448          IPRSM = 0                                                               
2449          DO 4400 IGC = 1,NGC(3)                                                  
2450             SUMK = 0.                                                            
2451             SUMF = 0.                                                            
2452             DO 4600 IPR = 1, NGN(NGS(2)+IGC)                                     
2453                IPRSM = IPRSM + 1                                                 
2454                SUMK = SUMK + SELFREF(JTJT,IPRSM)* RWGT(IPRSM+32)
2455                SUMF = SUMF + FRACREFA(IPRSM,JTJT)                                  
2456  4600       CONTINUE                                                             
2457             SELFREFC(JTJT,IGC) = SUMK                                              
2458             FRACREFAC(IGC,JTJT) = SUMF                                             
2459  4400    CONTINUE                                                                
2460  4000 CONTINUE                                                                   
2461                                                                                  
2462       DO 5000 JPJP = 1,5                                                           
2463          IPRSM = 0                                                               
2464          DO 5400 IGC = 1,NGC(3)                                                  
2465             SUMF = 0.                                                            
2466             DO 5600 IPR = 1, NGN(NGS(2)+IGC)                                     
2467                IPRSM = IPRSM + 1                                                 
2468                SUMF = SUMF + FRACREFB(IPRSM,JPJP)                                  
2469  5600       CONTINUE                                                             
2470             FRACREFBC(IGC,JPJP) = SUMF                                             
2471  5400    CONTINUE                                                                
2472  5000 CONTINUE                                                                   
2473                                                                                  
2474       IPRSM = 0                                                                  
2475       DO 6400 IGC = 1,NGC(3)                                                     
2476          SUMK1= 0.                                                               
2477          SUMK2= 0.                                                               
2478          SUMK3= 0.                                                               
2479          DO 6600 IPR = 1, NGN(NGS(2)+IGC)                                        
2480             IPRSM = IPRSM + 1                                                    
2481             SUMK1= SUMK1+ FORREF(IPRSM)*RWGT(IPRSM+32)                           
2482             SUMK2= SUMK2+ ABSN2OA(IPRSM)*RWGT(IPRSM+32)                          
2483             SUMK3= SUMK3+ ABSN2OB(IPRSM)*RWGT(IPRSM+32)                          
2484  6600    CONTINUE                                                                
2485          FORREFC(IGC) = SUMK1                                                    
2486          ABSN2OAC(IGC) = SUMK2                                                   
2487          ABSN2OBC(IGC) = SUMK3                                                   
2488  6400 CONTINUE                                                                   
2489                                                                                  
2490    END SUBROUTINE CMBGB3
2492 !***************************************************************************
2493    SUBROUTINE CMBGB4(abscoefL, abscoefH, SELFREF,                       &
2494                      FRACREFA, FRACREFB,                                &
2495                      SELFREFC, FRACREFAC, FRACREFBC                     )
2496 !***************************************************************************     
2497 !                                                                                
2498 !     BAND 4:  630-700 cm-1 (low - H2O,CO2; high - O3,CO2)                       
2499 !***************************************************************************     
2500                                                                                  
2501 ! Input                                                                          
2502       REAL abscoefL(9,5,13,MG),abscoefH(6,5,13:59,MG)
2503       REAL SELFREF(10,MG)            
2504       REAL FRACREFA(MG,9), FRACREFB(MG,6)
2505 !     REAL RWGT(MG*NBANDS) 
2506 ! Output                                                                         
2507       REAL SELFREFC(10,NG4)
2508       REAL FRACREFAC(NG4,9), FRACREFBC(NG4,6)
2509                                                                                  
2510       DO 2000 JN = 1,9                                                           
2511          DO 2000 JTJT = 1,5                                                        
2512             DO 2200 JPJP = 1,13                                                    
2513                IPRSM = 0                                                         
2514                DO 2400 IGC = 1,NGC(4)                                            
2515                  SUMK = 0.                                                       
2516                   DO 2600 IPR = 1, NGN(NGS(3)+IGC)                               
2517                      IPRSM = IPRSM + 1                                           
2518                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+48)
2519  2600             CONTINUE                                                       
2520                   ABSA4(JN+(JTJT-1)*9+(JPJP-1)*45,IGC) = SUMK                                       
2521  2400          CONTINUE                                                          
2522  2200       CONTINUE                                                             
2523  2000 CONTINUE                                                                   
2524       DO 3000 JN = 1,6                                                           
2525          DO 3000 JTJT = 1,5                                                        
2526             DO 3200 JPJP = 13,59                                                   
2527                IPRSM = 0                                                         
2528                DO 3400 IGC = 1,NGC(4)                                            
2529                   SUMK = 0.                                                      
2530                   DO 3600 IPR = 1, NGN(NGS(3)+IGC)                               
2531                      IPRSM = IPRSM + 1                                           
2532                      SUMK = SUMK + abscoefH(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+48)
2533  3600             CONTINUE                                                       
2534                   ABSB4(JN+(JTJT-1)*6+(JPJP-13)*30,IGC) = SUMK
2535  3400          CONTINUE                                                          
2536  3200       CONTINUE                                                             
2537  3000 CONTINUE                                                                   
2538                                                                                  
2539       DO 4000 JTJT = 1,10                                                          
2540          IPRSM = 0                                                               
2541          DO 4400 IGC = 1,NGC(4)                                                  
2542             SUMK = 0.                                                            
2543             DO 4600 IPR = 1, NGN(NGS(3)+IGC)                                     
2544                IPRSM = IPRSM + 1                                                 
2545                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+48)
2546  4600       CONTINUE                                                             
2547             SELFREFC(JTJT,IGC) = SUMK                                              
2548  4400    CONTINUE                                                                
2549  4000 CONTINUE                                                                   
2550                                                                                  
2551       DO 5000 JPJP = 1,9                                                           
2552          IPRSM = 0                                                               
2553          DO 5400 IGC = 1,NGC(4)                                                  
2554             SUMF = 0.                                                            
2555             DO 5600 IPR = 1, NGN(NGS(3)+IGC)                                     
2556                IPRSM = IPRSM + 1                                                 
2557                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
2558  5600       CONTINUE                                                             
2559             FRACREFAC(IGC,JPJP) = SUMF                                             
2560  5400    CONTINUE                                                                
2561  5000 CONTINUE                                                                   
2562                                                                                  
2563       DO 6000 JPJP = 1,6                                                           
2564          IPRSM = 0                                                               
2565          DO 6400 IGC = 1,NGC(4)                                                  
2566             SUMF = 0.                                                            
2567             DO 6600 IPR = 1, NGN(NGS(3)+IGC)                                     
2568                IPRSM = IPRSM + 1                                                 
2569                SUMF = SUMF + FRACREFB(IPRSM,JPJP)                                  
2570  6600       CONTINUE                                                             
2571             FRACREFBC(IGC,JPJP) = SUMF                                             
2572  6400    CONTINUE                                                                
2573  6000 CONTINUE                                                                   
2574                                                                                  
2575    END SUBROUTINE CMBGB4
2577 !***************************************************************************
2578    SUBROUTINE CMBGB5(abscoefL, abscoefH, SELFREF,                      &
2579                      FRACREFA, FRACREFB, CCL4,                         &
2580                      SELFREFC, CCL4C, FRACREFAC, FRACREFBC             )
2581 !***************************************************************************     
2582 !                                                                                
2583 !     BAND 5:  700-820 cm-1 (low - H2O,CO2; high - O3,CO2)                       
2584 !***************************************************************************     
2585                                                                                  
2586 ! Input                                                                          
2587       REAL abscoefL(9,5,13,MG),abscoefH(5,5,13:59,MG)
2588       REAL SELFREF(10,MG)            
2589       REAL FRACREFA(MG,9), FRACREFB(MG,5), CCL4(MG)
2590 !     REAL RWGT(MG*NBANDS) 
2591 ! Output                                                                         
2592       REAL SELFREFC(10,NG5), CCL4C(NG5) 
2593       REAL FRACREFAC(NG5,9), FRACREFBC(NG5,5)               
2594                                                          
2595       DO 2000 JN = 1,9                                                           
2596          DO 2000 JTJT = 1,5                                                        
2597             DO 2200 JPJP = 1,13                                                    
2598                IPRSM = 0                                                         
2599                DO 2400 IGC = 1,NGC(5)                                            
2600                  SUMK = 0.                                                       
2601                   DO 2600 IPR = 1, NGN(NGS(4)+IGC)                               
2602                      IPRSM = IPRSM + 1                                           
2603                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+64)
2604  2600             CONTINUE                                                       
2605                   ABSA5(JN+(JTJT-1)*9+(JPJP-1)*45,IGC) = SUMK                                       
2606  2400          CONTINUE                                                          
2607  2200       CONTINUE                                                             
2608  2000 CONTINUE                                                                   
2609       DO 3000 JN = 1,5                                                           
2610          DO 3000 JTJT = 1,5                                                        
2611             DO 3200 JPJP = 13,59                                                   
2612                IPRSM = 0                                                         
2613                DO 3400 IGC = 1,NGC(5)                                            
2614                   SUMK = 0.                                                      
2615                   DO 3600 IPR = 1, NGN(NGS(4)+IGC)                               
2616                      IPRSM = IPRSM + 1                                           
2617                      SUMK = SUMK + abscoefH(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+64)
2618  3600             CONTINUE                                                       
2619                   ABSB5(JN+(JTJT-1)*5+(JPJP-13)*25,IGC) = SUMK
2620  3400          CONTINUE                                                          
2621  3200       CONTINUE                                                             
2622  3000 CONTINUE                                                                   
2623                                                                                  
2624       DO 4000 JTJT = 1,10                                                          
2625          IPRSM = 0                                                               
2626          DO 4400 IGC = 1,NGC(5)                                                  
2627             SUMK = 0.                                                            
2628             DO 4600 IPR = 1, NGN(NGS(4)+IGC)                                     
2629                IPRSM = IPRSM + 1                                                 
2630                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+64)
2631  4600       CONTINUE                                                             
2632             SELFREFC(JTJT,IGC) = SUMK                                              
2633  4400    CONTINUE                                                                
2634  4000 CONTINUE                                                                   
2635                                                                                  
2636       DO 5000 JPJP = 1,9                                                           
2637          IPRSM = 0                                                               
2638          DO 5400 IGC = 1,NGC(5)                                                  
2639             SUMF = 0.                                                            
2640             DO 5600 IPR = 1, NGN(NGS(4)+IGC)                                     
2641                IPRSM = IPRSM + 1                                                 
2642                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
2643  5600       CONTINUE                                                             
2644             FRACREFAC(IGC,JPJP) = SUMF                                             
2645  5400    CONTINUE                                                                
2646  5000 CONTINUE                                                                   
2647                                                                                  
2648       DO 6000 JPJP = 1,5                                                           
2649          IPRSM = 0                                                               
2650          DO 6400 IGC = 1,NGC(5)                                                  
2651             SUMF = 0.                                                            
2652             DO 6600 IPR = 1, NGN(NGS(4)+IGC)                                     
2653                IPRSM = IPRSM + 1                                                 
2654                SUMF = SUMF + FRACREFB(IPRSM,JPJP)                                  
2655  6600       CONTINUE                                                             
2656             FRACREFBC(IGC,JPJP) = SUMF                                             
2657  6400    CONTINUE                                                                
2658  6000 CONTINUE                                                                   
2659                                                                                  
2660       IPRSM = 0                                                                  
2661       DO 7400 IGC = 1,NGC(5)                                                     
2662          SUMK = 0.                                                               
2663          DO 7600 IPR = 1, NGN(NGS(4)+IGC)                                        
2664             IPRSM = IPRSM + 1                                                    
2665             SUMK = SUMK + CCL4(IPRSM)*RWGT(IPRSM+64)                             
2666  7600    CONTINUE                                                                
2667          CCL4C(IGC) = SUMK                                                       
2668  7400 CONTINUE                                                                   
2669                                                                                  
2670    END SUBROUTINE CMBGB5
2672 !***************************************************************************
2673    SUBROUTINE CMBGB6(abscoefL, SELFREF,                                &
2674                      FRACREFA, ABSCO2, CFC11ADJ, CFC12,                &
2675                      SELFREFC, ABSCO2C, CFC11ADJC, CFC12C,             &
2676                      FRACREFAC                                         )
2677 !***************************************************************************     
2678 !                                                                                
2679 !     BAND 6:  820-980 cm-1 (low - H2O; high - nothing)                          
2680 !***************************************************************************     
2681                                                                                  
2682 ! Input                                                                          
2683       REAL abscoefL(5,13,MG)                                                           
2684       REAL SELFREF(10,MG)  
2685       REAL FRACREFA(MG), ABSCO2(MG), CFC11ADJ(MG), CFC12(MG)
2686 !     REAL RWGT(MG*NBANDS) 
2687 ! Output                                                                         
2688       REAL SELFREFC(10,NG6),  &
2689            ABSCO2C(NG6), CFC11ADJC(NG6), CFC12C(NG6) 
2690       REAL FRACREFAC(NG6)
2691                                                                                  
2692       DO 2000 JTJT = 1,5                                                           
2693          DO 2200 JPJP = 1,13                                                       
2694             IPRSM = 0                                                            
2695             DO 2400 IGC = 1,NGC(6)                                               
2696                SUMK = 0.                                                         
2697                DO 2600 IPR = 1, NGN(NGS(5)+IGC)                                  
2698                   IPRSM = IPRSM + 1                                              
2699                   SUMK = SUMK + abscoefL(JTJT,JPJP,IPRSM)*RWGT(IPRSM+80)
2700  2600          CONTINUE                                                          
2701                ABSA6(JTJT+(JPJP-1)*5,IGC) = SUMK                                             
2702  2400       CONTINUE                                                             
2703  2200    CONTINUE                                                                
2704  2000 CONTINUE                                                                   
2705                                                                                  
2706       DO 4000 JTJT = 1,10                                                          
2707          IPRSM = 0                                                               
2708          DO 4400 IGC = 1,NGC(6)                                                  
2709             SUMK = 0.                                                            
2710             DO 4600 IPR = 1, NGN(NGS(5)+IGC)                                     
2711                IPRSM = IPRSM + 1                                                 
2712                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+80) 
2713  4600       CONTINUE                                                             
2714             SELFREFC(JTJT,IGC) = SUMK                                              
2715  4400    CONTINUE                                                                
2716  4000 CONTINUE                                                                   
2717                                                                                  
2718       IPRSM = 0                                                                  
2719       DO 7400 IGC = 1,NGC(6)                                                     
2720          SUMF = 0.                                                               
2721          SUMK1= 0.                                                               
2722          SUMK2= 0.                                                               
2723          SUMK3= 0.                                                               
2724          DO 7600 IPR = 1, NGN(NGS(5)+IGC)                                        
2725             IPRSM = IPRSM + 1                                                    
2726             SUMF = SUMF + FRACREFA(IPRSM)                                        
2727             SUMK1= SUMK1+ ABSCO2(IPRSM)*RWGT(IPRSM+80)                           
2728             SUMK2= SUMK2+ CFC11ADJ(IPRSM)*RWGT(IPRSM+80)                         
2729             SUMK3= SUMK3+ CFC12(IPRSM)*RWGT(IPRSM+80)                            
2730  7600    CONTINUE                                                                
2731          FRACREFAC(IGC) = SUMF                                                   
2732          ABSCO2C(IGC) = SUMK1                                                    
2733          CFC11ADJC(IGC) = SUMK2                                                  
2734          CFC12C(IGC) = SUMK3                                                     
2735  7400 CONTINUE                                                                   
2736                                                                                  
2737    END SUBROUTINE CMBGB6
2739 !***************************************************************************
2740    SUBROUTINE CMBGB7(abscoefL, abscoefH, SELFREF,                      &
2741                      FRACREFA, FRACREFB, ABSCO2,                       &
2742                      SELFREFC, ABSCO2C, FRACREFAC, FRACREFBC           )
2743 !***************************************************************************     
2744 !                                                                                
2745 !     BAND 7:  980-1080 cm-1 (low - H2O,O3; high - O3)                           
2746 !***************************************************************************     
2747                                                                                  
2748 ! Input                                                                          
2749       REAL abscoefL(9,5,13,MG),abscoefH(5,13:59,MG)
2750       REAL SELFREF(10,MG)          
2751       REAL FRACREFA(MG,9), FRACREFB(MG), ABSCO2(MG)
2752 !     REAL RWGT(MG*NBANDS) 
2753 ! Output                                                                         
2754       REAL SELFREFC(10,NG7), ABSCO2C(NG7)
2755       REAL FRACREFAC(NG7,9), FRACREFBC(NG7)  
2756                                                                                  
2757       DO 2000 JN = 1,9                                                           
2758          DO 2000 JTJT = 1,5                                                        
2759             DO 2200 JPJP = 1,13                                                    
2760                IPRSM = 0                                                         
2761                DO 2400 IGC = 1,NGC(7)                                            
2762                  SUMK = 0.                                                       
2763                   DO 2600 IPR = 1, NGN(NGS(6)+IGC)                               
2764                      IPRSM = IPRSM + 1                                           
2765                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+96)
2766  2600             CONTINUE                                                       
2767                   ABSA7(JN+(JTJT-1)*9+(JPJP-1)*45,IGC) = SUMK                                       
2768  2400          CONTINUE                                                          
2769  2200       CONTINUE                                                             
2770  2000 CONTINUE                                                                   
2771       DO 3000 JTJT = 1,5                                                           
2772          DO 3200 JPJP = 13,59                                                      
2773             IPRSM = 0                                                            
2774             DO 3400 IGC = 1,NGC(7)                                               
2775                SUMK = 0.                                                         
2776                DO 3600 IPR = 1, NGN(NGS(6)+IGC)                                  
2777                   IPRSM = IPRSM + 1                                              
2778                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM+96)
2779  3600          CONTINUE                                                          
2780                ABSB7(JTJT+(JPJP-13)*5,IGC) = SUMK 
2781  3400       CONTINUE                                                             
2782  3200    CONTINUE                                                                
2783  3000 CONTINUE                                                                   
2784                                                                                  
2785       DO 4000 JTJT = 1,10                                                          
2786          IPRSM = 0                                                               
2787          DO 4400 IGC = 1,NGC(7)                                                  
2788             SUMK = 0.                                                            
2789             DO 4600 IPR = 1, NGN(NGS(6)+IGC)                                     
2790                IPRSM = IPRSM + 1                                                 
2791                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+96)
2792  4600       CONTINUE                                                             
2793             SELFREFC(JTJT,IGC) = SUMK                                              
2794  4400    CONTINUE                                                                
2795  4000 CONTINUE                                                                   
2796                                                                                  
2797       DO 5000 JPJP = 1,9                                                           
2798          IPRSM = 0                                                               
2799          DO 5400 IGC = 1,NGC(7)                                                  
2800             SUMF = 0.                                                            
2801             DO 5600 IPR = 1, NGN(NGS(6)+IGC)                                     
2802                IPRSM = IPRSM + 1                                                 
2803                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
2804  5600       CONTINUE                                                             
2805             FRACREFAC(IGC,JPJP) = SUMF                                             
2806  5400    CONTINUE                                                                
2807  5000 CONTINUE                                                                   
2808                                                                                  
2809       IPRSM = 0                                                                  
2810       DO 7400 IGC = 1,NGC(7)                                                     
2811          SUMF = 0.                                                               
2812          SUMK = 0.                                                               
2813          DO 7600 IPR = 1, NGN(NGS(6)+IGC)                                        
2814             IPRSM = IPRSM + 1                                                    
2815             SUMF = SUMF + FRACREFB(IPRSM)                                        
2816             SUMK = SUMK + ABSCO2(IPRSM)*RWGT(IPRSM+96)                           
2817  7600    CONTINUE                                                                
2818          FRACREFBC(IGC) = SUMF                                                   
2819          ABSCO2C(IGC) = SUMK                                                     
2820  7400 CONTINUE                                                                   
2821                                                                                  
2822    END SUBROUTINE CMBGB7
2824 !***************************************************************************
2825    SUBROUTINE CMBGB8(abscoefL, abscoefH, SELFREF,                     &
2826                      FRACREFA, FRACREFB, ABSCO2A, ABSCO2B,            &
2827                      ABSN2OA,  ABSN2OB,  CFC12,   CFC22ADJ,           &
2828                      SELFREFC, ABSCO2AC, ABSCO2BC,                    &
2829                      ABSN2OAC, ABSN2OBC, CFC12C, CFC22ADJC,           &
2830                      FRACREFAC, FRACREFBC                             )
2831 !***************************************************************************     
2832 !                                                                                
2833 !     BAND 8:  1080-1180 cm-1 (low (i.e.>~300mb) - H2O; high - O3)               
2834 !***************************************************************************     
2835                                                                                  
2836 ! Input                                                                          
2837       REAL abscoefL(5,7,MG),abscoefH(5,7:59,MG), SELFREF(10,MG)
2838       REAL FRACREFA(MG), FRACREFB(MG), ABSCO2A(MG), ABSCO2B(MG)
2839       REAL ABSN2OA(MG), ABSN2OB(MG), CFC12(MG), CFC22ADJ(MG) 
2840 !     REAL RWGT(MG*NBANDS) 
2841 ! Output                                                                         
2842       REAL SELFREFC(10,NG8),               &
2843            ABSCO2AC(NG8), ABSCO2BC(NG8),   &
2844            ABSN2OAC(NG8), ABSN2OBC(NG8),   &
2845            CFC12C(NG8), CFC22ADJC(NG8)
2846       REAL FRACREFAC(NG8), FRACREFBC(NG8)
2847                                                                                  
2848       DO 2000 JTJT = 1,5                                                           
2849          DO 2200 JPJP = 1,7                                                        
2850             IPRSM = 0                                                            
2851             DO 2400 IGC = 1,NGC(8)                                               
2852               SUMK = 0.                                                          
2853                DO 2600 IPR = 1, NGN(NGS(7)+IGC)                                  
2854                   IPRSM = IPRSM + 1                                              
2855                   SUMK = SUMK + abscoefL(JTJT,JPJP,IPRSM)*RWGT(IPRSM+112)
2856  2600          CONTINUE                                                          
2857                ABSA8(JTJT+(JPJP-1)*5,IGC) = SUMK                                             
2858  2400       CONTINUE                                                             
2859  2200    CONTINUE                                                                
2860  2000 CONTINUE                                                                   
2861       DO 3000 JTJT = 1,5                                                           
2862          DO 3200 JPJP = 7,59                                                       
2863             IPRSM = 0                                                            
2864             DO 3400 IGC = 1,NGC(8)                                               
2865                SUMK = 0.                                                         
2866                DO 3600 IPR = 1, NGN(NGS(7)+IGC)                                  
2867                   IPRSM = IPRSM + 1                                              
2868                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM+112)
2869  3600          CONTINUE                                                          
2870                ABSB8(JTJT+(JPJP-7)*5,IGC) = SUMK 
2871  3400       CONTINUE                                                             
2872  3200    CONTINUE                                                                
2873  3000 CONTINUE                                                                   
2874                                                                                  
2875       DO 4000 JTJT = 1,10                                                          
2876          IPRSM = 0                                                               
2877          DO 4400 IGC = 1,NGC(8)                                                  
2878             SUMK = 0.                                                            
2879             DO 4600 IPR = 1, NGN(NGS(7)+IGC)                                     
2880                IPRSM = IPRSM + 1                                                 
2881                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+112) 
2882  4600       CONTINUE                                                             
2883             SELFREFC(JTJT,IGC) = SUMK                                              
2884  4400    CONTINUE                                                                
2885  4000 CONTINUE                                                                   
2886                                                                                  
2887       IPRSM = 0                                                                  
2888       DO 7400 IGC = 1,NGC(8)                                                     
2889          SUMF1= 0.                                                               
2890          SUMF2= 0.                                                               
2891          SUMK1= 0.                                                               
2892          SUMK2= 0.                                                               
2893          SUMK3= 0.                                                               
2894          SUMK4= 0.                                                               
2895          SUMK5= 0.                                                               
2896          SUMK6= 0.                                                               
2897          DO 7600 IPR = 1, NGN(NGS(7)+IGC)                                        
2898             IPRSM = IPRSM + 1                                                    
2899             SUMF1= SUMF1+ FRACREFA(IPRSM)                                        
2900             SUMF2= SUMF2+ FRACREFB(IPRSM)                                        
2901             SUMK1= SUMK1+ ABSCO2A(IPRSM)*RWGT(IPRSM+112)                         
2902             SUMK2= SUMK2+ ABSCO2B(IPRSM)*RWGT(IPRSM+112)                         
2903             SUMK3= SUMK3+ ABSN2OA(IPRSM)*RWGT(IPRSM+112)                         
2904             SUMK4= SUMK4+ ABSN2OB(IPRSM)*RWGT(IPRSM+112)                         
2905             SUMK5= SUMK5+ CFC12(IPRSM)*RWGT(IPRSM+112)                           
2906             SUMK6= SUMK6+ CFC22ADJ(IPRSM)*RWGT(IPRSM+112)                        
2907  7600    CONTINUE                                                                
2908          FRACREFAC(IGC) = SUMF1                                                  
2909          FRACREFBC(IGC) = SUMF2                                                  
2910          ABSCO2AC(IGC) = SUMK1                                                   
2911          ABSCO2BC(IGC) = SUMK2                                                   
2912          ABSN2OAC(IGC) = SUMK3                                                   
2913          ABSN2OBC(IGC) = SUMK4                                                   
2914          CFC12C(IGC) = SUMK5                                                     
2915          CFC22ADJC(IGC) = SUMK6                                                  
2916  7400 CONTINUE                                                                   
2917                                                                                  
2918    END SUBROUTINE CMBGB8
2920 !***************************************************************************
2921    SUBROUTINE CMBGB9(abscoefL, abscoefH, SELFREF,                      &
2922                      FRACREFA, FRACREFB, ABSN2O,                       &
2923                      SELFREFC, ABSN2OC, FRACREFAC, FRACREFBC           )
2924 !***************************************************************************     
2925 !                                                                                
2926 !     BAND 9:  1180-1390 cm-1 (low - H2O,CH4; high - CH4)                        
2927 !***************************************************************************     
2928                                                                                  
2929 ! Input                                                                          
2930       REAL abscoefL(11,5,13,MG), abscoefH(5,13:59,MG)
2931       REAL SELFREF(10,MG)   
2932       REAL FRACREFA(MG,9), FRACREFB(MG), ABSN2O(3*MG)
2933 !     REAL RWGT(MG*NBANDS) 
2934 ! Output                                                                         
2935       REAL SELFREFC(10,NG9), ABSN2OC(3*NG9)
2936       REAL FRACREFAC(NG9,9), FRACREFBC(NG9)
2937                                                                                  
2938       DO 2000 JN = 1,11                                                          
2939          DO 2000 JTJT = 1,5                                                        
2940             DO 2200 JPJP = 1,13                                                    
2941                IPRSM = 0                                                         
2942                DO 2400 IGC = 1,NGC(9)                                            
2943                   SUMK = 0.                                                      
2944                   DO 2600 IPR = 1, NGN(NGS(8)+IGC)                               
2945                      IPRSM = IPRSM + 1                                           
2946                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+128)
2947  2600             CONTINUE                                                       
2948                   ABSA9(JN+(JTJT-1)*11+(JPJP-1)*55,IGC) = SUMK                                       
2949  2400          CONTINUE                                                          
2950  2200       CONTINUE                                                             
2951  2000 CONTINUE                                                                   
2952                                                                                  
2953       DO 3000 JTJT = 1,5                                                           
2954          DO 3200 JPJP = 13,59                                                      
2955             IPRSM = 0                                                            
2956             DO 3400 IGC = 1,NGC(9)                                               
2957                SUMK = 0.                                                         
2958                DO 3600 IPR = 1, NGN(NGS(8)+IGC)                                  
2959                   IPRSM = IPRSM + 1                                              
2960                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM+128)
2961  3600          CONTINUE                                                          
2962                ABSB9(JTJT+(JPJP-13)*5,IGC) = SUMK
2963  3400       CONTINUE                                                             
2964  3200    CONTINUE                                                                
2965  3000 CONTINUE                                                                   
2966                                                                                  
2967       DO 4000 JTJT = 1,10                                                          
2968          IPRSM = 0                                                               
2969          DO 4400 IGC = 1,NGC(9)                                                  
2970             SUMK = 0.                                                            
2971             DO 4600 IPR = 1, NGN(NGS(8)+IGC)                                     
2972                IPRSM = IPRSM + 1                                                 
2973                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+128)
2974  4600       CONTINUE                                                             
2975             SELFREFC(JTJT,IGC) = SUMK                                              
2976  4400    CONTINUE                                                                
2977  4000 CONTINUE                                                                   
2978                                                                                  
2979       DO 5000 JN = 1,3                                                           
2980          IPRSM = 0                                                               
2981          DO 5400 IGC = 1,NGC(9)                                                  
2982             SUMK = 0.                                                            
2983             DO 5600 IPR = 1, NGN(NGS(8)+IGC)                                     
2984                IPRSM = IPRSM + 1                                                 
2985                JND = (JN-1)*16                                                   
2986                SUMK = SUMK + ABSN2O(JND+IPRSM)*RWGT(IPRSM+128)                   
2987  5600       CONTINUE                                                             
2988             JNDC = (JN-1)*NGC(9)                                                 
2989             ABSN2OC(JNDC+IGC) = SUMK                                             
2990  5400    CONTINUE                                                                
2991  5000 CONTINUE                                                                   
2992                                                                                  
2993       DO 6000 JPJP = 1,9                                                           
2994          IPRSM = 0                                                               
2995          DO 6400 IGC = 1,NGC(9)                                                  
2996             SUMF = 0.                                                            
2997             DO 6600 IPR = 1, NGN(NGS(8)+IGC)                                     
2998                IPRSM = IPRSM + 1                                                 
2999                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
3000  6600       CONTINUE                                                             
3001             FRACREFAC(IGC,JPJP) = SUMF                                             
3002  6400    CONTINUE                                                                
3003  6000 CONTINUE                                                                   
3004                                                                                  
3005       IPRSM = 0                                                                  
3006       DO 7400 IGC = 1,NGC(9)                                                     
3007          SUMF = 0.                                                               
3008          DO 7600 IPR = 1, NGN(NGS(8)+IGC)                                        
3009             IPRSM = IPRSM + 1                                                    
3010             SUMF = SUMF + FRACREFB(IPRSM)                                        
3011  7600    CONTINUE                                                                
3012          FRACREFBC(IGC) = SUMF                                                   
3013  7400 CONTINUE                                                                   
3014                                                                                  
3015    END SUBROUTINE CMBGB9
3017 !***************************************************************************
3018    SUBROUTINE CMBGB10(abscoefL, abscoefH,                               &
3019                       FRACREFA, FRACREFB,                               &
3020                       FRACREFAC, FRACREFBC                              )
3021 !***************************************************************************     
3022 !                                                                                
3023 !     BAND 10:  1390-1480 cm-1 (low - H2O; high - H2O)                           
3024 !***************************************************************************     
3025                                                                                  
3026 ! Input                                                                          
3027       REAL abscoefL(5,13,MG),abscoefH(5,13:59,MG)            
3028       REAL FRACREFA(MG), FRACREFB(MG)
3029 !     REAL RWGT(MG*NBANDS) 
3030 ! Output                                                                         
3031       REAL FRACREFAC(NG10), FRACREFBC(NG10)
3032                                                                                  
3033       DO 2000 JTJT = 1,5                                                           
3034          DO 2200 JPJP = 1,13                                                       
3035             IPRSM = 0                                                            
3036             DO 2400 IGC = 1,NGC(10)                                              
3037                SUMK = 0.                                                         
3038                DO 2600 IPR = 1, NGN(NGS(9)+IGC)                                  
3039                   IPRSM = IPRSM + 1                                              
3040                   SUMK = SUMK + abscoefL(JTJT,JPJP,IPRSM)*RWGT(IPRSM+144)
3041  2600          CONTINUE                                                          
3042                ABSA10(JTJT+(JPJP-1)*5,IGC) = SUMK                                             
3043  2400       CONTINUE                                                             
3044  2200    CONTINUE                                                                
3045  2000 CONTINUE                                                                   
3046       DO 3000 JTJT = 1,5                                                           
3047          DO 3200 JPJP = 13,59                                                      
3048             IPRSM = 0                                                            
3049             DO 3400 IGC = 1,NGC(10)                                              
3050                SUMK = 0.                                                         
3051                DO 3600 IPR = 1, NGN(NGS(9)+IGC)                                  
3052                   IPRSM = IPRSM + 1                                              
3053                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM+144)
3054  3600          CONTINUE                                                          
3055                ABSB10(JTJT+(JPJP-13)*5,IGC) = SUMK
3056  3400       CONTINUE                                                             
3057  3200    CONTINUE                                                                
3058  3000 CONTINUE                                                                   
3059                                                                                  
3060       IPRSM = 0                                                                  
3061       DO 7400 IGC = 1,NGC(10)                                                    
3062          SUMF1= 0.                                                               
3063          SUMF2= 0.                                                               
3064          DO 7600 IPR = 1, NGN(NGS(9)+IGC)                                        
3065             IPRSM = IPRSM + 1                                                    
3066             SUMF1= SUMF1+ FRACREFA(IPRSM)                                        
3067             SUMF2= SUMF2+ FRACREFB(IPRSM)                                        
3068  7600    CONTINUE                                                                
3069          FRACREFAC(IGC) = SUMF1                                                  
3070          FRACREFBC(IGC) = SUMF2                                                  
3071  7400 CONTINUE                                                                   
3072                                                                                  
3073    END SUBROUTINE CMBGB10
3075 !***************************************************************************
3076    SUBROUTINE CMBGB11(abscoefL, abscoefH, SELFREF,                   &
3077                       FRACREFA, FRACREFB,                            &
3078                       SELFREFC,                                      &
3079                       FRACREFAC, FRACREFBC                           )
3080 !***************************************************************************     
3081 !                                                                                
3082 !     BAND 11:  1480-1800 cm-1 (low - H2O; high - H2O)                           
3083 !***************************************************************************     
3084                                                                                  
3085 ! Input                                                                          
3086       REAL abscoefL(5,13,MG),abscoefH(5,13:59,MG)
3087       REAL SELFREF(10,MG)      
3088       REAL FRACREFA(MG), FRACREFB(MG)
3089 !     REAL RWGT(MG*NBANDS) 
3090 ! Output                                                                         
3091       REAL SELFREFC(10,NG11)
3092       REAL FRACREFAC(NG11), FRACREFBC(NG11)
3093                                                                                  
3094       DO 2000 JTJT = 1,5                                                           
3095          DO 2200 JPJP = 1,13                                                       
3096             IPRSM = 0                                                            
3097             DO 2400 IGC = 1,NGC(11)                                              
3098                SUMK = 0.                                                         
3099                DO 2600 IPR = 1, NGN(NGS(10)+IGC)                                 
3100                   IPRSM = IPRSM + 1                                              
3101                   SUMK = SUMK + abscoefL(JTJT,JPJP,IPRSM)*RWGT(IPRSM+160)
3102  2600          CONTINUE                                                          
3103                ABSA11(JTJT+(JPJP-1)*5,IGC) = SUMK                                             
3104  2400       CONTINUE                                                             
3105  2200    CONTINUE                                                                
3106  2000 CONTINUE                                                                   
3107       DO 3000 JTJT = 1,5                                                           
3108          DO 3200 JPJP = 13,59                                                      
3109             IPRSM = 0                                                            
3110             DO 3400 IGC = 1,NGC(11)                                              
3111                SUMK = 0.                                                         
3112                DO 3600 IPR = 1, NGN(NGS(10)+IGC)                                 
3113                   IPRSM = IPRSM + 1                                              
3114                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM+160) 
3115  3600          CONTINUE                                                          
3116                ABSB11(JTJT+(JPJP-13)*5,IGC) = SUMK
3117  3400       CONTINUE                                                             
3118  3200    CONTINUE                                                                
3119  3000 CONTINUE                                                                   
3120                                                                                  
3121       DO 4000 JTJT = 1,10                                                          
3122          IPRSM = 0                                                               
3123          DO 4400 IGC = 1,NGC(11)                                                 
3124             SUMK = 0.                                                            
3125             DO 4600 IPR = 1, NGN(NGS(10)+IGC)                                    
3126                IPRSM = IPRSM + 1                                                 
3127                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+160) 
3128  4600       CONTINUE                                                             
3129             SELFREFC(JTJT,IGC) = SUMK                                              
3130  4400    CONTINUE                                                                
3131  4000 CONTINUE                                                                   
3132                                                                                  
3133       IPRSM = 0                                                                  
3134       DO 7400 IGC = 1,NGC(11)                                                    
3135          SUMF1= 0.                                                               
3136          SUMF2= 0.                                                               
3137          DO 7600 IPR = 1, NGN(NGS(10)+IGC)                                       
3138             IPRSM = IPRSM + 1                                                    
3139             SUMF1= SUMF1+ FRACREFA(IPRSM)                                        
3140             SUMF2= SUMF2+ FRACREFB(IPRSM)                                        
3141  7600    CONTINUE                                                                
3142          FRACREFAC(IGC) = SUMF1                                                  
3143          FRACREFBC(IGC) = SUMF2                                                  
3144  7400 CONTINUE                                                                   
3145                                                                                  
3146    END SUBROUTINE CMBGB11
3149 !***************************************************************************
3150    SUBROUTINE CMBGB12(abscoefL, SELFREF,                          &
3151                       FRACREFA,                                   &
3152                       SELFREFC, FRACREFAC                         )
3153 !***************************************************************************     
3154 !                                                                                
3155 !     BAND 12:  1800-2080 cm-1 (low - H2O,CO2; high - nothing)                   
3156 !***************************************************************************     
3157                                                                                  
3158 ! Input                                                                          
3159       REAL abscoefL(9,5,13,MG)  
3160       REAL SELFREF(10,MG)              
3161       REAL FRACREFA(MG,9)
3162 !     REAL RWGT(MG*NBANDS) 
3163 ! Output                                                                         
3164       REAL SELFREFC(10,NG12) 
3165       REAL FRACREFAC(NG12,9)
3166                                                                                  
3167       DO 2000 JN = 1,9                                                           
3168          DO 2000 JTJT = 1,5                                                        
3169             DO 2200 JPJP = 1,13                                                    
3170                IPRSM = 0                                                         
3171                DO 2400 IGC = 1,NGC(12)                                           
3172                   SUMK = 0.                                                      
3173                   DO 2600 IPR = 1, NGN(NGS(11)+IGC)                              
3174                      IPRSM = IPRSM + 1                                           
3175                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+176)
3176  2600             CONTINUE                                                       
3177                   ABSA12(JN+(JTJT-1)*9+(JPJP-1)*45,IGC) = SUMK                                       
3178  2400          CONTINUE                                                          
3179  2200       CONTINUE                                                             
3180  2000 CONTINUE                                                                   
3181                                                                                  
3182       DO 4000 JTJT = 1,10                                                          
3183          IPRSM = 0                                                               
3184          DO 4400 IGC = 1,NGC(12)                                                 
3185             SUMK = 0.                                                            
3186             DO 4600 IPR = 1, NGN(NGS(11)+IGC)                                    
3187                IPRSM = IPRSM + 1                                                 
3188                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+176)
3189  4600       CONTINUE                                                             
3190             SELFREFC(JTJT,IGC) = SUMK                                              
3191  4400    CONTINUE                                                                
3192  4000 CONTINUE                                                                   
3193                                                                                  
3194       DO 7000 JPJP = 1,9                                                           
3195          IPRSM = 0                                                               
3196          DO 7400 IGC = 1,NGC(12)                                                 
3197             SUMF = 0.                                                            
3198             DO 7600 IPR = 1, NGN(NGS(11)+IGC)                                    
3199                IPRSM = IPRSM + 1                                                 
3200                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
3201  7600       CONTINUE                                                             
3202             FRACREFAC(IGC,JPJP) = SUMF                                             
3203  7400    CONTINUE                                                                
3204  7000 CONTINUE                                                                   
3205                                                                                  
3206    END SUBROUTINE CMBGB12
3208 !***************************************************************************
3209    SUBROUTINE CMBGB13(abscoefL, SELFREF, FRACREFA,               &
3210                       SELFREFC, FRACREFAC                        )
3211 !***************************************************************************     
3212 !                                                                                
3213 !     BAND 13:  2080-2250 cm-1 (low - H2O,N2O; high - nothing)                   
3214 !***************************************************************************     
3215                                                                                  
3216 ! Input                                                                          
3217       REAL abscoefL(9,5,13,MG) 
3218       REAL SELFREF(10,MG)   
3219       REAL FRACREFA(MG,9)
3220 !     REAL RWGT(MG*NBANDS) 
3221 ! Output                                                                         
3222       REAL SELFREFC(10,NG13) 
3223       REAL FRACREFAC(NG13,9)
3224                                                                                  
3225       DO 2000 JN = 1,9                                                           
3226          DO 2000 JTJT = 1,5                                                        
3227             DO 2200 JPJP = 1,13                                                    
3228                IPRSM = 0                                                         
3229                DO 2400 IGC = 1,NGC(13)                                           
3230                   SUMK = 0.                                                      
3231                   DO 2600 IPR = 1, NGN(NGS(12)+IGC)                              
3232                      IPRSM = IPRSM + 1                                           
3233                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+192)
3234  2600             CONTINUE                                                       
3235                   ABSA13(JN+(JTJT-1)*9+(JPJP-1)*45,IGC) = SUMK 
3236  2400          CONTINUE                                                          
3237  2200       CONTINUE                                                             
3238  2000 CONTINUE                                                                   
3239                                                                                  
3240       DO 4000 JTJT = 1,10                                                          
3241          IPRSM = 0                                                               
3242          DO 4400 IGC = 1,NGC(13)                                                 
3243             SUMK = 0.                                                            
3244             DO 4600 IPR = 1, NGN(NGS(12)+IGC)                                    
3245                IPRSM = IPRSM + 1                                                 
3246                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+192)
3247  4600       CONTINUE                                                             
3248             SELFREFC(JTJT,IGC) = SUMK                                              
3249  4400    CONTINUE                                                                
3250  4000 CONTINUE                                                                   
3251                                                                                  
3252       DO 7000 JPJP = 1,9                                                           
3253          IPRSM = 0                                                               
3254          DO 7400 IGC = 1,NGC(13)                                                 
3255             SUMF = 0.                                                            
3256             DO 7600 IPR = 1, NGN(NGS(12)+IGC)                                    
3257                IPRSM = IPRSM + 1                                                 
3258                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
3259  7600       CONTINUE                                                             
3260             FRACREFAC(IGC,JPJP) = SUMF                                             
3261  7400    CONTINUE                                                                
3262  7000 CONTINUE                                                                   
3263                                                                                  
3264    END SUBROUTINE CMBGB13
3266 !***************************************************************************
3267    SUBROUTINE CMBGB14(abscoefL, abscoefH, SELFREF,                     &
3268                       FRACREFA, FRACREFB,                              &
3269                       SELFREFC, FRACREFAC, FRACREFBC                   )
3270 !***************************************************************************     
3271 !                                                                                
3272 !     BAND 14:  2250-2380 cm-1 (low - CO2; high - CO2)                           
3273 !***************************************************************************     
3274                                                                                  
3275 ! Input                                                                          
3276       REAL abscoefL(5,13,MG),abscoefH(5,13:59,MG)
3277       REAL SELFREF(10,MG)  
3278       REAL FRACREFA(MG), FRACREFB(MG)
3279 !     REAL RWGT(MG*NBANDS) 
3280 ! Output                                                                         
3281       REAL SELFREFC(10,NG14)                              
3282       REAL FRACREFAC(NG14), FRACREFBC(NG14) 
3283                                                                                  
3284       DO 2000 JTJT = 1,5                                                           
3285          DO 2200 JPJP = 1,13                                                       
3286             IPRSM = 0                                                            
3287             DO 2400 IGC = 1,NGC(14)                                              
3288                SUMK = 0.                                                         
3289                DO 2600 IPR = 1, NGN(NGS(13)+IGC)                                 
3290                   IPRSM = IPRSM + 1                                              
3291                   SUMK = SUMK + abscoefL(JTJT,JPJP,IPRSM)*RWGT(IPRSM+208)
3292  2600          CONTINUE                                                          
3293                ABSA14(JTJT+(JPJP-1)*5,IGC) = SUMK
3294  2400       CONTINUE                                                             
3295  2200    CONTINUE                                                                
3296  2000 CONTINUE                                                                   
3297                                                                                  
3298       DO 3000 JTJT = 1,5                                                           
3299          DO 3200 JPJP = 13,59                                                      
3300             IPRSM = 0                                                            
3301             DO 3400 IGC = 1,NGC(14)                                              
3302                SUMK = 0.                                                         
3303                DO 3600 IPR = 1, NGN(NGS(13)+IGC)                                 
3304                   IPRSM = IPRSM + 1                                              
3305                   SUMK = SUMK + abscoefH(JTJT,JPJP,IPRSM)*RWGT(IPRSM+208)
3306  3600          CONTINUE                                                          
3307                ABSB14(JTJT+(JPJP-13)*5,IGC) = SUMK
3308  3400       CONTINUE                                                             
3309  3200    CONTINUE                                                                
3310  3000 CONTINUE                                                                   
3311                                                                                  
3312       DO 4000 JTJT = 1,10                                                          
3313          IPRSM = 0                                                               
3314          DO 4400 IGC = 1,NGC(14)                                                 
3315             SUMK = 0.                                                            
3316             DO 4600 IPR = 1, NGN(NGS(13)+IGC)                                    
3317                IPRSM = IPRSM + 1                                                 
3318                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+208)
3319  4600       CONTINUE                                                             
3320             SELFREFC(JTJT,IGC) = SUMK                                              
3321  4400    CONTINUE                                                                
3322  4000 CONTINUE                                                                   
3323                                                                                  
3324       IPRSM = 0                                                                  
3325       DO 7400 IGC = 1,NGC(14)                                                    
3326          SUMF1= 0.                                                               
3327          SUMF2= 0.                                                               
3328          DO 7600 IPR = 1, NGN(NGS(13)+IGC)                                       
3329             IPRSM = IPRSM + 1                                                    
3330             SUMF1= SUMF1+ FRACREFA(IPRSM)                                        
3331             SUMF2= SUMF2+ FRACREFB(IPRSM)                                        
3332  7600    CONTINUE                                                                
3333          FRACREFAC(IGC) = SUMF1                                                  
3334          FRACREFBC(IGC) = SUMF2                                                  
3335  7400 CONTINUE                                                                   
3336                                                                                  
3337             
3338    END SUBROUTINE CMBGB14
3340 !***************************************************************************
3341    SUBROUTINE CMBGB15(abscoefL, SELFREF, FRACREFA,                &
3342                       SELFREFC, FRACREFAC                         )
3343 !***************************************************************************
3344 !                                                                                
3345 !     BAND 15:  2380-2600 cm-1 (low - N2O,CO2; high - nothing)                   
3346 !***************************************************************************     
3347                                                                                  
3348 ! Input                                                                          
3349       REAL abscoefL(9,5,13,MG)                                                         
3350       REAL SELFREF(10,MG)  
3351       REAL FRACREFA(MG,9)
3352 !     REAL RWGT(MG*NBANDS) 
3353 ! Output                                                                         
3354       REAL SELFREFC(10,NG15)
3355       REAL FRACREFAC(NG15,9) 
3356                                                                                  
3357       DO 2000 JN = 1,9                                                           
3358          DO 2000 JTJT = 1,5                                                        
3359             DO 2200 JPJP = 1,13                                                    
3360                IPRSM = 0                                                         
3361                DO 2400 IGC = 1,NGC(15)                                           
3362                   SUMK = 0.                                                      
3363                   DO 2600 IPR = 1, NGN(NGS(14)+IGC)                              
3364                      IPRSM = IPRSM + 1                                           
3365                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+224)
3366  2600             CONTINUE                                                       
3367                   ABSA15(JN+(JTJT-1)*9+(JPJP-1)*45,IGC) = SUMK 
3368  2400          CONTINUE                                                          
3369  2200       CONTINUE                                                             
3370  2000 CONTINUE                                                                   
3371                                                                                  
3372       DO 4000 JTJT = 1,10                                                          
3373          IPRSM = 0                                                               
3374          DO 4400 IGC = 1,NGC(15)                                                 
3375             SUMK = 0.                                                            
3376             DO 4600 IPR = 1, NGN(NGS(14)+IGC)                                    
3377                IPRSM = IPRSM + 1                                                 
3378                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+224)
3379  4600       CONTINUE                                                             
3380             SELFREFC(JTJT,IGC) = SUMK                                              
3381  4400    CONTINUE                                                                
3382  4000 CONTINUE                                                                   
3383                                                                                  
3384       DO 7000 JPJP = 1,9                                                           
3385          IPRSM = 0                                                               
3386          DO 7400 IGC = 1,NGC(15)                                                 
3387             SUMF = 0.                                                            
3388             DO 7600 IPR = 1, NGN(NGS(14)+IGC)                                    
3389                IPRSM = IPRSM + 1                                                 
3390                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
3391  7600       CONTINUE                                                             
3392             FRACREFAC(IGC,JPJP) = SUMF                                             
3393  7400    CONTINUE                                                                
3394  7000 CONTINUE                                                                   
3395                                                                                  
3396    END SUBROUTINE CMBGB15
3398 !***************************************************************************
3399    SUBROUTINE CMBGB16(abscoefL, SELFREF, FRACREFA,               &
3400                       SELFREFC, FRACREFAC                        )
3401 !***************************************************************************     
3402 !                                                                                
3403 !     BAND 16:  2600-3000 cm-1 (low - H2O,CH4; high - nothing)                   
3404 !***************************************************************************     
3405                                                                                  
3406 ! Input                                                                          
3407       REAL abscoefL(9,5,13,MG)                                                         
3408       REAL SELFREF(10,MG)     
3409       REAL FRACREFA(MG,9)
3410 !     REAL RWGT(MG*NBANDS) 
3411 ! Output                                                                         
3412       REAL SELFREFC(10,NG16)
3413       REAL FRACREFAC(NG16,9)
3414                                                                                  
3415       DO 2000 JN = 1,9                                                           
3416          DO 2000 JTJT = 1,5                                                        
3417             DO 2200 JPJP = 1,13                                                    
3418                IPRSM = 0                                                         
3419                DO 2400 IGC = 1,NGC(16)                                           
3420                   SUMK = 0.                                                      
3421                   DO 2600 IPR = 1, NGN(NGS(15)+IGC)                              
3422                      IPRSM = IPRSM + 1                                           
3423                      SUMK = SUMK + abscoefL(JN,JTJT,JPJP,IPRSM)*RWGT(IPRSM+240)
3424  2600             CONTINUE                                                       
3425                   ABSA16(JN+(JTJT-1)*9+(JPJP-1)*45,IGC) = SUMK
3426  2400          CONTINUE                                                          
3427  2200       CONTINUE                                                             
3428  2000 CONTINUE                                                                   
3429                                                                                  
3430       DO 4000 JTJT = 1,10                                                          
3431          IPRSM = 0                                                               
3432          DO 4400 IGC = 1,NGC(16)                                                 
3433             SUMK = 0.                                                            
3434             DO 4600 IPR = 1, NGN(NGS(15)+IGC)                                    
3435                IPRSM = IPRSM + 1                                                 
3436                SUMK = SUMK + SELFREF(JTJT,IPRSM)*RWGT(IPRSM+240)
3437  4600       CONTINUE                                                             
3438             SELFREFC(JTJT,IGC) = SUMK                                              
3439  4400    CONTINUE                                                                
3440  4000 CONTINUE                                                                   
3441                                                                                  
3442       DO 7000 JPJP = 1,9                                                           
3443          IPRSM = 0                                                               
3444          DO 7400 IGC = 1,NGC(16)                                                 
3445             SUMF = 0.                                                            
3446             DO 7600 IPR = 1, NGN(NGS(15)+IGC)                                    
3447                IPRSM = IPRSM + 1                                                 
3448                SUMF = SUMF + FRACREFA(IPRSM,JPJP)                                  
3449  7600       CONTINUE                                                             
3450             FRACREFAC(IGC,JPJP) = SUMF                                             
3451  7400    CONTINUE                                                                
3452  7000 CONTINUE                                                                   
3453                                                                                  
3454    END SUBROUTINE CMBGB16
3456 !-------------------------------------------------------------------------
3457    SUBROUTINE INIRAD (O3PROF,Pw, kts, kte)
3458 !-------------------------------------------------------------------------
3459       IMPLICIT NONE
3460 !-------------------------------------------------------------------------
3461    INTEGER, INTENT(IN   )                        ::    kts,kte
3463    REAL, DIMENSION( kts:kte ),INTENT(INOUT)      ::    O3PROF
3465    REAL, DIMENSION( kts:kte+1 ),INTENT(IN   )    ::        Pw
3467 ! LOCAL VAR
3468   
3469    REAL, DIMENSION( kts:kte+1 ) :: PAVEL, TAVEL 
3470    REAL, DIMENSION(   0:kte+1 ) :: PZ, TZ
3472    INTEGER :: k
3475 !                                                                                
3476 !  COMPUTE OZONE MIXING RATIO DISTRIBUTION                                       
3477 !                                                                                
3478    DO K=kts,kte
3479       O3PROF(K)=0.                                                       
3480    ENDDO
3481                                                                                  
3482    CALL O3DATA(O3PROF, Pw, kts, kte)
3483 !                                                                                
3484    END SUBROUTINE INIRAD
3485                                                                                  
3486 !-------------------------------------------------------------------------
3487    SUBROUTINE O3DATA (O3PROF, Pw, kts, kte)
3488 !-------------------------------------------------------------------------
3489    IMPLICIT NONE
3490 !-------------------------------------------------------------------------
3492    INTEGER, INTENT(IN   )   ::       kts, kte
3494    REAL, DIMENSION( kts:kte ),INTENT(INOUT)      ::    O3PROF
3496    REAL, DIMENSION( kts:kte+1 ),INTENT(IN   )    ::        Pw
3498 ! LOCAL VAR
3499    INTEGER :: K, JJ, NK
3501    REAL    ::  PRLEVH(kts:kte+1),PPWRKH(32),                       &
3502                O3WRK(31),PPWRK(31),O3SUM(31),PPSUM(31),          &
3503                O3WIN(31),PPWIN(31),O3ANN(31),PPANN(31)                                                       
3505    REAL    ::  PB1, PB2, PT1, PT2
3507    DATA O3SUM  /5.297E-8,5.852E-8,6.579E-8,7.505E-8,             &                    
3508         8.577E-8,9.895E-8,1.175E-7,1.399E-7,1.677E-7,2.003E-7,   &                 
3509         2.571E-7,3.325E-7,4.438E-7,6.255E-7,8.168E-7,1.036E-6,   &                 
3510         1.366E-6,1.855E-6,2.514E-6,3.240E-6,4.033E-6,4.854E-6,   &                 
3511         5.517E-6,6.089E-6,6.689E-6,1.106E-5,1.462E-5,1.321E-5,   &                 
3512         9.856E-6,5.960E-6,5.960E-6/                                              
3514    DATA PPSUM  /955.890,850.532,754.599,667.742,589.841,         &  
3515         519.421,455.480,398.085,347.171,301.735,261.310,225.360, &               
3516         193.419,165.490,141.032,120.125,102.689, 87.829, 75.123, &            
3517          64.306, 55.086, 47.209, 40.535, 34.795, 29.865, 19.122, &               
3518           9.277,  4.660,  2.421,  1.294,  0.647/                                 
3519 !                                                                                
3520    DATA O3WIN  /4.629E-8,4.686E-8,5.017E-8,5.613E-8,             &
3521         6.871E-8,8.751E-8,1.138E-7,1.516E-7,2.161E-7,3.264E-7,   &               
3522         4.968E-7,7.338E-7,1.017E-6,1.308E-6,1.625E-6,2.011E-6,   &               
3523         2.516E-6,3.130E-6,3.840E-6,4.703E-6,5.486E-6,6.289E-6,   &               
3524         6.993E-6,7.494E-6,8.197E-6,9.632E-6,1.113E-5,1.146E-5,   &               
3525         9.389E-6,6.135E-6,6.135E-6/                                              
3527    DATA PPWIN  /955.747,841.783,740.199,649.538,568.404,         &
3528         495.815,431.069,373.464,322.354,277.190,237.635,203.433, &               
3529         174.070,148.949,127.408,108.915, 93.114, 79.551, 67.940, &               
3530          58.072, 49.593, 42.318, 36.138, 30.907, 26.362, 16.423, &               
3531           7.583,  3.620,  1.807,  0.938,  0.469/                                 
3532 !                                                                                
3534    DO K=1,31                                                              
3535      PPANN(K)=PPSUM(K)                                                        
3536    ENDDO
3538    O3ANN(1)=0.5*(O3SUM(1)+O3WIN(1))                                           
3539 !                                                                                
3540    DO K=2,31                                                              
3541       O3ANN(K)=O3WIN(K-1)+(O3WIN(K)-O3WIN(K-1))/(PPWIN(K)-PPWIN(K-1))* & 
3542                (PPSUM(K)-PPWIN(K-1))                                           
3543    ENDDO
3545    DO K=2,31                                                              
3546       O3ANN(K)=0.5*(O3ANN(K)+O3SUM(K))                                         
3547    ENDDO
3549    DO K=1,31                                                                
3550       O3WRK(K)=O3ANN(K)                                                        
3551       PPWRK(K)=PPANN(K)                                                        
3552    ENDDO
3553 !                                                                                
3554 !  CALCULATE HALF PRESSURE LEVELS FOR MODEL AND DATA LEVELS                     
3555 !                                                                                
3557 ! Pw is total P at w level
3558 ! Pw is in mb
3560    DO K=kts,kte+1
3561       NK=kte+1-K+1
3562       PRLEVH(K)=Pw(NK)
3563    ENDDO
3564 !                                                                                
3565    PPWRKH(1)=1100.                                                        
3566    DO K=2,31                                                           
3567       PPWRKH(K)=(PPWRK(K)+PPWRK(K-1))/2.                                   
3568    ENDDO
3569    PPWRKH(32)=0.                                                          
3570    DO K=kts,kte
3571       DO 25 JJ=1,31                                                        
3572          IF((-(PRLEVH(K)-PPWRKH(JJ))).GE.0.)THEN                            
3573            PB1=0.                                                           
3574          ELSE                                                               
3575            PB1=PRLEVH(K)-PPWRKH(JJ)                                         
3576          ENDIF                                                              
3577          IF((-(PRLEVH(K)-PPWRKH(JJ+1))).GE.0.)THEN                          
3578            PB2=0.                                                           
3579          ELSE                                                               
3580            PB2=PRLEVH(K)-PPWRKH(JJ+1)                                       
3581          ENDIF                                                              
3582          IF((-(PRLEVH(K+1)-PPWRKH(JJ))).GE.0.)THEN                          
3583            PT1=0.                                                           
3584          ELSE                                                               
3585            PT1=PRLEVH(K+1)-PPWRKH(JJ)                                       
3586          ENDIF                                                              
3587          IF((-(PRLEVH(K+1)-PPWRKH(JJ+1))).GE.0.)THEN                        
3588            PT2=0.                                                           
3589          ELSE                                                               
3590            PT2=PRLEVH(K+1)-PPWRKH(JJ+1)                                     
3591          ENDIF                                                              
3592          O3PROF(K)=O3PROF(K)+(PB2-PB1-PT2+PT1)*O3WRK(JJ)                
3593   25  CONTINUE                                                             
3594       O3PROF(K)=O3PROF(K)/(PRLEVH(K)-PRLEVH(K+1))                      
3596    ENDDO
3597 !                                                                                
3598    END SUBROUTINE O3DATA
3600 !---------------------------------------------------------------------------
3601    SUBROUTINE MM5ATM(CLDFRA,O3PROF,T,Tw,TSFC,QV,QC,QR,QI,QS,QG,    &
3602                      P,Pw,DELZ,EMISS,R,G,                          &
3603                      PAVEL,TAVEL,PZ,TZ,CLDFRAC,TAUCLOUD,COLDRY,    &
3604                      WKL,WX,TBOUND,SEMISS,                         &
3605                      kts,kte                                       )
3606 !---------------------------------------------------------------------------
3607 !  RRTM Longwave Radiative Transfer Model                                        
3608 !  Atmospheric and Environmental Research, Inc., Cambridge, MA                   
3609 !                                                                                
3610 !  Revision for NCAR MM5:  J. Dudhia (converted from CCM code)                   
3611 !                                                                                
3612 !  Input atmospheric profile from NCAR MM5, and prepare it for use in RRTM.      
3613 !  Set other RRTM input parameters.  Values are passed back through existing     
3614 !  RRTM arrays and commons.                                                      
3615 !---------------------------------------------------------------------------
3616 ! RRTM Definitions                                                               
3617 !    MXLAY = kte+1                ! Maximum number of model layers               
3618 !    MAXXSEC                      ! Maximum number of cross sections             
3619 !    NLAYERS                      ! Number of model layers (kte+1)               
3620 !    PAVEL(MXLAY)                 ! Layer pressures (mb)                         
3621 !    PZ(0:MXLAY)                  ! Level (interface) pressures (mb)             
3622 !    TAVEL(MXLAY)                 ! Layer temperatures (K)                       
3623 !    TZ(0:MXLAY)                  ! Level (interface) temperatures(mb)           
3624 !    TBOUND                       ! Surface temperature (K)                      
3625 !    COLDRY(MXLAY)                ! Dry air column (molecules/cm2)               
3626 !    WKL(35,MXLAY)                ! Molecular amounts (molecules/cm2)            
3627 !    WBRODL(MXLAY)                ! Inactive in this version                     
3628 !    WX(MAXXSEC)                  ! Cross-section amounts (molecules/cm2)        
3629 !    CLDFRAC(MXLAY)               ! Layer cloud fraction                         
3630 !    TAUCLOUD(MXLAY)              ! Layer cloud optical depth                    
3631 !    AMD                          ! Atomic weight of dry air                     
3632 !    AMW                          ! Atomic weight of water                       
3633 !    AMO                          ! Atomic weight of ozone                       
3634 !    AMCH4                        ! Atomic weight of methane                     
3635 !    AMN2O                        ! Atomic weight of nitrous oxide               
3636 !    AMC11                        ! Atomic weight of CFC-11                      
3637 !    AMC12                        ! Atomic weight of CFC-12                      
3638 !    NXMOL                        ! Number of cross-section molecules            
3639 !    IXINDX                       ! Cross-section molecule index (see below)     
3640 !    IXSECT                       ! On/off flag for cross-sections (inactive)    
3641 !    IXMAX                        ! Maximum number of cross-sections (inactive)  
3642 !                                                                                
3643 !-----------------------------------------------------------------------------
3644 ! This compiler directive was added to insure private common block storage       
3645 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
3646 ! carry constants.                                                               
3647 !----------------------------------------------------------------------------
3648 !     Activate cross section molecules:                                             
3649 !     NXMOL     - number of cross-sections input by user                         
3650 !     IXINDX(I) - index of cross-section molecule corresponding to Ith           
3651 !                 cross-section specified by user                                
3652 !                 = 0 -- not allowed in RRTM                                     
3653 !                 = 1 -- CCL4                                                    
3654 !                 = 2 -- CFC11                                                   
3655 !                 = 3 -- CFC12                                                   
3656 !                 = 4 -- CFC22                                                   
3657 !     DATA NXMOL  /2/                                                            
3658 !     DATA IXINDX /0,2,3,0,31*0/                                                 
3659 !                                                                                 
3660 !    CLOUD EMISSIVITIES (M^2/G)                                                  
3661 !    THESE ARE CONSISTENT WITH LWRAD (ABCW=0.5*(ABUP+ABDOWN))                    
3662 !----------------------------------------------------------------------------
3664                                                                                  
3665       INTEGER, INTENT(IN ) ::  kts, kte
3667       REAL, DIMENSION( 35,kts:kte+1 ),                    &
3668             INTENT(INOUT)        ::                  WKL
3670       REAL, DIMENSION( MAXXSEC,kts:kte+1 ),               &
3671             INTENT(INOUT)        ::                   WX
3673       REAL, INTENT(INOUT)        ::               TBOUND
3674       REAL, DIMENSION(NBANDS), INTENT(INOUT) ::   SEMISS
3676       REAL, DIMENSION( kts:kte+1 ), INTENT(IN   ) ::      &
3677                                                       Tw, &
3678                                                       Pw
3679       REAL, DIMENSION( kts:kte ), INTENT(IN   ) ::        &
3680                                                   CLDFRA, &
3681                                                   O3PROF, &
3682                                                     DELZ, &
3683                                                        T, &
3684                                                        P
3686       REAL, DIMENSION( kts:kte ), INTENT(INOUT) ::        &
3687                                                       QV
3689       REAL, DIMENSION( kts:kte ), INTENT(IN   ) ::        &
3690                                                       QC, &
3691                                                       QR, &
3692                                                       QI, &
3693                                                       QS, &
3694                                                       QG
3696       REAL, DIMENSION( kts:kte+1 ), INTENT(INOUT) ::      &
3697                                                    PAVEL, &
3698                                                    TAVEL, &
3699                                                  CLDFRAC, &    
3700                                                 TAUCLOUD, &
3701                                                   COLDRY 
3703       REAL, DIMENSION(   0:kte+1 ), INTENT(INOUT) ::      &
3704                                                       PZ, &
3705                                                       TZ
3707       REAL, INTENT(IN   ) ::   R,G,EMISS,TSFC
3709       REAL    :: GRAVIT
3712 ! LOCAL
3714       REAL, DIMENSION( kts:kte ) ::                 CLDFRC, &
3715                                                       PINT, &
3716                                                       TINT, &
3717                                                         O3, &
3718                                                        N2O, &
3719                                                        CH4, &
3720                                                       CLWP, &
3721                                                       CIWP, &
3722                                                       PLWP, &
3723                                                       PIWP
3724       CHARACTER*80 errmess
3725                            
3726       real :: amd       ! Effective molecular weight of dry air (g/mol)  
3727       real :: amw       ! Molecular weight of water vapor (g/mol)        
3728       real :: amo       ! Molecular weight of ozone (g/mol)              
3729       real :: amch4     ! Molecular weight of methane (g/mol)            
3730       real :: amn2o     ! Molecular weight of nitrous oxide (g/mol)      
3731       real :: amc11     ! Molecular weight of CFC11 (g/mol) - CFCL3      
3732       real :: amc12     ! Molecular weight of CFC12 (g/mol) - CF2CL2     
3733       real :: avgdro    ! Avogadro's number (molecules/mole)             
3734                                                                                  
3735 ! Atomic weights for conversion from mass to volume mixing ratios                
3737       data amd   /  28.9644   /                                                  
3738       data amw   /  18.0154   /                                                  
3739       data amo   /  47.9998   /                                                  
3740       data amch4 /  16.0430   /                                                  
3741       data amn2o /  44.0128   /                                                  
3742       data amc11 / 137.3684   /                                                  
3743       data amc12 / 120.9138   /                                                  
3744       data avgdro/ 6.022E23   /                                                  
3745                                                                                  
3746 !     Set molecular weight ratios                                                    
3748       real :: amdw,  &  ! Molecular weight of dry air / water vapor      
3749               amdc,  &  ! Molecular weight of dry air / methane          
3750               amdn,  &  ! Molecular weight of dry air / nitrous oxide    
3751               amdc1, &  ! Molecular weight of dry air / CFC11            
3752               amdc2     ! Molecular weight of dry air / CFC12            
3754       data amdw /  1.607758 /                                                    
3755       data amdc /  1.805423 /                                                    
3756       data amdn /  0.658090 /                                                    
3757       data amdc1/  0.210852 /                                                    
3758       data amdc2/  0.239546 /                                                    
3760 !     Put in CO2 volume mixing ratio here (330 ppmv)                                
3762       real :: co2vmr
3763       data co2vmr / 330.e-6 /                                                    
3764                                                                                  
3765       REAL :: ABCW,ABICE,ABRN,ABSN
3767       DATA ABCW /0.144/                                                          
3768       DATA ABICE /0.0735/                                                        
3769       DATA ABRN /0.330E-3/                                                       
3770       DATA ABSN /2.34E-3/                                                        
3772       GRAVIT = G*100.
3774 !                                                                                
3775 !  MID-LAYER VALUES                                                              
3776       DO K=kts,kte
3777           RO=P(K)/(R*T(K))*100.                                                  
3778           DZ=DELZ(K)
3779           QV(K)=AMAX1(QV(K),1.E-12) 
3780   
3781           CLDFRC(K)=CLDFRA(K)                                                   
3782                                                                                  
3783 !  PATHS IN G/M^2                                                                
3785 ! QI=0 if no ice phase
3786 ! QS=0 if no ice phase
3788             CLWP(K)=RO*QC(K)*DZ*1000.                                            
3789             CIWP(K)=RO*QI(K)*DZ*1000.                                            
3790             PLWP(K)=(RO*QR(K))**0.75*DZ*1000.                                    
3791             PIWP(K)=(RO*QS(K))**0.75*DZ*1000.                                   
3792                                                                                  
3793           O3(K)=O3PROF(K)                                                      
3794           N2O(K)=0.                                                              
3795           CH4(K)=0.                                                              
3796                                                                                  
3797       ENDDO                                                                      
3798                                                                                  
3799 !  Initialize all molecular amounts to zero here, then pass MM5 amounts          
3800 !  into RRTM arrays WKL and WX below.                                            
3801                                                                                  
3802       DO 1000 ILAY = kts,kte+1
3803          DO 1100 ISP = 1,35                                                      
3804  1100       WKL(ISP,ILAY) = 0.0                                                  
3805          DO 1200 ISP = 1,MAXXSEC                                                 
3806  1200       WX(ISP,ILAY) = 0.0                                                   
3807  1000 CONTINUE                                                                   
3808                                                                                  
3809 !  Set parameters needed for RRTM execution:                                     
3811       IXSECT = 1                                                                 
3812       IXMAX = 4                                                                  
3813                                                                                  
3814 !  Set surface temperature.  The longwave upward surface flux is                 
3815 !  computed in the Land Surface Model based on the surface                       
3816 !  temperature and the emissivity of the surface type for each                   
3817 !  grid point.  The bottom interface temperature, tint(kte+1), is                 
3818 !  ground temperature consistent with this LW upward flux, and                   
3819 !  TBOUND is set to this temperature here.                                       
3820                                                                                  
3821 !     TBOUND = TINT(kte+1)                                                        
3822 !     TBOUND = Tw(kte+1)                                                        
3823       TBOUND = TSFC
3824       IF(TBOUND .GT. 340.)THEN
3825         WRITE( errmess , '(A,F10.3)' ) 'rrtm: TBOUND exceeds table limit: reset ',TBOUND
3826         CALL wrf_message (errmess)
3827         TBOUND = 339.99
3828       ENDIF
3829                                                                                  
3830 !  Install MM5 profiles into RRTM arrays for pressure, temperature,              
3831 !  and molecular amounts.  Pressures are converted from cb                       
3832 !  (CCM) to mb (RRTM).  H2O and trace gas amounts are converted from             
3833 !  mass mixing ratio to volume mixing ratio.  CO2 vmr is constant at all         
3834 !  levels.  The dry air column COLDRY (in molec/cm2) is calculated               
3835 !  from the level pressures PZ (in mb) based on the hydrostatic equation         
3836 !  and includes a correction to account for H2O in the layer.  The               
3837 !  molecular weight of moist air (amm) is calculated for each layer.             
3838                                                                                  
3839 !  RRTM is executed for an additional layer (L=kte+1), which extends              
3840 !  from the model top (ptop) to 0 mb, to calculate the downward                  
3841 !  flux at the model top interface.  H2O, CO2, and O3 vmrs for this              
3842 !  extra layer are set to the values in the model's top layer, though            
3843 !  the O3 value is reduced by a fraction (0.6) based on the US Std Atm.          
3844 !  For GCMs with a model top near 0 mb, this extra layer is not needed, and      
3845 !  NLAYERS should be set to the number of model layers (kte in this case).       
3846 !  Note: RRTM levels count from bottom to top, while MM5 levels count            
3847 !  from the top down and must be reversed here.                                  
3848                                                                                  
3849 !     NMOL = 6                                                                   
3850 !     PZ(0) = pint(kte+1)                                                         
3851 !     TZ(0) = tint(kte+1)                                                         
3853       PZ(0) = Pw(kte+1)                                                         
3854       TZ(0) = Tw(kte+1)                                                         
3855       DO 2000 L = 1, NLAYERS-1                                                   
3856          PAVEL(L) = p(kte+1-L)                                                   
3857          TAVEL(L) = t(kte+1-L)                                                   
3858 !        PZ(L) = pint(kte+1-L)                                                    
3859 !        TZ(L) = tint(kte+1-L)                                                    
3860          PZ(L) = Pw(kte+1-L)                                                    
3861          TZ(L) = Tw(kte+1-L)                                                    
3862          WKL(1,L) = qv(kte+1-L)*amdw                                             
3863          WKL(2,L) = co2vmr                                                       
3864          WKL(3,L) = o3(kte+1-L)                                                  
3865          WKL(4,L) = n2o(kte+1-L)*amdn                                            
3866          WKL(6,L) = ch4(kte+1-L)*amdc                                            
3867          amm = (1-WKL(1,L))*amd + WKL(1,L)*amw                                   
3868          COLDRY(L) = (PZ(L-1)-PZ(L))*1.E3*avgdro/    & 
3869                                (gravit*amm*(1+WKL(1,L)))                         
3870  2000    CONTINUE                                                                
3871                                                                                  
3872 !  Set cross section molecule amounts from CCM; convert to vmr                   
3873       DO 2100 L=1, NLAYERS-1                                                     
3874 !        WX(2,L) = c11mmr(kte+1-L)*amdc1                                         
3875 !        WX(3,L) = c12mmr(kte+1-L)*amdc2                                         
3876          WX(2,L) = 0.                                                            
3877          WX(3,L) = 0.                                                            
3878  2100 CONTINUE                                                                   
3879                                                                                  
3880 !  *****                                                                         
3881 !  Set up values for extra layer at top of the atmosphere.                       
3882 !  The top layer temperature for all gridpoints is set to the top layer-1        
3883 !  temperature plus a constant (0 K) that represents an isothermal layer         
3884 !  above ptop.  Top layer interface temperatures are                             
3885 !  linearly interpolated from the layer temperatures.                            
3886 !  Note: The top layer temperature and ozone amount are based on a 0-3mb         
3887 !  top layer and must be modified if the layering is changed.                    
3888 !  This section should be commented if the extra layer is not needed.            
3889                                                                                  
3890       PAVEL(NLAYERS) = 0.5*PZ(NLAYERS-1)                                         
3891       TAVEL(NLAYERS) = TAVEL(NLAYERS-1) + 0.0                                    
3892       PZ(NLAYERS) = 0.00                                                         
3893       TZ(NLAYERS-1) = 0.5*(TAVEL(NLAYERS)+TAVEL(NLAYERS-1))                      
3894       TZ(NLAYERS) = TZ(NLAYERS-1)+0.0                                            
3895       WKL(1,NLAYERS) = WKL(1,NLAYERS-1)                                          
3896       WKL(2,NLAYERS) = co2vmr                                                    
3897       WKL(3,NLAYERS) = 0.6*WKL(3,NLAYERS-1)                                      
3898       WKL(4,NLAYERS) = WKL(4,NLAYERS-1)                                          
3899       WKL(6,NLAYERS) = WKL(6,NLAYERS-1)                                          
3900       amm = (1-WKL(1,NLAYERS-1))*amd + WKL(1,NLAYERS-1)*amw                      
3901 !     COLDRY(NLAYERS) = (PZ(NLAYERS-1))*1.E3*avgdro/       & 
3902       COLDRY(NLAYERS) = ((PZ(NLAYERS-1)-PZ(NLAYERS)))*1.E3*avgdro/       & 
3903                                (gravit*amm*(1+WKL(1,NLAYERS-1)))                 
3904       WX(2,NLAYERS) = WX(2,NLAYERS-1)                                            
3905       WX(3,NLAYERS) = WX(3,NLAYERS-1)                                            
3906 !  *****                                                                         
3907                                                                                  
3908 !  Here, all molecules in WKL and WX are in volume mixing ratio; convert to      
3909 !  molec/cm2 based on COLDRY for use in RRTM                                     
3910                                                                                  
3911       DO 5000 L = 1, NLAYERS                                                     
3912          DO 4200 IMOL = 1, NMOL                                                  
3913             WKL(IMOL,L) = COLDRY(L) * WKL(IMOL,L)                                
3914  4200    CONTINUE                                                                
3915          DO 4400 IX = 1,MAXXSEC                                                  
3916             IF (IXINDX(IX) .NE. 0) THEN                                          
3917                WX(IXINDX(IX),L) = COLDRY(L) * WX(IX,L) * 1.E-20                  
3918             ENDIF                                                                
3919  4400    CONTINUE                                                                
3920  5000 CONTINUE                                                                   
3921                                                                                  
3922 !  Set spectral surface emissivity for each longwave band.  The default value    
3923 !  is set here to emiss(i,j) based on land-use (taken to be constant across band 
3924 !  Comment: if land-surface uses skin temperature, emissivity must match that    
3925 !   used in its calculation (e.g. 1.0)                                           
3926       DO 5500 N=1,NBANDS                                                         
3927          SEMISS(N) = EMISS
3928  5500 CONTINUE                                                                   
3929                                                                                  
3930 !  Transfer cloud fraction to RRTM array; compute cloud optical depth, TAUCLOUD, 
3931 !  as the product of clwp and cloud mass absorption coefficient in MM5, which is 
3932 !  a  combination of liquid and ice absorption coefficients.                     
3933 !  Note: RRTM levels count from bottom to top, while CCM levels count from the   
3934 !  top down and must be reversed here.  Values for the extra RRTM level (above   
3935 !  the model top) are set to zero.                                               
3936                                                                                  
3937       DO 7000 L = 1, NLAYERS-1                                                   
3938          TAUCLOUD(L) = ABCW*CLWP(kte+1-L)+ABICE*CIWP(kte+1-L) & 
3939                       +ABRN*PLWP(kte+1-L)+ABSN*PIWP(kte+1-L)                       
3940          IF(TAUCLOUD(L).GT.0.01)CLDFRC(kte+1-L)=1.                                
3941          CLDFRAC(L) = cldfrc(kte+1-L)                                             
3942  7000 CONTINUE                                                                   
3943       CLDFRAC(NLAYERS) = 0.0                                                     
3944       TAUCLOUD(NLAYERS) = 0.0                                                    
3946    END SUBROUTINE MM5ATM
3948 !---------------------------------------------------------------------------
3949       SUBROUTINE SETCOEF(kts,ktep1,                                        &
3950                          PAVEL,TAVEL,COLDRY,COLH2O,COLCO2,COLO3,           &
3951                          COLN2O,COLCH4,COLO2,CO2MULT,                      &
3952                          FAC00,FAC01,FAC10,FAC11,                          &
3953                          FORFAC,SELFFAC,SELFFRAC,                          &
3954                          JP,JT,JT1,INDSELF,WKL,LAYTROP,LAYSWTCH,LAYLOW     )
3955 !---------------------------------------------------------------------------
3956       IMPLICIT NONE
3957 !---------------------------------------------------------------------------
3958 !  RRTM Longwave Radiative Transfer Model                                        
3959 !  Atmospheric and Environmental Research, Inc., Cambridge, MA                   
3960 !                                                                                
3961 !  Original version:       E. J. Mlawer, et al.                                  
3962 !  Revision for NCAR CCM:  Michael J. Iacono; September, 1998                    
3963 !                                                                                
3964 !  For a given atmosphere, calculate the indices and fractions related to the    
3965 !  pressure and temperature interpolations.  Also calculate the values of the    
3966 !  integrated Planck functions for each band at the level and layer              
3967 !  temperatures.                                                                 
3968 !---------------------------------------------------------------------------
3970       INTEGER, INTENT(IN   ) ::          kts, ktep1
3972       REAL, DIMENSION( 35,kts:ktep1),                    &
3973             INTENT(IN   )        ::                  WKL
3975       INTEGER, INTENT(INOUT) ::  LAYTROP,LAYSWTCH,LAYLOW
3977       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::      &
3978                                                    PAVEL, &
3979                                                    TAVEL, &
3980                                                   COLDRY
3982       REAL, DIMENSION( kts:ktep1 ), INTENT(INOUT) ::      &
3983                                                   COLH2O, &
3984                                                   COLCO2, &
3985                                                    COLO3, &
3986                                                   COLN2O, &
3987                                                   COLCH4, &
3988                                                    COLO2, &
3989                                                  CO2MULT, &
3990                                                    FAC00, &
3991                                                    FAC01, &
3992                                                    FAC10, &
3993                                                    FAC11, &
3994                                                   FORFAC, &
3995                                                  SELFFAC, &
3996                                                 SELFFRAC
3998       INTEGER, DIMENSION( kts:ktep1 ), INTENT(INOUT) ::   &
3999                                                       JP, &
4000                                                       JT, &
4001                                                      JT1, &
4002                                                  INDSELF
4003 ! LOCAL 
4004      
4005       INTEGER ::   LAY, JP1 
4006       REAL    ::   STPFAC, PLOG, FP, FT, FT1, WATERS, WATER, &
4007                    CALEFAC, FACTOR, CO2REG, COMPFP, SCALEFAC 
4009 ! This compiler directive was added to insure private common block storage       
4010 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
4011 ! carry constants.                                                               
4012                                                                                  
4013       STPFAC = 296./1013.                                                        
4014       
4015       LAYTROP = 0                                                                
4016       LAYSWTCH = 0                                                               
4017       LAYLOW = 0                                                                 
4018       DO 7000 LAY = 1, NLAYERS                                                   
4019 !        Find the two reference pressures on either side of the                  
4020 !        layer pressure.  Store them in JP and JP1.  Store in FP the             
4021 !        fraction of the difference (in ln(pressure)) between these              
4022 !        two values that the layer pressure lies.                                
4023          PLOG = LOG(PAVEL(LAY))                                                  
4024          JP(LAY) = INT(36. - 5*(PLOG+0.04))                                      
4025          IF (JP(LAY) .LT. 1) THEN                                                
4026             JP(LAY) = 1                                                          
4027          ELSEIF (JP(LAY) .GT. 58) THEN                                           
4028             JP(LAY) = 58                                                         
4029          ENDIF                                                                   
4030          JP1 = JP(LAY) + 1                                                       
4031          FP = 5. * (PREFLOG(JP(LAY)) - PLOG)                                     
4032                                                                                  
4033 !        Determine, for each reference pressure (JP and JP1), which              
4034 !        reference temperature (these are different for each                     
4035 !        reference pressure) is nearest the layer temperature but does           
4036 !        not exceed it.  Store these indices in JT and JT1, resp.                
4037 !        Store in FT (resp. FT1) the fraction of the way between JT              
4038 !        (JT1) and the next highest reference temperature that the               
4039 !        layer temperature falls.                                                
4040          JT(LAY) = INT(3. + (TAVEL(LAY)-TREF(JP(LAY)))/15.)                      
4041          IF (JT(LAY) .LT. 1) THEN                                                
4042             JT(LAY) = 1                                                          
4043          ELSEIF (JT(LAY) .GT. 4) THEN                                            
4044             JT(LAY) = 4                                                          
4045          ENDIF                                                                   
4046          FT = ((TAVEL(LAY)-TREF(JP(LAY)))/15.) - FLOAT(JT(LAY)-3)                
4047          JT1(LAY) = INT(3. + (TAVEL(LAY)-TREF(JP1))/15.)                         
4048          IF (JT1(LAY) .LT. 1) THEN                                               
4049             JT1(LAY) = 1                                                         
4050          ELSEIF (JT1(LAY) .GT. 4) THEN                                           
4051             JT1(LAY) = 4                                                         
4052          ENDIF                                                                   
4053          FT1 = ((TAVEL(LAY)-TREF(JP1))/15.) - FLOAT(JT1(LAY)-3)                  
4054                                                                                  
4055          WATER = WKL(1,LAY)/COLDRY(LAY)                                          
4056          SCALEFAC = PAVEL(LAY) * STPFAC / TAVEL(LAY)                             
4057                                                                                  
4058 !        If the pressure is less than ~100mb, perform a different                
4059 !        set of species interpolations.                                          
4060          IF (PLOG .LE. 4.56) GO TO 5300                                          
4061          LAYTROP =  LAYTROP + 1                                                  
4062 !        For one band, the "switch" occurs at ~300 mb.                           
4063 ! JD: changed from (PLOG .GE. 5.76) to avoid out-of-range                        
4064          IF (PLOG .Gt. 5.76) LAYSWTCH = LAYSWTCH + 1                             
4065          IF (PLOG .GE. 6.62) LAYLOW = LAYLOW + 1                                 
4066 !                                                                                
4067          FORFAC(LAY) = SCALEFAC / (1.+WATER)                                     
4068 !        Set up factors needed to separately include the water vapor             
4069 !        self-continuum in the calculation of absorption coefficient.            
4070          SELFFAC(LAY) = WATER * FORFAC(LAY)                                      
4071          FACTOR = (TAVEL(LAY)-188.0)/7.2                                         
4072          INDSELF(LAY) = MIN(9, MAX(1, INT(FACTOR)-7))                            
4073          SELFFRAC(LAY) = FACTOR - FLOAT(INDSELF(LAY) + 7)                        
4074                                                                                  
4075 !        Calculate needed column amounts.                                        
4076          COLH2O(LAY) = 1.E-20 * WKL(1,LAY)                                       
4077          COLCO2(LAY) = 1.E-20 * WKL(2,LAY)                                       
4078          COLO3(LAY) = 1.E-20 * WKL(3,LAY)                                        
4079          COLN2O(LAY) = 1.E-20 * WKL(4,LAY)                                       
4080          COLCH4(LAY) = 1.E-20 * WKL(6,LAY)                                       
4081          COLO2(LAY) = 1.E-20 * WKL(7,LAY)                                        
4082          IF (COLCO2(LAY) .EQ. 0.) COLCO2(LAY) = 1.E-32 * COLDRY(LAY)             
4083          IF (COLN2O(LAY) .EQ. 0.) COLN2O(LAY) = 1.E-32 * COLDRY(LAY)             
4084          IF (COLCH4(LAY) .EQ. 0.) COLCH4(LAY) = 1.E-32 * COLDRY(LAY)             
4085 !        Using E = 1334.2 cm-1.                                                  
4086          CO2REG = 3.55E-24 * COLDRY(LAY)                                         
4087          CO2MULT(LAY)= (COLCO2(LAY) - CO2REG) *    & 
4088               272.63*EXP(-1919.4/TAVEL(LAY))/(8.7604E-4*TAVEL(LAY))              
4089          GO TO 5400                                                              
4090                                                                                  
4091 !        Above LAYTROP.                                                          
4092  5300    CONTINUE                                                                
4093                                                                                  
4094          FORFAC(LAY) = SCALEFAC / (1.+WATER)                                     
4095 !        Calculate needed column amounts.                                        
4096          COLH2O(LAY) = 1.E-20 * WKL(1,LAY)                                       
4097          COLCO2(LAY) = 1.E-20 * WKL(2,LAY)                                       
4098          COLO3(LAY) = 1.E-20 * WKL(3,LAY)                                        
4099          COLN2O(LAY) = 1.E-20 * WKL(4,LAY)                                       
4100          COLCH4(LAY) = 1.E-20 * WKL(6,LAY)                                       
4101          COLO2(LAY) = 1.E-20 * WKL(7,LAY)                                        
4102          IF (COLCO2(LAY) .EQ. 0.) COLCO2(LAY) = 1.E-32 * COLDRY(LAY)             
4103          IF (COLN2O(LAY) .EQ. 0.) COLN2O(LAY) = 1.E-32 * COLDRY(LAY)             
4104          IF (COLCH4(LAY) .EQ. 0.) COLCH4(LAY) = 1.E-32 * COLDRY(LAY)             
4105          CO2REG = 3.55E-24 * COLDRY(LAY)                                         
4106          CO2MULT(LAY)= (COLCO2(LAY) - CO2REG) *   & 
4107               272.63*EXP(-1919.4/TAVEL(LAY))/(8.7604E-4*TAVEL(LAY))              
4108  5400    CONTINUE                                                                
4109                                                                                  
4110 !        We have now isolated the layer ln pressure and temperature,             
4111 !        between two reference pressures and two reference temperatures          
4112 !        (for each reference pressure).  We multiply the pressure                
4113 !        fraction FP with the appropriate temperature fractions to get           
4114 !        the factors that will be needed for the interpolation that yields       
4115 !        the optical depths (performed in routines TAUGBn for band n).           
4116                                                                                  
4117          COMPFP = 1. - FP                                                        
4118          FAC10(LAY) = COMPFP * FT                                                
4119          FAC00(LAY) = COMPFP * (1. - FT)                                         
4120          FAC11(LAY) = FP * FT1                                                   
4121          FAC01(LAY) = FP * (1. - FT1)                                            
4122                                                                                  
4123  7000 CONTINUE                                                                   
4124                                                                                  
4125 !        Set LAYLOW for profiles with surface pressure less than 750mb.          
4126          IF (LAYLOW.EQ.0) LAYLOW=1                                               
4127 !        Sometimes round-off gives wrong LAYSWTCH therefore check here (JD)
4128          IF (JP(LAYSWTCH+1).LE.6) THEN
4129            LAYSWTCH=LAYSWTCH+1
4130          ENDIF
4132    END SUBROUTINE SETCOEF
4134 !-------------------------------------------------------------------------------
4135 !*                                                                             * 
4136 !*                  Optical depths developed for the                           * 
4137 !*                                                                             * 
4138 !*                RAPID RADIATIVE TRANSFER MODEL (RRTM)                        * 
4139 !*                                                                             * 
4140 !*                                                                             * 
4141 !*            ATMOSPHERIC AND ENVIRONMENTAL RESEARCH, INC.                     * 
4142 !*                        840 MEMORIAL DRIVE                                   * 
4143 !*                        CAMBRIDGE, MA 02139                                  * 
4144 !*                                                                             * 
4145 !*                                                                             * 
4146 !*                           ELI J. MLAWER                                     * 
4147 !*                         STEVEN J. TAUBMAN                                   * 
4148 !*                         SHEPARD A. CLOUGH                                   * 
4149 !*                                                                             * 
4150 !*                                                                             * 
4151 !*                                                                             * 
4152 !*                                                                             * 
4153 !*                       email:  mlawer@aer.com                                * 
4154 !*                                                                             * 
4155 !*        The authors wish to acknowledge the contributions of the             * 
4156 !*        following people:  Patrick D. Brown, Michael J. Iacono,              * 
4157 !*        Ronald E. Farren, Luke Chen, Robert Bergstrom.                       * 
4158 !*                                                                             * 
4159 !-------------------------------------------------------------------------------
4160 !*                                                                             * 
4161 !*  Revision for NCAR CCM:  Michael J. Iacono; September, 1998                 * 
4162 !*                                                                             * 
4163 !*     TAUMOL                                                                  * 
4164 !*                                                                             * 
4165 !*     This file contains the subroutines TAUGBn (where n goes from            * 
4166 !*     1 to 16).  TAUGBn calculates the optical depths and Planck fractions    * 
4167 !*     per g-value and layer for band n.                                       * 
4168 !*                                                                             * 
4169 !*  Output:  optical depths (unitless)                                         * 
4170 !*           fractions needed to compute Planck functions at every layer       * 
4171 !*               and g-value                                                   * 
4172 !*                                                                             * 
4173 !*     COMMON /TAUGCOM/  TAUG(MXLAY,MG)                                        * 
4174 !*     COMMON /PLANKG/   FRACS(MXLAY,MG)                                       * 
4175 !*                                                                             * 
4176 !*  Input                                                                      * 
4177 !*                                                                             * 
4178 !*     COMMON /FEATURES/ NG(NBANDS),NSPA(NBANDS),NSPB(NBANDS)                  * 
4179 !*     COMMON /PRECISE/  ONEMINUS                                              * 
4180 !*     COMMON /PROFILE/  NLAYERS,PAVEL(MXLAY),TAVEL(MXLAY),                    * 
4181 !*    &                  PZ(0:MXLAY),TZ(0:MXLAY)                               * 
4182 !*     COMMON /PROFDATA/ LAYTROP,LAYSWTCH,LAYLOW,                              * 
4183 !*    &                  COLH2O(MXLAY),COLCO2(MXLAY),                          * 
4184 !*    &                  COLO3(MXLAY),COLN2O(MXLAY),COLCH4(MXLAY),             * 
4185 !*    &                  COLO2(MXLAY),CO2MULT(MXLAY)                           * 
4186 !*     COMMON /INTFAC/   FAC00(MXLAY),FAC01(MXLAY),                            * 
4187 !*    &                  FAC10(MXLAY),FAC11(MXLAY)                             * 
4188 !*     COMMON /INTIND/   JP(MXLAY),JT(MXLAY),JT1(MXLAY)                        * 
4189 !*     COMMON /SELF/     SELFFAC(MXLAY), SELFFRAC(MXLAY), INDSELF(MXLAY)       * 
4190 !*                                                                             * 
4191 !*     Description:                                                            * 
4192 !*     NG(IBAND) - number of g-values in band IBAND                            * 
4193 !*     NSPA(IBAND) - for the lower atmosphere, the number of reference         * 
4194 !*                   atmospheres that are stored for band IBAND per            * 
4195 !*                   pressure level and temperature.  Each of these            * 
4196 !*                   atmospheres has different relative amounts of the         * 
4197 !*                   key species for the band (i.e. different binary           * 
4198 !*                   species parameters).                                      * 
4199 !*     NSPB(IBAND) - same for upper atmosphere                                 * 
4200 !*     ONEMINUS - since problems are caused in some cases by interpolation     * 
4201 !*                parameters equal to or greater than 1, for these cases       * 
4202 !*                these parameters are set to this value, slightly < 1.        * 
4203 !*     PAVEL - layer pressures (mb)                                            * 
4204 !*     TAVEL - layer temperatures (degrees K)                                  * 
4205 !*     PZ - level pressures (mb)                                               * 
4206 !*     TZ - level temperatures (degrees K)                                     * 
4207 !*     LAYTROP - layer at which switch is made from one combination of         * 
4208 !*               key species to another                                        * 
4209 !*     COLH2O, COLCO2, COLO3, COLN2O, COLCH4 - column amounts of water         * 
4210 !*               vapor,carbon dioxide, ozone, nitrous ozide, methane,          * 
4211 !*               respectively (molecules/cm**2)                                * 
4212 !*     CO2MULT - for bands in which carbon dioxide is implemented as a         * 
4213 !*               trace species, this is the factor used to multiply the        * 
4214 !*               band's average CO2 absorption coefficient to get the added    * 
4215 !*               contribution to the optical depth relative to 355 ppm.        * 
4216 !*     FACij(LAY) - for layer LAY, these are factors that are needed to        * 
4217 !*                  compute the interpolation factors that multiply the        * 
4218 !*                  appropriate reference k-values.  A value of 0 (1) for      * 
4219 !*                  i,j indicates that the corresponding factor multiplies     * 
4220 !*                  reference k-value for the lower (higher) of the two        * 
4221 !*                  appropriate temperatures, and altitudes, respectively.     * 
4222 !*     JP - the index of the lower (in altitude) of the two appropriate        * 
4223 !*          reference pressure levels needed for interpolation                 * 
4224 !*     JT, JT1 - the indices of the lower of the two appropriate reference     * 
4225 !*               temperatures needed for interpolation (for pressure           * 
4226 !*               levels JP and JP+1, respectively)                             * 
4227 !*     SELFFAC - scale factor needed to water vapor self-continuum, equals     * 
4228 !*               (water vapor density)/(atmospheric density at 296K and        * 
4229 !*               1013 mb)                                                      * 
4230 !*     SELFFRAC - factor needed for temperature interpolation of reference     * 
4231 !*                water vapor self-continuum data                              * 
4232 !*     INDSELF - index of the lower of the two appropriate reference           * 
4233 !*               temperatures needed for the self-continuum interpolation      * 
4234 !*                                                                             * 
4235 !*  Data input                                                                 * 
4236 !*     COMMON /Kn/ KA(NSPA(n),5,13,MG), KB(NSPB(n),5,13:59,MG), SELFREF(10,MG) * 
4237 !*        (note:  n is the band number)                                        * 
4238 !*                                                                             * 
4239 !*     Description:                                                            * 
4240 !*     KA - k-values for low reference atmospheres (no water vapor             * 
4241 !*          self-continuum) (units: cm**2/molecule)                            * 
4242 !*     KB - k-values for high reference atmospheres (all sources)              * 
4243 !*          (units: cm**2/molecule)                                            * 
4244 !*     SELFREF - k-values for water vapor self-continuum for reference         * 
4245 !*               atmospheres (used below LAYTROP)                              * 
4246 !*               (units: cm**2/molecule)                                       * 
4247 !*                                                                             * 
4248 !*     DIMENSION ABSA(65*NSPA(n),MG), ABSB(235*NSPB(n),MG)                     * 
4249 !*     EQUIVALENCE (KA,ABSA),(KB,ABSB)                                         * 
4250 !*                                                                             * 
4251 !******************************************************************************* 
4252                                                                                  
4253 !---------------------------------------------------------------------------    
4254       SUBROUTINE TAUGB1(kts,ktep1,COLH2O,FAC00,FAC01,FAC10,FAC11,          &
4255                         FORFAC,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,         &
4256                         PFRAC,TAUG,LAYTROP                                 )
4257 !---------------------------------------------------------------------------    
4258                                                                                  
4259       INTEGER, INTENT(IN )                      :: kts,ktep1
4261       INTEGER, INTENT(IN )                      ::  LAYTROP
4263       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
4264             INTENT(INOUT)        ::                  PFRAC, &
4265                                                       TAUG
4267       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
4268                                                     COLH2O, &
4269                                                      FAC00, &
4270                                                      FAC01, &
4271                                                      FAC10, &
4272                                                      FAC11, &
4273                                                     FORFAC, &
4274                                                    SELFFAC, &
4275                                                   SELFFRAC 
4277       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
4278                                                         JP, &
4279                                                         JT, &
4280                                                        JT1, &
4281                                                    INDSELF
4283 !     Written by Eli J. Mlawer, Atmospheric & Environmental Research.            
4284 !     Revised by Michael J. Iacono, Atmospheric & Environmental Research.        
4285                                                                                  
4286 !     BAND 1:  10-250 cm-1 (low - H2O; high - H2O)                               
4287                                                                                  
4288 ! This compiler directive was added to insure private common block storage       
4289 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
4290 ! carry constants.                                                               
4291                                                                                  
4292 !     Compute the optical depth by interpolating in ln(pressure) and             
4293 !     temperature.  Below LAYTROP, the water vapor self-continuum                
4294 !     is interpolated (in temperature) separately.                               
4295 !cdir novector
4296       DO 2500 LAY = 1, LAYTROP                                                   
4297          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(1) + 1                          
4298          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(1) + 1                             
4299          INDS = INDSELF(LAY)                                                     
4300          DO 2000 IG = 1, NG1                                                     
4301             TAUG(IG,LAY) = COLH2O(LAY) *                       & 
4302                 (FAC00(LAY) * ABSA1(IND0,IG) +                  &                 
4303                  FAC10(LAY) * ABSA1(IND0+1,IG) +                &                 
4304                  FAC01(LAY) * ABSA1(IND1,IG) +                  &                 
4305                  FAC11(LAY) * ABSA1(IND1+1,IG) +                &                 
4306                  SELFFAC(LAY) * (SELFREFC1(INDS,IG) +            &                 
4307                  SELFFRAC(LAY) *                               &                 
4308                  (SELFREFC1(INDS+1,IG) - SELFREFC1(INDS,IG))) +    &                 
4309                  FORFAC(LAY) * FORREFC1(IG))                                       
4310             PFRAC(IG,LAY) = FRACREFAC1(IG)                                         
4311  2000    CONTINUE                                                                
4312  2500 CONTINUE                                                                   
4313                                                                                  
4314 !cdir novector
4315       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
4316          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(1) + 1                         
4317          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(1) + 1                        
4318          DO 3000 IG = 1, NG1                                                     
4319             TAUG(IG,LAY) = COLH2O(LAY) *                      &
4320                 (FAC00(LAY) * ABSB1(IND0,IG) +                 &                  
4321                  FAC10(LAY) * ABSB1(IND0+1,IG) +               &                  
4322                  FAC01(LAY) * ABSB1(IND1,IG) +                 &                  
4323                  FAC11(LAY) * ABSB1(IND1+1,IG) +               &                  
4324                  FORFAC(LAY) * FORREFC1(IG))                                       
4325             PFRAC(IG,LAY) = FRACREFBC1(IG)                                         
4326  3000    CONTINUE                                                                
4327  3500 CONTINUE                                                                   
4328      
4329       END SUBROUTINE TAUGB1                        
4330                                                                                  
4331 !----------------------------------------------------------------------------    
4332       SUBROUTINE TAUGB2(kts,ktep1,COLDRY,COLH2O,FAC00,FAC01,FAC10,FAC11,    &
4333                         FORFAC,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,          &
4334                         PFRAC,TAUG,LAYTROP                                  )
4335 !----------------------------------------------------------------------------    
4336                                                                                  
4337 !     BAND 2:  250-500 cm-1 (low - H2O; high - H2O)                              
4338                                                                                  
4339       INTEGER, INTENT(IN )                      :: kts,ktep1
4341       INTEGER, PARAMETER :: NGS1=8                                       
4343       INTEGER, INTENT(IN )                      ::  LAYTROP
4345       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
4346             INTENT(INOUT)        ::                  PFRAC, &
4347                                                       TAUG
4349       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
4350                                                     COLDRY, &   
4351                                                     COLH2O, &
4352                                                      FAC00, &
4353                                                      FAC01, &
4354                                                      FAC10, &
4355                                                      FAC11, &
4356                                                     FORFAC, &
4357                                                    SELFFAC, &
4358                                                   SELFFRAC 
4360       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
4361                                                         JP, &
4362                                                         JT, &
4363                                                        JT1, &
4364                                                    INDSELF
4366 ! This compiler directive was added to insure private common block storage       
4367 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
4368 ! carry constants.                                                               
4369                                                                                  
4370       DIMENSION FC00(kts:ktep1),FC01(kts:ktep1),FC10(kts:ktep1),FC11(kts:ktep1)                  
4371       DIMENSION REFPARAM(13)                                                     
4372                                                                                  
4373 !     These are the mixing ratios for H2O for a MLS atmosphere at the            
4374 !     13 RRTM reference pressure levels:  1.8759999E-02, 1.2223309E-02,          
4375 !     5.8908667E-03, 2.7675382E-03, 1.4065107E-03, 7.5969833E-04,                
4376 !     3.8875898E-04, 1.6542293E-04, 3.7189537E-05, 7.4764857E-06,                
4377 !     4.3081886E-06, 3.3319423E-06, 3.2039343E-06/                               
4378                                                                                  
4379 !     The following are parameters related to the reference water vapor          
4380 !     mixing ratios by REFPARAM(I) = REFH2O(I) / (.002+REFH2O(I)).               
4381 !     These parameters are used for the Planck function interpolation.           
4382       DATA REFPARAM/  &                                                          
4383         0.903661, 0.859386, 0.746542, 0.580496, 0.412889, 0.275283, & 
4384         0.162745, 7.63929E-02, 1.82553E-02, 3.72432E-03,            &            
4385         2.14946E-03, 1.66320E-03, 1.59940E-03/                                   
4386                                                                                  
4387 !     Compute the optical depth by interpolating in ln(pressure) and             
4388 !     temperature.  Below LAYTROP, the water vapor self-continuum is             
4389 !     interpolated (in temperature) separately.                                  
4390 !cdir novector
4391       DO 2500 LAY = 1, LAYTROP                                                   
4392          WATER = 1.E20 * COLH2O(LAY) / COLDRY(LAY)                               
4393          H2OPARAM = WATER/(WATER +.002)                                          
4394          DO 1800 IFRAC = 2, 12                                                   
4395             IF (H2OPARAM .GE. REFPARAM(IFRAC)) GO TO 1900                        
4396  1800    CONTINUE                                                                
4397  1900    CONTINUE                                                                
4398          FRACINT = (H2OPARAM-REFPARAM(IFRAC))/    & 
4399               (REFPARAM(IFRAC-1)-REFPARAM(IFRAC))                                
4400                                                                                  
4401          FP = FAC11(LAY) + FAC01(LAY)                                            
4402          IFP = 2.E2*FP+0.5                                                       
4403          IF (IFP.LE.0) IFP = 0                                                   
4404          FC00(LAY) = FAC00(LAY) * CORR2(IFP)                                     
4405          FC10(LAY) = FAC10(LAY) * CORR2(IFP)                                     
4406          FC01(LAY) = FAC01(LAY) * CORR1(IFP)                                     
4407          FC11(LAY) = FAC11(LAY) * CORR1(IFP)                                     
4408          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(2) + 1                          
4409          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(2) + 1                             
4410          INDS = INDSELF(LAY)                                                     
4411          DO 2000 IG = 1, NG2                                                     
4412             TAUG(NGS1+IG,LAY) = COLH2O(LAY) *                   &                
4413                 (FC00(LAY) * ABSA2(IND0,IG) +                    &                
4414                  FC10(LAY) * ABSA2(IND0+1,IG) +                  &                
4415                  FC01(LAY) * ABSA2(IND1,IG) +                    &                
4416                  FC11(LAY) * ABSA2(IND1+1,IG) +                  &                
4417                  SELFFAC(LAY) * (SELFREFC2(INDS,IG) +             &                
4418                  SELFFRAC(LAY) *                                &                
4419                  (SELFREFC2(INDS+1,IG) - SELFREFC2(INDS,IG))) +     &                
4420                  FORFAC(LAY) * FORREFC2(IG))                                       
4421             PFRAC(NGS1+IG,LAY) = FRACREFAC2(IG,IFRAC) + FRACINT * &
4422                  (FRACREFAC2(IG,IFRAC-1)-FRACREFAC2(IG,IFRAC))                       
4423  2000    CONTINUE                                                                
4424  2500 CONTINUE                                                                   
4425                                                                                  
4426 !cdir novector
4427       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
4428          FP = FAC11(LAY) + FAC01(LAY)                                            
4429          IFP = 2.E2*FP+0.5                                                       
4430          IF (IFP.LE.0) IFP = 0                                                   
4431          FC00(LAY) = FAC00(LAY) * CORR2(IFP)                                     
4432          FC10(LAY) = FAC10(LAY) * CORR2(IFP)                                     
4433          FC01(LAY) = FAC01(LAY) * CORR1(IFP)                                     
4434          FC11(LAY) = FAC11(LAY) * CORR1(IFP)                                     
4435          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(2) + 1                         
4436          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(2) + 1                        
4437          DO 3000 IG = 1, NG2                                                     
4438             TAUG(NGS1+IG,LAY) = COLH2O(LAY) *                  & 
4439                 (FC00(LAY) * ABSB2(IND0,IG) +                   &                  
4440                  FC10(LAY) * ABSB2(IND0+1,IG) +                 &                  
4441                  FC01(LAY) * ABSB2(IND1,IG) +                   &                  
4442                  FC11(LAY) * ABSB2(IND1+1,IG) +                 &                  
4443                  FORFAC(LAY) * FORREFC2(IG))                                       
4444             PFRAC(NGS1+IG,LAY) = FRACREFBC2(IG)                                    
4445  3000    CONTINUE                                                                
4446  3500 CONTINUE                                                                   
4447                                                                                  
4448       END SUBROUTINE TAUGB2
4449                                                                                  
4450 !-----------------------------------------------------------------------------    
4451       SUBROUTINE TAUGB3(kts,ktep1,COLH2O,COLCO2,COLN2O,FAC00,FAC01,FAC10,    &
4452                         FAC11,FORFAC,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,     &
4453                         PFRAC,TAUG,LAYTROP                                   )
4454 !-----------------------------------------------------------------------------    
4455                                                                                  
4456 !     BAND 3:  500-630 cm-1 (low - H2O,CO2; high - H2O,CO2)                      
4457                                                                                  
4458       INTEGER, PARAMETER :: NGS2=22                                      
4459                                                                                  
4460       INTEGER, INTENT(IN )                      :: kts,ktep1
4462       INTEGER, INTENT(IN )                      ::  LAYTROP
4464       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
4465             INTENT(INOUT)        ::                  PFRAC, &
4466                                                       TAUG
4468       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
4469                                                     COLH2O, &
4470                                                     COLCO2, &
4471                                                     COLN2O, &
4472                                                      FAC00, &
4473                                                      FAC01, &
4474                                                      FAC10, &
4475                                                      FAC11, &
4476                                                     FORFAC, &
4477                                                    SELFFAC, &
4478                                                   SELFFRAC 
4480       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
4481                                                         JP, &
4482                                                         JT, &
4483                                                        JT1, &
4484                                                    INDSELF
4486 ! This compiler directive was added to insure private common block storage       
4487 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
4488 ! carry constants.                                                               
4489                                                                                  
4490       DIMENSION H2OREF(59),CO2REF(59), ETAREF(10)                                
4491       REAL N2OMULT,N2OREF(59)                                              
4492                                                                                  
4493       DATA ETAREF/  &                                                             
4494            0.,0.125,0.25,0.375,0.5,0.625,0.75,0.875,0.9875,1.0/                  
4495       DATA H2OREF/  &                                                             
4496            1.87599E-02,1.22233E-02,5.89086E-03,2.76753E-03,1.40651E-03, &
4497            7.59698E-04,3.88758E-04,1.65422E-04,3.71895E-05,7.47648E-06, &        
4498            4.30818E-06,3.33194E-06,3.20393E-06,3.16186E-06,3.25235E-06, &        
4499            3.42258E-06,3.62884E-06,3.91482E-06,4.14875E-06,4.30810E-06, &        
4500            4.44204E-06,4.57783E-06,4.70865E-06,4.79432E-06,4.86971E-06, &        
4501            4.92603E-06,4.96688E-06,4.99628E-06,5.05266E-06,5.12658E-06, &        
4502            5.25028E-06,5.35708E-06,5.45085E-06,5.48304E-06,5.50000E-06, &        
4503            5.50000E-06,5.45359E-06,5.40468E-06,5.35576E-06,5.25327E-06, &        
4504            5.14362E-06,5.03396E-06,4.87662E-06,4.69787E-06,4.51911E-06, &        
4505            4.33600E-06,4.14416E-06,3.95232E-06,3.76048E-06,3.57217E-06, &        
4506            3.38549E-06,3.19881E-06,3.01212E-06,2.82621E-06,2.64068E-06, &        
4507            2.45515E-06,2.26962E-06,2.08659E-06,1.93029E-06/                      
4508       DATA N2OREF/  & 
4509            3.20000E-07,3.20000E-07,3.20000E-07,3.20000E-07,3.20000E-07, &
4510            3.19652E-07,3.15324E-07,3.03830E-07,2.94221E-07,2.84953E-07, &        
4511            2.76714E-07,2.64709E-07,2.42847E-07,2.09547E-07,1.71945E-07, &        
4512            1.37491E-07,1.13319E-07,1.00354E-07,9.12812E-08,8.54633E-08, &        
4513            8.03631E-08,7.33718E-08,6.59754E-08,5.60386E-08,4.70901E-08, &        
4514            3.99774E-08,3.29786E-08,2.60642E-08,2.10663E-08,1.65918E-08, &        
4515            1.30167E-08,1.00900E-08,7.62490E-09,6.11592E-09,4.66725E-09, &        
4516            3.28574E-09,2.84838E-09,2.46198E-09,2.07557E-09,1.85507E-09, &        
4517            1.65675E-09,1.45843E-09,1.31948E-09,1.20716E-09,1.09485E-09, &        
4518            9.97803E-10,9.31260E-10,8.64721E-10,7.98181E-10,7.51380E-10, &        
4519            7.13670E-10,6.75960E-10,6.38250E-10,6.09811E-10,5.85998E-10, &        
4520            5.62185E-10,5.38371E-10,5.15183E-10,4.98660E-10/                      
4521       DATA CO2REF/ &                                                             
4522            53*3.55E-04, 3.5470873E-04, 3.5427220E-04, 3.5383567E-04,    &
4523            3.5339911E-04, 3.5282588E-04, 3.5079606E-04/                          
4524                         
4525       STRRAT = 1.19268                                                           
4526                                                                                  
4527 !     Compute the optical depth by interpolating in ln(pressure),                
4528 !     temperature, and appropriate species.  Below LAYTROP, the water            
4529 !     vapor self-continuum is interpolated (in temperature) separately.          
4531 !cdir novector
4532       DO 2500 LAY = 1, LAYTROP                                                   
4533          SPECCOMB = COLH2O(LAY) + STRRAT*COLCO2(LAY)                             
4534          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
4535          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
4536          SPECMULT = 8.*(SPECPARM)                                                
4537          JS = 1 + INT(SPECMULT)                                                  
4538          FS = MOD(SPECMULT,1.0)                                                 
4539          IF (JS .EQ. 8) THEN                                                     
4540             IF (FS .GE. 0.9) THEN                                                
4541                JS = 9                                                            
4542                FS = 10. * (FS - 0.9)                                             
4543             ELSE                                                                 
4544                FS = FS/0.9                                                       
4545             ENDIF                                                                
4546          ENDIF                                                                   
4547          NS = JS + INT(FS + 0.5)                                                 
4548          FP = FAC01(LAY) + FAC11(LAY)                                            
4549          FAC000 = (1. - FS) * FAC00(LAY)                                         
4550          FAC010 = (1. - FS) * FAC10(LAY)                                         
4551          FAC100 = FS * FAC00(LAY)                                                
4552          FAC110 = FS * FAC10(LAY)                                                
4553          FAC001 = (1. - FS) * FAC01(LAY)                                         
4554          FAC011 = (1. - FS) * FAC11(LAY)                                         
4555          FAC101 = FS * FAC01(LAY)                                                
4556          FAC111 = FS * FAC11(LAY)                                                
4557          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(3) + JS                         
4558          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(3) + JS                            
4559          INDS = INDSELF(LAY)                                                     
4560          COLREF1 = N2OREF(JP(LAY))                                               
4561          COLREF2 = N2OREF(JP(LAY)+1)                                             
4562          IF (NS .EQ. 10) THEN                                                    
4563             WCOMB1 = H2OREF(JP(LAY))                                             
4564             WCOMB2 = H2OREF(JP(LAY)+1)                                           
4565          ELSE                                                                    
4566             WCOMB1 = STRRAT * CO2REF(JP(LAY))/(1.-ETAREF(NS))                    
4567             WCOMB2 = STRRAT * CO2REF(JP(LAY)+1)/(1.-ETAREF(NS))                  
4568          ENDIF                                                                   
4569          RATIO = (COLREF1/WCOMB1)+FP*((COLREF2/WCOMB2)-(COLREF1/WCOMB1))         
4570          CURRN2O = SPECCOMB * RATIO                                              
4571          N2OMULT = COLN2O(LAY) - CURRN2O                                         
4572 !!DIR$ VECTOR                                                                     
4573          DO 2000 IG = 1, NG3                                                     
4574             TAUG(NGS2+IG,LAY) = SPECCOMB *                     & 
4575                 (FAC000 * ABSA3(IND0,IG) +                      &                 
4576                  FAC100 * ABSA3(IND0+1,IG) +                    &                 
4577                  FAC010 * ABSA3(IND0+10,IG) +                   &                 
4578                  FAC110 * ABSA3(IND0+11,IG) +                   &                 
4579                  FAC001 * ABSA3(IND1,IG) +                      &                 
4580                  FAC101 * ABSA3(IND1+1,IG) +                    &                 
4581                  FAC011 * ABSA3(IND1+10,IG) +                   &                 
4582                  FAC111 * ABSA3(IND1+11,IG)) +                  &                 
4583                  COLH2O(LAY) *                                 &                 
4584                  (SELFFAC(LAY) * (SELFREFC3(INDS,IG) +           &                 
4585                  SELFFRAC(LAY) *                               &                 
4586                  (SELFREFC3(INDS+1,IG) - SELFREFC3(INDS,IG))) +    &                 
4587                  FORFAC(LAY) * FORREFC3(IG))                     &                 
4588                  + N2OMULT * ABSN2OAC3(IG)                                         
4589             PFRAC(NGS2+IG,LAY) = FRACREFAC3(IG,JS) + FS *        & 
4590                  (FRACREFAC3(IG,JS+1) - FRACREFAC3(IG,JS))                           
4591  2000    CONTINUE                                                                
4592  2500 CONTINUE                                                                   
4593                                                                                  
4594 !!DIR$ NOVECTOR                                                                   
4595 !cdir novector
4596       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
4597          SPECCOMB = COLH2O(LAY) + STRRAT*COLCO2(LAY)                             
4598          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
4599          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
4600          SPECMULT = 4.*(SPECPARM)                                                
4601          JS = 1 + INT(SPECMULT)                                                  
4602          FS = MOD(SPECMULT,1.0)                                                 
4603          NS = JS + INT(FS + 0.5)                                                 
4604          FP = FAC01(LAY) + FAC11(LAY)                                            
4605          FAC000 = (1. - FS) * FAC00(LAY)                                         
4606          FAC010 = (1. - FS) * FAC10(LAY)                                         
4607          FAC100 = FS * FAC00(LAY)                                                
4608          FAC110 = FS * FAC10(LAY)                                                
4609          FAC001 = (1. - FS) * FAC01(LAY)                                         
4610          FAC011 = (1. - FS) * FAC11(LAY)                                         
4611          FAC101 = FS * FAC01(LAY)                                                
4612          FAC111 = FS * FAC11(LAY)                                                
4613          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(3) + JS                        
4614          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(3) + JS                       
4615          COLREF1 = N2OREF(JP(LAY))                                               
4616          COLREF2 = N2OREF(JP(LAY)+1)                                             
4617          IF (NS .EQ. 5) THEN                                                     
4618             WCOMB1 = H2OREF(JP(LAY))                                             
4619             WCOMB2 = H2OREF(JP(LAY)+1)                                           
4620          ELSE                                                                    
4621             WCOMB1 = STRRAT * CO2REF(JP(LAY))/(1.-ETAREF(NS))                    
4622             WCOMB2 = STRRAT * CO2REF(JP(LAY)+1)/(1.-ETAREF(NS))                  
4623          ENDIF                                                                   
4624          RATIO = (COLREF1/WCOMB1)+FP*((COLREF2/WCOMB2)-(COLREF1/WCOMB1))         
4625          CURRN2O = SPECCOMB * RATIO                                              
4626          N2OMULT = COLN2O(LAY) - CURRN2O                                         
4627 !!DIR$ VECTOR                                                                     
4628          DO 3000 IG = 1, NG3                                                     
4629             TAUG(NGS2+IG,LAY) = SPECCOMB *                 &
4630                 (FAC000 * ABSB3(IND0,IG) +                  &                     
4631                  FAC100 * ABSB3(IND0+1,IG) +                &                     
4632                  FAC010 * ABSB3(IND0+5,IG) +                &                     
4633                  FAC110 * ABSB3(IND0+6,IG) +                &                     
4634                  FAC001 * ABSB3(IND1,IG) +                  &                     
4635                  FAC101 * ABSB3(IND1+1,IG) +                &                     
4636                  FAC011 * ABSB3(IND1+5,IG) +                &                     
4637                  FAC111 * ABSB3(IND1+6,IG)) +               &                     
4638                  COLH2O(LAY) * FORFAC(LAY) * FORREFC3(IG)    &                     
4639                  + N2OMULT * ABSN2OBC3(IG)                                         
4640             PFRAC(NGS2+IG,LAY) = FRACREFBC3(IG,JS) + FS *    & 
4641                  (FRACREFBC3(IG,JS+1) - FRACREFBC3(IG,JS))                           
4642  3000    CONTINUE                                                                
4643  3500 CONTINUE                                                                   
4644                                                                                  
4645       END SUBROUTINE TAUGB3
4646                                                                                  
4647 !----------------------------------------------------------------------------    
4648       SUBROUTINE TAUGB4(kts,ktep1,COLH2O,COLCO2,COLO3,FAC00,FAC01,FAC10,    &
4649                         FAC11,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,           &
4650                         PFRAC,TAUG,LAYTROP                                  )
4651 !----------------------------------------------------------------------------    
4652                                                                                  
4653 !     BAND 4:  630-700 cm-1 (low - H2O,CO2; high - O3,CO2)                       
4654                                                                                  
4655       INTEGER, PARAMETER :: NGS3=38                                      
4656                                                                                  
4657       INTEGER, INTENT(IN )                      :: kts,ktep1
4659       INTEGER, INTENT(IN )                      ::  LAYTROP
4661       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
4662             INTENT(INOUT)        ::                  PFRAC, &
4663                                                       TAUG
4665       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
4666                                                     COLH2O, &
4667                                                     COLCO2, &
4668                                                      COLO3, &
4669                                                      FAC00, &
4670                                                      FAC01, &
4671                                                      FAC10, &
4672                                                      FAC11, &
4673                                                    SELFFAC, &
4674                                                   SELFFRAC 
4676       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
4677                                                         JP, &
4678                                                         JT, &
4679                                                        JT1, &
4680                                                    INDSELF
4682 ! This compiler directive was added to insure private common block storage       
4683 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
4684 ! carry constants.                                                               
4685                                                                                  
4686       STRRAT1 = 850.577                                                          
4687       STRRAT2 = 35.7416                                                          
4688                                                                                  
4689 !     Compute the optical depth by interpolating in ln(pressure),                
4690 !     temperature, and appropriate species.  Below LAYTROP, the water            
4691 !     vapor self-continuum is interpolated (in temperature) separately.          
4692 !!DIR$ NOVECTOR                                                                   
4693 !cdir novector
4694       DO 2500 LAY = 1, LAYTROP                                                   
4695          SPECCOMB = COLH2O(LAY) + STRRAT1*COLCO2(LAY)                            
4696          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
4697          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
4698          SPECMULT = 8.*(SPECPARM)                                                
4699          JS = 1 + INT(SPECMULT)                                                  
4700          FS = MOD(SPECMULT,1.0)                                                 
4701          FAC000 = (1. - FS) * FAC00(LAY)                                         
4702          FAC010 = (1. - FS) * FAC10(LAY)                                         
4703          FAC100 = FS * FAC00(LAY)                                                
4704          FAC110 = FS * FAC10(LAY)                                                
4705          FAC001 = (1. - FS) * FAC01(LAY)                                         
4706          FAC011 = (1. - FS) * FAC11(LAY)                                         
4707          FAC101 = FS * FAC01(LAY)                                                
4708          FAC111 = FS * FAC11(LAY)                                                
4709          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(4) + JS                         
4710          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(4) + JS                            
4711          INDS = INDSELF(LAY)                                                     
4712 !!DIR$ VECTOR                                                                     
4713          DO 2000 IG = 1, NG4                                                     
4714             TAUG(NGS3+IG,LAY) = SPECCOMB *                    &
4715                 (FAC000 * ABSA4(IND0,IG) +                     &                  
4716                  FAC100 * ABSA4(IND0+1,IG) +                   &                  
4717                  FAC010 * ABSA4(IND0+9,IG) +                   &                  
4718                  FAC110 * ABSA4(IND0+10,IG) +                  &                  
4719                  FAC001 * ABSA4(IND1,IG) +                     &                  
4720                  FAC101 * ABSA4(IND1+1,IG) +                   &                  
4721                  FAC011 * ABSA4(IND1+9,IG) +                   &                  
4722                  FAC111 * ABSA4(IND1+10,IG)) +                 &                  
4723                  COLH2O(LAY) *                                &                  
4724                  SELFFAC(LAY) * (SELFREFC4(INDS,IG) +           &                  
4725                  SELFFRAC(LAY) *                              &                  
4726                  (SELFREFC4(INDS+1,IG) - SELFREFC4(INDS,IG)))                        
4727             PFRAC(NGS3+IG,LAY) = FRACREFAC4(IG,JS) + FS *       &                  
4728                  (FRACREFAC4(IG,JS+1) - FRACREFAC4(IG,JS))                           
4729  2000    CONTINUE                                                                
4730  2500 CONTINUE                                                                   
4731                                                                                  
4732 !!DIR$ NOVECTOR                                                                   
4733 !cdir novector
4734       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
4735          SPECCOMB = COLO3(LAY) + STRRAT2*COLCO2(LAY)                             
4736          SPECPARM = COLO3(LAY)/SPECCOMB                                          
4737          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
4738          SPECMULT = 4.*(SPECPARM)                                                
4739          JS = 1 + INT(SPECMULT)                                                  
4740          FS = MOD(SPECMULT,1.0)                                                 
4741          IF (JS .GT. 1) THEN                                                     
4742             JS = JS + 1                                                          
4743          ELSEIF (FS .GE. 0.0024) THEN                                            
4744             JS = 2                                                               
4745             FS = (FS - 0.0024)/0.9976                                            
4746          ELSE                                                                    
4747             JS = 1                                                               
4748             FS = FS/0.0024                                                       
4749          ENDIF                                                                   
4750          FAC000 = (1. - FS) * FAC00(LAY)                                         
4751          FAC010 = (1. - FS) * FAC10(LAY)                                         
4752          FAC100 = FS * FAC00(LAY)                                                
4753          FAC110 = FS * FAC10(LAY)                                                
4754          FAC001 = (1. - FS) * FAC01(LAY)                                         
4755          FAC011 = (1. - FS) * FAC11(LAY)                                         
4756          FAC101 = FS * FAC01(LAY)                                                
4757          FAC111 = FS * FAC11(LAY)                                                
4758          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(4) + JS                        
4759          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(4) + JS                       
4760 !!DIR$ VECTOR                                                                     
4761          DO 3000 IG = 1, NG4                                                     
4762             TAUG(NGS3+IG,LAY) = SPECCOMB *              &                        
4763                 (FAC000 * ABSB4(IND0,IG) +               &                        
4764                  FAC100 * ABSB4(IND0+1,IG) +             &                        
4765                  FAC010 * ABSB4(IND0+6,IG) +             &                        
4766                  FAC110 * ABSB4(IND0+7,IG) +             &                        
4767                  FAC001 * ABSB4(IND1,IG) +               &                        
4768                  FAC101 * ABSB4(IND1+1,IG) +             &                        
4769                  FAC011 * ABSB4(IND1+6,IG) +             &                        
4770                  FAC111 * ABSB4(IND1+7,IG))                                       
4771             PFRAC(NGS3+IG,LAY) = FRACREFBC4(IG,JS) + FS * &
4772                  (FRACREFBC4(IG,JS+1) - FRACREFBC4(IG,JS))                           
4773  3000    CONTINUE                                                                
4774  3500 CONTINUE                                                                   
4775                                                                                  
4776       END SUBROUTINE TAUGB4
4777                                                                                  
4778 !----------------------------------------------------------------------------   
4779       SUBROUTINE TAUGB5(kts,ktep1,COLH2O,COLCO2,COLO3,FAC00,FAC01,FAC10,    &
4780                         FAC11,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,WX,        &
4781                         PFRAC,TAUG,LAYTROP                                  )
4782 !----------------------------------------------------------------------------   
4783                                                                                  
4784 !     BAND 5:  700-820 cm-1 (low - H2O,CO2; high - O3,CO2)                       
4785                                                                                  
4786       INTEGER, PARAMETER :: NGS4=52                                      
4787                                                                                  
4788       INTEGER, INTENT(IN )                      :: kts,ktep1
4790       INTEGER, INTENT(IN )                      ::  LAYTROP
4792       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
4793             INTENT(INOUT)        ::                  PFRAC, &
4794                                                       TAUG
4796       REAL, DIMENSION( MAXXSEC,kts:ktep1 ),                 &
4797             INTENT(IN   )        ::                     WX
4799       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
4800                                                     COLH2O, &
4801                                                     COLCO2, &
4802                                                      COLO3, &
4803                                                      FAC00, &
4804                                                      FAC01, &
4805                                                      FAC10, &
4806                                                      FAC11, &
4807                                                    SELFFAC, &
4808                                                   SELFFRAC 
4810       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
4811                                                         JP, &
4812                                                         JT, &
4813                                                        JT1, &
4814                                                    INDSELF
4816 ! This compiler directive was added to insure private common block storage       
4817 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
4818 ! carry constants.                                                               
4819                                                                                  
4820       STRRAT1 = 90.4894                                                          
4821       STRRAT2 = 0.900502                                                         
4822                                                                                  
4823 !     Compute the optical depth by interpolating in ln(pressure),                
4824 !     temperature, and appropriate species.  Below LAYTROP, the water            
4825 !     vapor self-continuum is interpolated (in temperature) separately.          
4826 !!DIR$ NOVECTOR                                                                   
4827 !cdir novector
4828       DO 2500 LAY = 1, LAYTROP                                                   
4829          SPECCOMB = COLH2O(LAY) + STRRAT1*COLCO2(LAY)                            
4830          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
4831          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
4832          SPECMULT = 8.*(SPECPARM)                                                
4833          JS = 1 + INT(SPECMULT)                                                  
4834          FS = MOD(SPECMULT,1.0)                                                 
4835          FAC000 = (1. - FS) * FAC00(LAY)                                         
4836          FAC010 = (1. - FS) * FAC10(LAY)                                         
4837          FAC100 = FS * FAC00(LAY)                                                
4838          FAC110 = FS * FAC10(LAY)                                                
4839          FAC001 = (1. - FS) * FAC01(LAY)                                         
4840          FAC011 = (1. - FS) * FAC11(LAY)                                         
4841          FAC101 = FS * FAC01(LAY)                                                
4842          FAC111 = FS * FAC11(LAY)                                                
4843          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(5) + JS                         
4844          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(5) + JS                            
4845          INDS = INDSELF(LAY)                                                     
4846 !!DIR$ VECTOR                                                                     
4847          DO 2000 IG = 1, NG5                                                     
4848             TAUG(NGS4+IG,LAY) = SPECCOMB *                    &
4849                 (FAC000 * ABSA5(IND0,IG) +                     &                  
4850                  FAC100 * ABSA5(IND0+1,IG) +                   &                  
4851                  FAC010 * ABSA5(IND0+9,IG) +                   &                  
4852                  FAC110 * ABSA5(IND0+10,IG) +                  &                  
4853                  FAC001 * ABSA5(IND1,IG) +                     &                  
4854                  FAC101 * ABSA5(IND1+1,IG) +                   &                  
4855                  FAC011 * ABSA5(IND1+9,IG) +                   &                  
4856                  FAC111 * ABSA5(IND1+10,IG)) +                 &                  
4857                  COLH2O(LAY) *                                &                  
4858                  SELFFAC(LAY) * (SELFREFC5(INDS,IG) +           &                  
4859                  SELFFRAC(LAY) *                              &                  
4860                  (SELFREFC5(INDS+1,IG) - SELFREFC5(INDS,IG)))     &                  
4861                  + WX(1,LAY) * CCL4C5(IG)                                          
4862             PFRAC(NGS4+IG,LAY) = FRACREFAC5(IG,JS) + FS *       &                  
4863                  (FRACREFAC5(IG,JS+1) - FRACREFAC5(IG,JS))                           
4864  2000    CONTINUE                                                                
4865  2500 CONTINUE                                                                   
4866                                                                                  
4867 !!DIR$ NOVECTOR                                                                   
4868 !cdir novector
4869       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
4870          SPECCOMB = COLO3(LAY) + STRRAT2*COLCO2(LAY)                             
4871          SPECPARM = COLO3(LAY)/SPECCOMB                                          
4872          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
4873          SPECMULT = 4.*(SPECPARM)                                                
4874          JS = 1 + INT(SPECMULT)                                                  
4875          FS = MOD(SPECMULT,1.0)                                                 
4876          FAC000 = (1. - FS) * FAC00(LAY)                                         
4877          FAC010 = (1. - FS) * FAC10(LAY)                                         
4878          FAC100 = FS * FAC00(LAY)                                                
4879          FAC110 = FS * FAC10(LAY)                                                
4880          FAC001 = (1. - FS) * FAC01(LAY)                                         
4881          FAC011 = (1. - FS) * FAC11(LAY)                                         
4882          FAC101 = FS * FAC01(LAY)                                                
4883          FAC111 = FS * FAC11(LAY)                                                
4884          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(5) + JS                        
4885          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(5) + JS                       
4886 !!DIR$ VECTOR                                                                     
4887          DO 3000 IG = 1, NG5                                                     
4888             TAUG(NGS4+IG,LAY) = SPECCOMB *          &
4889                 (FAC000 * ABSB5(IND0,IG) +           &                            
4890                  FAC100 * ABSB5(IND0+1,IG) +         &                            
4891                  FAC010 * ABSB5(IND0+5,IG) +         &                            
4892                  FAC110 * ABSB5(IND0+6,IG) +         &                            
4893                  FAC001 * ABSB5(IND1,IG) +           &                            
4894                  FAC101 * ABSB5(IND1+1,IG) +         &                            
4895                  FAC011 * ABSB5(IND1+5,IG) +         &                            
4896                  FAC111 * ABSB5(IND1+6,IG))          &                            
4897                  + WX(1,LAY) * CCL4C5(IG)                                          
4898             PFRAC(NGS4+IG,LAY) = FRACREFBC5(IG,JS) + FS *  &                       
4899                  (FRACREFBC5(IG,JS+1) - FRACREFBC5(IG,JS))                           
4900  3000    CONTINUE                                                                
4901  3500 CONTINUE                                                                   
4902                                                                                  
4903       END SUBROUTINE TAUGB5
4904                                                                                  
4905 !-----------------------------------------------------------------------------    
4906       SUBROUTINE TAUGB6(kts,ktep1,COLH2O,CO2MULT,FAC00,FAC01,FAC10,FAC11,    &
4907                         SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,WX,PFRAC,TAUG,    &
4908                         LAYTROP                                              )
4909 !-----------------------------------------------------------------------------    
4910                                                                                  
4911 !     BAND 6:  820-980 cm-1 (low - H2O; high - nothing)                          
4912                                                                                  
4913       INTEGER, PARAMETER :: NGS5=68                                       
4914                                                                                  
4915       INTEGER, INTENT(IN )                      :: kts,ktep1
4917       INTEGER, INTENT(IN )                      ::  LAYTROP
4919       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
4920             INTENT(INOUT)        ::                  PFRAC, &
4921                                                       TAUG
4923       REAL, DIMENSION( MAXXSEC,kts:ktep1 ),                 &
4924             INTENT(IN   )        ::                     WX
4926       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
4927                                                     COLH2O, &
4928                                                    CO2MULT, &
4929                                                      FAC00, &
4930                                                      FAC01, &
4931                                                      FAC10, &
4932                                                      FAC11, &
4933                                                    SELFFAC, &
4934                                                   SELFFRAC 
4936       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
4937                                                         JP, &
4938                                                         JT, &
4939                                                        JT1, &
4940                                                    INDSELF
4942 ! This compiler directive was added to insure private common block storage       
4943 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
4944 ! carry constants.                                                               
4945                                                                                  
4946 !     Compute the optical depth by interpolating in ln(pressure) and             
4947 !     temperature. The water vapor self-continuum is interpolated                
4948 !     (in temperature) separately.                                               
4949 !cdir novector
4950       DO 2500 LAY = 1, LAYTROP                                                   
4951          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(6) + 1                          
4952          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(6) + 1                             
4953          INDS = INDSELF(LAY)                                                     
4954          DO 2000 IG = 1, NG6                                                     
4955             TAUG(NGS5+IG,LAY) = COLH2O(LAY) *              & 
4956                 (FAC00(LAY) * ABSA6(IND0,IG) +              &                     
4957                  FAC10(LAY) * ABSA6(IND0+1,IG) +            &                     
4958                  FAC01(LAY) * ABSA6(IND1,IG) +              &                     
4959                  FAC11(LAY) * ABSA6(IND1+1,IG) +            &                     
4960                  SELFFAC(LAY) * (SELFREFC6(INDS,IG) +        &                     
4961                  SELFFRAC(LAY)*                            &                     
4962                  (SELFREFC6(INDS+1,IG)-SELFREFC6(INDS,IG))))   &                     
4963                  + WX(2,LAY) * CFC11ADJC6(IG)                &                     
4964                  + WX(3,LAY) * CFC12C6(IG)                   &                     
4965                  + CO2MULT(LAY) * ABSCO2C6(IG)                                     
4966             PFRAC(NGS5+IG,LAY) = FRACREFAC6(IG)                                    
4967  2000    CONTINUE                                                                
4968  2500 CONTINUE                                                                   
4969                                                                                  
4970 !     Nothing important goes on above LAYTROP in this band.                      
4971 !cdir novector
4972       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
4973          DO 3000 IG = 1, NG6                                                     
4974             TAUG(NGS5+IG,LAY) = 0.0                        & 
4975                  + WX(2,LAY) * CFC11ADJC6(IG)                &                     
4976                  + WX(3,LAY) * CFC12C6(IG)                                         
4977             PFRAC(NGS5+IG,LAY) = FRACREFAC6(IG)                                    
4978  3000    CONTINUE                                                                
4979  3500 CONTINUE                                                                   
4980                                                                                  
4981       END SUBROUTINE TAUGB6
4982                                                                                  
4983 !-----------------------------------------------------------------------------    
4984       SUBROUTINE TAUGB7(kts,ktep1,COLH2O,COLO3,CO2MULT,FAC00,FAC01,FAC10,    &   
4985                         FAC11,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,            &
4986                         PFRAC,TAUG,LAYTROP                                   )
4987 !-----------------------------------------------------------------------------    
4988                                                                                  
4989 !     BAND 7:  980-1080 cm-1 (low - H2O,O3; high - O3)                           
4990                                                                                  
4991       INTEGER, PARAMETER :: NGS6=76                                      
4992                                                                                  
4993       INTEGER, INTENT(IN )                      :: kts,ktep1
4995       INTEGER, INTENT(IN )                      ::  LAYTROP
4997       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
4998             INTENT(INOUT)        ::                  PFRAC, &
4999                                                       TAUG
5001       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5002                                                     COLH2O, &
5003                                                      COLO3, &
5004                                                    CO2MULT, &
5005                                                      FAC00, &
5006                                                      FAC01, &
5007                                                      FAC10, &
5008                                                      FAC11, &
5009                                                    SELFFAC, &
5010                                                   SELFFRAC 
5012       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5013                                                         JP, &
5014                                                         JT, &
5015                                                        JT1, &
5016                                                    INDSELF
5018 ! This compiler directive was added to insure private common block storage       
5019 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5020 ! carry constants.                                                               
5021                                                                                  
5022       STRRAT1 = 8.21104E4                                                        
5023                                                                                  
5024 !     Compute the optical depth by interpolating in ln(pressure),                
5025 !     temperature, and appropriate species.  Below LAYTROP, the water            
5026 !     vapor self-continuum is interpolated (in temperature) separately.          
5027 !!DIR$ NOVECTOR                                                                   
5028 !cdir novector
5029       DO 2500 LAY = 1, LAYTROP                                                   
5030          SPECCOMB = COLH2O(LAY) + STRRAT1*COLO3(LAY)                             
5031          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
5032          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
5033          SPECMULT = 8.*SPECPARM                                                  
5034          JS = 1 + INT(SPECMULT)                                                  
5035          FS = MOD(SPECMULT,1.0)                                                 
5036          FAC000 = (1. - FS) * FAC00(LAY)                                         
5037          FAC010 = (1. - FS) * FAC10(LAY)                                         
5038          FAC100 = FS * FAC00(LAY)                                                
5039          FAC110 = FS * FAC10(LAY)                                                
5040          FAC001 = (1. - FS) * FAC01(LAY)                                         
5041          FAC011 = (1. - FS) * FAC11(LAY)                                         
5042          FAC101 = FS * FAC01(LAY)                                                
5043          FAC111 = FS * FAC11(LAY)                                                
5044          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(7) + JS                         
5045          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(7) + JS                            
5046          INDS = INDSELF(LAY)                                                     
5047 !!DIR$ VECTOR                                                                     
5048          DO 2000 IG = 1, NG7                                                     
5049             TAUG(NGS6+IG,LAY) = SPECCOMB *                   & 
5050                 (FAC000 * ABSA7(IND0,IG) +                   &                    
5051                  FAC100 * ABSA7(IND0+1,IG) +                 &                    
5052                  FAC010 * ABSA7(IND0+9,IG) +                 &                    
5053                  FAC110 * ABSA7(IND0+10,IG) +                &                    
5054                  FAC001 * ABSA7(IND1,IG) +                   &                    
5055                  FAC101 * ABSA7(IND1+1,IG) +                 &                    
5056                  FAC011 * ABSA7(IND1+9,IG) +                 &                    
5057                  FAC111 * ABSA7(IND1+10,IG)) +               &                    
5058                  COLH2O(LAY) *                               &                    
5059                  SELFFAC(LAY) * (SELFREFC7(INDS,IG) +        &                    
5060                  SELFFRAC(LAY) *                             &                    
5061                  (SELFREFC7(INDS+1,IG) - SELFREFC7(INDS,IG)))&
5062                  + CO2MULT(LAY) * ABSCO2C7(IG)                                     
5063          PFRAC(NGS6+IG,LAY) = FRACREFAC7(IG,JS) + FS *        &                    
5064                  (FRACREFAC7(IG,JS+1) - FRACREFAC7(IG,JS))                           
5065  2000    CONTINUE                                                                
5066  2500 CONTINUE                                                                   
5067                                                                                  
5068 !cdir novector
5069       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5070          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(7) + 1                         
5071          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(7) + 1                        
5072          DO 3000 IG = 1, NG7                                                     
5073             TAUG(NGS6+IG,LAY) = COLO3(LAY) *                & 
5074                 (FAC00(LAY) * ABSB7(IND0,IG) +               &                    
5075                  FAC10(LAY) * ABSB7(IND0+1,IG) +             &                    
5076                  FAC01(LAY) * ABSB7(IND1,IG) +               &                    
5077                  FAC11(LAY) * ABSB7(IND1+1,IG))              &                    
5078                  + CO2MULT(LAY) * ABSCO2C7(IG)                                     
5079             PFRAC(NGS6+IG,LAY) = FRACREFBC7(IG)                                    
5080  3000    CONTINUE                                                                
5081  3500 CONTINUE                                                                   
5082                                                                                  
5083       END SUBROUTINE TAUGB7
5084                                                                                  
5085 !----------------------------------------------------------------------------    
5086       SUBROUTINE TAUGB8(kts,ktep1,COLH2O,COLO3,COLN2O,CO2MULT,              &
5087                         FAC00,FAC01,FAC10,FAC11,SELFFAC,SELFFRAC,           &
5088                         JP,JT,JT1,INDSELF,WX,PFRAC,TAUG,LAYSWTCH            )
5089 !----------------------------------------------------------------------------    
5090                                                                                  
5091 !     BAND 8:  1080-1180 cm-1 (low (i.e.>~300mb) - H2O; high - O3)               
5092                                                                                  
5093       INTEGER, PARAMETER :: NGS7=88                                       
5094                                                                                  
5095       INTEGER, INTENT(IN )                      :: kts,ktep1
5097       INTEGER, INTENT(IN )                      :: LAYSWTCH
5099       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5100             INTENT(INOUT)        ::                  PFRAC, &
5101                                                       TAUG
5103       REAL, DIMENSION( MAXXSEC,kts:ktep1 ),                 &
5104             INTENT(IN   )        ::                     WX
5106       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5107                                                     COLH2O, &
5108                                                      COLO3, &
5109                                                     COLN2O, &
5110                                                    CO2MULT, &
5111                                                      FAC00, &
5112                                                      FAC01, &
5113                                                      FAC10, &
5114                                                      FAC11, &
5115                                                    SELFFAC, &
5116                                                   SELFFRAC 
5118       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5119                                                         JP, &
5120                                                         JT, &
5121                                                        JT1, &
5122                                                    INDSELF
5124 ! This compiler directive was added to insure private common block storage       
5125 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5126 ! carry constants.                                                               
5127                                                                                  
5128       DIMENSION H2OREF(59),O3REF(59)                                             
5129       REAL N2OMULT,N2OREF(59)                                              
5130                                                                                  
5131       DATA H2OREF/ &                                                             
5132            1.87599E-02,1.22233E-02,5.89086E-03,2.76753E-03,1.40651E-03, &        
5133            7.59698E-04,3.88758E-04,1.65422E-04,3.71895E-05,7.47648E-06, &        
5134            4.30818E-06,3.33194E-06,3.20393E-06,3.16186E-06,3.25235E-06, &        
5135            3.42258E-06,3.62884E-06,3.91482E-06,4.14875E-06,4.30810E-06, &        
5136            4.44204E-06,4.57783E-06,4.70865E-06,4.79432E-06,4.86971E-06, &        
5137            4.92603E-06,4.96688E-06,4.99628E-06,5.05266E-06,5.12658E-06, &        
5138            5.25028E-06,5.35708E-06,5.45085E-06,5.48304E-06,5.50000E-06, &        
5139            5.50000E-06,5.45359E-06,5.40468E-06,5.35576E-06,5.25327E-06, &        
5140            5.14362E-06,5.03396E-06,4.87662E-06,4.69787E-06,4.51911E-06, &        
5141            4.33600E-06,4.14416E-06,3.95232E-06,3.76048E-06,3.57217E-06, &        
5142            3.38549E-06,3.19881E-06,3.01212E-06,2.82621E-06,2.64068E-06, &        
5143            2.45515E-06,2.26962E-06,2.08659E-06,1.93029E-06/                      
5144       DATA N2OREF/ &                                                             
5145            3.20000E-07,3.20000E-07,3.20000E-07,3.20000E-07,3.20000E-07, &        
5146            3.19652E-07,3.15324E-07,3.03830E-07,2.94221E-07,2.84953E-07, &        
5147            2.76714E-07,2.64709E-07,2.42847E-07,2.09547E-07,1.71945E-07, &        
5148            1.37491E-07,1.13319E-07,1.00354E-07,9.12812E-08,8.54633E-08, &        
5149            8.03631E-08,7.33718E-08,6.59754E-08,5.60386E-08,4.70901E-08, &        
5150            3.99774E-08,3.29786E-08,2.60642E-08,2.10663E-08,1.65918E-08, &        
5151            1.30167E-08,1.00900E-08,7.62490E-09,6.11592E-09,4.66725E-09, &        
5152            3.28574E-09,2.84838E-09,2.46198E-09,2.07557E-09,1.85507E-09, &        
5153            1.65675E-09,1.45843E-09,1.31948E-09,1.20716E-09,1.09485E-09, &        
5154            9.97803E-10,9.31260E-10,8.64721E-10,7.98181E-10,7.51380E-10, &        
5155            7.13670E-10,6.75960E-10,6.38250E-10,6.09811E-10,5.85998E-10, &        
5156            5.62185E-10,5.38371E-10,5.15183E-10,4.98660E-10/                      
5157       DATA O3REF/  &                                                             
5158            3.01700E-08,3.47254E-08,4.24769E-08,5.27592E-08,6.69439E-08, &        
5159            8.71295E-08,1.13911E-07,1.56771E-07,2.17878E-07,3.24430E-07, &        
5160            4.65942E-07,5.68057E-07,6.96065E-07,1.11863E-06,1.76175E-06, &        
5161            2.32689E-06,2.95769E-06,3.65930E-06,4.59503E-06,5.31891E-06, &        
5162            5.96179E-06,6.51133E-06,7.06350E-06,7.69169E-06,8.25771E-06, &        
5163            8.70824E-06,8.83245E-06,8.71486E-06,8.09434E-06,7.33071E-06, &        
5164            6.31014E-06,5.36717E-06,4.48289E-06,3.83913E-06,3.28270E-06, &        
5165            2.82351E-06,2.49061E-06,2.16453E-06,1.83845E-06,1.66182E-06, &        
5166            1.50517E-06,1.34852E-06,1.19718E-06,1.04822E-06,8.99264E-07, &        
5167            7.63432E-07,6.53806E-07,5.44186E-07,4.34564E-07,3.64210E-07, &        
5168            3.11938E-07,2.59667E-07,2.07395E-07,1.91456E-07,1.93639E-07, &        
5169            1.95821E-07,1.98004E-07,2.06442E-07,2.81546E-07/                      
5170                                                                                  
5171 !     Compute the optical depth by interpolating in ln(pressure) and             
5172 !     temperature.                                                               
5173 !cdir novector
5174       DO 2500 LAY = 1, LAYSWTCH                                                  
5175          FP = FAC01(LAY) + FAC11(LAY)                                            
5176          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(8) + 1                          
5177          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(8) + 1                             
5178          INDS = INDSELF(LAY)                                                     
5179          COLREF1 = N2OREF(JP(LAY))                                               
5180          COLREF2 = N2OREF(JP(LAY)+1)                                             
5181          WCOMB1 = H2OREF(JP(LAY))                                                
5182          WCOMB2 = H2OREF(JP(LAY)+1)                                              
5183          RATIO = (COLREF1/WCOMB1)+FP*((COLREF2/WCOMB2)-(COLREF1/WCOMB1))         
5184          CURRN2O = COLH2O(LAY) * RATIO                                           
5185          N2OMULT = COLN2O(LAY) - CURRN2O                                         
5186          DO 2000 IG = 1, NG8                                                     
5187             TAUG(NGS7+IG,LAY) = COLH2O(LAY) *                 &
5188                 (FAC00(LAY) * ABSA8(IND0,IG) +                &                   
5189                  FAC10(LAY) * ABSA8(IND0+1,IG) +              &                   
5190                  FAC01(LAY) * ABSA8(IND1,IG) +                &                   
5191                  FAC11(LAY) * ABSA8(IND1+1,IG) +              &                   
5192                  SELFFAC(LAY) * (SELFREFC8(INDS,IG) +         &                   
5193                  SELFFRAC(LAY) *                              &                   
5194                  (SELFREFC8(INDS+1,IG) - SELFREFC8(INDS,IG))))&                   
5195                  + WX(3,LAY) * CFC12C8(IG)                    &                   
5196                  + WX(4,LAY) * CFC22ADJC8(IG)                 &                   
5197                  + CO2MULT(LAY) * ABSCO2AC8(IG)               &                   
5198                  + N2OMULT * ABSN2OAC8(IG)        
5199             PFRAC(NGS7+IG,LAY) = FRACREFAC8(IG)                                    
5200  2000    CONTINUE                                                                
5201  2500 CONTINUE                                                                   
5202                                                                                  
5203 !cdir novector
5204       DO 3500 LAY = LAYSWTCH+1, NLAYERS                                          
5205          FP = FAC01(LAY) + FAC11(LAY)                                            
5206          IND0 = ((JP(LAY)-7)*5+(JT(LAY)-1))*NSPB(8) + 1                          
5207          IND1 = ((JP(LAY)-6)*5+(JT1(LAY)-1))*NSPB(8) + 1                         
5208          COLREF1 = N2OREF(JP(LAY))                                               
5209          COLREF2 = N2OREF(JP(LAY)+1)                                             
5210          WCOMB1 = O3REF(JP(LAY))                                                 
5211          WCOMB2 = O3REF(JP(LAY)+1)                                               
5212          RATIO = (COLREF1/WCOMB1)+FP*((COLREF2/WCOMB2)-(COLREF1/WCOMB1))         
5213          CURRN2O = COLO3(LAY) * RATIO                                            
5214          N2OMULT = COLN2O(LAY) - CURRN2O                                         
5215          DO 3000 IG = 1, NG8                                                     
5216             TAUG(NGS7+IG,LAY) = COLO3(LAY) *        &
5217                 (FAC00(LAY) * ABSB8(IND0,IG) +       &                            
5218                  FAC10(LAY) * ABSB8(IND0+1,IG) +     &                            
5219                  FAC01(LAY) * ABSB8(IND1,IG) +       &                            
5220                  FAC11(LAY) * ABSB8(IND1+1,IG))      &                            
5221                  + WX(3,LAY) * CFC12C8(IG)            &                            
5222                  + WX(4,LAY) * CFC22ADJC8(IG)         &                            
5223                  + CO2MULT(LAY) * ABSCO2BC8(IG)       &                            
5224                  + N2OMULT * ABSN2OBC8(IG)                                         
5225             PFRAC(NGS7+IG,LAY) = FRACREFBC8(IG)                                    
5226  3000    CONTINUE                                                                
5227  3500 CONTINUE                                                                   
5228                                                                                  
5229       END SUBROUTINE TAUGB8
5230                                                                                  
5231 !-----------------------------------------------------------------------------    
5232       SUBROUTINE TAUGB9(kts,ktep1,COLH2O,COLN2O,COLCH4,FAC00,FAC01,FAC10,    &
5233                         FAC11,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,            &
5234                         PFRAC,TAUG,LAYTROP,LAYSWTCH,LAYLOW                   )
5235 !-----------------------------------------------------------------------------    
5236                                                                                  
5237 !     BAND 9:  1180-1390 cm-1 (low - H2O,CH4; high - CH4)                        
5238                                                                                  
5239       INTEGER, PARAMETER :: NGS8=96                                      
5240                                                                                  
5241       INTEGER, INTENT(IN )                      :: kts,ktep1
5243       INTEGER, INTENT(IN )   ::  LAYTROP,LAYSWTCH,LAYLOW
5245       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5246             INTENT(INOUT)        ::                  PFRAC, &
5247                                                       TAUG
5249       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5250                                                     COLH2O, &
5251                                                     COLN2O, &
5252                                                     COLCH4, &
5253                                                      FAC00, &
5254                                                      FAC01, &
5255                                                      FAC10, &
5256                                                      FAC11, &
5257                                                    SELFFAC, &
5258                                                   SELFFRAC 
5260       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5261                                                         JP, &
5262                                                         JT, &
5263                                                        JT1, &
5264                                                    INDSELF
5266 ! This compiler directive was added to insure private common block storage       
5267 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5268 ! carry constants.                                                               
5269                                                                                  
5270       DIMENSION H2OREF(13),CH4REF(13),ETAREF(11)                                 
5271       REAL N2OMULT,N2OREF(13)                                              
5272                                                                                  
5273       DATA N2OREF/  &                                                            
5274            3.20000E-07,3.20000E-07,3.20000E-07,3.20000E-07,3.20000E-07,  &
5275            3.19652E-07,3.15324E-07,3.03830E-07,2.94221E-07,2.84953E-07,  &       
5276            2.76714E-07,2.64709E-07,2.42847E-07/                                  
5277       DATA H2OREF/  &                                                            
5278            1.8759999E-02, 1.2223309E-02, 5.8908667E-03, 2.7675382E-03,   &       
5279            1.4065107E-03, 7.5969833E-04, 3.8875898E-04, 1.6542293E-04,   &       
5280            3.7189537E-05, 7.4764857E-06, 4.3081886E-06, 3.3319423E-06,   &       
5281            3.2039343E-06/                                                        
5282       DATA CH4REF/  &                                                            
5283            1.7000001E-06, 1.7000001E-06, 1.6998713E-06, 1.6904165E-06,   &       
5284            1.6671424E-06, 1.6350652E-06, 1.6097551E-06, 1.5590465E-06,   &       
5285            1.5119849E-06, 1.4741138E-06, 1.4384609E-06, 1.4002215E-06,   &       
5286            1.3573376E-06/                                                        
5287       DATA ETAREF/  &                                                            
5288            0.,0.125,0.25,0.375,0.5,0.625,0.75,0.875,0.96,0.99,1.0/               
5289                                                                                  
5290       STRRAT = 21.6282                                                           
5291       IOFF = 0                                                                   
5292                                                                                  
5293 !     Compute the optical depth by interpolating in ln(pressure),                
5294 !     temperature, and appropriate species.  Below LAYTROP, the water            
5295 !     vapor self-continuum is interpolated (in temperature) separately.          
5296 !cdir novector
5297       DO 2500 LAY = 1, LAYTROP                                                   
5298          SPECCOMB = COLH2O(LAY) + STRRAT*COLCH4(LAY)                             
5299          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
5300          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
5301          SPECMULT = 8.*(SPECPARM)                                                
5302          JS = 1 + INT(SPECMULT)                                                  
5303          JFRAC = JS                                                              
5304          FS = MOD(SPECMULT,1.0)                                                 
5305          FFRAC = FS                                                              
5306          IF (JS .EQ. 8) THEN                                                     
5307             IF (FS .LE. 0.68) THEN                                               
5308                FS = FS/0.68                                                      
5309             ELSEIF (FS .LE. 0.92) THEN                                           
5310                JS = JS + 1                                                       
5311                FS = (FS-0.68)/0.24                                               
5312             ELSE                                                                 
5313                JS = JS + 2                                                       
5314                FS = (FS-0.92)/0.08                                               
5315             ENDIF                                                                
5316          ELSEIF (JS .EQ.9) THEN                                                  
5317             JS = 10                                                              
5318             FS = 1.                                                              
5319             JFRAC = 8                                                            
5320             FFRAC = 1.                                                           
5321          ENDIF                                                                   
5322          FP = FAC01(LAY) + FAC11(LAY)                                            
5323          NS = JS + INT(FS + 0.5)                                                 
5324          FAC000 = (1. - FS) * FAC00(LAY)                                         
5325          FAC010 = (1. - FS) * FAC10(LAY)                                         
5326          FAC100 = FS * FAC00(LAY)                                                
5327          FAC110 = FS * FAC10(LAY)                                                
5328          FAC001 = (1. - FS) * FAC01(LAY)                                         
5329          FAC011 = (1. - FS) * FAC11(LAY)                                         
5330          FAC101 = FS * FAC01(LAY)                                                
5331          FAC111 = FS * FAC11(LAY)                                                
5332          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(9) + JS                         
5333          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(9) + JS                            
5334          INDS = INDSELF(LAY)                                                     
5335          IF (LAY .EQ. LAYLOW) IOFF = NG9                                         
5336          IF (LAY .EQ. LAYSWTCH) IOFF = 2*NG9                                     
5337          COLREF1 = N2OREF(JP(LAY))                                               
5338          COLREF2 = N2OREF(JP(LAY)+1)                                             
5339          IF (NS .EQ. 11) THEN                                                    
5340             WCOMB1 = H2OREF(JP(LAY))                                             
5341             WCOMB2 = H2OREF(JP(LAY)+1)                                           
5342          ELSE                                                                    
5343             WCOMB1 = STRRAT * CH4REF(JP(LAY))/(1.-ETAREF(NS))                    
5344             WCOMB2 = STRRAT * CH4REF(JP(LAY)+1)/(1.-ETAREF(NS))                  
5345          ENDIF                                                                   
5346          RATIO = (COLREF1/WCOMB1)+FP*((COLREF2/WCOMB2)-(COLREF1/WCOMB1))         
5347          CURRN2O = SPECCOMB * RATIO                                              
5348          N2OMULT = COLN2O(LAY) - CURRN2O                                         
5349          DO 2000 IG = 1, NG9                                                     
5350             TAUG(NGS8+IG,LAY) = SPECCOMB *                      &
5351                 (FAC000 * ABSA9(IND0,IG) +                      &                 
5352                  FAC100 * ABSA9(IND0+1,IG) +                    &                 
5353                  FAC010 * ABSA9(IND0+11,IG) +                   &                 
5354                  FAC110 * ABSA9(IND0+12,IG) +                   &                 
5355                  FAC001 * ABSA9(IND1,IG) +                      &                 
5356                  FAC101 * ABSA9(IND1+1,IG) +                    &                 
5357                  FAC011 * ABSA9(IND1+11,IG) +                   &                 
5358                  FAC111 * ABSA9(IND1+12,IG)) +                  &                 
5359                  COLH2O(LAY) *                                  &                 
5360                  SELFFAC(LAY) * (SELFREFC9(INDS,IG) +           &                 
5361                  SELFFRAC(LAY) *                                &                 
5362                  (SELFREFC9(INDS+1,IG) - SELFREFC9(INDS,IG)))   & 
5363                  + N2OMULT * ABSN2OC9(IG+IOFF)                                     
5364             PFRAC(NGS8+IG,LAY) = FRACREFAC9(IG,JFRAC) + FFRAC *  &                 
5365                  (FRACREFAC9(IG,JFRAC+1) - FRACREFAC9(IG,JFRAC))                     
5366  2000    CONTINUE                                                                
5367  2500 CONTINUE                                                                   
5368                                                                                  
5369 !cdir novector
5370       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5371          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(9) + 1                         
5372          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(9) + 1                        
5373          DO 3000 IG = 1, NG9                                                     
5374             TAUG(NGS8+IG,LAY) = COLCH4(LAY) *                  &                 
5375                 (FAC00(LAY) * ABSB9(IND0,IG) +                  &                 
5376                  FAC10(LAY) * ABSB9(IND0+1,IG) +                &                 
5377                  FAC01(LAY) * ABSB9(IND1,IG) +                  &                 
5378                  FAC11(LAY) * ABSB9(IND1+1,IG))                                   
5379             PFRAC(NGS8+IG,LAY) = FRACREFBC9(IG)                                    
5380  3000    CONTINUE                                                                
5381  3500 CONTINUE                                                                   
5382                                                                                  
5383       END SUBROUTINE TAUGB9
5384                                                                                  
5385 !--------------------------------------------------------------------------------    
5386       SUBROUTINE TAUGB10(kts,ktep1,COLH2O,FAC00,FAC01,FAC10,FAC11,JP,JT,JT1,    &
5387                          PFRAC,TAUG,LAYTROP                                     )
5388 !--------------------------------------------------------------------------------    
5389                                                                                  
5390 !     BAND 10:  1390-1480 cm-1 (low - H2O; high - H2O)                           
5391                                                                                  
5392       INTEGER, PARAMETER :: NGS9=108                                     
5393                                                                                  
5394       INTEGER, INTENT(IN )                      :: kts,ktep1
5396       INTEGER, INTENT(IN )                      ::  LAYTROP
5398       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5399             INTENT(INOUT)        ::                  PFRAC, &
5400                                                       TAUG
5402       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5403                                                     COLH2O, &
5404                                                      FAC00, &
5405                                                      FAC01, &
5406                                                      FAC10, &
5407                                                      FAC11
5409       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5410                                                         JP, &
5411                                                         JT, &
5412                                                        JT1
5414 ! This compiler directive was added to insure private common block storage       
5415 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5416 ! carry constants.                                                               
5417                                                                                  
5418 !     Compute the optical depth by interpolating in ln(pressure) and             
5419 !     temperature.                                                               
5420 !cdir novector
5421       DO 2500 LAY = 1, LAYTROP                                                   
5422          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(10) + 1                         
5423          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(10) + 1                            
5424          DO 2000 IG = 1, NG10                                                    
5425             TAUG(NGS9+IG,LAY) = COLH2O(LAY) *          &
5426                 (FAC00(LAY) * ABSA10(IND0,IG) +        &                           
5427                  FAC10(LAY) * ABSA10(IND0+1,IG) +      &                           
5428                  FAC01(LAY) * ABSA10(IND1,IG) +        &                           
5429                  FAC11(LAY) * ABSA10(IND1+1,IG))                                   
5430             PFRAC(NGS9+IG,LAY) = FRACREFAC10(IG)                                    
5431  2000    CONTINUE                                                                
5432  2500 CONTINUE                                                                   
5433                                                                                  
5434 !cdir novector
5435       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5436          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(10) + 1                        
5437          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(10) + 1                       
5438          DO 3000 IG = 1, NG10                                                    
5439             TAUG(NGS9+IG,LAY) = COLH2O(LAY) *        &
5440                 (FAC00(LAY) * ABSB10(IND0,IG) +        &                           
5441                  FAC10(LAY) * ABSB10(IND0+1,IG) +      &                           
5442                  FAC01(LAY) * ABSB10(IND1,IG) +        &                           
5443                  FAC11(LAY) * ABSB10(IND1+1,IG))                                   
5444             PFRAC(NGS9+IG,LAY) = FRACREFBC10(IG)                                    
5445  3000    CONTINUE                                                                
5446  3500 CONTINUE                                                                   
5447                                                                                  
5448       END SUBROUTINE TAUGB10
5449                                                                                  
5450 !--------------------------------------------------------------------------    
5451       SUBROUTINE TAUGB11(kts,ktep1,COLH2O,FAC00,FAC01,FAC10,FAC11,        &
5452                          SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,   &
5453                          LAYTROP                                          )
5454 !--------------------------------------------------------------------------    
5455                                                                                  
5456 !     BAND 11:  1480-1800 cm-1 (low - H2O; high - H2O)                           
5457                                                                                  
5458       INTEGER, PARAMETER :: NGS10=114                                    
5459                                                                                  
5460       INTEGER, INTENT(IN )                      :: kts,ktep1
5462       INTEGER, INTENT(IN )                      ::  LAYTROP
5464       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5465             INTENT(INOUT)        ::                  PFRAC, &
5466                                                       TAUG
5468       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5469                                                     COLH2O, &
5470                                                      FAC00, &
5471                                                      FAC01, &
5472                                                      FAC10, &
5473                                                      FAC11, &
5474                                                    SELFFAC, &
5475                                                   SELFFRAC 
5477       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5478                                                         JP, &
5479                                                         JT, &
5480                                                        JT1, &
5481                                                    INDSELF
5483 ! This compiler directive was added to insure private common block storage       
5484 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5485 ! carry constants.                                                               
5486                                                                                  
5488 !     Compute the optical depth by interpolating in ln(pressure) and             
5489 !     temperature.  Below LAYTROP, the water vapor self-continuum                
5490 !     is interpolated (in temperature) separately.                               
5491 !cdir novector
5492       DO 2500 LAY = 1, LAYTROP                                                   
5493          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(11) + 1                         
5494          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(11) + 1                            
5495          INDS = INDSELF(LAY)                                                     
5496          DO 2000 IG = 1, NG11                                                    
5497             TAUG(NGS10+IG,LAY) = COLH2O(LAY) *                 &                   
5498                 (FAC00(LAY) * ABSA11(IND0,IG) +                &                   
5499                  FAC10(LAY) * ABSA11(IND0+1,IG) +              &                   
5500                  FAC01(LAY) * ABSA11(IND1,IG) +                &                   
5501                  FAC11(LAY) * ABSA11(IND1+1,IG) +              &                   
5502                  SELFFAC(LAY) * (SELFREFC11(INDS,IG) +         & 
5503                  SELFFRAC(LAY) *                               &                   
5504                  (SELFREFC11(INDS+1,IG) - SELFREFC11(INDS,IG))))                       
5505             PFRAC(NGS10+IG,LAY) = FRACREFAC11(IG)                                   
5506  2000    CONTINUE                                                                
5507  2500 CONTINUE                                                                   
5508                                                                                  
5509 !cdir novector
5510       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5511          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(11) + 1                        
5512          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(11) + 1                       
5513          DO 3000 IG = 1, NG11                                                    
5514             TAUG(NGS10+IG,LAY) = COLH2O(LAY) *               &                   
5515                 (FAC00(LAY) * ABSB11(IND0,IG) +                &                   
5516                  FAC10(LAY) * ABSB11(IND0+1,IG) +              &                   
5517                  FAC01(LAY) * ABSB11(IND1,IG) +                &                   
5518                  FAC11(LAY) * ABSB11(IND1+1,IG))                                   
5519             PFRAC(NGS10+IG,LAY) = FRACREFBC11(IG)                                   
5520  3000    CONTINUE                                                                
5521  3500 CONTINUE                                                                   
5522                                                                                  
5523       END SUBROUTINE TAUGB11
5524                                                                                  
5525 !-----------------------------------------------------------------------------    
5526       SUBROUTINE TAUGB12(kts,ktep1,COLH2O,COLCO2,FAC00,FAC01,FAC10,FAC11,    &
5527                          SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,      &
5528                          LAYTROP                                             )
5529 !-----------------------------------------------------------------------------   
5530                                                                                  
5531 !     BAND 12:  1800-2080 cm-1 (low - H2O,CO2; high - nothing)                   
5532                                                                                  
5533       INTEGER, PARAMETER :: NGS11=122                                    
5534                                                                                  
5535       INTEGER, INTENT(IN )                      :: kts,ktep1
5537       INTEGER, INTENT(IN )                      ::  LAYTROP
5539       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5540             INTENT(INOUT)        ::                  PFRAC, &
5541                                                       TAUG
5543       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5544                                                     COLH2O, &
5545                                                     COLCO2, &
5546                                                      FAC00, &
5547                                                      FAC01, &
5548                                                      FAC10, &
5549                                                      FAC11, &
5550                                                    SELFFAC, &
5551                                                   SELFFRAC 
5553       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5554                                                         JP, &
5555                                                         JT, &
5556                                                        JT1, &
5557                                                    INDSELF
5559 ! This compiler directive was added to insure private common block storage       
5560 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5561 ! carry constants.                                                               
5562                                                                                  
5563       STRRAT1 = 0.009736757                                                      
5564                                                                                  
5565 !     Compute the optical depth by interpolating in ln(pressure),                
5566 !     temperature, and appropriate species.  Below LAYTROP, the water            
5567 !     vapor self-continuum is interpolated (in temperature) separately.          
5568 !!DIR$ NOVECTOR                                                                   
5569 !cdir novector
5570       DO 2500 LAY = 1, LAYTROP                                                   
5571          SPECCOMB = COLH2O(LAY) + STRRAT1*COLCO2(LAY)                            
5572          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
5573          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
5574          SPECMULT = 8.*(SPECPARM)                                                
5575          JS = 1 + INT(SPECMULT)                                                  
5576          FS = MOD(SPECMULT,1.0)                                                 
5577          FAC000 = (1. - FS) * FAC00(LAY)                                         
5578          FAC010 = (1. - FS) * FAC10(LAY)                                         
5579          FAC100 = FS * FAC00(LAY)                                                
5580          FAC110 = FS * FAC10(LAY)                                                
5581          FAC001 = (1. - FS) * FAC01(LAY)                                         
5582          FAC011 = (1. - FS) * FAC11(LAY)                                         
5583          FAC101 = FS * FAC01(LAY)                                                
5584          FAC111 = FS * FAC11(LAY)                                                
5585          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(12) + JS                        
5586          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(12) + JS                           
5587          INDS = INDSELF(LAY)                                                     
5588 !!DIR$ VECTOR                                                                     
5589          DO 2000 IG = 1, NG12                                                    
5590             TAUG(NGS11+IG,LAY) = SPECCOMB *             & 
5591                 (FAC000 * ABSA12(IND0,IG) +             &                          
5592                  FAC100 * ABSA12(IND0+1,IG) +           &                          
5593                  FAC010 * ABSA12(IND0+9,IG) +           &                          
5594                  FAC110 * ABSA12(IND0+10,IG) +          &                          
5595                  FAC001 * ABSA12(IND1,IG) +             &                          
5596                  FAC101 * ABSA12(IND1+1,IG) +           &                          
5597                  FAC011 * ABSA12(IND1+9,IG) +           &                          
5598                  FAC111 * ABSA12(IND1+10,IG)) +         &                          
5599                  COLH2O(LAY) *                          &                          
5600                  SELFFAC(LAY) * (SELFREFC12(INDS,IG) +  &                          
5601                  SELFFRAC(LAY) *                        &                          
5602                  (SELFREFC12(INDS+1,IG) - SELFREFC12(INDS,IG)))                        
5603             PFRAC(NGS11+IG,LAY) = FRACREFAC12(IG,JS) + FS *  & 
5604                  (FRACREFAC12(IG,JS+1) - FRACREFAC12(IG,JS))                           
5605  2000    CONTINUE                                                                
5606  2500 CONTINUE                                                                   
5607                                                                                  
5608 !cdir novector
5609       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5610          DO 3000 IG = 1, NG12                                                    
5611             TAUG(NGS11+IG,LAY) = 0.0                                             
5612             PFRAC(NGS11+IG,LAY) = 0.0                                            
5613  3000    CONTINUE                                                                
5614  3500 CONTINUE                                                                   
5615                                                                                  
5616       END SUBROUTINE TAUGB12
5617                                                                                  
5618 !-----------------------------------------------------------------------------    
5619       SUBROUTINE TAUGB13(kts,ktep1,COLH2O,COLN2O,FAC00,FAC01,FAC10,FAC11,    &
5620                          SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,      &
5621                          LAYTROP                                             )
5622 !-----------------------------------------------------------------------------    
5623                                                                                  
5624 !     BAND 13:  2080-2250 cm-1 (low - H2O,N2O; high - nothing)                   
5625                                                                                  
5626       INTEGER, PARAMETER :: NGS12=130                                    
5627                                                                                  
5628       INTEGER, INTENT(IN )                      :: kts,ktep1
5630       INTEGER, INTENT(IN )                      ::  LAYTROP
5632       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5633             INTENT(INOUT)        ::                  PFRAC, &
5634                                                       TAUG
5636       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5637                                                     COLH2O, &
5638                                                     COLN2O, &
5639                                                      FAC00, &
5640                                                      FAC01, &
5641                                                      FAC10, &
5642                                                      FAC11, &
5643                                                    SELFFAC, &
5644                                                   SELFFRAC 
5646       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5647                                                         JP, &
5648                                                         JT, &
5649                                                        JT1, &
5650                                                    INDSELF
5652 ! This compiler directive was added to insure private common block storage       
5653 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5654 ! carry constants.                                                               
5655                                                                                  
5656       STRRAT1 = 16658.87                                                         
5657                                                                                  
5658 !     Compute the optical depth by interpolating in ln(pressure),                
5659 !     temperature, and appropriate species.  Below LAYTROP, the water            
5660 !     vapor self-continuum is interpolated (in temperature) separately.          
5661       DO 2500 LAY = 1, LAYTROP                                                   
5662          SPECCOMB = COLH2O(LAY) + STRRAT1*COLN2O(LAY)                            
5663          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
5664          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
5665          SPECMULT = 8.*(SPECPARM)                                                
5666          JS = 1 + INT(SPECMULT)                                                  
5667          FS = MOD(SPECMULT,1.0)                                                 
5668          FAC000 = (1. - FS) * FAC00(LAY)                                         
5669          FAC010 = (1. - FS) * FAC10(LAY)                                         
5670          FAC100 = FS * FAC00(LAY)                                                
5671          FAC110 = FS * FAC10(LAY)                                                
5672          FAC001 = (1. - FS) * FAC01(LAY)                                         
5673          FAC011 = (1. - FS) * FAC11(LAY)                                         
5674          FAC101 = FS * FAC01(LAY)                                                
5675          FAC111 = FS * FAC11(LAY)                                                
5676          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(13) + JS                        
5677          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(13) + JS                           
5678          INDS = INDSELF(LAY)                                                     
5679          DO 2000 IG = 1, NG13                                                    
5680             TAUG(NGS12+IG,LAY) = SPECCOMB *                &                       
5681                 (FAC000 * ABSA13(IND0,IG) +                &                       
5682                  FAC100 * ABSA13(IND0+1,IG) +              &                       
5683                  FAC010 * ABSA13(IND0+9,IG) +              &                       
5684                  FAC110 * ABSA13(IND0+10,IG) +             &                       
5685                  FAC001 * ABSA13(IND1,IG) +                &                       
5686                  FAC101 * ABSA13(IND1+1,IG) +              &                       
5687                  FAC011 * ABSA13(IND1+9,IG) +              &                       
5688                  FAC111 * ABSA13(IND1+10,IG)) +            &                       
5689                  COLH2O(LAY) *                           &                       
5690                  SELFFAC(LAY) * (SELFREFC13(INDS,IG) +      &                       
5691                  SELFFRAC(LAY) *                         &                       
5692                  (SELFREFC13(INDS+1,IG) - SELFREFC13(INDS,IG)))                        
5693             PFRAC(NGS12+IG,LAY) = FRACREFAC13(IG,JS) + FS * &                       
5694                  (FRACREFAC13(IG,JS+1) - FRACREFAC13(IG,JS))                           
5695  2000    CONTINUE                                                                
5696  2500 CONTINUE                                                                   
5697                                                                                  
5698       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5699          DO 3000 IG = 1, NG13                                                    
5700             TAUG(NGS12+IG,LAY) = 0.0                                             
5701             PFRAC(NGS12+IG,LAY) = 0.0                                            
5702  3000    CONTINUE                                                                
5703  3500 CONTINUE                                                                   
5704                                                                                  
5706       END SUBROUTINE TAUGB13
5707                                                                                  
5708 !----------------------------------------------------------------------------    
5709       SUBROUTINE TAUGB14(kts,ktep1,COLCO2,FAC00,FAC01,FAC10,FAC11,          &
5710                          SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,     &
5711                          LAYTROP                                            )
5712 !----------------------------------------------------------------------------    
5713                                                                                  
5714 !     BAND 14:  2250-2380 cm-1 (low - CO2; high - CO2)                           
5715                                                                                  
5716       INTEGER, PARAMETER :: NGS13=134                                    
5717                                                                                  
5718       INTEGER, INTENT(IN )                      :: kts,ktep1
5720       INTEGER, INTENT(IN )                      ::  LAYTROP
5722       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5723             INTENT(INOUT)        ::                  PFRAC, &
5724                                                       TAUG
5726       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5727                                                     COLCO2, &
5728                                                      FAC00, &
5729                                                      FAC01, &
5730                                                      FAC10, &
5731                                                      FAC11, &
5732                                                    SELFFAC, &
5733                                                   SELFFRAC 
5735       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5736                                                         JP, &
5737                                                         JT, &
5738                                                        JT1, &
5739                                                    INDSELF
5741 ! This compiler directive was added to insure private common block storage       
5742 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5743 ! carry constants.                                                               
5744                                                                                  
5745 !     Compute the optical depth by interpolating in ln(pressure) and             
5746 !     temperature.  Below LAYTROP, the water vapor self-continuum                
5747 !     is interpolated (in temperature) separately.                               
5748       DO 2500 LAY = 1, LAYTROP                                                   
5749          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(14) + 1                         
5750          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(14) + 1                            
5751          INDS = INDSELF(LAY)                                                     
5752          DO 2000 IG = 1, NG14                                                    
5753             TAUG(NGS13+IG,LAY) = COLCO2(LAY) *           &
5754                 (FAC00(LAY) * ABSA14(IND0,IG) +          &                         
5755                  FAC10(LAY) * ABSA14(IND0+1,IG) +        &                         
5756                  FAC01(LAY) * ABSA14(IND1,IG) +          &                         
5757                  FAC11(LAY) * ABSA14(IND1+1,IG) +        &                         
5758                  SELFFAC(LAY) * (SELFREFC14(INDS,IG) +   &                         
5759                  SELFFRAC(LAY) *                         &                         
5760                  (SELFREFC14(INDS+1,IG) - SELFREFC14(INDS,IG))))                       
5761             PFRAC(NGS13+IG,LAY) = FRACREFAC14(IG)                                   
5762  2000    CONTINUE                                                                
5763  2500 CONTINUE                                                                   
5764                                                                                  
5765       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5766          IND0 = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(14) + 1                        
5767          IND1 = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(14) + 1                       
5768          DO 3000 IG = 1, NG14                                                    
5769             TAUG(NGS13+IG,LAY) = COLCO2(LAY) *       &                           
5770                 (FAC00(LAY) * ABSB14(IND0,IG) +        &                           
5771                  FAC10(LAY) * ABSB14(IND0+1,IG) +      &                           
5772                  FAC01(LAY) * ABSB14(IND1,IG) +        &                           
5773                  FAC11(LAY) * ABSB14(IND1+1,IG))                                   
5774             PFRAC(NGS13+IG,LAY) = FRACREFBC14(IG)                                   
5775  3000    CONTINUE                                                                
5776  3500 CONTINUE                                                                   
5777                                                                                  
5778       END SUBROUTINE TAUGB14
5779                                                                                  
5780 !------------------------------------------------------------------------------    
5781       SUBROUTINE TAUGB15(kts,ktep1,COLH2O,COLCO2,COLN2O,FAC00,FAC01,FAC10,    &
5782                          FAC11,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,            &
5783                          PFRAC,TAUG,LAYTROP                                   )
5784 !------------------------------------------------------------------------------    
5785                                                                                  
5786 !     BAND 15:  2380-2600 cm-1 (low - N2O,CO2; high - nothing)                   
5787                                                                                  
5788       INTEGER, PARAMETER :: NGS14=136                                    
5789                                                                                  
5790       INTEGER, INTENT(IN )                      :: kts,ktep1
5792       INTEGER, INTENT(IN )                      ::  LAYTROP
5794       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5795             INTENT(INOUT)        ::                  PFRAC, &
5796                                                       TAUG
5798       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5799                                                     COLH2O, &
5800                                                     COLCO2, &
5801                                                     COLN2O, &
5802                                                      FAC00, &
5803                                                      FAC01, &
5804                                                      FAC10, &
5805                                                      FAC11, &
5806                                                    SELFFAC, &
5807                                                   SELFFRAC 
5809       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5810                                                         JP, &
5811                                                         JT, &
5812                                                        JT1, &
5813                                                    INDSELF
5815 ! This compiler directive was added to insure private common block storage       
5816 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5817 ! carry constants.                                                               
5818                                                                                  
5819       STRRAT1 = 0.2883201                                                        
5820                                                                                  
5821 !     Compute the optical depth by interpolating in ln(pressure),                
5822 !     temperature, and appropriate species.  Below LAYTROP, the water            
5823 !     vapor self-continuum is interpolated (in temperature) separately.          
5824       DO 2500 LAY = 1, LAYTROP                                                   
5825          SPECCOMB = COLN2O(LAY) + STRRAT1*COLCO2(LAY)                            
5826          SPECPARM = COLN2O(LAY)/SPECCOMB                                         
5827          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
5828          SPECMULT = 8.*(SPECPARM)                                                
5829          JS = 1 + INT(SPECMULT)                                                  
5830          FS = MOD(SPECMULT,1.0)                                                 
5831          FAC000 = (1. - FS) * FAC00(LAY)                                         
5832          FAC010 = (1. - FS) * FAC10(LAY)                                         
5833          FAC100 = FS * FAC00(LAY)                                                
5834          FAC110 = FS * FAC10(LAY)                                                
5835          FAC001 = (1. - FS) * FAC01(LAY)                                         
5836          FAC011 = (1. - FS) * FAC11(LAY)                                         
5837          FAC101 = FS * FAC01(LAY)                                                
5838          FAC111 = FS * FAC11(LAY)                                                
5839          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(15) + JS                        
5840          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(15) + JS                           
5841          INDS = INDSELF(LAY)                                                     
5842          DO 2000 IG = 1, NG15                                                    
5843             TAUG(NGS14+IG,LAY) = SPECCOMB *                     &                  
5844                 (FAC000 * ABSA15(IND0,IG) +                     &                  
5845                  FAC100 * ABSA15(IND0+1,IG) +                   &                  
5846                  FAC010 * ABSA15(IND0+9,IG) +                   &                  
5847                  FAC110 * ABSA15(IND0+10,IG) +                  &                  
5848                  FAC001 * ABSA15(IND1,IG) +                     &                  
5849                  FAC101 * ABSA15(IND1+1,IG) +                   &                  
5850                  FAC011 * ABSA15(IND1+9,IG) +                   &                  
5851                  FAC111 * ABSA15(IND1+10,IG)) +                 &                  
5852                  COLH2O(LAY) *                                &                  
5853                  SELFFAC(LAY) * (SELFREFC15(INDS,IG) +           &                  
5854                  SELFFRAC(LAY) *                              &                  
5855                  (SELFREFC15(INDS+1,IG) - SELFREFC15(INDS,IG)))                        
5856             PFRAC(NGS14+IG,LAY) = FRACREFAC15(IG,JS) + FS *      &                  
5857                  (FRACREFAC15(IG,JS+1) - FRACREFAC15(IG,JS))                           
5858  2000    CONTINUE                                                                
5859  2500 CONTINUE                                                                   
5860                                                                                  
5861       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5862          DO 3000 IG = 1, NG15                                                    
5863             TAUG(NGS14+IG,LAY) = 0.0                                             
5864             PFRAC(NGS14+IG,LAY) = 0.0                                            
5865  3000    CONTINUE                                                                
5866  3500 CONTINUE                                                                   
5867                                                                                  
5868       END SUBROUTINE TAUGB15
5869                                                                                  
5870 !-----------------------------------------------------------------------------    
5871       SUBROUTINE TAUGB16(kts,ktep1,COLH2O,COLCH4,FAC00,FAC01,FAC10,FAC11,    &
5872                          SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,      &
5873                          LAYTROP                                             )
5874 !-----------------------------------------------------------------------------    
5875                                                                                  
5876 !     BAND 16:  2600-3000 cm-1 (low - H2O,CH4; high - nothing)                   
5877                                                                                  
5878       INTEGER, PARAMETER :: NGS15=138                                    
5879                                                                                  
5880       INTEGER, INTENT(IN )                      :: kts,ktep1
5882       INTEGER, INTENT(IN )                      ::  LAYTROP
5884       REAL, DIMENSION( NGPT,kts:ktep1 ),                    &
5885             INTENT(INOUT)        ::                  PFRAC, &
5886                                                       TAUG
5888       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::        &
5889                                                     COLH2O, &
5890                                                     COLCH4, &
5891                                                      FAC00, &
5892                                                      FAC01, &
5893                                                      FAC10, &
5894                                                      FAC11, &
5895                                                    SELFFAC, &
5896                                                   SELFFRAC 
5898       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::     &
5899                                                         JP, &
5900                                                         JT, &
5901                                                        JT1, &
5902                                                    INDSELF
5904 ! This compiler directive was added to insure private common block storage       
5905 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
5906 ! carry constants.                                                               
5907                                                                                  
5908       STRRAT1 = 830.411                                                          
5909                                                                                  
5910 !     Compute the optical depth by interpolating in ln(pressure),                
5911 !     temperature, and appropriate species.  Below LAYTROP, the water            
5912 !     vapor self-continuum is interpolated (in temperature) separately.          
5913       DO 2500 LAY = 1, LAYTROP                                                   
5914          SPECCOMB = COLH2O(LAY) + STRRAT1*COLCH4(LAY)                            
5915          SPECPARM = COLH2O(LAY)/SPECCOMB                                         
5916          IF (SPECPARM .GE. ONEMINUS) SPECPARM = ONEMINUS                         
5917          SPECMULT = 8.*(SPECPARM)                                                
5918          JS = 1 + INT(SPECMULT)                                                  
5919          FS = MOD(SPECMULT,1.0)                                                 
5920          FAC000 = (1. - FS) * FAC00(LAY)                                         
5921          FAC010 = (1. - FS) * FAC10(LAY)                                         
5922          FAC100 = FS * FAC00(LAY)                                                
5923          FAC110 = FS * FAC10(LAY)                                                
5924          FAC001 = (1. - FS) * FAC01(LAY)                                         
5925          FAC011 = (1. - FS) * FAC11(LAY)                                         
5926          FAC101 = FS * FAC01(LAY)                                                
5927          FAC111 = FS * FAC11(LAY)                                                
5928          IND0 = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(16) + JS                        
5929          IND1 = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(16) + JS                           
5930          INDS = INDSELF(LAY)                                                     
5931          DO 2000 IG = 1, NG16                                                    
5932             TAUG(NGS15+IG,LAY) = SPECCOMB *                 &
5933                 (FAC000 * ABSA16(IND0,IG) +                 &                      
5934                  FAC100 * ABSA16(IND0+1,IG) +               &                      
5935                  FAC010 * ABSA16(IND0+9,IG) +               &                      
5936                  FAC110 * ABSA16(IND0+10,IG) +              &                      
5937                  FAC001 * ABSA16(IND1,IG) +                 &                      
5938                  FAC101 * ABSA16(IND1+1,IG) +               &                      
5939                  FAC011 * ABSA16(IND1+9,IG) +               &                      
5940                  FAC111 * ABSA16(IND1+10,IG)) +             &                      
5941                  COLH2O(LAY) *                            &                      
5942                  SELFFAC(LAY) * (SELFREFC16(INDS,IG) +       &                      
5943                  SELFFRAC(LAY) *                          &                      
5944                  (SELFREFC16(INDS+1,IG) - SELFREFC16(INDS,IG)))                        
5945             PFRAC(NGS15+IG,LAY) = FRACREFAC16(IG,JS) + FS *  &                      
5946                  (FRACREFAC16(IG,JS+1) - FRACREFAC16(IG,JS))                           
5947  2000    CONTINUE                                                                
5948  2500 CONTINUE                                                                   
5949                                                                                  
5950       DO 3500 LAY = LAYTROP+1, NLAYERS                                           
5951          DO 3000 IG = 1, NG16                                                    
5952             TAUG(NGS15+IG,LAY) = 0.0                                             
5953             PFRAC(NGS15+IG,LAY) = 0.0                                            
5954  3000    CONTINUE                                                                
5955  3500 CONTINUE                                                                   
5956                                                                                  
5957       END SUBROUTINE TAUGB16
5958                                                                                  
5960 !-------------------------------------------------------------------------
5961       SUBROUTINE RTRN(kts,ktep1,                                         &
5962                       TAVEL, PZ, TZ, CLDFRAC, TAUCLOUD, TOTDFLUX,        &
5963                       TOTUFLUX, HTR, ICLDLYR, ITR, PFRAC, TBOUND,SEMISS  )
5964 !-------------------------------------------------------------------------
5965 !  RRTM Longwave Radiative Transfer Model                                        
5966 !  Atmospheric and Environmental Research, Inc., Cambridge, MA                   
5967 !                                                                                
5968 !  Original version:       E. J. Mlawer, et al.                                  
5969 !  Revision for NCAR CCM:  Michael J. Iacono; September, 1998                    
5970 !                                                                                
5971 !  This program calculates the upward fluxes, downward fluxes, and               
5972 !  heating rates for an arbitrary clear or cloudy atmosphere.  The input         
5973 !  to this program is the atmospheric profile, all Planck function               
5974 !  information, and the cloud fraction by layer.  The diffusivity angle          
5975 !  (SECANG=1.66) is used for the angle integration for consistency with          
5976 !  the NCAR CCM; the Gaussian weight appropriate to this angle (WTNUM=0.5)       
5977 !  is applied here.  Note that use of the emissivity angle for the flux          
5978 !  integration can cause errors of 1 to 4 W/m2 within cloudy layers.             
5979 !-------------------------------------------------------------------------
5980                                                                                  
5981       INTEGER, INTENT(IN )    ::      kts,ktep1
5983       INTEGER, DIMENSION( NGPT,kts:ktep1 ),               &
5984                INTENT(IN   )  ::                     ITR
5986       REAL, DIMENSION( NGPT,kts:ktep1 ),                  &
5987             INTENT(IN   )     ::                   PFRAC
5989       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::      &
5990                                                    TAVEL
5991       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::      &
5992                                                  CLDFRAC, &
5993                                                 TAUCLOUD
5995       REAL, DIMENSION(   0:ktep1 ),INTENT(INOUT)::        &
5996                                                 TOTDFLUX, &
5997                                                 TOTUFLUX
5999       REAL, DIMENSION(   0:ktep1 ), INTENT(INOUT) ::        &
6000                                                      HTR  
6002       REAL, DIMENSION(   0:ktep1 ), INTENT(IN   ) ::      &
6003                                                       PZ, &
6004                                                       TZ
6005       INTEGER, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::   &
6006                                                  ICLDLYR
6008       REAL, INTENT(IN   )        ::               TBOUND
6009       REAL, DIMENSION(NBANDS), INTENT(IN   ) ::   SEMISS
6011 ! LOCAL VAR
6013       REAL, DIMENSION(   0:ktep1 )              ::        &
6014                                                 TOTUCLFL, &
6015                                                 TOTDCLFL
6017       REAL, DIMENSION(   0:ktep1 )              ::        &
6018                                                     FNET, &
6019                                                    FNETC, &
6020                                                     HTRC
6022       INTEGER :: kk
6023      
6024       REAL    :: CLRNTTOA,CLRNTSRF 
6026 ! Parameters                                                                     
6028 !     INTEGER, PARAMETER :: MXLAY=101                                                      
6029       REAL, PARAMETER :: SECANG=1.66                                                    
6030       REAL, PARAMETER :: WTNUM=0.5                                                      
6031                                                                                  
6032 ! RRTM Definitions                                                               
6033 ! Input                                                                          
6034 !    MXLAY                        ! Maximum number of model layers               
6035 !    NGPT                         ! Total number of g-point subintervals         
6036 !    NBANDS                       ! Number of longwave spectral bands            
6037 !    SECANG                       ! Diffusivity angle                            
6038 !    WTNUM                        ! Weight for radiance to flux conversion       
6039 !    NLAYERS                      ! Number of model layers (plev+1)              
6040 !    PAVEL(MXLAY)                 ! Layer pressures (mb)                         
6041 !    PZ(0:MXLAY)                  ! Level (interface) pressures (mb)             
6042 !    TAVEL(MXLAY)                 ! Layer temperatures (K)                       
6043 !    TZ(0:MXLAY)                  ! Level (interface) temperatures(mb)           
6044 !    TBOUND                       ! Surface temperature (K)                      
6045 !    CLDFRAC(MXLAY)               ! Layer cloud fraction                         
6046 !    TAUCLOUD(MXLAY)              ! Layer cloud optical depth                    
6047 !    ITR(NGPT,MXLAY)              ! Integer look-up table index                  
6048 !    PFRAC(NGPT,MXLAY)               ! Planck fractions                             
6049 !    ICLDLYR(MXLAY)               ! Flag for cloudy layers                       
6050 !    ICLD                         ! Flag for cloudy in column                    
6051 !    SEMISS(NBANDS)               ! Surface emissivities for each band           
6052 !    BPADE                        ! Pade constant                                
6053 !    TAU                          ! Clear sky optical depth look-up table        
6054 !    TF                           ! Tau transition function look-up table        
6055 !    TRANS                        ! Clear sky transmittance look-up table        
6056 ! Local                                                                          
6057 !    ABSS(NGPT*MXLAY)             ! Gaseous absorptivity                         
6058 !    ABSCLD(MXLAY)                ! Cloud absorptivity                           
6059 !    ATOT(NGPT*MXLAY)             ! Combined gaseous and cloud absorptivity      
6060 !    ODCLR(NGPT,MXLAY)            ! Clear sky (gaseous) optical depth            
6061 !    ODCLD(MXLAY)                 ! Cloud optical depth                          
6062 !    EFCLFRAC(MXLAY)              ! Effective cloud fraction                     
6063 !    RADLU(NGPT)                  ! Upward radiance                              
6064 !    URAD                         ! Spectrally summed upward radiance            
6065 !    RADCLRU(NGPT)                ! Clear sky upward radiance                    
6066 !    CLRURAD                      ! Spectrally summed clear sky upward radiance  
6067 !    RADLD(NGPT)                  ! Downward radiance                            
6068 !    DRAD                         ! Spectrally summed downward radiance          
6069 !    RADCLRD(NGPT)                ! Clear sky downward radiance                  
6070 !    CLRDRAD                      ! Spectrally summed clear sky downward radianc 
6071 ! Output                                                                         
6072 !    TOTUFLUX(0:MXLAY)            ! Upward longwave flux (W/m2)                  
6073 !    TOTDFLUX(0:MXLAY)            ! Downward longwave flux (W/m2)                
6074 !    FNET(0:MXLAY)                ! Net longwave flux (W/m2)                     
6075 !    HTR(0:MXLAY)                 ! Longwave heating rate (K/day)                
6076 !    CLRNTTOA                     ! Clear sky TOA outgoing flux (W/m2)           
6077 !    CLRNTSFC                     ! Clear sky net surface flux (W/m2)            
6078 !    TOTUCLFL(0:MXLAY)            ! Clear sky upward longwave flux (W/m2)        
6079 !    TOTDCLFL(0:MXLAY)            ! Clear sky downward longwave flux (W/m2)      
6080 !    FNETC(0:MXLAY)               ! Clear sky net longwave flux (W/m2)           
6081 !    HTRC(0:MXLAY)                ! Clear sky longwave heating rate (K/day)      
6082 !                                                                                
6083                                                                                  
6084 ! This compiler directive was added to insure private common block storage       
6085 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
6086 ! carry constants.                                                               
6088       DIMENSION BBU(NGPT*(ktep1-kts+1)),BBUTOT(NGPT*(ktep1-kts)),BGLEV(NGPT)                   
6089       DIMENSION PLANKBND(NBANDS),PLNKEMIT(NBANDS)                                
6090       DIMENSION PLVL(NBANDS,0:ktep1),PLAY(NBANDS,kts:ktep1)                          
6091       DIMENSION INDLAY(kts:ktep1),INDLEV(0:ktep1)                                    
6092       DIMENSION TLAYFRAC(kts:ktep1),TLEVFRAC(0:ktep1)                                
6093       DIMENSION ABSS(NGPT*(ktep1-kts+1)),ABSCLD(kts:ktep1-1),ATOT(NGPT*(ktep1-kts)) 
6094       DIMENSION ODCLR(NGPT,kts:ktep1-1),ODCLD(kts:ktep1-1),EFCLFRAC(kts:ktep1-1)
6095       DIMENSION RADLU(NGPT),RADLD(NGPT)                                          
6096       DIMENSION RADCLRU(NGPT),RADCLRD(NGPT)                                      
6097       DIMENSION SEMIS(NGPT),RADUEMIT(NGPT)                                       
6098                                                                                  
6099       INDBOUND = TBOUND - 159.                                                   
6100       TBNDFRAC = TBOUND - INT(TBOUND)                                            
6101                                                                                  
6102       DO 200 LAY = 0, NLAYERS                                                    
6103          TOTUFLUX(LAY) = 0.0                                                     
6104          TOTDFLUX(LAY) = 0.0                                                     
6105          TOTUCLFL(LAY) = 0.0                                                     
6106          TOTDCLFL(LAY) = 0.0                                                     
6107          INDLEV(LAY) = TZ(LAY) - 159.                                            
6108          TLEVFRAC(LAY) = TZ(LAY) - INT(TZ(LAY))                                  
6109  200  CONTINUE                                                                   
6110                                                                                  
6111       DO 220 LEV = 1, NLAYERS                                                    
6112                                                                                  
6113          IF (ICLDLYR(LEV).EQ.1) THEN                                             
6114             INDLAY(LEV) = TAVEL(LEV) - 159.                                      
6115             TLAYFRAC(LEV) = TAVEL(LEV) - INT(TAVEL(LEV))                         
6116 !  Cloudy sky optical depth and absorptivity.                                    
6117             ODCLD(LEV) = SECANG * TAUCLOUD(LEV)                                  
6118             TRANSCLD = EXP(-ODCLD(LEV))                                          
6119             ABSCLD(LEV) = 1. - TRANSCLD                                          
6120             EFCLFRAC(LEV) = ABSCLD(LEV) * CLDFRAC(LEV)                           
6121 !  Get clear sky optical depth from TAU lookup table                             
6122             DO 250 IPR = 1, NGPT                                                 
6123                IND = ITR(IPR,LEV)                                                
6124                ODCLR(IPR,LEV) = TAU(IND)                                         
6125  250        CONTINUE                                                             
6126          ELSE                                                                    
6127             INDLAY(LEV) = TAVEL(LEV) - 159.                                      
6128             TLAYFRAC(LEV) = TAVEL(LEV) - INT(TAVEL(LEV))                         
6129          ENDIF                                                                   
6130                                                                                  
6131  220  CONTINUE                                                                   
6132                                                                                  
6133 !      SUMPL   = 0.0                                                             
6134 !      SUMPLEM = 0.0                                                             
6135 ! *** Loop over frequency bands.                                                 
6136       DO 600 IBAND = 1, NBANDS                                                   
6137          DBDTLEV = TOTPLNK(INDBOUND+1,IBAND)-TOTPLNK(INDBOUND,IBAND)             
6138          PLANKBND(IBAND) = DELWAVE(IBAND) * (TOTPLNK(INDBOUND,IBAND) +  &
6139               TBNDFRAC * DBDTLEV)                                                
6140          DBDTLEV = TOTPLNK(INDLEV(0)+1,IBAND) -                         &        
6141               TOTPLNK(INDLEV(0),IBAND)                                           
6142          PLVL(IBAND,0) = DELWAVE(IBAND) * (TOTPLNK(INDLEV(0),IBAND) +   &        
6143               TLEVFRAC(0)*DBDTLEV)                                               
6144                                                                                  
6145          PLNKEMIT(IBAND) = SEMISS(IBAND) * PLANKBND(IBAND)                       
6146 !         SUMPLEM  = SUMPLEM + PLNKEMIT(IBAND)                                   
6147 !         SUMPL    = SUMPL   + PLANKBND(IBAND)                                   
6148                                                                                  
6149          DO 300 LEV = 1, NLAYERS                                                 
6150 !     Calculate the integrated Planck functions at the level and                 
6151 !     layer temperatures.                                                        
6152             DBDTLEV = TOTPLNK(INDLEV(LEV)+1,IBAND) -          &
6153                  TOTPLNK(INDLEV(LEV),IBAND)                                      
6154             DBDTLAY = TOTPLNK(INDLAY(LEV)+1,IBAND) -          &                  
6155                  TOTPLNK(INDLAY(LEV),IBAND)                                      
6156             PLAY(IBAND,LEV) = DELWAVE(IBAND) *                &                  
6157                  (TOTPLNK(INDLAY(LEV),IBAND) + TLAYFRAC(LEV) * DBDTLAY)          
6158             PLVL(IBAND,LEV) = DELWAVE(IBAND) *                &                  
6159                  (TOTPLNK(INDLEV(LEV),IBAND) + TLEVFRAC(LEV) * DBDTLEV)          
6160  300     CONTINUE                                                                
6161  600  CONTINUE                                                                   
6162                                                                                  
6163 !      SEMISLW = SUMPLEM / SUMPL                                                 
6164                                                                                  
6165 ! *** Initialize for radiative transfer.                                         
6166       DO 500 IPR = 1, NGPT                                                       
6167          RADCLRD(IPR) = 0.                                                       
6168          RADLD(IPR) = 0.                                                         
6169          SEMIS(IPR) = SEMISS(NGB(IPR))                                           
6170          RADUEMIT(IPR) = PFRAC(IPR,1) * PLNKEMIT(NGB(IPR))                          
6171          BGLEV(IPR) = PFRAC(IPR,NLAYERS) * PLVL(NGB(IPR),NLAYERS)                   
6172  500  CONTINUE                                                                   
6173                                                                                  
6174                                                                                  
6175 ! *** DOWNWARD RADIATIVE TRANSFER                                                
6176 ! *** DRAD holds summed radiance for total sky stream                            
6177 ! *** CLRDRAD holds summed radiance for clear sky stream                         
6178                                                                                  
6179       ICLDDN = 0                                                                 
6180       DO 3000 LEV = NLAYERS, 1, -1                                               
6181          DRAD = 0.0                                                              
6182          CLRDRAD = 0.0                                                           
6183                                                                                  
6184          IF (ICLDLYR(LEV).EQ.1) THEN                                             
6185                                                                                  
6186 ! *** Cloudy layer                                                               
6187          ICLDDN = 1                                                              
6188          IENT = NGPT * (LEV-1)                                                   
6189          DO 2000 IPR = 1, NGPT                                                   
6190             INDEX = IENT + IPR                                                   
6191 !     Get lookup table index                                                     
6192             IND = ITR(IPR,LEV)                                                   
6193 !     Add clear sky and cloud optical depths                                     
6194             ODSM = ODCLR(IPR,LEV) + ODCLD(LEV)                                   
6195             FACTOT = ODSM / (BPADE + ODSM)                                       
6196             BGLAY = PFRAC(IPR,LEV) * PLAY(NGB(IPR),LEV)                             
6197             DELBGUP = BGLEV(IPR) - BGLAY                                         
6198 !     Get TF from lookup table                                                   
6199             TAUF = TF(IND)                                                       
6200             BBU(INDEX) = BGLAY + TAUF * DELBGUP                                  
6201             BBUTOT(INDEX) = BGLAY + FACTOT * DELBGUP                             
6202             BGLEV(IPR) = PFRAC(IPR,LEV) * PLVL(NGB(IPR),LEV-1)                      
6203             DELBGDN = BGLEV(IPR) - BGLAY                                         
6204             BBD = BGLAY + TAUF * DELBGDN                                         
6205             BBDLEVD = BGLAY + FACTOT * DELBGDN                                   
6206 !     Get clear sky transmittance from lookup table                              
6207             ABSS(INDEX) = 1. - TRANS(IND)                                        
6208             ATOT(INDEX) = ABSS(INDEX) + ABSCLD(LEV) -      &
6209                 ABSS(INDEX) * ABSCLD(LEV)                                        
6210             GASSRC = BBD * ABSS(INDEX)                                           
6211 !     Total sky radiance                                                         
6212             RADLD(IPR) = RADLD(IPR) - RADLD(IPR) * (ABSS(INDEX) +  &             
6213                EFCLFRAC(LEV) * (1.-ABSS(INDEX))) + GASSRC +        &             
6214                CLDFRAC(LEV) * (BBDLEVD * ATOT(INDEX) - GASSRC)                   
6215             DRAD = DRAD + RADLD(IPR)                                             
6216 !     Clear sky radiance                                                         
6217             RADCLRD(IPR) = RADCLRD(IPR) + (BBD - RADCLRD(IPR))     & 
6218                          * ABSS(INDEX)                                           
6219             CLRDRAD = CLRDRAD + RADCLRD(IPR)                                     
6220  2000    CONTINUE                                                                
6221                                                                                  
6222          ELSE                                                                    
6223                                                                                  
6224 ! *** Clear layer                                                                
6225          IENT = NGPT * (LEV-1)                                                   
6226          DO 2100 IPR = 1, NGPT                                                   
6227             INDEX = IENT + IPR                                                   
6228             IND = ITR(IPR,LEV)                                                   
6229             BGLAY = PFRAC(IPR,LEV) * PLAY(NGB(IPR),LEV)                             
6230             DELBGUP = BGLEV(IPR) - BGLAY                                         
6231 !     Get TF from lookup table                                                   
6232             TAUF = TF(IND)                                                       
6233             BBU(INDEX) = BGLAY + TAUF * DELBGUP                                  
6234             BGLEV(IPR) = PFRAC(IPR,LEV) * PLVL(NGB(IPR),LEV-1)                      
6235             DELBGDN = BGLEV(IPR) - BGLAY                                         
6236             BBD = BGLAY + TAUF * DELBGDN                                         
6237 !     Get clear sky transmittance from lookup table                              
6238             ABSS(INDEX) = 1. - TRANS(IND)                                        
6239 !     Total sky radiance                                                         
6240             RADLD(IPR) = RADLD(IPR) + (BBD - RADLD(IPR)) *     & 
6241                          ABSS(INDEX)                                             
6242             DRAD = DRAD + RADLD(IPR)                                             
6243  2100    CONTINUE                                                                
6244 !     Set clear sky stream to total sky stream as long as layers                 
6245 !     remain clear.  Streams diverge when a cloud is reached.                    
6246             IF (ICLDDN.EQ.1) THEN                                                
6247          DO 2200 IPR = 1, NGPT                                                   
6248                RADCLRD(IPR) = RADCLRD(IPR) + (BBD - RADCLRD(IPR)) *   & 
6249                               ABSS(INDEX)                                        
6250                CLRDRAD = CLRDRAD + RADCLRD(IPR)                                  
6251  2200    CONTINUE                                                                
6252             ELSE                                                                 
6253          DO 2300 IPR = 1, NGPT                                                   
6254                RADCLRD(IPR) = RADLD(IPR)                                         
6255                CLRDRAD = DRAD                                                    
6256  2300    CONTINUE                                                                
6257             ENDIF                                                                
6258                                                                                  
6259 ! 2100    CONTINUE                                                               
6260                                                                                  
6261          ENDIF                                                                   
6262                                                                                  
6263          TOTDFLUX(LEV-1) = DRAD * WTNUM                                          
6264          TOTDCLFL(LEV-1) = CLRDRAD * WTNUM                                       
6265                                                                                  
6266  3000 CONTINUE                                                                   
6267                                                                                  
6268                                                                                  
6269 ! SPECTRAL EMISSIVITY & REFLECTANCE                                              
6270 ! Include the contribution of spectrally varying longwave emissivity and         
6271 ! reflection from the surface to the upward radiative transfer.                  
6272 ! Note: Spectral and Lambertian reflection are identical for the one angle       
6273 ! flux integration used here.                                                    
6274                                                                                  
6275       URAD = 0.0                                                                 
6276       CLRURAD = 0.0                                                              
6277       DO 3500 IPR = 1, NGPT                                                      
6278 !     Total sky radiance                                                         
6279          RADLU(IPR) = RADUEMIT(IPR) + (1. - SEMIS(IPR)) * RADLD(IPR)             
6280          URAD = URAD + RADLU(IPR)                                                
6281 !     Clear sky radiance                                                         
6282          RADCLRU(IPR) = RADUEMIT(IPR) + (1. - SEMIS(IPR))  & 
6283                         * RADCLRD(IPR)                                           
6284          CLRURAD = CLRURAD + RADCLRU(IPR)                                        
6285  3500 CONTINUE                                                                   
6286       TOTUFLUX(0) = URAD * WTNUM                                                 
6287       TOTUCLFL(0) = CLRURAD * WTNUM                                              
6288                                                                                  
6289                                                                                  
6290 ! *** UPWARD RADIATIVE TRANSFER                                                  
6291 ! *** URAD holds the summed radiance for total sky stream                        
6292 ! *** CLRURAD holds the summed radiance for clear sky stream                     
6293                                                                                  
6294       DO 5000 LEV = 1, NLAYERS                                                   
6295          URAD = 0.0                                                              
6296          CLRURAD = 0.0                                                           
6297                                                                                  
6298 ! Check flag for cloud in current layer                                          
6299                                                                                  
6300          IF (ICLDLYR(LEV).EQ.1) THEN                                             
6301                                                                                  
6302 ! *** Cloudy layers                                                              
6303          IENT = NGPT * (LEV-1)                                                   
6304          DO 4000 IPR = 1, NGPT                                                   
6305             INDEX = IENT + IPR                                                   
6306             GASSRC = BBU(INDEX) * ABSS(INDEX)                                    
6307 !     Total sky radiance                                                         
6308             RADLU(IPR) = RADLU(IPR) - RADLU(IPR) * (ABSS(INDEX) +    &           
6309                EFCLFRAC(LEV) * (1.-ABSS(INDEX))) + GASSRC +          &
6310                CLDFRAC(LEV) * (BBUTOT(INDEX) * ATOT(INDEX) - GASSRC)             
6311             URAD = URAD + RADLU(IPR)                                             
6312 !     Clear sky radiance                                                         
6313             RADCLRU(IPR) = RADCLRU(IPR) + (BBU(INDEX) - RADCLRU(IPR)) * &        
6314                            ABSS(INDEX)                                           
6315             CLRURAD = CLRURAD + RADCLRU(IPR)                                     
6316  4000    CONTINUE                                                                
6317                                                                                  
6318          ELSE                                                                    
6319                                                                                  
6320 ! *** Clear layer                                                                
6321          IENT = NGPT * (LEV-1)                                                   
6322          DO 4100 IPR = 1, NGPT                                                   
6323             INDEX = IENT + IPR                                                   
6324 !     Total sky radiance                                                         
6325             RADLU(IPR) = RADLU(IPR) + (BBU(INDEX)-RADLU(IPR)) *  & 
6326                          ABSS(INDEX)                                             
6327             URAD = URAD + RADLU(IPR)                                             
6328 !     Clear sky radiance                                                         
6329 !     Upward clear and total sky streams must remain separate because surface    
6330 !     reflectance is different for each.                                         
6331             RADCLRU(IPR) = RADCLRU(IPR) + (BBU(INDEX) - RADCLRU(IPR))   &         
6332                            * ABSS(INDEX)                                         
6333             CLRURAD = CLRURAD + RADCLRU(IPR)                                     
6334  4100    CONTINUE                                                                
6335                                                                                  
6336          ENDIF                                                                   
6337                                                                                  
6338          TOTUFLUX(LEV) = URAD * WTNUM                                            
6339          TOTUCLFL(LEV) = CLRURAD * WTNUM                                         
6340                                                                                  
6341  5000 CONTINUE                                                                   
6342                                                                                  
6343                                                                                  
6344 ! *** Convert radiances to fluxes and heating rates for total sky.  Calculates   
6345 !     clear sky surface and TOA values.  To compute clear sky profiles, uncommen 
6346 !     relevant lines below.                                                      
6347       TOTUFLUX(0) = TOTUFLUX(0) * FLUXFAC                                        
6348       TOTDFLUX(0) = TOTDFLUX(0) * FLUXFAC                                        
6349       FNET(0) = TOTUFLUX(0) - TOTDFLUX(0)                                        
6350       TOTUCLFL(0) = TOTUCLFL(0) * FLUXFAC                                        
6351       TOTDCLFL(0) = TOTDCLFL(0) * FLUXFAC                                        
6352       FNETC(0) = TOTUCLFL(0) - TOTDCLFL(0)                                       
6353       CLRNTTOA = TOTUCLFL(NLAYERS)                                               
6354       CLRNTSRF = TOTUFLUX(0) - TOTDCLFL(0)                                       
6355                                                                                  
6356       DO 7000 LEV = 1, NLAYERS                                                   
6357          TOTUFLUX(LEV) = TOTUFLUX(LEV) * FLUXFAC                                 
6358          TOTDFLUX(LEV) = TOTDFLUX(LEV) * FLUXFAC                                 
6359          FNET(LEV) = TOTUFLUX(LEV) - TOTDFLUX(LEV)                               
6360          TOTUCLFL(LEV) = TOTUCLFL(LEV) * FLUXFAC                                 
6361          TOTDCLFL(LEV) = TOTDCLFL(LEV) * FLUXFAC                                 
6362          FNETC(LEV) = TOTUCLFL(LEV) - TOTDCLFL(LEV)                              
6363          L = LEV - 1                                                             
6364 !     Calculate Heating Rates.                                                   
6365          HTR(L) = HEATFAC * (FNET(L) - FNET(LEV)) / (PZ(L) - PZ(LEV))            
6366          HTRC(L) = HEATFAC * (FNETC(L) - FNETC(LEV)) / (PZ(L) - PZ(LEV))         
6367  7000 CONTINUE                                                                   
6368       HTR(NLAYERS) = 0.0                                                         
6369       HTRC(NLAYERS) = 0.0                                                        
6370                                                                                  
6372       END  SUBROUTINE RTRN
6374 !---------------------------------------------------------------------------
6375       SUBROUTINE GASABS(kts,ktep1,                                         &
6376                         COLDRY,COLH2O,COLCO2,COLO3,COLN2O,COLCH4,          &
6377                         COLO2,CO2MULT,                                     &
6378                         FAC00,FAC01,FAC10,FAC11,                           &
6379                         FORFAC,SELFFAC,SELFFRAC,                           &
6380                         JP,JT,JT1,INDSELF,ITR,WX,PFRAC,TAUG,               &
6381                         LAYTROP,LAYSWTCH,LAYLOW                            )
6382 !---------------------------------------------------------------------------
6383 !  RRTM Longwave Radiative Transfer Model                                        
6384 !  Atmospheric and Environmental Research, Inc., Cambridge, MA                   
6385 !                                                                                
6386 !  Original version:       E. J. Mlawer, et al.                                  
6387 !  Revision for NCAR CCM:  Michael J. Iacono; September, 1998                    
6388 !                                                                                
6389 !  This routine calculates the gaseous optical depths for all 16 longwave        
6390 !  spectral bands.  The optical depths are used to define the Pade               
6391 !  approximation to the function of tau transition from tranparancy to           
6392 !  opacity.  This function, which varies from 0 to 1, is converted to an         
6393 !  integer that will serve as an index for the lookup tables of tau              
6394 !  transition function and transmittance used in the radiative transfer.         
6395 !  These lookup tables are created on initialization in routine RRTMINIT.        
6396 !---------------------------------------------------------------------------
6397 !                                                                                
6398 ! Definitions                                                                    
6399 !    NGPT                         ! Total number of g-point subintervals         
6400 !    MXLAY                        ! Maximum number of model layers               
6401 !    SECANG                       ! Diffusivity angle for flux computation       
6402 !    TAU(NGPT,MXLAY)              ! Gaseous optical depths                       
6403 !    NLAYERS                      ! Number of model layers used in RRTM          
6404 !    PAVEL(MXLAY)                 ! Model layer pressures (mb)                   
6405 !    PZ(0:MXLAY)                  ! Model level (interface) pressures (mb)       
6406 !    TAVEL(MXLAY)                 ! Model layer temperatures (K)                 
6407 !    TZ(0:MXLAY)                  ! Model level (interface) temperatures (K)     
6408 !    TBOUND                       ! Surface temperature (K)                      
6409 !    BPADE                        ! Pade approximation constant (=1./0.278)      
6410 !    ITR(NGPT,MXLAY)              ! Integer lookup table index                   
6411 !                                                                                
6412 ! Parameters                              
6414       IMPLICIT NONE
6415                                        
6416       REAL, PARAMETER :: SECANG=1.66                                                    
6418       INTEGER, INTENT(IN )   ::  kts,ktep1
6419       INTEGER, INTENT(IN )   ::  LAYTROP,LAYSWTCH,LAYLOW
6421       REAL, DIMENSION( NGPT,kts:ktep1 ),                  &
6422             INTENT(INOUT)        ::                PFRAC
6424       REAL, DIMENSION( NGPT,kts:ktep1 ),                  &
6425             INTENT(INOUT)        ::                 TAUG
6427       REAL, DIMENSION( MAXXSEC,kts:ktep1 ),               &
6428             INTENT(IN   )        ::                   WX
6430       INTEGER, DIMENSION( NGPT,kts:ktep1 ),               &
6431                INTENT(INOUT)  ::                     ITR
6433       REAL, DIMENSION( kts:ktep1 ), INTENT(IN   ) ::      &
6434                                                   COLDRY, &  
6435                                                   COLH2O, &
6436                                                   COLCO2, &
6437                                                    COLO3, &
6438                                                   COLN2O, &
6439                                                   COLCH4, &
6440                                                    COLO2, &
6441                                                  CO2MULT, &
6442                                                    FAC00, &
6443                                                    FAC01, &
6444                                                    FAC10, &
6445                                                    FAC11, &
6446                                                   FORFAC, &
6447                                                  SELFFAC, &
6448                                                 SELFFRAC
6450       INTEGER, DIMENSION( kts:ktep1 ), INTENT(INOUT) ::   &
6451                                                       JP, &
6452                                                       JT, &
6453                                                      JT1, &
6454                                                  INDSELF
6456       INTEGER :: lay,ipr
6457       REAL    :: odepth,tff
6459 ! This compiler directive was added to insure private common block storage       
6460 ! in multi-tasked mode on a CRAY or SGI for all commons except those that        
6461 ! carry constants.                                                               
6462                                                                                  
6463 ! **************************************************************************     
6465 !  Calculate optical depth for each band                                         
6466      
6467       CALL TAUGB1(kts,ktep1,COLH2O,FAC00,FAC01,FAC10,FAC11,              &
6468                   FORFAC,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,  &
6469                   LAYTROP)
6470       CALL TAUGB2(kts,ktep1,COLDRY,COLH2O,FAC00,FAC01,FAC10,FAC11,       &
6471                   FORFAC,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,  &
6472                   LAYTROP)
6473       CALL TAUGB3(kts,ktep1,COLH2O,COLCO2,COLN2O,FAC00,FAC01,FAC10,FAC11,&
6474                   FORFAC,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,  &
6475                   LAYTROP)
6476       CALL TAUGB4(kts,ktep1,COLH2O,COLCO2,COLO3,FAC00,FAC01,FAC10,FAC11, &
6477                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6478                   LAYTROP)
6479       CALL TAUGB5(kts,ktep1,COLH2O,COLCO2,COLO3,FAC00,FAC01,FAC10,FAC11, &
6480                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,WX,PFRAC,TAUG,      &
6481                   LAYTROP)
6482       CALL TAUGB6(kts,ktep1,COLH2O,CO2MULT,FAC00,FAC01,FAC10,FAC11,      &
6483                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,WX,PFRAC,TAUG,      &
6484                   LAYTROP)
6485       CALL TAUGB7(kts,ktep1,COLH2O,COLO3,CO2MULT,FAC00,FAC01,FAC10,FAC11,&
6486                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6487                   LAYTROP)
6488       CALL TAUGB8(kts,ktep1,COLH2O,COLO3,COLN2O,CO2MULT,FAC00,FAC01,FAC10,&
6489                   FAC11,SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,WX,PFRAC,TAUG,&
6490                   LAYSWTCH)
6491       CALL TAUGB9(kts,ktep1,COLH2O,COLN2O,COLCH4,FAC00,FAC01,FAC10,FAC11,&
6492                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6493                   LAYTROP,LAYSWTCH,LAYLOW)
6494       CALL TAUGB10(kts,ktep1,COLH2O,FAC00,FAC01,FAC10,FAC11,JP,JT,JT1,&
6495                   PFRAC,TAUG,LAYTROP)
6496       CALL TAUGB11(kts,ktep1,COLH2O,FAC00,FAC01,FAC10,FAC11,             &
6497                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6498                   LAYTROP)
6499       CALL TAUGB12(kts,ktep1,COLH2O,COLCO2,FAC00,FAC01,FAC10,FAC11,      &
6500                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6501                   LAYTROP)
6502       CALL TAUGB13(kts,ktep1,COLH2O,COLN2O,FAC00,FAC01,FAC10,FAC11,      &
6503                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6504                   LAYTROP)
6505       CALL TAUGB14(kts,ktep1,COLCO2,FAC00,FAC01,FAC10,FAC11,             &
6506                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6507                   LAYTROP)
6508       CALL TAUGB15(kts,ktep1,COLH2O,COLCO2,COLN2O,FAC00,FAC01,FAC10,FAC11,&
6509                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6510                   LAYTROP)
6511       CALL TAUGB16(kts,ktep1,COLH2O,COLCH4,FAC00,FAC01,FAC10,FAC11,      &
6512                   SELFFAC,SELFFRAC,JP,JT,JT1,INDSELF,PFRAC,TAUG,         &
6513                   LAYTROP)
6514                                                                                  
6515 !  Compute the lookup table index from the Pade approximation of the             
6516 !  tau transition function, which is derived from the optical depth.             
6517                                                                                  
6518       DO 6000 LAY = 1, NLAYERS                                                   
6519          DO 5000 IPR = 1, NGPT                                                   
6520             ODEPTH = SECANG * TAUG(IPR,LAY)                                       
6521             TFF = ODEPTH/(BPADE+ODEPTH)                                           
6522             IF (ODEPTH.LE.0.) TFF=0.                                              
6523             ITR(IPR,LAY) = INT(5.E3*TFF+0.5)
6524  5000    CONTINUE                                                                
6525  6000 CONTINUE                                                                   
6526       
6527    END SUBROUTINE GASABS
6529 !====================================================================
6530    SUBROUTINE rrtminit(                                             &
6531                        allowed_to_read ,                            &
6532                        ids, ide, jds, jde, kds, kde,                &
6533                        ims, ime, jms, jme, kms, kme,                &
6534                        its, ite, jts, jte, kts, kte                 )
6535 !--------------------------------------------------------------------
6536    IMPLICIT NONE
6537 !--------------------------------------------------------------------
6539    LOGICAL , INTENT(IN)           :: allowed_to_read
6540    INTEGER , INTENT(IN)           :: ids, ide, jds, jde, kds, kde,  &
6541                                      ims, ime, jms, jme, kms, kme,  &
6542                                      its, ite, jts, jte, kts, kte
6544    REAL :: pi
6546    PI = 2.*ASIN(1.) 
6547    FLUXFAC  = PI   * 2.D4                     
6548    NLAYERS = kme
6550    IF ( allowed_to_read ) THEN
6551      CALL rrtm_lookuptable
6552    ENDIF
6554    END SUBROUTINE rrtminit
6557 ! **************************************************************************     
6558       SUBROUTINE rrtm_lookuptable
6559 ! **************************************************************************     
6561 USE module_wrf_error
6562 USE module_dm
6563 IMPLICIT NONE
6565 !  RRTM Longwave Radiative Transfer Model                                        
6566 !  Atmospheric and Environmental Research, Inc., Cambridge, MA                   
6567 !                                                                                
6568 !  Original version:       Michael J. Iacono; July, 1998                         
6569 !  Revision for NCAR CCM:  Michael J. Iacono; September, 1998                    
6570 !                                                                                
6571 !  This subroutine performs calculations necessary for the initialization        
6572 !  of the LW model, RRTM.  Lookup tables are computed for use in the LW          
6573 !  radiative transfer, and input absorption coefficient data for each            
6574 !  spectral band are reduced from 256 g-points to 140 for use in RRTM.           
6575 ! **************************************************************************     
6576                                                                                  
6577 ! Definitions                                                                    
6578 !     Arrays for 5000-point look-up tables:                                      
6579 !     TAU     Clear-sky optical depth (used in cloudy radiative transfer)        
6580 !     TF      Tau transition function; i.e. the transition of the Planck         
6581 !             function from that for the mean layer temperature to that for      
6582 !             the layer boundary temperature as a function of optical depth.     
6583 !             The "linear in tau" method is used to make the table.              
6584 !     TRANS   Transmittance                                                      
6585 !     BPADE   Inverse of the Pade approximation constant (= 1./0.278)            
6587 ! Local                                    
6588       INTEGER :: i,itre,igcsm,ibnd,igc,ind,ig,ipr,iprsm
6589       REAL :: tfn,fp,rtfp,wtsum                                        
6590       LOGICAL                 :: opened
6591       LOGICAL , EXTERNAL      :: wrf_dm_on_monitor
6593       REAL :: WTSM(MG)                       
6594       CHARACTER*80 errmess
6595       INTEGER rrtm_unit
6597       IF ( wrf_dm_on_monitor() ) THEN
6598         DO i = 10,99
6599           INQUIRE ( i , OPENED = opened )
6600           IF ( .NOT. opened ) THEN
6601             rrtm_unit = i
6602             GOTO 2010
6603           ENDIF
6604         ENDDO
6605         rrtm_unit = -1
6606  2010   CONTINUE
6607       ENDIF
6608       CALL wrf_dm_bcast_bytes ( rrtm_unit , IWORDSIZE )
6609       IF ( rrtm_unit < 0 ) THEN
6610         CALL wrf_error_fatal ( 'module_ra_rrtm: rrtm_lookuptable: Can not '// &
6611                                'find unused fortran unit to read in lookup table.' )
6612       ENDIF
6614 ! start data 1
6616 ! **************************************************************************     
6617 !  RRTM Longwave Radiative Transfer Model                                        
6618 !  Atmospheric and Environmental Research, Inc., Cambridge, MA                   
6619 !                                                                                
6620 !  Original version:       E. J. Mlawer, et al.                                  
6621 !  Revision for NCAR CCM:  Michael J. Iacono; September, 1998                    
6622 !                                                                                
6623 !  This routine contains 16 READ statements that include the                
6624 !  absorption coefficients and other data for each of the 16 longwave            
6625 !  spectral bands used in RRTM.  Here, the data are defined for 16               
6626 !  g-points, or sub-intervals, per band.  These data are combined and            
6627 !  weighted using a mapping procedure in routine RRTMINIT to reduce              
6628 !  the total number of g-points from 256 to 140 for use in the CCM.              
6629 ! **************************************************************************     
6630         IF ( wrf_dm_on_monitor() ) THEN
6631           OPEN(rrtm_unit,FILE='RRTM_DATA',                  &
6632                FORM='UNFORMATTED',STATUS='OLD',ERR=9009)
6633         ENDIF
6634                                                                                  
6635 !     The array abscoefL1 contains absorption coefs at the 16 chosen g-values   
6636 !     for a range of pressure levels > ~100mb and temperatures.  The first       
6637 !     index in the array, JT, which runs from 1 to 5, corresponds to     
6638 !     different temperatures.  More specifically, JT = 3 means that the          
6639 !     data are for the corresponding TREF for this  pressure level,              
6640 !     JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30,            
6641 !     JT = 4 is for TREF+15, and JT = 5 is for TREF+30.  The second              
6642 !     index, JP, runs from 1 to 13 and refers to the corresponding               
6643 !     pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).      
6644 !     The third index, IG, goes from 1 to 16, and tells us which                 
6645 !     g-interval the absorption coefficients are for.                            
6648                                                                                  
6649 !     The array abscoefH1 contains absorption coefs at the 16 chosen g-values           
6650 !     for a range of pressure levels < ~100mb and temperatures. The first        
6651 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6652 !     different temperatures.  More specifically, JT = 3 means that the          
6653 !     data are for the reference temperature TREF for this pressure              
6654 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
6655 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
6656 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
6657 !     reference pressure level (see taumol.f for the value of these              
6658 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
6659 !     and tells us which g-interval the absorption coefficients are for.         
6661                                                                                  
6662 !     The array SELFREF1 contains the coefficient of the water vapor              
6663 !     self-continuum (including the energy term).  The first index               
6664 !     refers to temperature in 7.2 degree increments.  For instance, &          
6665 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
6666 !     etc.  The second index runs over the g-channel (1 to 16).                  
6668 #define DM_BCAST_MACRO(A) CALL wrf_dm_bcast_bytes ( A , size ( A ) * RWORDSIZE )
6670          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL1, abscoefH1, SELFREF1
6671          DM_BCAST_MACRO(abscoefL1)
6672          DM_BCAST_MACRO(abscoefH1)
6673          DM_BCAST_MACRO(SELFREF1)
6675 ! **************************************************************************     
6676 !     The array abscoefL2 contains absorption coefs at the 16 chosen g-values 
6677 !     for a range of pressure levels > ~100mb and temperatures.  The first       
6678 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6679 !     different temperatures.  More specifically, JT = 3 means that the          
6680 !     data are for the corresponding TREF for this  pressure level, &           
6681 !     JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30, &         
6682 !     JT = 4 is for TREF+15, and JT = 5 is for TREF+30.  The second              
6683 !     index, JP, runs from 1 to 13 and refers to the corresponding               
6684 !     pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).      
6685 !     The third index, IG, goes from 1 to 16, and tells us which                 
6686 !     g-interval the absorption coefficients are for.                            
6688                                                                                  
6689 !     The array abscoefH2 contains absorption coefs at the 16 chosen g-values           
6690 !     for a range of pressure levels < ~100mb and temperatures. The first        
6691 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6692 !     different temperatures.  More specifically, JT = 3 means that the          
6693 !     data are for the reference temperature TREF for this pressure              
6694 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
6695 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
6696 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
6697 !     reference pressure level (see taumol.f for the value of these              
6698 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
6699 !     and tells us which g-interval the absorption coefficients are for.         
6701                                                                                  
6702 !     The array SELFREF2 contains the coefficient of the water vapor              
6703 !     self-continuum (including the energy term).  The first index               
6704 !     refers to temperature in 7.2 degree increments.  For instance, &          
6705 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
6706 !     etc.  The second index runs over the g-channel (1 to 16).                  
6708          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL2, abscoefH2, SELFREF2
6709          DM_BCAST_MACRO(abscoefL2)
6710          DM_BCAST_MACRO(abscoefH2)
6711          DM_BCAST_MACRO(SELFREF2)
6712                                                                                  
6713 ! **************************************************************************     
6715 !     The array abscoefL3 contains absorption coefs for each of the 16 g-intervals   
6716 !     for a range of pressure levels > ~100mb, temperatures, and ratios          
6717 !     of water vapor to CO2.  The first index in the array, JS, runs             
6718 !     from 1 to 10, and corresponds to different water vapor to CO2 ratios, &   
6719 !     as expressed through the binary species parameter eta, defined as          
6720 !     eta = h2o/(h20 + (rat) * co2), where rat is the ratio of the integrated    
6721 !     line strength in the band of co2 to that of h2o.  For instance, &         
6722 !     JS=1 refers to dry air (eta = 0), JS = 10 corresponds to eta = 1.0.        
6723 !     The 2nd index in the array, JT, which runs from 1 to 5, corresponds        
6724 !     to different temperatures.  More specifically, JT = 3 means that the       
6725 !     data are for the reference temperature TREF for this  pressure             
6726 !     level, JT = 2 refers to the temperature                                    
6727 !     TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5          
6728 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
6729 !     to the reference pressure level (e.g. JP = 1 is for a                      
6730 !     pressure of 1053.63 mb).  The fourth index, IG, goes from 1 to 16, &      
6731 !     and tells us which g-interval the absorption coefficients are for.         
6733                                                                                  
6734 !     The array abscoefH3 contains absorption coefs for each of the 16 g-intervals      
6735 !     for a range of pressure levels  < ~100mb, temperatures, and ratios         
6736 !     of H2O to CO2.  The first index in the array, JS, runs from 1 to 5, &     
6737 !     and corresponds to different H2O to CO2 ratios, as expressed through       
6738 !     the binary species parameter eta, defined as eta = H2O/(H2O+RAT*CO2), &   
6739 !     where RAT is the ratio of the integrated line strength in the band         
6740 !     of CO2 to that of H2O.  For instance, JS=1 refers to no H2O, &            
6741 !     JS = 2 corresponds to eta = 0.25, etc.  The second index, JT, which        
6742 !     runs from 1 to 5, corresponds to different temperatures.  More             
6743 !     specifically, JT = 3 means that the data are for the corresponding         
6744 !     reference temperature TREF for this  pressure level, JT = 2 refers         
6745 !     to the TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and          
6746 !     JT = 5 is for TREF+30.  The third index, JP, runs from 13 to 59 and        
6747 !     refers to the corresponding pressure level in PREF (e.g. JP = 13 is        
6748 !     for a pressure of 95.5835 mb).  The fourth index, IG, goes from 1 to       
6749 !     16, and tells us which g-interval the absorption coefficients are for.     
6751                                                                                  
6752 !     The array SELFREF3 contains the coefficient of the water vapor              
6753 !     self-continuum (including the energy term).  The first index               
6754 !     refers to temperature in 7.2 degree increments.  For instance, &          
6755 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
6756 !     etc.  The second index runs over the g-channel (1 to 16).                  
6758          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL3, abscoefH3, SELFREF3
6759          DM_BCAST_MACRO(abscoefL3)
6760          DM_BCAST_MACRO(abscoefH3)
6761          DM_BCAST_MACRO(SELFREF3)
6762                                                                                  
6763 ! **************************************************************************     
6764                                                                                  
6765 !     The array abscoefL4 contains absorption coefs for each of the 16 g-intervals      
6766 !     for a range of pressure levels > ~100mb, temperatures, and ratios          
6767 !     of water vapor to CO2.  The first index in the array, JS, runs             
6768 !     from 1 to 9 and corresponds to different water vapor to CO2 ratios, &     
6769 !     as expressed through the binary species parameter eta, defined as          
6770 !     eta = h2o/(h20 + (rat) * co2), where rat is the ratio of the integrated    
6771 !     line strength in the band of co2 to that of h2o.  For instance, &         
6772 !     JS=1 refers to dry air (eta = 0), JS = 9 corresponds to eta = 1.0.         
6773 !     The 2nd index in the array, JT, which runs from 1 to 5, corresponds        
6774 !     to different temperatures.  More specifically, JT = 3 means that the       
6775 !     data are for the reference temperature TREF for this pressure              
6776 !     level, JT = 2 refers to the temperature TREF-15, &                        
6777 !     JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5                   
6778 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
6779 !     to the reference pressure level (e.g. JP = 1 is for a                      
6780 !     pressure of 1053.63 mb).  The fourth index, IG, goes from 1 to 16, &      
6781 !     and tells us which g-interval the absorption coefficients are for.         
6783                                                                                  
6784 !     The array abscoefH4 contains absorption coefs for each of the 16 g-intervals      
6785 !     for a range of pressure levels  < ~100mb, temperatures, and ratios         
6786 !     of O3 to CO2.  The first index in the array, JS, runs from 1 to 6, &      
6787 !     and corresponds to different O3 to CO2 ratios, as expressed through        
6788 !     the binary species parameter eta, defined as eta = O3/(O3+RAT*H2O), &     
6789 !     where RAT is the ratio of the integrated line strength in the band         
6790 !     of CO2 to that of O3.  For instance, JS=1 refers to no O3 (eta = 0)        
6791 !     and JS = 5 corresponds to eta = 1.0.  The second index, JT, which          
6792 !     runs from 1 to 5, corresponds to different temperatures.  More             
6793 !     specifically, JT = 3 means that the data are for the corresponding         
6794 !     reference temperature TREF for this  pressure level, JT = 2 refers         
6795 !     to the TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and          
6796 !     JT = 5 is for TREF+30.  The third index, JP, runs from 13 to 59 and        
6797 !     refers to the corresponding pressure level in PREF (e.g. JP = 13 is        
6798 !     for a pressure of 95.5835 mb).  The fourth index, IG, goes from 1 to       
6799 !     16, and tells us which g-interval the absorption coefficients are for.     
6801                                                                                  
6802 !     The array SELFREF4 contains the coefficient of the water vapor              
6803 !     self-continuum (including the energy term).  The first index               
6804 !     refers to temperature in 7.2 degree increments.  For instance, &          
6805 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
6806 !     etc.  The second index runs over the g-channel (1 to 16).                  
6808          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL4, abscoefH4, SELFREF4
6809          DM_BCAST_MACRO(abscoefL4)
6810          DM_BCAST_MACRO(abscoefH4)
6811          DM_BCAST_MACRO(SELFREF4)
6812                                                                                  
6813 ! **************************************************************************     
6814                                                                                  
6815 !     The array abscoefL5 contains absorption coefs for each of the 16 g-intervals
6816 !     for a range of pressure levels > ~100mb, temperatures, and ratios          
6817 !     of water vapor to CO2.  The first index in the array, JS, runs             
6818 !     from 1 to 9 and corresponds to different water vapor to CO2 ratios, &     
6819 !     as expressed through the binary species parameter eta, defined as          
6820 !     eta = h2o/(h20 + (rat) * co2), where rat is the ratio of the integrated    
6821 !     line strength in the band of co2 to that of h2o.  For instance, &         
6822 !     JS=1 refers to dry air (eta = 0), JS = 9 corresponds to eta = 1.0.         
6823 !     The 2nd index in the array, JT, which runs from 1 to 5, corresponds        
6824 !     to different temperatures.  More specifically, JT = 3 means that the       
6825 !     data are for the reference temperature TREF for this  pressure             
6826 !     level, JT = 2 refers to the temperature TREF-15, &                        
6827 !     JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5                   
6828 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
6829 !     to the reference pressure level (e.g. JP = 1 is for a                      
6830 !     pressure of 1053.63 mb).  The fourth index, IG, goes from 1 to 16, &      
6831 !     and tells us which g-interval the absorption coefficients are for.         
6833                                                                                  
6834 !     The array abscoefH5 contains absorption coefs for each of the 16 g-intervals      
6835 !     for a range of pressure levels  < ~100mb, temperatures, and ratios         
6836 !     of O3 to CO2.  The first index in the array, JS, runs from 1 to 5, &      
6837 !     and corresponds to different O3 to CO2 ratios, as expressed through        
6838 !     the binary species parameter eta, defined as eta = O3/(O3+RAT*CO2), &     
6839 !     where RAT is the ratio of the integrated line strength in the band         
6840 !     of co2 to that of O3.  For instance, JS=1 refers to no O3 (eta = 0)        
6841 !     and JS = 5 corresponds to eta = 1.0.  The second index, JT, which          
6842 !     runs from 1 to 5, corresponds to different temperatures.  More             
6843 !     specifically, JT = 3 means that the data are for the corresponding         
6844 !     reference temperature TREF for this  pressure level, JT = 2 refers         
6845 !     to the TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and          
6846 !     JT = 5 is for TREF+30.  The third index, JP, runs from 13 to 59 and        
6847 !     refers to the corresponding pressure level in PREF (e.g. JP = 13 is        
6848 !     for a pressure of 95.5835 mb).  The fourth index, IG, goes from 1 to       
6849 !     16, and tells us which g-interval the absorption coefficients are for.     
6851                                                                                  
6852 !     The array SELFREF5 contains the coefficient of the water vapor              
6853 !     self-continuum (including the energy term).  The first index               
6854 !     refers to temperature in 7.2 degree increments.  For instance, &          
6855 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
6856 !     etc.  The second index runs over the g-channel (1 to 16).                  
6858          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL5, abscoefH5, SELFREF5
6859          DM_BCAST_MACRO(abscoefL5)
6860          DM_BCAST_MACRO(abscoefH5)
6861          DM_BCAST_MACRO(SELFREF5)
6862                                                                                  
6863 ! **************************************************************************     
6864                                                                                  
6865 !     The array abscoefL6 contains absorption coefs at the 16 chosen g-values    
6866 !     for a range of pressure levels > ~100mb and temperatures.  The first       
6867 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6868 !     different temperatures.  More specifically, JT = 3 means that the          
6869 !     data are for the corresponding TREF for this  pressure level, &           
6870 !     JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30, &         
6871 !     JT = 4 is for TREF+15, and JT = 5 is for TREF+30.  The second              
6872 !     index, JP, runs from 1 to 13 and refers to the corresponding               
6873 !     pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).      
6874 !     The third index, IG, goes from 1 to 16, and tells us which                 
6875 !     g-interval the absorption coefficients are for.                            
6877                                                                                  
6878 !     The array SELFREF6 contains the coefficient of the water vapor              
6879 !     self-continuum (including the energy term).  The first index               
6880 !     refers to temperature in 7.2 degree increments.  For instance, &          
6881 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
6882 !     etc.  The second index runs over the g-channel (1 to 16).                  
6884          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL6, SELFREF6
6885          DM_BCAST_MACRO(abscoefL6)
6886          DM_BCAST_MACRO(SELFREF6)
6887                                                                                  
6888 ! **************************************************************************     
6889                                                                                  
6890 !     The array abscoefL7 contains absorption coefs at the 16 chosen g-values           
6891 !     for a range of pressure levels> ~100mb, temperatures, and binary           
6892 !     species parameters (see taumol.f for definition).  The first               
6893 !     index in the array, JS, runs from 1 to 9, and corresponds to               
6894 !     different values of the binary species parameter.  For instance, &        
6895 !     JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8, &   
6896 !     JS = 3 corresponds to the parameter value 2/8, etc.  The second index      
6897 !     in the array, JT, which runs from 1 to 5, corresponds to different         
6898 !     temperatures.  More specifically, JT = 3 means that the data are for       
6899 !     the reference temperature TREF for this  pressure level, JT = 2 refers     
6900 !     to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5       
6901 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
6902 !     to the JPth reference pressure level (see taumol.f for these levels        
6903 !     in mb).  The fourth index, IG, goes from 1 to 16, and indicates            
6904 !     which g-interval the absorption coefficients are for.                      
6906                                                                                  
6907 !     The array abscoefH7 contains absorption coefs at the 16 chosen g-values           
6908 !     for a range of pressure levels < ~100mb and temperatures. The first        
6909 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6910 !     different temperatures.  More specifically, JT = 3 means that the          
6911 !     data are for the reference temperature TREF for this pressure              
6912 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
6913 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
6914 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
6915 !     reference pressure level (see taumol.f for the value of these              
6916 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
6917 !     and tells us which g-interval the absorption coefficients are for.         
6919                                                                                  
6920 !     The array SELFREF7 contains the coefficient of the water vapor              
6921 !     self-continuum (including the energy term).  The first index               
6922 !     refers to temperature in 7.2 degree increments.  For instance, &          
6923 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
6924 !     etc.  The second index runs over the g-channel (1 to 16).                  
6926          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL7, abscoefH7, SELFREF7
6927          DM_BCAST_MACRO(abscoefL7)
6928          DM_BCAST_MACRO(abscoefH7)
6929          DM_BCAST_MACRO(SELFREF7)
6930                                                                                  
6931 ! **************************************************************************
6932                                                                                  
6933 !     The array abscoefL8 contains absorption coefs at the 16 chosen g-values    
6934 !     for a range of pressure levels > ~100mb and temperatures.  The first       
6935 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6936 !     different temperatures.  More specifically, JT = 3 means that the          
6937 !     data are for the corresponding TREF for this  pressure level, &           
6938 !     JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30, &         
6939 !     JT = 4 is for TREF+15, and JT = 5 is for TREF+30.  The second              
6940 !     index, JP, runs from 1 to 13 and refers to the corresponding               
6941 !     pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).      
6942 !     The third index, IG, goes from 1 to 16, and tells us which                 
6943 !     g-interval the absorption coefficients are for.                            
6944 !     The array abscoefL8 contains absorption coef5s at the 16 chosen g-values          
6945 !     for a range of pressure levels > ~100mb and temperatures.  The first       
6946 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6947 !     different temperatures.  More specifically, JT = 3 means that the          
6948 !     data are for the cooresponding TREF for this  pressure level, &           
6949 !     JT = 2 refers to the temperature                                           
6950 !     TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5          
6951 !     is for TREF+30.  The second index, JP, runs from 1 to 13 and refers        
6952 !     to the corresponding pressure level in PREF (e.g. JP = 1 is for a          
6953 !     pressure of 1053.63 mb).  The third index, IG, goes from 1 to 16, &       
6954 !     and tells us which "g-channel" the absorption coefficients are for.        
6956                                                                                  
6957 !     The array abscoefH8 contains absorption coefs at the 16 chosen g-values           
6958 !     for a range of pressure levels < ~100mb and temperatures. The first        
6959 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6960 !     different temperatures.  More specifically, JT = 3 means that the          
6961 !     data are for the reference temperature TREF for this pressure              
6962 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
6963 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
6964 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
6965 !     reference pressure level (see taumol.f for the value of these              
6966 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
6967 !     and tells us which g-interval the absorption coefficients are for.         
6969 !                                                                                
6970 !       SELFREF8 is the array for the self-continuum.                                   
6971 !                                                                                
6972          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL8, abscoefH8, SELFREF8
6973          DM_BCAST_MACRO(abscoefL8)
6974          DM_BCAST_MACRO(abscoefH8)
6975          DM_BCAST_MACRO(SELFREF8)
6976                                                                                  
6977 ! **************************************************************************
6978                                                                                  
6979 !     The array abscoefL9 contains absorption coefs at the 16 chosen g-values    
6980 !     for a range of pressure levels> ~100mb, temperatures, and binary           
6981 !     species parameters (see taumol.f for definition).  The first               
6982 !     index in the array, JS, runs from 1 to 11, and corresponds to              
6983 !     different values of the binary species parameter.  For instance, &        
6984 !     JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8, &   
6985 !     JS = 3 corresponds to the parameter value 2/8, etc.  The second index      
6986 !     in the array, JT, which runs from 1 to 5, corresponds to different         
6987 !     temperatures.  More specifically, JT = 3 means that the data are for       
6988 !     the reference temperature TREF for this  pressure level, JT = 2 refers     
6989 !     to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5       
6990 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
6991 !     to the JPth reference pressure level (see taumol.f for these levels        
6992 !     in mb).  The fourth index, IG, goes from 1 to 16, and indicates            
6993 !     which g-interval the absorption coefficients are for.                      
6995                                                                                  
6996 !     The array abscoefH9 contains absorption coefs at the 16 chosen g-values           
6997 !     for a range of pressure levels < ~100mb and temperatures. The first        
6998 !     index in the array, JT, which runs from 1 to 5, corresponds to             
6999 !     different temperatures.  More specifically, JT = 3 means that the          
7000 !     data are for the reference temperature TREF for this pressure              
7001 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
7002 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
7003 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
7004 !     reference pressure level (see taumol.f for the value of these              
7005 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
7006 !     and tells us which g-interval the absorption coefficients are for.         
7008                                                                                  
7009 !     The array SELFREF9 contains the coefficient of the water vapor              
7010 !     self-continuum (including the energy term).  The first index               
7011 !     refers to temperature in 7.2 degree increments.  For instance, &          
7012 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
7013 !     etc.  The second index runs over the g-channel (1 to 16).                  
7015          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL9, abscoefH9, SELFREF9
7016          DM_BCAST_MACRO(abscoefL9)
7017          DM_BCAST_MACRO(abscoefH9)
7018          DM_BCAST_MACRO(SELFREF9)
7019                                                                                  
7020 ! **************************************************************************
7021                                                                                  
7022 !     The array abscoefL10 contains absorption coefs at the 16 chosen g-values   
7023 !     for a range of pressure levels > ~100mb and temperatures.  The first       
7024 !     index in the array, JT, which runs from 1 to 5, corresponds to             
7025 !     different temperatures.  More specifically, JT = 3 means that the          
7026 !     data are for the corresponding TREF for this  pressure level, &           
7027 !     JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30, &         
7028 !     JT = 4 is for TREF+15, and JT = 5 is for TREF+30.  The second              
7029 !     index, JP, runs from 1 to 13 and refers to the corresponding               
7030 !     pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).      
7031 !     The third index, IG, goes from 1 to 16, and tells us which                 
7032 !     g-interval the absorption coefficients are for.                            
7034                                                                                  
7035 !     The array abscoefH10 contains absorption coefs at the 16 chosen g-values           
7036 !     for a range of pressure levels < ~100mb and temperatures. The first        
7037 !     index in the array, JT, which runs from 1 to 5, corresponds to             
7038 !     different temperatures.  More specifically, JT = 3 means that the          
7039 !     data are for the reference temperature TREF for this pressure              
7040 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
7041 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
7042 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
7043 !     reference pressure level (see taumol.f for the value of these              
7044 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
7045 !     and tells us which g-interval the absorption coefficients are for.         
7047          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL10, abscoefH10
7048          DM_BCAST_MACRO(abscoefL10)
7049          DM_BCAST_MACRO(abscoefH10)
7050                                                                                  
7051 ! **************************************************************************
7052                                                                                  
7053 !     The array abscoefL11 contains absorption coefs at the 16 chosen g-values   
7054 !     for a range of pressure levels > ~100mb and temperatures.  The first       
7055 !     index in the array, JT, which runs from 1 to 5, corresponds to             
7056 !     different temperatures.  More specifically, JT = 3 means that the          
7057 !     data are for the corresponding TREF for this  pressure level, &           
7058 !     JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30, &         
7059 !     JT = 4 is for TREF+15, and JT = 5 is for TREF+30.  The second              
7060 !     index, JP, runs from 1 to 13 and refers to the corresponding               
7061 !     pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).      
7062 !     The third index, IG, goes from 1 to 16, and tells us which                 
7063 !     g-interval the absorption coefficients are for.                            
7065                                                                                  
7066 !     The array abscoefH11 contains absorption coefs at the 16 chosen g-values           
7067 !     for a range of pressure levels < ~100mb and temperatures. The first        
7068 !     index in the array, JT, which runs from 1 to 5, corresponds to             
7069 !     different temperatures.  More specifically, JT = 3 means that the          
7070 !     data are for the reference temperature TREF for this pressure              
7071 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
7072 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
7073 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
7074 !     reference pressure level (see taumol.f for the value of these              
7075 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
7076 !     and tells us which g-interval the absorption coefficients are for.         
7078                                                                                  
7079 !     The array SELFREF11 contains the coefficient of the water vapor              
7080 !     self-continuum (including the energy term).  The first index               
7081 !     refers to temperature in 7.2 degree increments.  For instance, &          
7082 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
7083 !     etc.  The second index runs over the g-channel (1 to 16).                  
7085          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL11, abscoefH11, SELFREF11
7086          DM_BCAST_MACRO(abscoefL11)
7087          DM_BCAST_MACRO(abscoefH11)
7088          DM_BCAST_MACRO(SELFREF11)
7089                                                                                         
7090 ! **************************************************************************
7091                                                                                  
7092 !     The array abscoefL12 contains absorption coefs at the 16 chosen g-values   
7093 !     for a range of pressure levels> ~100mb, temperatures, and binary           
7094 !     species parameters (see taumol.f for definition).  The first               
7095 !     index in the array, JS, runs from 1 to 9, and corresponds to               
7096 !     different values of the binary species parameter.  For instance, &        
7097 !     JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8, &   
7098 !     JS = 3 corresponds to the parameter value 2/8, etc.  The second index      
7099 !     in the array, JT, which runs from 1 to 5, corresponds to different         
7100 !     temperatures.  More specifically, JT = 3 means that the data are for       
7101 !     the reference temperature TREF for this  pressure level, JT = 2 refers     
7102 !     to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5       
7103 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
7104 !     to the JPth reference pressure level (see taumol.f for these levels        
7105 !     in mb).  The fourth index, IG, goes from 1 to 16, and indicates            
7106 !     which g-interval the absorption coefficients are for.                      
7108                                                                                  
7109 !     The array SELFREF12 contains the coefficient of the water vapor              
7110 !     self-continuum (including the energy term).  The first index               
7111 !     refers to temperature in 7.2 degree increments.  For instance, &          
7112 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
7113 !     etc.  The second index runs over the g-channel (1 to 16).                  
7115          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL12, SELFREF12
7116          DM_BCAST_MACRO(abscoefL12)
7117          DM_BCAST_MACRO(SELFREF12)
7118                                                                                  
7119 ! **************************************************************************
7120                                                                                  
7121 !     The array abscoefL13 contains absorption coefs at the 16 chosen g-values   
7122 !     for a range of pressure levels> ~100mb, temperatures, and binary           
7123 !     species parameters (see taumol.f for definition).  The first               
7124 !     index in the array, JS, runs from 1 to 9, and corresponds to               
7125 !     different values of the binary species parameter.  For instance, &        
7126 !     JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8, &   
7127 !     JS = 3 corresponds to the parameter value 2/8, etc.  The second index      
7128 !     in the array, JT, which runs from 1 to 5, corresponds to different         
7129 !     temperatures.  More specifically, JT = 3 means that the data are for       
7130 !     the reference temperature TREF for this  pressure level, JT = 2 refers     
7131 !     to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5       
7132 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
7133 !     to the JPth reference pressure level (see taumol.f for these levels        
7134 !     in mb).  The fourth index, IG, goes from 1 to 16, and indicates            
7135 !     which g-interval the absorption coefficients are for.                      
7137                                                                                  
7138 !     The array SELFREF13 contains the coefficient of the water vapor              
7139 !     self-continuum (including the energy term).  The first index               
7140 !     refers to temperature in 7.2 degree increments.  For instance, &          
7141 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
7142 !     etc.  The second index runs over the g-channel (1 to 16).                  
7144          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL13, SELFREF13
7145          DM_BCAST_MACRO(abscoefL13)
7146          DM_BCAST_MACRO(SELFREF13)
7147                                                                                  
7148 ! **************************************************************************
7149                                                                                  
7150 !     The array abscoefL14 contains absorption coefs at the 16 chosen g-values   
7151 !     for a range of pressure levels > ~100mb and temperatures.  The first       
7152 !     index in the array, JT, which runs from 1 to 5, corresponds to             
7153 !     different temperatures.  More specifically, JT = 3 means that the          
7154 !     data are for the corresponding TREF for this  pressure level, &           
7155 !     JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30, &         
7156 !     JT = 4 is for TREF+15, and JT = 5 is for TREF+30.  The second              
7157 !     index, JP, runs from 1 to 13 and refers to the corresponding               
7158 !     pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).      
7159 !     The third index, IG, goes from 1 to 16, and tells us which                 
7160 !     g-interval the absorption coefficients are for.                            
7162                                                                                  
7163 !     The array abscoefH14 contains absorption coefs at the 16 chosen g-values           
7164 !     for a range of pressure levels < ~100mb and temperatures. The first        
7165 !     index in the array, JT, which runs from 1 to 5, corresponds to             
7166 !     different temperatures.  More specifically, JT = 3 means that the          
7167 !     data are for the reference temperature TREF for this pressure              
7168 !     level, JT = 2 refers to the temperature TREF-15, JT = 1 is for             
7169 !     TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.                 
7170 !     The second index, JP, runs from 13 to 59 and refers to the JPth            
7171 !     reference pressure level (see taumol.f for the value of these              
7172 !     pressure levels in mb).  The third index, IG, goes from 1 to 16, &        
7173 !     and tells us which g-interval the absorption coefficients are for.         
7175                                                                                  
7176 !     The array SELFREF14 contains the coefficient of the water vapor              
7177 !     self-continuum (including the energy term).  The first index               
7178 !     refers to temperature in 7.2 degree increments.  For instance, &          
7179 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
7180 !     etc.  The second index runs over the g-channel (1 to 16).                  
7182          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL14, abscoefH14, SELFREF14
7183          DM_BCAST_MACRO(abscoefL14)
7184          DM_BCAST_MACRO(abscoefH14)
7185          DM_BCAST_MACRO(SELFREF14)
7186                                                                                         
7187 ! **************************************************************************
7188                                                                                  
7189 !     The array abscoefL15 contains absorption coefs at the 16 chosen g-values   
7190 !     for a range of pressure levels> ~100mb, temperatures, and binary           
7191 !     species parameters (see taumol.f for definition).  The first               
7192 !     index in the array, JS, runs from 1 to 9, and corresponds to               
7193 !     different values of the binary species parameter.  For instance, &        
7194 !     JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8, &   
7195 !     JS = 3 corresponds to the parameter value 2/8, etc.  The second index      
7196 !     in the array, JT, which runs from 1 to 5, corresponds to different         
7197 !     temperatures.  More specifically, JT = 3 means that the data are for       
7198 !     the reference temperature TREF for this  pressure level, JT = 2 refers     
7199 !     to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5       
7200 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
7201 !     to the JPth reference pressure level (see taumol.f for these levels        
7202 !     in mb).  The fourth index, IG, goes from 1 to 16, and indicates            
7203 !     which g-interval the absorption coefficients are for.                      
7205                                                                                  
7206 !     The array SELFREF15 contains the coefficient of the water vapor              
7207 !     self-continuum (including the energy term).  The first index               
7208 !     refers to temperature in 7.2 degree increments.  For instance, &          
7209 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
7210 !     etc.  The second index runs over the g-channel (1 to 16).                  
7212          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL15, SELFREF15
7213          DM_BCAST_MACRO(abscoefL15)
7214          DM_BCAST_MACRO(SELFREF15)
7215                                                                                  
7216 ! **************************************************************************
7217                                                                                  
7218 !     The array abscoefL16 contains absorption coefs at the 16 chosen g-values  
7219 !     for a range of pressure levels> ~100mb, temperatures, and binary           
7220 !     species parameters (see taumol.f for definition).  The first               
7221 !     index in the array, JS, runs from 1 to 9, and corresponds to               
7222 !     different values of the binary species parameter.  For instance, &        
7223 !     JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8, &   
7224 !     JS = 3 corresponds to the parameter value 2/8, etc.  The second index      
7225 !     in the array, JT, which runs from 1 to 5, corresponds to different         
7226 !     temperatures.  More specifically, JT = 3 means that the data are for       
7227 !     the reference temperature TREF for this  pressure level, JT = 2 refers     
7228 !     to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5       
7229 !     is for TREF+30.  The third index, JP, runs from 1 to 13 and refers         
7230 !     to the JPth reference pressure level (see taumol.f for these levels        
7231 !     in mb).  The fourth index, IG, goes from 1 to 16, and indicates            
7232 !     which g-interval the absorption coefficients are for.                      
7234                                                                                  
7235 !     The array SELFREF16 contains the coefficient of the water vapor              
7236 !     self-continuum (including the energy term).  The first index               
7237 !     refers to temperature in 7.2 degree increments.  For instance, &          
7238 !     JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8, &        
7239 !     etc.  The second index runs over the g-channel (1 to 16).                  
7241          IF ( wrf_dm_on_monitor() ) READ (rrtm_unit,ERR=9010) abscoefL16, SELFREF16
7242          DM_BCAST_MACRO(abscoefL16)
7243          DM_BCAST_MACRO(SELFREF16)
7245          IF ( wrf_dm_on_monitor() ) CLOSE (rrtm_unit)
7246                                                                                  
7247 !-----------------------------------------------------------------------
7248                                                             
7249                 
7250                                                                            
7251 !  Compute lookup tables for transmittance, tau transition function,             
7252 !  and clear sky tau (for the cloudy sky radiative transfer).  Tau is            
7253 !  computed as a function of the tau transition function, transmittance          
7254 !  is calculated as a function of tau, and the tau transition function           
7255 !  is calculated using the linear in tau formulation at values of tau            
7256 !  above 0.01.  TF is approximated as tau/6 for tau < 0.01.  All tables          
7257 !  are computed at intervals of 0.001.  The inverse of the constant used         
7258 !  in the Pade approximation to the tau transition function is set to b.         
7259                                                                                  
7260       TAU(0) = 0.0                                                               
7261       TAU(5000) = 1.E10                                                          
7262       TRANS(0) = 1.0                                                             
7263       TRANS(5000) = 0.0                                                          
7264       TF(0) = 0.0                                                                
7265       TF(5000) = 1.0                                                             
7266       BPADE=1./0.278                                                             
7267       DO 1000 ITRE = 1,4999                                                       
7268          TFN = ITRE/5.E3                                                          
7269          TAU(ITRE) = BPADE*TFN/(1.-TFN)                                           
7270          TRANS(ITRE) = EXP(-TAU(ITRE))                                             
7271          IF (TAU(ITRE).LT.0.1) THEN                                               
7272             TF(ITRE) = TAU(ITRE)/6.                                                
7273          ELSE                                                                    
7274             TF(ITRE) = 1.-2.*((1./TAU(ITRE))-(TRANS(ITRE)/(1.-TRANS(ITRE))))         
7275          ENDIF                                                                   
7276  1000 CONTINUE                                                                   
7277 !  Calculate lookup tables for functions needed in routine TAUMOL (TAUGB2)       
7278       CORR1(0) = 1.                                                              
7279       CORR1(200) = 1.                                                            
7280       CORR2(0) = 1.                                                              
7281       CORR2(200) = 1.                                                            
7282       DO 1200 I = 1,199                                                          
7283          FP = 0.005*FLOAT(I)                                                     
7284          RTFP = SQRT(FP)                                                         
7285          CORR1(I) = RTFP/FP                                                      
7286          CORR2(I) = (1.-RTFP)/(1.-FP)                                            
7287  1200 CONTINUE                                                                   
7288                                                                                  
7289 !  Perform g-point reduction from 16 per band (256 total points) to              
7290 !  a band dependant number (140 total points) for all absorption                 
7291 !  coefficient input data and Planck fraction input data.                        
7292 !  Compute relative weighting for new g-point combinations.                      
7293                                                                                  
7294       IGCSM = 0                                                                  
7295       DO 500 IBND = 1,NBANDS                                                     
7296          IPRSM = 0                                                               
7297          IF (NGC(IBND).LT.16) THEN                                               
7298             DO 450 IGC = 1,NGC(IBND)                                             
7299                IGCSM = IGCSM + 1                                                 
7300                WTSUM = 0.                                                        
7301                DO 420 IPR = 1, NGN(IGCSM)                                        
7302                   IPRSM = IPRSM + 1                                              
7303                   WTSUM = WTSUM + WT(IPRSM)                                      
7304  420           CONTINUE                                                          
7305                WTSM(IGC) = WTSUM                                                 
7306  450        CONTINUE                                                             
7307             DO 400 IG = 1,NG(IBND)                                               
7308                IND = (IBND-1)*16 + IG                                            
7309                RWGT(IND) = WT(IG)/WTSM(NGM(IND))                                 
7310  400        CONTINUE                                                             
7311          ELSE                                                                    
7312             DO 300 IG = 1,NG(IBND)                                               
7313                IGCSM = IGCSM + 1                                                 
7314                IND = (IBND-1)*16 + IG                                            
7315                RWGT(IND) = 1.0                                                   
7316  300        CONTINUE                                                             
7317          ENDIF                                                                   
7318  500  CONTINUE                                                                   
7319                                                                                  
7320 !  Reduce g-points for relevant data in each LW spectral band.                   
7321                                                                                  
7322       CALL CMBGB1 (abscoefL1,   abscoefH1,  SELFREF1,                   &
7323                    FRACREFA1,   FRACREFB1,  FORREF1,                    &
7324                    SELFREFC1,  FORREFC1, FRACREFAC1,                    &
7325                    FRACREFBC1   &
7326                   )
7327       CALL CMBGB2 (abscoefL2,   abscoefH2,  SELFREF2,                   &
7328                    FRACREFA2,   FRACREFB2,  FORREF2,                    &
7329                    SELFREFC2,  FORREFC2, FRACREFAC2,                    &
7330                    FRACREFBC2   &
7331                   )
7332       CALL CMBGB3 (abscoefL3,   abscoefH3,  SELFREF3,                   &
7333                    FRACREFA3,   FRACREFB3,                              &
7334                    FORREF3,     ABSN2OA3,   ABSN2OB3,                   &
7335                    SELFREFC3,  FORREFC3,                                &
7336                    ABSN2OAC3,   ABSN2OBC3,  FRACREFAC3, FRACREFBC3      &
7337                   )
7338       CALL CMBGB4 (abscoefL4,   abscoefH4,  SELFREF4,                   &
7339                    FRACREFA4,   FRACREFB4,                              &
7340                    SELFREFC4,  FRACREFAC4, FRACREFBC4                   &
7341                   )
7342       CALL CMBGB5 (abscoefL5,   abscoefH5,  SELFREF5,                   &
7343                    FRACREFA5,   FRACREFB5,  CCL45,                      &
7344                    SELFREFC5,  CCL4C5, FRACREFAC5,                      &
7345                    FRACREFBC5   &
7346                   )
7347       CALL CMBGB6 (abscoefL6,               SELFREF6,                   &
7348                    FRACREFA6,   ABSCO26,    CFC11ADJ6, CFC126,          &
7349                    SELFREFC6, ABSCO2C6, CFC11ADJC6, CFC12C6,            &
7350                    FRACREFAC6   &
7351                   )
7352       CALL CMBGB7 (abscoefL7,   abscoefH7,  SELFREF7,                   &
7353                    FRACREFA7,   FRACREFB7,  ABSCO27,                    &
7354                    SELFREFC7,  ABSCO2C7, FRACREFAC7,                    &
7355                    FRACREFBC7   &
7356                   )
7357       CALL CMBGB8 (abscoefL8,   abscoefH8,  SELFREF8,                   &
7358                    FRACREFA8,   FRACREFB8,  ABSCO2A8, ABSCO2B8,         &
7359                    ABSN2OA8,    ABSN2OB8,   CFC128,   CFC22ADJ8,        &
7360                    SELFREFC8,  ABSCO2AC8, ABSCO2BC8,                    &
7361                    ABSN2OAC8,   ABSN2OBC8,  CFC12C8,   CFC22ADJC8,      &
7362                    FRACREFAC8, FRACREFBC8                               &
7363                   )
7364       CALL CMBGB9 (abscoefL9,   abscoefH9,  SELFREF9,                   &
7365                    FRACREFA9,   FRACREFB9,  ABSN2O9,                    &
7366                    SELFREFC9,  ABSN2OC9, FRACREFAC9,                    &
7367                    FRACREFBC9                                           &
7368                   )  
7369       CALL CMBGB10(abscoefL10, abscoefH10,                              &
7370                    FRACREFA10, FRACREFB10,                              &
7371                    FRACREFAC10, FRACREFBC10                             &
7372                   )
7373       CALL CMBGB11(abscoefL11, abscoefH11, SELFREF11,                   &
7374                    FRACREFA11, FRACREFB11,                              &
7375                    SELFREFC11,  FRACREFAC11,                            &
7376                    FRACREFBC11  &
7377                   )
7378       CALL CMBGB12(abscoefL12,             SELFREF12,                   &
7379                    FRACREFA12,                                          &
7380                    SELFREFC12, FRACREFAC12                              &
7381                   )
7382       CALL CMBGB13(abscoefL13,             SELFREF13,                   &
7383                    FRACREFA13,                                          &
7384                    SELFREFC13, FRACREFAC13                              &
7385                   )
7386       CALL CMBGB14(abscoefL14, abscoefH14, SELFREF14,                   &
7387                    FRACREFA14, FRACREFB14,                              &
7388                    SELFREFC14, FRACREFAC14,                             &
7389                    FRACREFBC14 &
7390                   )
7391       CALL CMBGB15(abscoefL15,             SELFREF15,                   &
7392                    FRACREFA15,                                          &
7393                    SELFREFC15, FRACREFAC15                              &
7394                   )
7395       CALL CMBGB16(abscoefL16,             SELFREF16,                   &
7396                    FRACREFA16,                                          &
7397                    SELFREFC16, FRACREFAC16                              &
7398                   )
7399       RETURN
7400 9009 CONTINUE
7401      WRITE( errmess , '(A,I4)' ) 'module_ra_rrtm: error opening RRTM_DATA on unit ',rrtm_unit
7402      CALL wrf_error_fatal(errmess)
7403      RETURN
7404 9010 CONTINUE
7405      WRITE( errmess , '(A,I4)' ) 'module_ra_rrtm: error reading RRTM_DATA on unit ',rrtm_unit
7406      CALL wrf_error_fatal(errmess)
7407       END SUBROUTINE rrtm_lookuptable
7409 !------------------------------------------------------------------
7411 END MODULE module_ra_rrtm