1 | MODULE optci_mod |
---|
2 | |
---|
3 | IMPLICIT NONE |
---|
4 | |
---|
5 | CONTAINS |
---|
6 | |
---|
7 | subroutine optci(PLEV,TLEV,DTAUI,TAUCUMI, & |
---|
8 | QXIAER,QSIAER,GIAER,COSBI,WBARI,TAUAERO, & |
---|
9 | TMID,PMID,TAUGSURF,QVAR,MUVAR) |
---|
10 | |
---|
11 | use radinc_h, only: L_LEVELS, L_NLAYRAD, L_NSPECTI, L_NGAUSS, & |
---|
12 | L_NLEVRAD, L_REFVAR, naerkind |
---|
13 | use radcommon_h, only: gasi,tlimit,wrefVAR,Cmk,tgasref,pfgasref,wnoi,scalep,indi,glat_ig |
---|
14 | use gases_h, only: gfrac, ngasmx, igas_N2, igas_He, igas_H2O, igas_H2 |
---|
15 | use comcstfi_mod, only: g, r, mugaz |
---|
16 | use callkeys_mod, only: kastprof,continuum,graybody |
---|
17 | implicit none |
---|
18 | |
---|
19 | !================================================================== |
---|
20 | ! |
---|
21 | ! Purpose |
---|
22 | ! ------- |
---|
23 | ! Calculates longwave optical constants at each level. For each |
---|
24 | ! layer and spectral interval in the IR it calculates WBAR, DTAU |
---|
25 | ! and COSBAR. For each level it calculates TAU. |
---|
26 | ! |
---|
27 | ! TAUCUMI(L,LW) is the cumulative optical depth at level L (or alternatively |
---|
28 | ! at the *bottom* of layer L), LW is the spectral wavelength interval. |
---|
29 | ! |
---|
30 | ! TLEV(L) - Temperature at the layer boundary (i.e., level) |
---|
31 | ! PLEV(L) - Pressure at the layer boundary (i.e., level) |
---|
32 | ! |
---|
33 | ! Authors |
---|
34 | ! ------- |
---|
35 | ! Adapted from the NASA Ames code by R. Wordsworth (2009) |
---|
36 | ! |
---|
37 | !================================================================== |
---|
38 | |
---|
39 | |
---|
40 | real*8 DTAUI(L_NLAYRAD,L_NSPECTI,L_NGAUSS) |
---|
41 | real*8 DTAUKI(L_LEVELS,L_NSPECTI,L_NGAUSS) |
---|
42 | real*8 TAUI(L_NLEVRAD,L_NSPECTI,L_NGAUSS) |
---|
43 | real*8 TAUCUMI(L_LEVELS,L_NSPECTI,L_NGAUSS) |
---|
44 | real*8 PLEV(L_LEVELS) |
---|
45 | real*8 TLEV(L_LEVELS) |
---|
46 | real*8 TMID(L_LEVELS), PMID(L_LEVELS) |
---|
47 | real*8 COSBI(L_NLAYRAD,L_NSPECTI,L_NGAUSS) |
---|
48 | real*8 WBARI(L_NLAYRAD,L_NSPECTI,L_NGAUSS) |
---|
49 | |
---|
50 | ! for aerosols |
---|
51 | real*8 QXIAER(L_LEVELS,L_NSPECTI,NAERKIND) |
---|
52 | real*8 QSIAER(L_LEVELS,L_NSPECTI,NAERKIND) |
---|
53 | real*8 GIAER(L_LEVELS,L_NSPECTI,NAERKIND) |
---|
54 | real*8 TAUAERO(L_LEVELS,NAERKIND) |
---|
55 | real*8 TAUAEROLK(L_LEVELS,L_NSPECTI,NAERKIND) |
---|
56 | real*8 TAEROS(L_LEVELS,L_NSPECTI,NAERKIND) |
---|
57 | |
---|
58 | integer L, NW, NG, K, LK, IAER |
---|
59 | integer MT(L_LEVELS), MP(L_LEVELS), NP(L_LEVELS) |
---|
60 | real*8 ANS, TAUGAS |
---|
61 | real*8 DPR(L_LEVELS), U(L_LEVELS) |
---|
62 | real*8 LCOEF(4), LKCOEF(L_LEVELS,4) |
---|
63 | |
---|
64 | real*8 taugsurf(L_NSPECTI,L_NGAUSS-1) |
---|
65 | real*8 DCONT,DAERO |
---|
66 | double precision wn_cont, p_cont, p_air, T_cont, dtemp, dtempc |
---|
67 | double precision p_cross |
---|
68 | |
---|
69 | ! variable species mixing ratio variables |
---|
70 | real*8 QVAR(L_LEVELS), WRATIO(L_LEVELS), MUVAR(L_LEVELS) |
---|
71 | real*8 KCOEF(4) |
---|
72 | integer NVAR(L_LEVELS) |
---|
73 | |
---|
74 | ! temporary variables to reduce memory access time to gasi |
---|
75 | real*8 tmpk(2,2) |
---|
76 | real*8 tmpkvar(2,2,2) |
---|
77 | |
---|
78 | ! temporary variables for multiple aerosol calculation |
---|
79 | real*8 atemp |
---|
80 | real*8 btemp(L_NLAYRAD,L_NSPECTI) |
---|
81 | |
---|
82 | ! variables for k in units m^-1 |
---|
83 | real*8 dz(L_LEVELS) |
---|
84 | !real*8 rho !! see test below |
---|
85 | |
---|
86 | integer igas, jgas |
---|
87 | |
---|
88 | integer interm |
---|
89 | |
---|
90 | !--- Kasting's CIA ---------------------------------------- |
---|
91 | !real*8, parameter :: Ci(L_NSPECTI)=[ & |
---|
92 | ! 3.8E-5, 1.2E-5, 2.8E-6, 7.6E-7, 4.5E-7, 2.3E-7, & |
---|
93 | ! 5.4E-7, 1.6E-6, 0.0, & |
---|
94 | ! 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, & |
---|
95 | ! 0.0, 4.0E-7, 4.0E-6, 1.4E-5, & |
---|
96 | ! 1.0E-5, 1.2E-6, 2.0E-7, 5.0E-8, 3.0E-8, 0.0 ] |
---|
97 | !real*8, parameter :: Ti(L_NSPECTI)=[ -2.2, -1.9, & |
---|
98 | ! -1.7, -1.7, -1.7, -1.7, -1.7, -1.7, & |
---|
99 | ! 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, & |
---|
100 | ! -1.7,-1.7,-1.7,-1.7,-1.7,-1.7,-1.7, -1.7,0.0 ] |
---|
101 | !---------------------------------------------------------- |
---|
102 | |
---|
103 | !! AS: to save time in computing continuum (see bilinearbig) |
---|
104 | IF (.not.ALLOCATED(indi)) THEN |
---|
105 | ALLOCATE(indi(L_NSPECTI,ngasmx,ngasmx)) |
---|
106 | indi = -9999 ! this initial value means "to be calculated" |
---|
107 | ENDIF |
---|
108 | |
---|
109 | !======================================================================= |
---|
110 | ! Determine the total gas opacity throughout the column, for each |
---|
111 | ! spectral interval, NW, and each Gauss point, NG. |
---|
112 | |
---|
113 | taugsurf(:,:) = 0.0 |
---|
114 | dpr(:) = 0.0 |
---|
115 | lkcoef(:,:) = 0.0 |
---|
116 | |
---|
117 | do K=2,L_LEVELS |
---|
118 | DPR(k) = PLEV(K)-PLEV(K-1) |
---|
119 | |
---|
120 | !--- Kasting's CIA ---------------------------------------- |
---|
121 | !dz(k)=dpr(k)*189.02*TMID(K)/(0.03720*PMID(K)) |
---|
122 | ! this is CO2 path length (in cm) as written by Francois |
---|
123 | ! delta_z = delta_p * R_specific * T / (g * P) |
---|
124 | ! But Kasting states that W is in units of _atmosphere_ cm |
---|
125 | ! So we do |
---|
126 | !dz(k)=dz(k)*(PMID(K)/1013.25) |
---|
127 | !dz(k)=dz(k)/100.0 ! in m for SI calc |
---|
128 | !---------------------------------------------------------- |
---|
129 | |
---|
130 | ! if we have continuum opacities, we need dz |
---|
131 | if(kastprof)then |
---|
132 | dz(k) = dpr(k)*(1000.0d0*8.3145d0/muvar(k))*TMID(K)/(g*PMID(K)) |
---|
133 | U(k) = Cmk*DPR(k)*mugaz/muvar(k) |
---|
134 | else |
---|
135 | dz(k) = dpr(k)*R*TMID(K)/(glat_ig*PMID(K))*mugaz/muvar(k) |
---|
136 | U(k) = Cmk*DPR(k)*mugaz/muvar(k) ! only Cmk line in optci.F |
---|
137 | !JL13 the mugaz/muvar factor takes into account water meanmolecular weight if water is present |
---|
138 | endif |
---|
139 | |
---|
140 | call tpindex(PMID(K),TMID(K),QVAR(K),pfgasref,tgasref,WREFVAR, & |
---|
141 | LCOEF,MT(K),MP(K),NVAR(K),WRATIO(K)) |
---|
142 | |
---|
143 | do LK=1,4 |
---|
144 | LKCOEF(K,LK) = LCOEF(LK) |
---|
145 | end do |
---|
146 | end do ! levels |
---|
147 | |
---|
148 | ! Spectral dependance of aerosol absorption |
---|
149 | do iaer=1,naerkind |
---|
150 | DO NW=1,L_NSPECTI |
---|
151 | do K=2,L_LEVELS |
---|
152 | TAEROS(K,NW,IAER) = TAUAERO(K,IAER) * QXIAER(K,NW,IAER) |
---|
153 | end do ! levels |
---|
154 | END DO |
---|
155 | end do |
---|
156 | |
---|
157 | do NW=1,L_NSPECTI |
---|
158 | |
---|
159 | do K=2,L_LEVELS |
---|
160 | |
---|
161 | DAERO=SUM(TAEROS(K,NW,1:naerkind)) ! aerosol absorption |
---|
162 | |
---|
163 | DCONT = 0.0d0 ! continuum absorption |
---|
164 | |
---|
165 | if(continuum.and.(.not.graybody))then |
---|
166 | ! include continua if necessary |
---|
167 | wn_cont = dble(wnoi(nw)) |
---|
168 | T_cont = dble(TMID(k)) |
---|
169 | do igas=1,ngasmx |
---|
170 | |
---|
171 | if(gfrac(igas).eq.-1)then ! variable |
---|
172 | p_cont = dble(PMID(k)*scalep*QVAR(k)) ! qvar = mol/mol |
---|
173 | else |
---|
174 | p_cont = dble(PMID(k)*scalep*gfrac(igas)*(1.-QVAR(k))) |
---|
175 | endif |
---|
176 | |
---|
177 | dtemp=0.0d0 |
---|
178 | if(igas.eq.igas_N2)then |
---|
179 | |
---|
180 | interm = indi(nw,igas,igas) |
---|
181 | call interpolateN2N2(wn_cont,T_cont,p_cont,dtemp,.false.,interm) |
---|
182 | indi(nw,igas,igas) = interm |
---|
183 | |
---|
184 | elseif(igas.eq.igas_H2)then |
---|
185 | |
---|
186 | ! first do self-induced absorption |
---|
187 | interm = indi(nw,igas,igas) |
---|
188 | call interpolateH2H2(wn_cont,T_cont,p_cont,dtemp,.false.,interm) |
---|
189 | indi(nw,igas,igas) = interm |
---|
190 | |
---|
191 | ! then cross-interactions with other gases |
---|
192 | do jgas=1,ngasmx |
---|
193 | p_cross = dble(PMID(k)*scalep*gfrac(jgas)*(1.-QVAR(k))) |
---|
194 | dtempc = 0.0d0 |
---|
195 | if(jgas.eq.igas_N2)then |
---|
196 | interm = indi(nw,igas,jgas) |
---|
197 | call interpolateN2H2(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm) |
---|
198 | indi(nw,igas,jgas) = interm |
---|
199 | elseif(jgas.eq.igas_He)then |
---|
200 | interm = indi(nw,igas,jgas) |
---|
201 | call interpolateH2He(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm) |
---|
202 | indi(nw,igas,jgas) = interm |
---|
203 | endif |
---|
204 | dtemp = dtemp + dtempc |
---|
205 | enddo |
---|
206 | |
---|
207 | elseif(igas.eq.igas_H2O.and.T_cont.gt.100.0)then |
---|
208 | ! Compute self and foreign (with air) continuum of H2O |
---|
209 | p_air = dble(PMID(k)*scalep) - p_cont ! note assumes background is air! |
---|
210 | interm = indi(nw,igas,igas) |
---|
211 | call interpolateH2O_self_foreign(wn_cont,T_cont,p_cont,p_air,dtemp,.false.,interm) ! MTCKD v3.3 |
---|
212 | indi(nw,igas,igas) = interm |
---|
213 | |
---|
214 | endif |
---|
215 | |
---|
216 | DCONT = DCONT + dtemp |
---|
217 | |
---|
218 | enddo |
---|
219 | |
---|
220 | ! Oobleck test |
---|
221 | !rho = PMID(k)*scalep / (TMID(k)*286.99) |
---|
222 | !if(WNOI(nw).gt.300.0 .and. WNOI(nw).lt.500.0)then |
---|
223 | ! DCONT = rho * 0.125 * 4.6e-4 |
---|
224 | !elseif(WNOI(nw).gt.500.0 .and. WNOI(nw).lt.700.0)then |
---|
225 | ! DCONT = 1000*dpr(k) * 1.0 * 4.6e-4 / g |
---|
226 | ! DCONT = rho * 1.0 * 4.6e-4 |
---|
227 | !elseif(WNOI(nw).gt.700.0 .and. WNOI(nw).lt.900.0)then |
---|
228 | ! DCONT = rho * 0.125 * 4.6e-4 |
---|
229 | !endif |
---|
230 | |
---|
231 | DCONT = DCONT*dz(k) |
---|
232 | |
---|
233 | endif |
---|
234 | |
---|
235 | do ng=1,L_NGAUSS-1 |
---|
236 | |
---|
237 | ! Now compute TAUGAS |
---|
238 | |
---|
239 | ! Interpolate between water mixing ratios |
---|
240 | ! WRATIO = 0.0 if the requested water amount is equal to, or outside the |
---|
241 | ! the water data range |
---|
242 | |
---|
243 | if(L_REFVAR.eq.1)then ! added by RW for special no variable case |
---|
244 | |
---|
245 | ! JVO 2017 : added tmpk because the repeated calls to gasi/v increased dramatically |
---|
246 | ! the execution time of optci/v -> ~ factor 2 on the whole radiative |
---|
247 | ! transfer on the tested simulations ! |
---|
248 | |
---|
249 | tmpk = GASI(MT(K):MT(K)+1,MP(K):MP(K)+1,1,NW,NG) |
---|
250 | |
---|
251 | KCOEF(1) = tmpk(1,1) ! KCOEF(1) = GASI(MT(K),MP(K),1,NW,NG) |
---|
252 | KCOEF(2) = tmpk(1,2) ! KCOEF(2) = GASI(MT(K),MP(K)+1,1,NW,NG) |
---|
253 | KCOEF(3) = tmpk(2,2) ! KCOEF(3) = GASI(MT(K)+1,MP(K)+1,1,NW,NG) |
---|
254 | KCOEF(4) = tmpk(2,1) ! KCOEF(4) = GASI(MT(K)+1,MP(K),1,NW,NG) |
---|
255 | |
---|
256 | else |
---|
257 | |
---|
258 | tmpkvar = GASI(MT(K):MT(K)+1,MP(K):MP(K)+1,NVAR(K):NVAR(K)+1,NW,NG) |
---|
259 | |
---|
260 | KCOEF(1) = tmpkvar(1,1,1) + WRATIO(K) * & |
---|
261 | ( tmpkvar(1,1,2)-tmpkvar(1,1,1) ) |
---|
262 | |
---|
263 | KCOEF(2) = tmpkvar(1,2,1) + WRATIO(K) * & |
---|
264 | ( tmpkvar(1,2,2)-tmpkvar(1,2,1) ) |
---|
265 | |
---|
266 | KCOEF(3) = tmpkvar(2,2,1) + WRATIO(K) * & |
---|
267 | ( tmpkvar(2,2,2)-tmpkvar(2,2,1) ) |
---|
268 | |
---|
269 | KCOEF(4) = tmpkvar(2,1,1) + WRATIO(K) * & |
---|
270 | ( tmpkvar(2,1,2)-tmpkvar(2,1,1) ) |
---|
271 | |
---|
272 | endif |
---|
273 | |
---|
274 | ! Interpolate the gaseous k-coefficients to the requested T,P values |
---|
275 | |
---|
276 | ANS = LKCOEF(K,1)*KCOEF(1) + LKCOEF(K,2)*KCOEF(2) + & |
---|
277 | LKCOEF(K,3)*KCOEF(3) + LKCOEF(K,4)*KCOEF(4) |
---|
278 | |
---|
279 | TAUGAS = U(k)*ANS |
---|
280 | |
---|
281 | TAUGSURF(NW,NG) = TAUGSURF(NW,NG) + TAUGAS + DCONT |
---|
282 | DTAUKI(K,nw,ng) = TAUGAS & |
---|
283 | + DCONT & ! For parameterized continuum absorption |
---|
284 | + DAERO ! For aerosol absorption |
---|
285 | |
---|
286 | end do |
---|
287 | |
---|
288 | ! Now fill in the "clear" part of the spectrum (NG = L_NGAUSS), |
---|
289 | ! which holds continuum opacity only |
---|
290 | |
---|
291 | NG = L_NGAUSS |
---|
292 | DTAUKI(K,nw,ng) = 0.d0 & |
---|
293 | + DCONT & ! For parameterized continuum absorption |
---|
294 | + DAERO ! For aerosol absorption |
---|
295 | |
---|
296 | end do |
---|
297 | end do |
---|
298 | |
---|
299 | !======================================================================= |
---|
300 | ! Now the full treatment for the layers, where besides the opacity |
---|
301 | ! we need to calculate the scattering albedo and asymmetry factors |
---|
302 | |
---|
303 | do iaer=1,naerkind |
---|
304 | DO NW=1,L_NSPECTI |
---|
305 | DO K=2,L_LEVELS |
---|
306 | TAUAEROLK(K,NW,IAER) = TAUAERO(K,IAER)*QSIAER(K,NW,IAER) ! effect of scattering albedo |
---|
307 | ENDDO |
---|
308 | ENDDO |
---|
309 | end do |
---|
310 | |
---|
311 | DO NW=1,L_NSPECTI |
---|
312 | DO L=1,L_NLAYRAD-1 |
---|
313 | K = 2*L+1 |
---|
314 | btemp(L,NW) = SUM(TAUAEROLK(K,NW,1:naerkind)) + SUM(TAUAEROLK(K+1,NW,1:naerkind)) |
---|
315 | END DO ! L vertical loop |
---|
316 | |
---|
317 | ! Last level |
---|
318 | L = L_NLAYRAD |
---|
319 | K = 2*L+1 |
---|
320 | btemp(L,NW) = SUM(TAUAEROLK(K,NW,1:naerkind)) |
---|
321 | |
---|
322 | END DO ! NW spectral loop |
---|
323 | |
---|
324 | |
---|
325 | DO NW=1,L_NSPECTI |
---|
326 | NG = L_NGAUSS |
---|
327 | DO L=1,L_NLAYRAD-1 |
---|
328 | |
---|
329 | K = 2*L+1 |
---|
330 | DTAUI(L,nw,ng) = DTAUKI(K,NW,NG) + DTAUKI(K+1,NW,NG)! + 1.e-50 |
---|
331 | |
---|
332 | atemp = 0. |
---|
333 | if(DTAUI(L,NW,NG) .GT. 1.0D-9) then |
---|
334 | do iaer=1,naerkind |
---|
335 | atemp = atemp + & |
---|
336 | GIAER(K,NW,IAER) * TAUAEROLK(K,NW,IAER) + & |
---|
337 | GIAER(K+1,NW,IAER) * TAUAEROLK(K+1,NW,IAER) |
---|
338 | end do |
---|
339 | WBARI(L,nw,ng) = btemp(L,nw) / DTAUI(L,NW,NG) |
---|
340 | else |
---|
341 | WBARI(L,nw,ng) = 0.0D0 |
---|
342 | DTAUI(L,NW,NG) = 1.0D-9 |
---|
343 | endif |
---|
344 | |
---|
345 | if(btemp(L,nw) .GT. 0.0d0) then |
---|
346 | cosbi(L,NW,NG) = atemp/btemp(L,nw) |
---|
347 | else |
---|
348 | cosbi(L,NW,NG) = 0.0D0 |
---|
349 | end if |
---|
350 | |
---|
351 | END DO ! L vertical loop |
---|
352 | |
---|
353 | ! Last level |
---|
354 | |
---|
355 | L = L_NLAYRAD |
---|
356 | K = 2*L+1 |
---|
357 | DTAUI(L,nw,ng) = DTAUKI(K,NW,NG) ! + 1.e-50 |
---|
358 | |
---|
359 | atemp = 0. |
---|
360 | if(DTAUI(L,NW,NG) .GT. 1.0D-9) then |
---|
361 | do iaer=1,naerkind |
---|
362 | atemp = atemp + GIAER(K,NW,IAER) * TAUAEROLK(K,NW,IAER) |
---|
363 | end do |
---|
364 | WBARI(L,nw,ng) = btemp(L,nw) / DTAUI(L,NW,NG) |
---|
365 | else |
---|
366 | WBARI(L,nw,ng) = 0.0D0 |
---|
367 | DTAUI(L,NW,NG) = 1.0D-9 |
---|
368 | endif |
---|
369 | |
---|
370 | if(btemp(L,nw) .GT. 0.0d0) then |
---|
371 | cosbi(L,NW,NG) = atemp/btemp(L,nw) |
---|
372 | else |
---|
373 | cosbi(L,NW,NG) = 0.0D0 |
---|
374 | end if |
---|
375 | |
---|
376 | |
---|
377 | ! Now the other Gauss points, if needed. |
---|
378 | |
---|
379 | DO NG=1,L_NGAUSS-1 |
---|
380 | IF(TAUGSURF(NW,NG) .gt. TLIMIT) THEN |
---|
381 | |
---|
382 | DO L=1,L_NLAYRAD-1 |
---|
383 | K = 2*L+1 |
---|
384 | DTAUI(L,nw,ng) = DTAUKI(K,NW,NG)+DTAUKI(K+1,NW,NG)! + 1.e-50 |
---|
385 | |
---|
386 | if(DTAUI(L,NW,NG) .GT. 1.0D-9) then |
---|
387 | |
---|
388 | WBARI(L,nw,ng) = btemp(L,nw) / DTAUI(L,NW,NG) |
---|
389 | |
---|
390 | else |
---|
391 | WBARI(L,nw,ng) = 0.0D0 |
---|
392 | DTAUI(L,NW,NG) = 1.0D-9 |
---|
393 | endif |
---|
394 | |
---|
395 | cosbi(L,NW,NG) = cosbi(L,NW,L_NGAUSS) |
---|
396 | END DO ! L vertical loop |
---|
397 | |
---|
398 | ! Last level |
---|
399 | L = L_NLAYRAD |
---|
400 | K = 2*L+1 |
---|
401 | DTAUI(L,nw,ng) = DTAUKI(K,NW,NG)! + 1.e-50 |
---|
402 | |
---|
403 | if(DTAUI(L,NW,NG) .GT. 1.0D-9) then |
---|
404 | |
---|
405 | WBARI(L,nw,ng) = btemp(L,nw) / DTAUI(L,NW,NG) |
---|
406 | |
---|
407 | else |
---|
408 | WBARI(L,nw,ng) = 0.0D0 |
---|
409 | DTAUI(L,NW,NG) = 1.0D-9 |
---|
410 | endif |
---|
411 | |
---|
412 | cosbi(L,NW,NG) = cosbi(L,NW,L_NGAUSS) |
---|
413 | |
---|
414 | END IF |
---|
415 | |
---|
416 | END DO ! NG Gauss loop |
---|
417 | END DO ! NW spectral loop |
---|
418 | |
---|
419 | ! Total extinction optical depths |
---|
420 | |
---|
421 | DO NG=1,L_NGAUSS ! full gauss loop |
---|
422 | DO NW=1,L_NSPECTI |
---|
423 | TAUCUMI(1,NW,NG)=0.0D0 |
---|
424 | DO K=2,L_LEVELS |
---|
425 | TAUCUMI(K,NW,NG)=TAUCUMI(K-1,NW,NG)+DTAUKI(K,NW,NG) |
---|
426 | END DO |
---|
427 | END DO ! end full gauss loop |
---|
428 | END DO |
---|
429 | |
---|
430 | ! be aware when comparing with textbook results |
---|
431 | ! (e.g. Pierrehumbert p. 218) that |
---|
432 | ! taucumi does not take the <cos theta>=0.5 factor into |
---|
433 | ! account. It is the optical depth for a vertically |
---|
434 | ! ascending ray with angle theta = 0. |
---|
435 | |
---|
436 | !open(127,file='taucum.out') |
---|
437 | !do nw=1,L_NSPECTI |
---|
438 | ! write(127,*) taucumi(L_LEVELS,nw,L_NGAUSS) |
---|
439 | !enddo |
---|
440 | !close(127) |
---|
441 | |
---|
442 | ! print*,'WBARI' |
---|
443 | ! print*,WBARI |
---|
444 | ! print*,'DTAUI' |
---|
445 | ! print*,DTAUI |
---|
446 | ! call abort |
---|
447 | |
---|
448 | end subroutine optci |
---|
449 | |
---|
450 | END MODULE optci_mod |
---|
451 | |
---|