/[MITgcm]/MITgcm/pkg/fizhi/fizhi_lwrad.F
ViewVC logotype

Contents of /MITgcm/pkg/fizhi/fizhi_lwrad.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download)
Mon Jul 26 18:45:17 2004 UTC (19 years, 11 months ago) by molod
Branch: MAIN
Changes since 1.9: +127 -128 lines
Went to use of FIZHI_OPTIONS and _RL in all routines

1 C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_lwrad.F,v 1.9 2004/07/14 17:31:57 molod Exp $
2 C $Name: $
3
4 #include "FIZHI_OPTIONS.h"
5 subroutine lwrio (nymd,nhms,bi,bj,istrip,npcs,low_level,mid_level,
6 . pz,plz,plze,dpres,pkht,pkz,tz,qz,oz,
7 . co2,cfc11,cfc12,cfc22,methane,n2o,emissivity,
8 . tgz,radlwg,st4,dst4,
9 . dtradlw,dlwdtg,dtradlwc,lwgclr,
10 . im,jm,lm,ptop,
11 . nlwcld,cldlw,clwmo,nlwlz,lwlz,
12 . lpnt,imstturb,qliqave,fccave,landtype)
13
14 implicit none
15 #ifdef ALLOW_DIAGNOSTICS
16 #include "SIZE.h"
17 #include "diagnostics_SIZE.h"
18 #include "diagnostics.h"
19 #endif
20
21 c Input Variables
22 c ---------------
23 integer nymd,nhms,istrip,npcs,bi,bj
24 integer mid_level,low_level
25 integer im,jm,lm
26 _RL ptop
27 _RL pz(im,jm),plz(im,jm,lm),plze(im,jm,lm+1)
28 _RL dpres(im,jm,lm),pkht(im,jm,lm+1),pkz(im,jm,lm)
29 _RL tz(im,jm,lm),qz(im,jm,lm),oz(im,jm,lm)
30 _RL co2,cfc11,cfc12,cfc22,methane(lm),n2o(lm)
31 _RL emissivity(im,jm,10)
32 _RL tgz(im,jm),radlwg(im,jm),st4(im,jm),dst4(im,jm)
33 _RL dtradlw(im,jm,lm),dlwdtg (im,jm,lm)
34 _RL dtradlwc(im,jm,lm),lwgclr(im,jm)
35 integer nlwcld,nlwlz
36 _RL cldlw(im,jm,lm),clwmo(im,jm,lm),lwlz(im,jm,lm)
37 logical lpnt
38 integer imstturb
39 _RL qliqave(im,jm,lm),fccave(im,jm,lm)
40 integer landtype(im,jm)
41
42 c Local Variables
43 c ---------------
44 integer i,j,l,n,nn
45
46 _RL cldtot (im,jm,lm)
47 _RL cldmxo (im,jm,lm)
48
49 _RL pl(istrip,lm)
50 _RL pk(istrip,lm)
51 _RL pke(istrip,lm)
52 _RL ple(istrip,lm+1)
53
54 _RL ADELPL(ISTRIP,lm)
55 _RL dtrad(istrip,lm),dtradc(istrip,lm)
56 _RL OZL(ISTRIP,lm),TZL(ISTRIP,lm)
57 _RL SHZL(ISTRIP,lm),CLRO(ISTRIP,lm)
58 _RL CLMO(ISTRIP,lm)
59 _RL flx(ISTRIP,lm+1),flxclr(ISTRIP,lm+1)
60 _RL cldlz(istrip,lm)
61 _RL dfdts(istrip,lm+1),dtdtg(istrip,lm)
62
63 _RL emiss(istrip,10)
64 _RL taual(istrip,lm,10)
65 _RL ssaal(istrip,lm,10)
66 _RL asyal(istrip,lm,10)
67 _RL cwc(istrip,lm,3)
68 _RL reff(istrip,lm,3)
69 _RL tauc(istrip,lm,3)
70
71 _RL SGMT4(ISTRIP),TSURF(ISTRIP),dsgmt4(ISTRIP)
72 integer lwi(istrip)
73
74 _RL getcon,secday,convrt
75
76 logical high, trace, cldwater
77 data high /.true./
78 data trace /.true./
79 data cldwater /.false./
80
81 C **********************************************************************
82 C **** INITIALIZATION ****
83 C **********************************************************************
84
85 SECDAY = GETCON('SDAY')
86 CONVRT = GETCON('GRAVITY') / ( 100.0 * GETCON('CP') )
87
88 c Adjust cloud fractions and cloud liquid water due to moist turbulence
89 c ---------------------------------------------------------------------
90 if(imstturb.ne.0) then
91 do L =1,lm
92 do j =1,jm
93 do i =1,im
94 cldtot(i,j,L)=min(1.0,max(cldlw(i,j,L),fccave(i,j,L)/imstturb))
95 cldmxo(i,j,L) = min( 1.0 , clwmo(i,j,L) )
96 lwlz(i,j,L) = lwlz(i,j,L) + qliqave(i,j,L)/imstturb
97 enddo
98 enddo
99 enddo
100 else
101 do L =1,lm
102 do j =1,jm
103 do i =1,im
104 cldtot(i,j,L) = min( 1.0,cldlw(i,j,L) )
105 cldmxo(i,j,L) = min( 1.0,clwmo(i,j,L) )
106 enddo
107 enddo
108 enddo
109 endif
110
111 C***********************************************************************
112 C **** LOOP OVER STRIPS ****
113 C **********************************************************************
114
115 DO 1000 NN=1,NPCS
116
117 C **********************************************************************
118 C **** VARIABLE INITIALIZATION ****
119 C **********************************************************************
120
121 CALL STRIP (OZ,OZL ,im*jm,ISTRIP,lm ,NN)
122 CALL STRIP (PLZE,ple ,im*jm,ISTRIP,lm+1 ,NN)
123 CALL STRIP (PLZ ,pl ,im*jm,ISTRIP,lm ,NN)
124 CALL STRIP (PKZ ,pk ,im*jm,ISTRIP,lm ,NN)
125 CALL STRIP (PKHT,pke ,im*jm,ISTRIP,lm ,NN)
126 CALL STRIP (TZ,TZL ,im*jm,ISTRIP,lm ,NN)
127 CALL STRIP (qz,SHZL ,im*jm,ISTRIP,lm ,NN)
128 CALL STRIP (cldtot,CLRO ,im*jm,ISTRIP,lm ,NN)
129 CALL STRIP (cldmxo,CLMO ,im*jm,ISTRIP,lm ,NN)
130 CALL STRIP (lwlz,cldlz ,im*jm,ISTRIP,lm ,NN)
131 CALL STRIP (tgz,tsurf ,im*jm,ISTRIP,1 ,NN)
132
133 CALL STRIP (emissivity,emiss,im*jm,ISTRIP,10,NN)
134
135 call stripitint (landtype,lwi,im*jm,im*jm,istrip,1,nn)
136
137 DO I = 1,ISTRIP*lm
138 ADELPL(I,1) = convrt / ( ple(I,2)-ple(I,1) )
139 ENDDO
140
141 C Compute Clouds
142 C --------------
143 IF(NLWCLD.NE.0)THEN
144 DO L = 1,lm
145 DO I = 1,ISTRIP
146 CLRO(I,L) = min( 1.0,clro(i,L) )
147 CLMO(I,L) = min( 1.0,clmo(i,L) )
148 ENDDO
149 ENDDO
150 ENDIF
151
152 DO L = 1,lm
153 DO I = 1,ISTRIP
154 TZL(I,L) = TZL(I,L)*pk(I,L)
155 ENDDO
156 ENDDO
157 DO I = 1,ISTRIP
158 C To reduce longwave heating in lowest model layer
159 TZL(I,lm) = ( 2*tzl(i,lm)+tsurf(i) )/3.0
160 ENDDO
161
162 C Compute Optical Thicknesses
163 C ---------------------------
164 call opthk ( tzl,pl,ple,cldlz,clro,clmo,lwi,istrip,1,lm,tauc )
165
166 do n = 1,3
167 do L = 1,lm
168 do i = 1,istrip
169 tauc(i,L,n) = tauc(i,L,n)*0.75
170 enddo
171 enddo
172 enddo
173
174 C Set the optical thickness, single scattering albedo and assymetry factor
175 C for aerosols equal to zero to omit the contribution of aerosols
176 c-------------------------------------------------------------------------
177 do n = 1,10
178 do L = 1,lm
179 do i = 1,istrip
180 taual(i,L,n) = 0.
181 ssaal(i,L,n) = 0.
182 asyal(i,L,n) = 0.
183 enddo
184 enddo
185 enddo
186
187 C Set cwc and reff to zero - when cldwater is .false.
188 c----------------------------------------------------
189 do n = 1,3
190 do L = 1,lm
191 do i = 1,istrip
192 cwc(i,L,n) = 0.
193 reff(i,L,n) = 0.
194 enddo
195 enddo
196 enddo
197
198 C **********************************************************************
199 C **** CALL M-D Chou RADIATION ****
200 C **********************************************************************
201
202 call irrad ( istrip,1,1,lm,ple,tzl,shzl,ozl,tsurf,co2,
203 . n2o,methane,cfc11,cfc12,cfc22,emiss,
204 . cldwater,cwc,tauc,reff,clro,mid_level,low_level,
205 . taual,ssaal,asyal,
206 . high,trace,flx,flxclr,dfdts,sgmt4 )
207
208 C **********************************************************************
209 C **** HEATING RATES ****
210 C **********************************************************************
211
212 do L = 1,lm
213 do i = 1,istrip
214 dtrad(i,L) = ( flx(i,L)- flx(i,L+1))*adelpl(i,L)
215 dtdtg(i,L) = ( dfdts(i,L)- dfdts(i,L+1))*adelpl(i,L)
216 dtradc(i,L) = (flxclr(i,L)-flxclr(i,L+1))*adelpl(i,L)
217 enddo
218 enddo
219
220 C **********************************************************************
221 C **** NET UPWARD LONGWAVE FLUX (W/M**2) ****
222 C **********************************************************************
223
224 DO I = 1,ISTRIP
225 flx (i,1) = -flx (i,1)
226 flxclr(i,1) = -flxclr(i,1)
227 flx (i,lm+1) = -flx (i,lm+1)
228 flxclr(i,lm+1) = -flxclr(i,lm+1)
229 sgmt4(i) = - sgmt4(i)
230 dsgmt4(i) = - dfdts(i,lm+1)
231 ENDDO
232
233 CALL PASTE ( flx (1,lm+1),RADLWG,ISTRIP,im*jm,1,NN )
234 CALL PASTE ( flxclr(1,lm+1),LWGCLR,ISTRIP,im*jm,1,NN )
235
236 CALL PASTE ( sgmt4, st4,ISTRIP,im*jm,1,NN )
237 CALL PASTE ( dsgmt4,dst4,ISTRIP,im*jm,1,NN )
238
239 C **********************************************************************
240 C **** PASTE AND BUMP SOME DIAGNOSTICS ****
241 C **********************************************************************
242
243 IF(IOLR.GT.0)CALL PSTBMP(flx(1,1),QDIAG(1,1,IOLR,bi,bj),ISTRIP,
244 . im*jm, 1,NN)
245 IF(IOLRCLR.GT.0)CALL PSTBMP(flxclr(1,1),QDIAG(1,1,IOLRCLR,bi,bj),
246 . ISTRIP,im*jm,1,NN)
247 IF(IOZLW.GT.0)CALL PSTBMP(OZL(1,1),QDIAG(1,1,IOZLW,bi,bj),ISTRIP,
248 . im*jm,lm,NN)
249
250 C **********************************************************************
251 C **** TENDENCY UPDATES ****
252 C **********************************************************************
253
254 DO L = 1,lm
255 DO I = 1,ISTRIP
256 DTRAD (I,L) = ( ple(i,lm+1)-PTOP ) * DTRAD (I,L)/pk(I,L)
257 DTRADC(I,L) = ( ple(i,lm+1)-PTOP ) * DTRADC(I,L)/pk(I,L)
258 dtdtg(I,L) = ( ple(i,lm+1)-PTOP ) * dtdtg (I,L)/pk(I,L)
259 ENDDO
260 ENDDO
261 CALL PASTE ( DTRAD ,DTRADLW ,ISTRIP,im*jm,lm,NN )
262 CALL PASTE ( DTRADC,DTRADLWC,ISTRIP,im*jm,lm,NN )
263 CALL PASTE ( dtdtg ,dlwdtg ,ISTRIP,im*jm,lm,NN )
264
265 1000 CONTINUE
266
267 C **********************************************************************
268 C **** BUMP DIAGNOSTICS ****
269 C **********************************************************************
270
271 if(itgrlw.ne.0) then
272 do j = 1,jm
273 do i = 1,im
274 qdiag(i,j,itgrlw,bi,bj) = qdiag(i,j,itgrlw,bi,bj) + tgz(i,j)
275 enddo
276 enddo
277 endif
278
279 if (itlw.ne.0) then
280 do L = 1,lm
281 do j = 1,jm
282 do i = 1,im
283 qdiag(i,j,itlw+L-1,bi,bj) = qdiag(i,j,itlw+L-1,bi,bj) +
284 . tz(i,j,L)*pkz(i,j,L)
285 enddo
286 enddo
287 enddo
288 endif
289
290 if (ishrad.ne.0) then
291 do L = 1,lm
292 do j = 1,jm
293 do i = 1,im
294 qdiag(i,j,ishrad+L-1,bi,bj) = qdiag(i,j,ishrad+L-1,bi,bj) +
295 . qz(i,j,L)*1000
296 enddo
297 enddo
298 enddo
299 endif
300
301
302 C **********************************************************************
303 C **** Increment Diagnostics Counters and Zero-Out Cloud Info ****
304 C **********************************************************************
305
306 ntlw = ntlw + 1
307 nshrad = nshrad + 1
308 nozlw = nozlw + 1
309 ntgrlw = ntgrlw + 1
310 nolr = nolr + 1
311 nolrclr = nolrclr + 1
312
313 nlwlz = 0
314 nlwcld = 0
315 imstturb = 0
316
317 do L = 1,lm
318 do j = 1,jm
319 do i = 1,im
320 fccave(i,j,L) = 0.
321 qliqave(i,j,L) = 0.
322 enddo
323 enddo
324 enddo
325
326 return
327 end
328 c********************** November 26, 1997 **************************
329
330 subroutine irrad (m,n,ndim,np,pl,ta,wa,oa,ts,co2,
331 * n2o,ch4,cfc11,cfc12,cfc22,emiss,
332 * cldwater,cwc,taucl,reff,fcld,ict,icb,
333 * taual,ssaal,asyal,
334 * high,trace,flx,flc,dfdts,st4)
335
336 c***********************************************************************
337 c
338 c Version IR-5 (September, 1998)
339 c
340 c New features of this version are:
341 c (1) The effect of aerosol scattering on LW fluxes is included.
342 c (2) Absorption and scattering of rain drops are included.
343 c
344 c***********************************************************************
345 c
346 c Version IR-4 (October, 1997)
347 c
348 c New features of this version are:
349 c (1) The surface is treated as non-black. The surface
350 c emissivity, emiss, is an input parameter
351 c (2) The effect of cloud scattering on LW fluxes is included
352 c
353 c*********************************************************************
354 c
355 c This routine computes ir fluxes due to water vapor, co2, o3,
356 c trace gases (n2o, ch4, cfc11, cfc12, cfc22, co2-minor),
357 c clouds, and aerosols.
358 c
359 c This is a vectorized code. It computes fluxes simultaneously for
360 c (m x n) soundings, which is a subset of (m x ndim) soundings.
361 c In a global climate model, m and ndim correspond to the numbers of
362 c grid boxes in the zonal and meridional directions, respectively.
363 c
364 c Some detailed descriptions of the radiation routine are given in
365 c Chou and Suarez (1994).
366 c
367 c Ice and liquid cloud particles are allowed to co-exist in any of the
368 c np layers.
369 c
370 c If no information is available for the effective cloud particle size,
371 c reff, default values of 10 micron for liquid water and 75 micron
372 c for ice can be used.
373 c
374 c The maximum-random assumption is applied for cloud overlapping.
375 c clouds are grouped into high, middle, and low clouds separated by the
376 c level indices ict and icb. Within each of the three groups, clouds
377 c are assumed maximally overlapped, and the cloud cover of a group is
378 c the maximum cloud cover of all the layers in the group. clouds among
379 c the three groups are assumed randomly overlapped. The indices ict and
380 c icb correpond approximately to the 400 mb and 700 mb levels.
381 c
382 c Aerosols are allowed to be in any of the np layers. Aerosol optical
383 c properties can be specified as functions of height and spectral band.
384 c
385 c There are options for computing fluxes:
386 c
387 c If cldwater=.true., taucl is computed from cwc and reff as a
388 c function of height and spectral band.
389 c If cldwater=.false., taucl must be given as input to the radiation
390 c routine. It is independent of spectral band.
391 c
392 c If high = .true., transmission functions in the co2, o3, and the
393 c three water vapor bands with strong absorption are computed using
394 c table look-up. cooling rates are computed accurately from the
395 c surface up to 0.01 mb.
396 c If high = .false., transmission functions are computed using the
397 c k-distribution method with linear pressure scaling for all spectral
398 c bands and gases. cooling rates are not calculated accurately for
399 c pressures less than 20 mb. the computation is faster with
400 c high=.false. than with high=.true.
401
402 c If trace = .true., absorption due to n2o, ch4, cfcs, and the
403 c two minor co2 bands in the window region is included.
404 c If trace = .false., absorption in minor bands is neglected.
405 c
406 c The IR spectrum is divided into nine bands:
407 c
408 c band wavenumber (/cm) absorber
409 c
410 c 1 0 - 340 h2o
411 c 2 340 - 540 h2o
412 c 3 540 - 800 h2o,cont,co2,n2o
413 c 4 800 - 980 h2o,cont
414 c co2,f11,f12,f22
415 c 5 980 - 1100 h2o,cont,o3
416 c co2,f11
417 c 6 1100 - 1215 h2o,cont
418 c n2o,ch4,f12,f22
419 c 7 1215 - 1380 h2o
420 c n2o,ch4
421 c 8 1380 - 1900 h2o
422 c 9 1900 - 3000 h2o
423 c
424 c In addition, a narrow band in the 15 micrometer region is added to
425 c compute flux reduction due to n2o
426 c
427 c 10 540 - 620 h2o,cont,co2,n2o
428 c
429 c Band 3 (540-800/cm) is further divided into 3 sub-bands :
430 c
431 c subband wavenumber (/cm)
432 c
433 c 1 540 - 620
434 c 2 620 - 720
435 c 3 720 - 800
436 c
437 c---- Input parameters units size
438 c
439 c number of soundings in zonal direction (m) n/d 1
440 c number of soundings in meridional direction (n) n/d 1
441 c maximum number of soundings in
442 c meridional direction (ndim>=n) n/d 1
443 c number of atmospheric layers (np) n/d 1
444 c level pressure (pl) mb m*ndim*(np+1)
445 c layer temperature (ta) k m*ndim*np
446 c layer specific humidity (wa) g/g m*ndim*np
447 c layer ozone mixing ratio by mass (oa) g/g m*ndim*np
448 c surface temperature (ts) k m*ndim
449 c co2 mixing ratio by volumn (co2) pppv 1
450 c n2o mixing ratio by volumn (n2o) pppv np
451 c ch4 mixing ratio by volumn (ch4) pppv np
452 c cfc11 mixing ratio by volumn (cfc11) pppv 1
453 c cfc12 mixing ratio by volumn (cfc12) pppv 1
454 c cfc22 mixing ratio by volumn (cfc22) pppv 1
455 c surface emissivity (emiss) fraction m*ndim*10
456 c input option for cloud optical thickness n/d 1
457 c cldwater="true" if cwc is provided
458 c cldwater="false" if taucl is provided
459 c cloud water mixing ratio (cwc) gm/gm m*ndim*np*3
460 c index 1 for ice particles
461 c index 2 for liquid drops
462 c index 3 for rain drops
463 c cloud optical thickness (taucl) n/d m*ndim*np*3
464 c index 1 for ice particles
465 c index 2 for liquid drops
466 c index 3 for rain drops
467 c effective cloud-particle size (reff) micrometer m*ndim*np*3
468 c index 1 for ice particles
469 c index 2 for liquid drops
470 c index 3 for rain drops
471 c cloud amount (fcld) fraction m*ndim*np
472 c level index separating high and middle n/d 1
473 c clouds (ict)
474 c level index separating middle and low n/d 1
475 c clouds (icb)
476 c aerosol optical thickness (taual) n/d m*ndim*np*10
477 c aerosol single-scattering albedo (ssaal) n/d m*ndim*np*10
478 c aerosol asymmetry factor (asyal) n/d m*ndim*np*10
479 c high (see explanation above) 1
480 c trace (see explanation above) 1
481 c
482 c Data used in table look-up for transmittance calculations:
483 c
484 c c1 , c2, c3: for co2 (band 3)
485 c o1 , o2, o3: for o3 (band 5)
486 c h11,h12,h13: for h2o (band 1)
487 c h21,h22,h23: for h2o (band 2)
488 c h81,h82,h83: for h2o (band 8)
489 c
490 c---- output parameters
491 c
492 c net downward flux, all-sky (flx) w/m**2 m*ndim*(np+1)
493 c net downward flux, clear-sky (flc) w/m**2 m*ndim*(np+1)
494 c sensitivity of net downward flux
495 c to surface temperature (dfdts) w/m**2/k m*ndim*(np+1)
496 c emission by the surface (st4) w/m**2 m*ndim
497 c
498 c Notes:
499 c
500 c (1) Water vapor continuum absorption is included in 540-1380 /cm.
501 c (2) Scattering is parameterized for clouds and aerosols.
502 c (3) Diffuse cloud and aerosol transmissions are computed
503 c from exp(-1.66*tau).
504 c (4) If there are no clouds, flx=flc.
505 c (5) plevel(1) is the pressure at the top of the model atmosphere,
506 c and plevel(np+1) is the surface pressure.
507 c (6) Downward flux is positive and upward flux is negative.
508 c (7) dfdts is negative because upward flux is defined as negative.
509 c (8) For questions and coding errors, contact with Ming-Dah Chou,
510 c Code 913, NASA/Goddard Space Flight Center, Greenbelt, MD 20771.
511 c Phone: 301-286-4012, Fax: 301-286-1759,
512 c e-mail: chou@climate.gsfc.nasa.gov
513 c
514 c-----parameters defining the size of the pre-computed tables for transmittance
515 c calculations using table look-up.
516 c
517 c "nx" is the number of intervals in pressure
518 c "no" is the number of intervals in o3 amount
519 c "nc" is the number of intervals in co2 amount
520 c "nh" is the number of intervals in h2o amount
521 c "nt" is the number of copies to be made from the pre-computed
522 c transmittance tables to reduce "memory-bank conflict"
523 c in parallel machines and, hence, enhancing the speed of
524 c computations using table look-up.
525 c If such advantage does not exist, "nt" can be set to 1.
526 c***************************************************************************
527
528 cfpp$ expand (h2oexps)
529 cfpp$ expand (conexps)
530 cfpp$ expand (co2exps)
531 cfpp$ expand (n2oexps)
532 cfpp$ expand (ch4exps)
533 cfpp$ expand (comexps)
534 cfpp$ expand (cfcexps)
535 cfpp$ expand (b10exps)
536 cfpp$ expand (tablup)
537 cfpp$ expand (h2okdis)
538 cfpp$ expand (co2kdis)
539 cfpp$ expand (n2okdis)
540 cfpp$ expand (ch4kdis)
541 cfpp$ expand (comkdis)
542 cfpp$ expand (cfckdis)
543 cfpp$ expand (b10kdis)
544
545 implicit none
546 integer nx,no,nc,nh,nt
547 integer i,j,k,ip,iw,it,ib,ik,iq,isb,k1,k2
548 parameter (nx=26,no=21,nc=24,nh=31,nt=7)
549
550 c---- input parameters ------
551
552 integer m,n,ndim,np,ict,icb
553 _RL pl(m,ndim,np+1),ta(m,ndim,np),wa(m,ndim,np),oa(m,ndim,np),
554 * ts(m,ndim)
555 _RL co2,n2o(np),ch4(np),cfc11,cfc12,cfc22,emiss(m,ndim,10)
556 _RL cwc(m,ndim,np,3),taucl(m,ndim,np,3),reff(m,ndim,np,3),
557 * fcld(m,ndim,np)
558 _RL taual(m,ndim,np,10),ssaal(m,ndim,np,10),asyal(m,ndim,np,10)
559 logical cldwater,high,trace
560
561 c---- output parameters ------
562
563 _RL flx(m,ndim,np+1),flc(m,ndim,np+1),dfdts(m,ndim,np+1),
564 * st4(m,ndim)
565
566 c---- static data -----
567
568 _RL cb(5,10)
569 _RL xkw(9),aw(9),bw(9),pm(9),fkw(6,9),gkw(6,3),xke(9)
570 _RL aib(3,10),awb(4,10),aiw(4,10),aww(4,10),aig(4,10),awg(4,10)
571 integer ne(9),mw(9)
572
573 c---- temporary arrays -----
574
575 _RL pa(m,n,np),dt(m,n,np)
576 _RL sh2o(m,n,np+1),swpre(m,n,np+1),swtem(m,n,np+1)
577 _RL sco3(m,n,np+1),scopre(m,n,np+1),scotem(m,n,np+1)
578 _RL dh2o(m,n,np),dcont(m,n,np),dco2(m,n,np),do3(m,n,np)
579 _RL dn2o(m,n,np),dch4(m,n,np)
580 _RL df11(m,n,np),df12(m,n,np),df22(m,n,np)
581 _RL th2o(m,n,6),tcon(m,n,3),tco2(m,n,6,2)
582 _RL tn2o(m,n,4),tch4(m,n,4),tcom(m,n,2)
583 _RL tf11(m,n),tf12(m,n),tf22(m,n)
584 _RL h2oexp(m,n,np,6),conexp(m,n,np,3),co2exp(m,n,np,6,2)
585 _RL n2oexp(m,n,np,4),ch4exp(m,n,np,4),comexp(m,n,np,2)
586 _RL f11exp(m,n,np), f12exp(m,n,np), f22exp(m,n,np)
587 _RL clr(m,n,0:np+1),fclr(m,n)
588 _RL blayer(m,n,0:np+1),dlayer(m,n,np+1),dbs(m,n)
589 _RL clrlw(m,n),clrmd(m,n),clrhi(m,n)
590 _RL cwp(m,n,np,3)
591 _RL trant(m,n),tranal(m,n),transfc(m,n,np+1),trantcr(m,n,np+1)
592 _RL flxu(m,n,np+1),flxd(m,n,np+1),flcu(m,n,np+1),flcd(m,n,np+1)
593 _RL rflx(m,n,np+1),rflc(m,n,np+1)
594
595 logical oznbnd,co2bnd,h2otbl,conbnd,n2obnd
596 logical ch4bnd,combnd,f11bnd,f12bnd,f22bnd,b10bnd
597
598 _RL c1 (nx,nc,nt),c2 (nx,nc,nt),c3 (nx,nc,nt)
599 _RL o1 (nx,no,nt),o2 (nx,no,nt),o3 (nx,no,nt)
600 _RL h11(nx,nh,nt),h12(nx,nh,nt),h13(nx,nh,nt)
601 _RL h21(nx,nh,nt),h22(nx,nh,nt),h23(nx,nh,nt)
602 _RL h81(nx,nh,nt),h82(nx,nh,nt),h83(nx,nh,nt)
603
604 _RL dp,xx,p1,dwe,dpe,a1,b1,fk1,a2,b2,fk2
605 _RL w1,w2,w3,g1,g2,g3,ww,gg,ff,taux,reff1,reff2
606
607 c-----the following coefficients (equivalent to table 2 of
608 c chou and suarez, 1995) are for computing spectrally
609 c integrated planck fluxes using eq. (22)
610
611 data cb/
612 1 -2.6844e-1,-8.8994e-2, 1.5676e-3,-2.9349e-6, 2.2233e-9,
613 2 3.7315e+1,-7.4758e-1, 4.6151e-3,-6.3260e-6, 3.5647e-9,
614 3 3.7187e+1,-3.9085e-1,-6.1072e-4, 1.4534e-5,-1.6863e-8,
615 4 -4.1928e+1, 1.0027e+0,-8.5789e-3, 2.9199e-5,-2.5654e-8,
616 5 -4.9163e+1, 9.8457e-1,-7.0968e-3, 2.0478e-5,-1.5514e-8,
617 6 -4.7107e+1, 8.9130e-1,-5.9735e-3, 1.5596e-5,-9.5911e-9,
618 7 -5.4041e+1, 9.5332e-1,-5.7784e-3, 1.2555e-5,-2.9377e-9,
619 8 -6.9233e+0,-1.5878e-1, 3.9160e-3,-2.4496e-5, 4.9301e-8,
620 9 1.1483e+2,-2.2376e+0, 1.6394e-2,-5.3672e-5, 6.6456e-8,
621 * 1.9668e+1,-3.1161e-1, 1.2886e-3, 3.6835e-7,-1.6212e-9/
622
623 c-----xkw are the absorption coefficients for the first
624 c k-distribution function due to water vapor line absorption
625 c (tables 4 and 7). units are cm**2/g
626
627 data xkw / 29.55 , 4.167e-1, 1.328e-2, 5.250e-4,
628 * 5.25e-4, 9.369e-3, 4.719e-2, 1.320e-0, 5.250e-4/
629
630 c-----xke are the absorption coefficients for the first
631 c k-distribution function due to water vapor continuum absorption
632 c (table 6). units are cm**2/g
633
634 data xke / 0.00, 0.00, 27.40, 15.8,
635 * 9.40, 7.75, 0.0, 0.0, 0.0/
636
637 c-----mw are the ratios between neighboring absorption coefficients
638 c for water vapor line absorption (tables 4 and 7).
639
640 data mw /6,6,8,6,6,8,9,6,16/
641
642 c-----aw and bw (table 3) are the coefficients for temperature scaling
643 c in eq. (25).
644
645 data aw/ 0.0021, 0.0140, 0.0167, 0.0302,
646 * 0.0307, 0.0195, 0.0152, 0.0008, 0.0096/
647 data bw/ -1.01e-5, 5.57e-5, 8.54e-5, 2.96e-4,
648 * 2.86e-4, 1.108e-4, 7.608e-5, -3.52e-6, 1.64e-5/
649
650 data pm/ 1.0, 1.0, 1.0, 1.0, 1.0, 0.77, 0.5, 1.0, 1.0/
651
652 c-----fkw is the planck-weighted k-distribution function due to h2o
653 c line absorption given in table 4 of Chou and Suarez (1995).
654 c the k-distribution function for the third band, fkw(*,3), is not used
655
656 data fkw / 0.2747,0.2717,0.2752,0.1177,0.0352,0.0255,
657 2 0.1521,0.3974,0.1778,0.1826,0.0374,0.0527,
658 3 6*1.00,
659 4 0.4654,0.2991,0.1343,0.0646,0.0226,0.0140,
660 5 0.5543,0.2723,0.1131,0.0443,0.0160,0.0000,
661 6 0.5955,0.2693,0.0953,0.0335,0.0064,0.0000,
662 7 0.1958,0.3469,0.3147,0.1013,0.0365,0.0048,
663 8 0.0740,0.1636,0.4174,0.1783,0.1101,0.0566,
664 9 0.1437,0.2197,0.3185,0.2351,0.0647,0.0183/
665
666 c-----gkw is the planck-weighted k-distribution function due to h2o
667 c line absorption in the 3 subbands (800-720,620-720,540-620 /cm)
668 c of band 3 given in table 7. Note that the order of the sub-bands
669 c is reversed.
670
671 data gkw/ 0.1782,0.0593,0.0215,0.0068,0.0022,0.0000,
672 2 0.0923,0.1675,0.0923,0.0187,0.0178,0.0000,
673 3 0.0000,0.1083,0.1581,0.0455,0.0274,0.0041/
674
675 c-----ne is the number of terms used in each band to compute water vapor
676 c continuum transmittance (table 6).
677
678 data ne /0,0,3,1,1,1,0,0,0/
679 c
680 c-----coefficients for computing the extinction coefficient
681 c for cloud ice particles
682 c polynomial fit: y=a1+a2/x**a3; x is in m**2/gm
683 c
684 data aib / -0.44171, 0.62951, 0.06465,
685 2 -0.13727, 0.61291, 0.28962,
686 3 -0.01878, 1.67680, 0.79080,
687 4 -0.01896, 1.06510, 0.69493,
688 5 -0.04788, 0.88178, 0.54492,
689 6 -0.02265, 1.57390, 0.76161,
690 7 -0.01038, 2.15640, 0.89045,
691 8 -0.00450, 2.51370, 0.95989,
692 9 -0.00044, 3.15050, 1.03750,
693 * -0.02956, 1.44680, 0.71283/
694 c
695 c-----coefficients for computing the extinction coefficient
696 c for cloud liquid drops
697 c polynomial fit: y=a1+a2*x+a3*x**2+a4*x**3; x is in m**2/gm
698 c
699 data awb / 0.08641, 0.01769, -1.5572e-3, 3.4896e-5,
700 2 0.22027, 0.00997, -1.8719e-3, 5.3112e-5,
701 3 0.39252, -0.02817, 7.2931e-4, -3.8151e-6,
702 4 0.39975, -0.03426, 1.2884e-3, -1.7930e-5,
703 5 0.34021, -0.02805, 1.0654e-3, -1.5443e-5,
704 6 0.15587, 0.00371, -7.7705e-4, 2.0547e-5,
705 7 0.05518, 0.04544, -4.2067e-3, 1.0184e-4,
706 8 0.12724, 0.04751, -5.2037e-3, 1.3711e-4,
707 9 0.30390, 0.01656, -3.5271e-3, 1.0828e-4,
708 * 0.63617, -0.06287, 2.2350e-3, -2.3177e-5/
709 c
710 c-----coefficients for computing the single-scattering albedo
711 c for cloud ice particles
712 c polynomial fit: y=a1+a2*x+a3*x**2+a4*x**3; x is in m**2/gm
713 c
714 data aiw/ 0.17201, 1.2229e-2, -1.4837e-4, 5.8020e-7,
715 2 0.81470, -2.7293e-3, 9.7816e-8, 5.7650e-8,
716 3 0.54859, -4.8273e-4, 5.4353e-6, -1.5679e-8,
717 4 0.39218, 4.1717e-3, - 4.8869e-5, 1.9144e-7,
718 5 0.71773, -3.3640e-3, 1.9713e-5, -3.3189e-8,
719 6 0.77345, -5.5228e-3, 4.8379e-5, -1.5151e-7,
720 7 0.74975, -5.6604e-3, 5.6475e-5, -1.9664e-7,
721 8 0.69011, -4.5348e-3, 4.9322e-5, -1.8255e-7,
722 9 0.83963, -6.7253e-3, 6.1900e-5, -2.0862e-7,
723 * 0.64860, -2.8692e-3, 2.7656e-5, -8.9680e-8/
724 c
725 c-----coefficients for computing the single-scattering albedo
726 c for cloud liquid drops
727 c polynomial fit: y=a1+a2*x+a3*x**2+a4*x**3; x is in m**2/gm
728 c
729 data aww/ -7.8566e-2, 8.0875e-2, -4.3403e-3, 8.1341e-5,
730 2 -1.3384e-2, 9.3134e-2, -6.0491e-3, 1.3059e-4,
731 3 3.7096e-2, 7.3211e-2, -4.4211e-3, 9.2448e-5,
732 4 -3.7600e-3, 9.3344e-2, -5.6561e-3, 1.1387e-4,
733 5 0.40212, 7.8083e-2, -5.9583e-3, 1.2883e-4,
734 6 0.57928, 5.9094e-2, -5.4425e-3, 1.2725e-4,
735 7 0.68974, 4.2334e-2, -4.9469e-3, 1.2863e-4,
736 8 0.80122, 9.4578e-3, -2.8508e-3, 9.0078e-5,
737 9 1.02340, -2.6204e-2, 4.2552e-4, 3.2160e-6,
738 * 0.05092, 7.5409e-2, -4.7305e-3, 1.0121e-4/
739 c
740 c-----coefficients for computing the asymmetry factor for cloud ice particles
741 c polynomial fit: y=a1+a2*x+a3*x**2+a4*x**3; x is in m**2/gm
742 c
743 data aig / 0.57867, 1.0135e-2, -1.1142e-4, 4.1537e-7,
744 2 0.72259, 3.1149e-3, -1.9927e-5, 5.6024e-8,
745 3 0.76109, 4.5449e-3, -4.6199e-5, 1.6446e-7,
746 4 0.86934, 2.7474e-3, -3.1301e-5, 1.1959e-7,
747 5 0.89103, 1.8513e-3, -1.6551e-5, 5.5193e-8,
748 6 0.86325, 2.1408e-3, -1.6846e-5, 4.9473e-8,
749 7 0.85064, 2.5028e-3, -2.0812e-5, 6.3427e-8,
750 8 0.86945, 2.4615e-3, -2.3882e-5, 8.2431e-8,
751 9 0.80122, 3.1906e-3, -2.4856e-5, 7.2411e-8,
752 * 0.73290, 4.8034e-3, -4.4425e-5, 1.4839e-7/
753 c
754 c-----coefficients for computing the asymmetry factor for cloud liquid drops
755 c polynomial fit: y=a1+a2*x+a3*x**2+a4*x**3; x is in m**2/gm
756 c
757 data awg / -0.51930, 0.20290, -1.1747e-2, 2.3868e-4,
758 2 -0.22151, 0.19708, -1.2462e-2, 2.6646e-4,
759 3 0.14157, 0.14705, -9.5802e-3, 2.0819e-4,
760 4 0.41590, 0.10482, -6.9118e-3, 1.5115e-4,
761 5 0.55338, 7.7016e-2, -5.2218e-3, 1.1587e-4,
762 6 0.61384, 6.4402e-2, -4.6241e-3, 1.0746e-4,
763 7 0.67891, 4.8698e-2, -3.7021e-3, 9.1966e-5,
764 8 0.78169, 2.0803e-2, -1.4749e-3, 3.9362e-5,
765 9 0.93218, -3.3425e-2, 2.9632e-3, -6.9362e-5,
766 * 0.01649, 0.16561, -1.0723e-2, 2.3220e-4/
767 c
768 c-----include tables used in the table look-up for co2 (band 3),
769 c o3 (band 5), and h2o (bands 1, 2, and 7) transmission functions.
770
771 logical first
772 data first /.true./
773
774 #include "h2o-tran3.h"
775 #include "co2-tran3.h"
776 #include "o3-tran3.h"
777
778 save c1,c2,c3,o1,o2,o3
779 save h11,h12,h13,h21,h22,h23,h81,h82,h83
780
781 if (first) then
782
783 c-----tables co2 and h2o are only used with 'high' option
784
785 if (high) then
786
787 do iw=1,nh
788 do ip=1,nx
789 h11(ip,iw,1)=1.0-h11(ip,iw,1)
790 h21(ip,iw,1)=1.0-h21(ip,iw,1)
791 h81(ip,iw,1)=1.0-h81(ip,iw,1)
792 enddo
793 enddo
794
795 do iw=1,nc
796 do ip=1,nx
797 c1(ip,iw,1)=1.0-c1(ip,iw,1)
798 enddo
799 enddo
800
801 c-----copy tables to enhance the speed of co2 (band 3), o3 (band 5),
802 c and h2o (bands 1, 2, and 8 only) transmission calculations
803 c using table look-up.
804 c-----tables are replicated to avoid memory bank conflicts
805
806 do it=2,nt
807 do iw=1,nc
808 do ip=1,nx
809 c1 (ip,iw,it)= c1(ip,iw,1)
810 c2 (ip,iw,it)= c2(ip,iw,1)
811 c3 (ip,iw,it)= c3(ip,iw,1)
812 enddo
813 enddo
814 do iw=1,nh
815 do ip=1,nx
816 h11(ip,iw,it)=h11(ip,iw,1)
817 h12(ip,iw,it)=h12(ip,iw,1)
818 h13(ip,iw,it)=h13(ip,iw,1)
819 h21(ip,iw,it)=h21(ip,iw,1)
820 h22(ip,iw,it)=h22(ip,iw,1)
821 h23(ip,iw,it)=h23(ip,iw,1)
822 h81(ip,iw,it)=h81(ip,iw,1)
823 h82(ip,iw,it)=h82(ip,iw,1)
824 h83(ip,iw,it)=h83(ip,iw,1)
825 enddo
826 enddo
827 enddo
828
829 endif
830
831 c-----always use table look-up for ozone transmittance
832
833 do iw=1,no
834 do ip=1,nx
835 o1(ip,iw,1)=1.0-o1(ip,iw,1)
836 enddo
837 enddo
838
839 do it=2,nt
840 do iw=1,no
841 do ip=1,nx
842 o1 (ip,iw,it)= o1(ip,iw,1)
843 o2 (ip,iw,it)= o2(ip,iw,1)
844 o3 (ip,iw,it)= o3(ip,iw,1)
845 enddo
846 enddo
847 enddo
848
849 first=.false.
850
851 endif
852
853 c-----set the pressure at the top of the model atmosphere
854 c to 1.0e-4 if it is zero
855
856 do j=1,n
857 do i=1,m
858 if (pl(i,j,1) .eq. 0.0) then
859 pl(i,j,1)=1.0e-4
860 endif
861 enddo
862 enddo
863
864 c-----compute layer pressure (pa) and layer temperature minus 250K (dt)
865
866 do k=1,np
867 do j=1,n
868 do i=1,m
869 pa(i,j,k)=0.5*(pl(i,j,k)+pl(i,j,k+1))
870 dt(i,j,k)=ta(i,j,k)-250.0
871 enddo
872 enddo
873 enddo
874
875 c-----compute layer absorber amount
876
877 c dh2o : water vapor amount (g/cm**2)
878 c dcont: scaled water vapor amount for continuum absorption
879 c (g/cm**2)
880 c dco2 : co2 amount (cm-atm)stp
881 c do3 : o3 amount (cm-atm)stp
882 c dn2o : n2o amount (cm-atm)stp
883 c dch4 : ch4 amount (cm-atm)stp
884 c df11 : cfc11 amount (cm-atm)stp
885 c df12 : cfc12 amount (cm-atm)stp
886 c df22 : cfc22 amount (cm-atm)stp
887 c the factor 1.02 is equal to 1000/980
888 c factors 789 and 476 are for unit conversion
889 c the factor 0.001618 is equal to 1.02/(.622*1013.25)
890 c the factor 6.081 is equal to 1800/296
891
892
893 do k=1,np
894 do j=1,n
895 do i=1,m
896
897 dp = pl(i,j,k+1)-pl(i,j,k)
898 dh2o (i,j,k) = 1.02*wa(i,j,k)*dp+1.e-10
899 do3 (i,j,k) = 476.*oa(i,j,k)*dp+1.e-10
900 dco2 (i,j,k) = 789.*co2*dp+1.e-10
901 dch4 (i,j,k) = 789.*ch4(k)*dp+1.e-10
902 dn2o (i,j,k) = 789.*n2o(k)*dp+1.e-10
903 df11 (i,j,k) = 789.*cfc11*dp+1.e-10
904 df12 (i,j,k) = 789.*cfc12*dp+1.e-10
905 df22 (i,j,k) = 789.*cfc22*dp+1.e-10
906
907 c-----compute scaled water vapor amount for h2o continuum absorption
908 c following eq. (43).
909
910 xx=pa(i,j,k)*0.001618*wa(i,j,k)*wa(i,j,k)*dp
911 dcont(i,j,k) = xx*exp(1800./ta(i,j,k)-6.081)+1.e-10
912
913 enddo
914 enddo
915 enddo
916
917 c-----compute column-integrated h2o amoumt, h2o-weighted pressure
918 c and temperature. it follows eqs. (37) and (38).
919
920 if (high) then
921 call column(m,n,np,pa,dt,dh2o,sh2o,swpre,swtem)
922 endif
923
924 c-----compute layer cloud water amount (gm/m**2)
925 c index is 1 for ice, 2 for waterdrops and 3 for raindrops.
926 c Rain optical thickness is 0.00307 /(gm/m**2).
927 c It is for a specific drop size distribution provided by Q. Fu.
928
929 if (cldwater) then
930 do k=1,np
931 do j=1,n
932 do i=1,m
933 dp =pl(i,j,k+1)-pl(i,j,k)
934 cwp(i,j,k,1)=1.02*10000.0*cwc(i,j,k,1)*dp
935 cwp(i,j,k,2)=1.02*10000.0*cwc(i,j,k,2)*dp
936 cwp(i,j,k,3)=1.02*10000.0*cwc(i,j,k,3)*dp
937 taucl(i,j,k,3)=0.00307*cwp(i,j,k,3)
938 enddo
939 enddo
940 enddo
941 endif
942
943 c-----the surface (np+1) is treated as a layer filled with black clouds.
944 c clr is the equivalent clear fraction of a layer
945 c transfc is the transmttance between the surface and a pressure level.
946 c trantcr is the clear-sky transmttance between the surface and a
947 c pressure level.
948
949 do j=1,n
950 do i=1,m
951 clr(i,j,0) = 1.0
952 clr(i,j,np+1) = 0.0
953 st4(i,j) = 0.0
954 transfc(i,j,np+1)=1.0
955 trantcr(i,j,np+1)=1.0
956 enddo
957 enddo
958
959 c-----initialize fluxes
960
961 do k=1,np+1
962 do j=1,n
963 do i=1,m
964 flx(i,j,k) = 0.0
965 flc(i,j,k) = 0.0
966 dfdts(i,j,k)= 0.0
967 rflx(i,j,k) = 0.0
968 rflc(i,j,k) = 0.0
969 enddo
970 enddo
971 enddo
972
973 c-----integration over spectral bands
974
975 do 1000 ib=1,10
976
977 c-----if h2otbl, compute h2o (line) transmittance using table look-up.
978 c if conbnd, compute h2o (continuum) transmittance in bands 3-6.
979 c if co2bnd, compute co2 transmittance in band 3.
980 c if oznbnd, compute o3 transmittance in band 5.
981 c if n2obnd, compute n2o transmittance in bands 6 and 7.
982 c if ch4bnd, compute ch4 transmittance in bands 6 and 7.
983 c if combnd, compute co2-minor transmittance in bands 4 and 5.
984 c if f11bnd, compute cfc11 transmittance in bands 4 and 5.
985 c if f12bnd, compute cfc12 transmittance in bands 4 and 6.
986 c if f22bnd, compute cfc22 transmittance in bands 4 and 6.
987 c if b10bnd, compute flux reduction due to n2o in band 10.
988
989 h2otbl=high.and.(ib.eq.1.or.ib.eq.2.or.ib.eq.8)
990 conbnd=ib.ge.3.and.ib.le.6
991 co2bnd=ib.eq.3
992 oznbnd=ib.eq.5
993 n2obnd=ib.eq.6.or.ib.eq.7
994 ch4bnd=ib.eq.6.or.ib.eq.7
995 combnd=ib.eq.4.or.ib.eq.5
996 f11bnd=ib.eq.4.or.ib.eq.5
997 f12bnd=ib.eq.4.or.ib.eq.6
998 f22bnd=ib.eq.4.or.ib.eq.6
999 b10bnd=ib.eq.10
1000
1001 c-----blayer is the spectrally integrated planck flux of the mean layer
1002 c temperature derived from eq. (22)
1003 c the fitting for the planck flux is valid in the range 160-345 K.
1004
1005 do k=1,np
1006 do j=1,n
1007 do i=1,m
1008 blayer(i,j,k)=ta(i,j,k)*(ta(i,j,k)*(ta(i,j,k)
1009 * *(ta(i,j,k)*cb(5,ib)+cb(4,ib))+cb(3,ib))
1010 * +cb(2,ib))+cb(1,ib)
1011 enddo
1012 enddo
1013 enddo
1014
1015 c-----the earth's surface, with an index "np+1", is treated as a layer
1016
1017 do j=1,n
1018 do i=1,m
1019 blayer(i,j,0) = 0.0
1020 blayer(i,j,np+1)= ( ts(i,j)*(ts(i,j)*(ts(i,j)
1021 * *(ts(i,j)*cb(5,ib)+cb(4,ib))+cb(3,ib))
1022 * +cb(2,ib))+cb(1,ib) )*emiss(i,j,ib)
1023
1024 c-----dbs is the derivative of the surface emission with respect to
1025 c surface temperature (eq. 59).
1026
1027 dbs(i,j)=(ts(i,j)*(ts(i,j)*(ts(i,j)*4.*cb(5,ib)
1028 * +3.*cb(4,ib))+2.*cb(3,ib))+cb(2,ib))*emiss(i,j,ib)
1029
1030 enddo
1031 enddo
1032
1033 do k=1,np+1
1034 do j=1,n
1035 do i=1,m
1036 dlayer(i,j,k)=blayer(i,j,k-1)-blayer(i,j,k)
1037 enddo
1038 enddo
1039 enddo
1040
1041 c-----compute column-integrated absorber amoumt, absorber-weighted
1042 c pressure and temperature for co2 (band 3) and o3 (band 5).
1043 c it follows eqs. (37) and (38).
1044
1045 c-----this is in the band loop to save storage
1046
1047 if (high .and. co2bnd) then
1048 call column(m,n,np,pa,dt,dco2,sco3,scopre,scotem)
1049 endif
1050
1051 if (oznbnd) then
1052 call column(m,n,np,pa,dt,do3,sco3,scopre,scotem)
1053 endif
1054
1055 c-----compute cloud optical thickness
1056
1057 if (cldwater) then
1058 do k= 1, np
1059 do j= 1, n
1060 do i= 1, m
1061 taucl(i,j,k,1)=cwp(i,j,k,1)*(aib(1,ib)+aib(2,ib)/
1062 * reff(i,j,k,1)**aib(3,ib))
1063 taucl(i,j,k,2)=cwp(i,j,k,2)*(awb(1,ib)+(awb(2,ib)+(awb(3,ib)
1064 * +awb(4,ib)*reff(i,j,k,2))*reff(i,j,k,2))*reff(i,j,k,2))
1065 enddo
1066 enddo
1067 enddo
1068 endif
1069
1070 c-----compute cloud single-scattering albedo and asymmetry factor for
1071 c a mixture of ice particles, liquid drops, and rain drops
1072 c single-scattering albedo and asymmetry factor of rain are set
1073 c to 0.54 and 0.95, respectively.
1074
1075 do k= 1, np
1076 do j= 1, n
1077 do i= 1, m
1078
1079 clr(i,j,k) = 1.0
1080 taux=taucl(i,j,k,1)+taucl(i,j,k,2)+taucl(i,j,k,3)
1081
1082 if (taux.gt.0.02 .and. fcld(i,j,k).gt.0.01) then
1083
1084 reff1=min(reff(i,j,k,1),130.)
1085 reff2=min(reff(i,j,k,2),20.0)
1086
1087 w1=taucl(i,j,k,1)*(aiw(1,ib)+(aiw(2,ib)+(aiw(3,ib)
1088 * +aiw(4,ib)*reff1)*reff1)*reff1)
1089 w2=taucl(i,j,k,2)*(aww(1,ib)+(aww(2,ib)+(aww(3,ib)
1090 * +aww(4,ib)*reff2)*reff2)*reff2)
1091 w3=taucl(i,j,k,3)*0.54
1092 ww=(w1+w2+w3)/taux
1093
1094 g1=w1*(aig(1,ib)+(aig(2,ib)+(aig(3,ib)
1095 * +aig(4,ib)*reff1)*reff1)*reff1)
1096 g2=w2*(awg(1,ib)+(awg(2,ib)+(awg(3,ib)
1097 * +awg(4,ib)*reff2)*reff2)*reff2)
1098 g3=w3*0.95
1099
1100 gg=(g1+g2+g3)/(w1+w2+w3)
1101
1102 c-----parameterization of LW scattering
1103 c compute forward-scattered fraction and scale optical thickness
1104
1105 ff=0.5+(0.3739+(0.0076+0.1185*gg)*gg)*gg
1106 taux=taux*(1.-ww*ff)
1107
1108 c-----compute equivalent cloud-free fraction, clr, for each layer
1109 c the cloud diffuse transmittance is approximated by using
1110 c a diffusivity factor of 1.66.
1111
1112 clr(i,j,k)=1.0-(fcld(i,j,k)*(1.0-exp(-1.66*taux)))
1113
1114 endif
1115
1116 enddo
1117 enddo
1118 enddo
1119
1120 c-----compute the exponential terms (eq. 32) at each layer due to
1121 c water vapor line absorption when k-distribution is used
1122
1123 if (.not.h2otbl .and. .not.b10bnd) then
1124 call h2oexps(ib,m,n,np,dh2o,pa,dt,xkw,aw,bw,pm,mw,h2oexp)
1125 endif
1126
1127 c-----compute the exponential terms (eq. 46) at each layer due to
1128 c water vapor continuum absorption
1129
1130 if (conbnd) then
1131 call conexps(ib,m,n,np,dcont,xke,conexp)
1132 endif
1133
1134 c-----compute the exponential terms (eq. 32) at each layer due to
1135 c co2 absorption
1136
1137 if (.not.high .and. co2bnd) then
1138 call co2exps(m,n,np,dco2,pa,dt,co2exp)
1139 endif
1140
1141 c***** for trace gases *****
1142
1143 if (trace) then
1144
1145 c-----compute the exponential terms at each layer due to n2o absorption
1146
1147 if (n2obnd) then
1148 call n2oexps(ib,m,n,np,dn2o,pa,dt,n2oexp)
1149 endif
1150
1151 c-----compute the exponential terms at each layer due to ch4 absorption
1152
1153 if (ch4bnd) then
1154 call ch4exps(ib,m,n,np,dch4,pa,dt,ch4exp)
1155 endif
1156
1157 c-----compute the exponential terms due to co2 minor absorption
1158
1159 if (combnd) then
1160 call comexps(ib,m,n,np,dco2,dt,comexp)
1161 endif
1162
1163 c-----compute the exponential terms due to cfc11 absorption
1164
1165 if (f11bnd) then
1166 a1 = 1.26610e-3
1167 b1 = 3.55940e-6
1168 fk1 = 1.89736e+1
1169 a2 = 8.19370e-4
1170 b2 = 4.67810e-6
1171 fk2 = 1.01487e+1
1172 call cfcexps(ib,m,n,np,a1,b1,fk1,a2,b2,fk2,df11,dt,f11exp)
1173 endif
1174
1175 c-----compute the exponential terms due to cfc12 absorption
1176
1177 if (f12bnd) then
1178 a1 = 8.77370e-4
1179 b1 =-5.88440e-6
1180 fk1 = 1.58104e+1
1181 a2 = 8.62000e-4
1182 b2 =-4.22500e-6
1183 fk2 = 3.70107e+1
1184 call cfcexps(ib,m,n,np,a1,b1,fk1,a2,b2,fk2,df12,dt,f12exp)
1185 endif
1186
1187 c-----compute the exponential terms due to cfc22 absorption
1188
1189 if (f22bnd) then
1190 a1 = 9.65130e-4
1191 b1 = 1.31280e-5
1192 fk1 = 6.18536e+0
1193 a2 =-3.00010e-5
1194 b2 = 5.25010e-7
1195 fk2 = 3.27912e+1
1196 call cfcexps(ib,m,n,np,a1,b1,fk1,a2,b2,fk2,df22,dt,f22exp)
1197 endif
1198
1199 c-----compute the exponential terms at each layer in band 10 due to
1200 c h2o line and continuum, co2, and n2o absorption
1201
1202 if (b10bnd) then
1203 call b10exps(m,n,np,dh2o,dcont,dco2,dn2o,pa,dt
1204 * ,h2oexp,conexp,co2exp,n2oexp)
1205 endif
1206
1207 endif
1208
1209 c-----compute transmittances for regions between levels k1 and k2
1210 c and update the fluxes at the two levels.
1211
1212
1213 c-----initialize fluxes
1214
1215 do k=1,np+1
1216 do j=1,n
1217 do i=1,m
1218 flxu(i,j,k) = 0.0
1219 flxd(i,j,k) = 0.0
1220 flcu(i,j,k) = 0.0
1221 flcd(i,j,k) = 0.0
1222 enddo
1223 enddo
1224 enddo
1225
1226
1227 do 2000 k1=1,np
1228
1229 c-----initialize fclr, th2o, tcon, tco2, and tranal
1230 c fclr is the clear fraction of the line-of-sight
1231 c clrlw, clrmd, and clrhi are the clear-sky fractions of the
1232 c low, middle, and high troposphere, respectively
1233 c tranal is the aerosol transmission function
1234
1235 do j=1,n
1236 do i=1,m
1237 fclr(i,j) = 1.0
1238 clrlw(i,j) = 1.0
1239 clrmd(i,j) = 1.0
1240 clrhi(i,j) = 1.0
1241 tranal(i,j)= 1.0
1242 enddo
1243 enddo
1244
1245 c-----for h2o line transmission
1246
1247 if (.not. h2otbl) then
1248 do ik=1,6
1249 do j=1,n
1250 do i=1,m
1251 th2o(i,j,ik)=1.0
1252 enddo
1253 enddo
1254 enddo
1255 endif
1256
1257 c-----for h2o continuum transmission
1258
1259 if (conbnd) then
1260 do iq=1,3
1261 do j=1,n
1262 do i=1,m
1263 tcon(i,j,iq)=1.0
1264 enddo
1265 enddo
1266 enddo
1267 endif
1268
1269 c-----for co2 transmission using k-distribution method.
1270 c band 3 is divided into 3 sub-bands, but sub-bands 3a and 3c
1271 c are combined in computing the co2 transmittance.
1272
1273 if (.not.high .and. co2bnd) then
1274 do isb=1,2
1275 do ik=1,6
1276 do j=1,n
1277 do i=1,m
1278 tco2(i,j,ik,isb)=1.0
1279 enddo
1280 enddo
1281 enddo
1282 enddo
1283 endif
1284
1285 c***** for trace gases *****
1286
1287 if (trace) then
1288
1289 c-----for n2o transmission using k-distribution method.
1290
1291 if (n2obnd) then
1292 do ik=1,4
1293 do j=1,n
1294 do i=1,m
1295 tn2o(i,j,ik)=1.0
1296 enddo
1297 enddo
1298 enddo
1299 endif
1300
1301 c-----for ch4 transmission using k-distribution method.
1302
1303 if (ch4bnd) then
1304 do ik=1,4
1305 do j=1,n
1306 do i=1,m
1307 tch4(i,j,ik)=1.0
1308 enddo
1309 enddo
1310 enddo
1311 endif
1312
1313 c-----for co2-minor transmission using k-distribution method.
1314
1315 if (combnd) then
1316 do ik=1,2
1317 do j=1,n
1318 do i=1,m
1319 tcom(i,j,ik)=1.0
1320 enddo
1321 enddo
1322 enddo
1323 endif
1324
1325 c-----for cfc-11 transmission using k-distribution method.
1326
1327 if (f11bnd) then
1328 do j=1,n
1329 do i=1,m
1330 tf11(i,j)=1.0
1331 enddo
1332 enddo
1333 endif
1334
1335 c-----for cfc-12 transmission using k-distribution method.
1336
1337 if (f12bnd) then
1338 do j=1,n
1339 do i=1,m
1340 tf12(i,j)=1.0
1341 enddo
1342 enddo
1343 endif
1344
1345 c-----for cfc-22 transmission when using k-distribution method.
1346
1347 if (f22bnd) then
1348 do j=1,n
1349 do i=1,m
1350 tf22(i,j)=1.0
1351 enddo
1352 enddo
1353 endif
1354
1355 c-----for the transmission in band 10 using k-distribution method.
1356
1357 if (b10bnd) then
1358 do ik=1,6
1359 do j=1,n
1360 do i=1,m
1361 th2o(i,j,ik)=1.0
1362 tco2(i,j,ik,1)=1.0
1363 enddo
1364 enddo
1365 enddo
1366 do iq=1,3
1367 do j=1,n
1368 do i=1,m
1369 tcon(i,j,iq)=1.0
1370 enddo
1371 enddo
1372 enddo
1373 do ik=1,4
1374 do j=1,n
1375 do i=1,m
1376 tn2o(i,j,ik)=1.0
1377 enddo
1378 enddo
1379 enddo
1380 endif
1381
1382 endif
1383
1384 c-----loop over the bottom level of the region (k2)
1385
1386 do 3000 k2=k1+1,np+1
1387
1388 c-----initialize total transmission function (trant)
1389
1390 do j=1,n
1391 do i=1,m
1392 trant(i,j)=1.0
1393 enddo
1394 enddo
1395
1396 if (h2otbl) then
1397 w1=-8.0
1398 p1=-2.0
1399 dwe=0.3
1400 dpe=0.2
1401
1402 c-----compute water vapor transmittance using table look-up
1403
1404 if (ib.eq.1) then
1405 call tablup(k1,k2,m,n,np,nx,nh,nt,sh2o,swpre,swtem,
1406 * w1,p1,dwe,dpe,h11,h12,h13,trant)
1407
1408 endif
1409 if (ib.eq.2) then
1410 call tablup(k1,k2,m,n,np,nx,nh,nt,sh2o,swpre,swtem,
1411 * w1,p1,dwe,dpe,h21,h22,h23,trant)
1412
1413 endif
1414 if (ib.eq.8) then
1415 call tablup(k1,k2,m,n,np,nx,nh,nt,sh2o,swpre,swtem,
1416 * w1,p1,dwe,dpe,h81,h82,h83,trant)
1417 endif
1418
1419 else
1420
1421 c-----compute water vapor transmittance using k-distribution
1422
1423 if (.not.b10bnd) then
1424 call h2okdis(ib,m,n,np,k2-1,fkw,gkw,ne,h2oexp,conexp,
1425 * th2o,tcon,trant)
1426 endif
1427
1428 endif
1429
1430 if (co2bnd) then
1431
1432 if (high) then
1433
1434 c-----compute co2 transmittance using table look-up method
1435
1436 w1=-4.0
1437 p1=-2.0
1438 dwe=0.3
1439 dpe=0.2
1440 call tablup(k1,k2,m,n,np,nx,nc,nt,sco3,scopre,scotem,
1441 * w1,p1,dwe,dpe,c1,c2,c3,trant)
1442 else
1443
1444 c-----compute co2 transmittance using k-distribution method
1445 call co2kdis(m,n,np,k2-1,co2exp,tco2,trant)
1446
1447 endif
1448
1449 endif
1450
1451 c-----All use table look-up to compute o3 transmittance.
1452
1453 if (oznbnd) then
1454 w1=-6.0
1455 p1=-2.0
1456 dwe=0.3
1457 dpe=0.2
1458 call tablup(k1,k2,m,n,np,nx,no,nt,sco3,scopre,scotem,
1459 * w1,p1,dwe,dpe,o1,o2,o3,trant)
1460 endif
1461
1462 c***** for trace gases *****
1463
1464 if (trace) then
1465
1466 c-----compute n2o transmittance using k-distribution method
1467
1468 if (n2obnd) then
1469 call n2okdis(ib,m,n,np,k2-1,n2oexp,tn2o,trant)
1470 endif
1471
1472 c-----compute ch4 transmittance using k-distribution method
1473
1474 if (ch4bnd) then
1475 call ch4kdis(ib,m,n,np,k2-1,ch4exp,tch4,trant)
1476 endif
1477
1478 c-----compute co2-minor transmittance using k-distribution method
1479
1480 if (combnd) then
1481 call comkdis(ib,m,n,np,k2-1,comexp,tcom,trant)
1482 endif
1483
1484 c-----compute cfc11 transmittance using k-distribution method
1485
1486 if (f11bnd) then
1487 call cfckdis(m,n,np,k2-1,f11exp,tf11,trant)
1488 endif
1489
1490 c-----compute cfc12 transmittance using k-distribution method
1491
1492 if (f12bnd) then
1493 call cfckdis(m,n,np,k2-1,f12exp,tf12,trant)
1494 endif
1495
1496 c-----compute cfc22 transmittance using k-distribution method
1497
1498 if (f22bnd) then
1499 call cfckdis(m,n,np,k2-1,f22exp,tf22,trant)
1500 endif
1501
1502 c-----compute transmittance in band 10 using k-distribution method
1503 c here, trant is the change in transmittance due to n2o absorption
1504
1505 if (b10bnd) then
1506 call b10kdis(m,n,np,k2-1,h2oexp,conexp,co2exp,n2oexp
1507 * ,th2o,tcon,tco2,tn2o,trant)
1508 endif
1509
1510 endif
1511 c
1512 c-----include aerosol effect
1513 c
1514 do j=1,n
1515 do i=1,m
1516 ff=0.5+(0.3739+(0.0076+0.1185*asyal(i,j,k2-1,ib))
1517 * *asyal(i,j,k2-1,ib))*asyal(i,j,k2-1,ib)
1518 taux=taual(i,j,k2-1,ib)*(1.-ssaal(i,j,k2-1,ib)*ff)
1519 tranal(i,j)=tranal(i,j)*exp(-1.66*taux)
1520 trant (i,j)=trant(i,j) *tranal(i,j)
1521 enddo
1522 enddo
1523
1524 c-----Identify the clear-sky fractions clrhi, clrmd and clrlw, in the
1525 c high, middle and low cloud groups.
1526 c fclr is the clear-sky fraction between levels k1 and k2 assuming
1527 c the three cloud groups are randomly overlapped.
1528
1529 do j=1,n
1530 do i=1,m
1531 if( k2 .le. ict ) then
1532 clrhi(i,j)=min(clr(i,j,k2-1),clrhi(i,j))
1533 elseif( k2 .gt. ict .and. k2 .le. icb ) then
1534 clrmd(i,j)=min(clr(i,j,k2-1),clrmd(i,j))
1535 elseif( k2 .gt. icb ) then
1536 clrlw(i,j)=min(clr(i,j,k2-1),clrlw(i,j))
1537 endif
1538 fclr(i,j)=clrlw(i,j)*clrmd(i,j)*clrhi(i,j)
1539
1540 enddo
1541 enddo
1542
1543 c-----compute upward and downward fluxes (band 1-9).
1544 c add "boundary" terms to the net downward flux.
1545 c these are the first terms on the right-hand-side of
1546 c eqs. (56a) and (56b). downward fluxes are positive.
1547
1548 if (.not. b10bnd) then
1549
1550 if (k2 .eq. k1+1) then
1551
1552 do j=1,n
1553 do i=1,m
1554
1555 c-----compute upward and downward fluxes for clear-sky situation
1556
1557 flcu(i,j,k1)=flcu(i,j,k1)-blayer(i,j,k1)
1558 flcd(i,j,k2)=flcd(i,j,k2)+blayer(i,j,k1)
1559
1560 c-----compute upward and downward fluxes for all-sky situation
1561
1562 flxu(i,j,k1)=flxu(i,j,k1)-blayer(i,j,k1)
1563 flxd(i,j,k2)=flxd(i,j,k2)+blayer(i,j,k1)
1564
1565 enddo
1566 enddo
1567
1568 endif
1569
1570 c-----add flux components involving the four layers above and below
1571 c the levels k1 and k2. it follows eqs. (56a) and (56b).
1572
1573 do j=1,n
1574 do i=1,m
1575 xx=trant(i,j)*dlayer(i,j,k2)
1576 flcu(i,j,k1) =flcu(i,j,k1)+xx
1577 flxu(i,j,k1) =flxu(i,j,k1)+xx*fclr(i,j)
1578 xx=trant(i,j)*dlayer(i,j,k1)
1579 flcd(i,j,k2) =flcd(i,j,k2)+xx
1580 flxd(i,j,k2) =flxd(i,j,k2)+xx*fclr(i,j)
1581 enddo
1582 enddo
1583
1584 else
1585
1586 c-----flux reduction due to n2o in band 10
1587
1588 if (trace) then
1589
1590 do j=1,n
1591 do i=1,m
1592 rflx(i,j,k1) = rflx(i,j,k1)+trant(i,j)*fclr(i,j)
1593 * *dlayer(i,j,k2)
1594 rflx(i,j,k2) = rflx(i,j,k2)+trant(i,j)*fclr(i,j)
1595 * *dlayer(i,j,k1)
1596 rflc(i,j,k1) = rflc(i,j,k1)+trant(i,j)
1597 * *dlayer(i,j,k2)
1598 rflc(i,j,k2) = rflc(i,j,k2)+trant(i,j)
1599 * *dlayer(i,j,k1)
1600 enddo
1601 enddo
1602
1603 endif
1604
1605 endif
1606
1607 3000 continue
1608
1609
1610 c-----transmission between level k1 and the surface
1611
1612 do j=1,n
1613 do i=1,m
1614 trantcr(i,j,k1) =trant(i,j)
1615 transfc(i,j,k1) =trant(i,j)*fclr(i,j)
1616 enddo
1617 enddo
1618
1619 c-----compute the partial derivative of fluxes with respect to
1620 c surface temperature (eq. 59)
1621
1622 if (trace .or. (.not. b10bnd) ) then
1623
1624 do j=1,n
1625 do i=1,m
1626 dfdts(i,j,k1) =dfdts(i,j,k1)-dbs(i,j)*transfc(i,j,k1)
1627 enddo
1628 enddo
1629
1630 endif
1631
1632 2000 continue
1633
1634 if (.not. b10bnd) then
1635
1636 c-----add contribution from the surface to the flux terms at the surface
1637
1638 do j=1,n
1639 do i=1,m
1640 flcu(i,j,np+1)=flcu(i,j,np+1)-blayer(i,j,np+1)
1641 flxu(i,j,np+1)=flxu(i,j,np+1)-blayer(i,j,np+1)
1642 st4(i,j)=st4(i,j)-blayer(i,j,np+1)
1643 dfdts(i,j,np+1)=dfdts(i,j,np+1)-dbs(i,j)
1644 enddo
1645 enddo
1646
1647 c-----add the flux component reflected by the surface
1648 c note: upward flux is negative
1649
1650 do k=1, np+1
1651 do j=1,n
1652 do i=1,m
1653 flcu(i,j,k)=flcu(i,j,k)-
1654 * flcd(i,j,np+1)*trantcr(i,j,k)*(1.-emiss(i,j,ib))
1655 flxu(i,j,k)=flxu(i,j,k)-
1656 * flxd(i,j,np+1)*transfc(i,j,k)*(1.-emiss(i,j,ib))
1657 enddo
1658 enddo
1659 enddo
1660
1661 endif
1662
1663 c-----summation of fluxes over spectral bands
1664
1665 do k=1,np+1
1666 do j=1,n
1667 do i=1,m
1668 flc(i,j,k)=flc(i,j,k)+flcd(i,j,k)+flcu(i,j,k)
1669 flx(i,j,k)=flx(i,j,k)+flxd(i,j,k)+flxu(i,j,k)
1670 enddo
1671 enddo
1672 enddo
1673
1674 1000 continue
1675
1676 c-----adjust fluxes due to n2o absorption in band 10
1677
1678 do k=1,np+1
1679 do j=1,n
1680 do i=1,m
1681 flc(i,j,k)=flc(i,j,k)+rflc(i,j,k)
1682 flx(i,j,k)=flx(i,j,k)+rflx(i,j,k)
1683 enddo
1684 enddo
1685 enddo
1686
1687 return
1688 end
1689 c***********************************************************************
1690 subroutine column (m,n,np,pa,dt,sabs0,sabs,spre,stem)
1691 c***********************************************************************
1692 c-----compute column-integrated (from top of the model atmosphere)
1693 c absorber amount (sabs), absorber-weighted pressure (spre) and
1694 c temperature (stem).
1695 c computations of spre and stem follows eqs. (37) and (38).
1696 c
1697 c--- input parameters
1698 c number of soundings in zonal direction (m)
1699 c number of soundings in meridional direction (n)
1700 c number of atmospheric layers (np)
1701 c layer pressure (pa)
1702 c layer temperature minus 250K (dt)
1703 c layer absorber amount (sabs0)
1704 c
1705 c--- output parameters
1706 c column-integrated absorber amount (sabs)
1707 c column absorber-weighted pressure (spre)
1708 c column absorber-weighted temperature (stem)
1709 c
1710 c--- units of pa and dt are mb and k, respectively.
1711 c units of sabs are g/cm**2 for water vapor and (cm-atm)stp
1712 c for co2 and o3
1713 c***********************************************************************
1714 implicit none
1715 integer m,n,np,i,j,k
1716
1717 c---- input parameters -----
1718
1719 _RL pa(m,n,np),dt(m,n,np),sabs0(m,n,np)
1720
1721 c---- output parameters -----
1722
1723 _RL sabs(m,n,np+1),spre(m,n,np+1),stem(m,n,np+1)
1724
1725 c*********************************************************************
1726 do j=1,n
1727 do i=1,m
1728 sabs(i,j,1)=0.0
1729 spre(i,j,1)=0.0
1730 stem(i,j,1)=0.0
1731 enddo
1732 enddo
1733
1734 do k=1,np
1735 do j=1,n
1736 do i=1,m
1737 sabs(i,j,k+1)=sabs(i,j,k)+sabs0(i,j,k)
1738 spre(i,j,k+1)=spre(i,j,k)+pa(i,j,k)*sabs0(i,j,k)
1739 stem(i,j,k+1)=stem(i,j,k)+dt(i,j,k)*sabs0(i,j,k)
1740 enddo
1741 enddo
1742 enddo
1743
1744 return
1745 end
1746 c**********************************************************************
1747 subroutine h2oexps(ib,m,n,np,dh2o,pa,dt,xkw,aw,bw,pm,mw,h2oexp)
1748 c**********************************************************************
1749 c compute exponentials for water vapor line absorption
1750 c in individual layers.
1751 c
1752 c---- input parameters
1753 c spectral band (ib)
1754 c number of grid intervals in zonal direction (m)
1755 c number of grid intervals in meridional direction (n)
1756 c number of layers (np)
1757 c layer water vapor amount for line absorption (dh2o)
1758 c layer pressure (pa)
1759 c layer temperature minus 250K (dt)
1760 c absorption coefficients for the first k-distribution
1761 c function due to h2o line absorption (xkw)
1762 c coefficients for the temperature and pressure scaling (aw,bw,pm)
1763 c ratios between neighboring absorption coefficients for
1764 c h2o line absorption (mw)
1765 c
1766 c---- output parameters
1767 c 6 exponentials for each layer (h2oexp)
1768 c**********************************************************************
1769 implicit none
1770 integer ib,m,n,np,i,j,k,ik
1771
1772 c---- input parameters ------
1773
1774 _RL dh2o(m,n,np),pa(m,n,np),dt(m,n,np)
1775
1776 c---- output parameters -----
1777
1778 _RL h2oexp(m,n,np,6)
1779
1780 c---- static data -----
1781
1782 integer mw(9)
1783 _RL xkw(9),aw(9),bw(9),pm(9)
1784
1785 c---- temporary arrays -----
1786
1787 _RL xh,xh1
1788
1789 c**********************************************************************
1790 c note that the 3 sub-bands in band 3 use the same set of xkw, aw,
1791 c and bw, therefore, h2oexp for these sub-bands are identical.
1792 c**********************************************************************
1793
1794 do k=1,np
1795 do j=1,n
1796 do i=1,m
1797
1798 c-----xh is the scaled water vapor amount for line absorption
1799 c computed from (27)
1800
1801 xh = dh2o(i,j,k)*(pa(i,j,k)/500.)**pm(ib)
1802 1 * ( 1.+(aw(ib)+bw(ib)* dt(i,j,k))*dt(i,j,k) )
1803
1804 c-----h2oexp is the water vapor transmittance of the layer k
1805 c due to line absorption
1806
1807 h2oexp(i,j,k,1) = exp(-xh*xkw(ib))
1808
1809 enddo
1810 enddo
1811 enddo
1812
1813 do ik=2,6
1814
1815 if (mw(ib).eq.6) then
1816
1817 do k=1,np
1818 do j=1,n
1819 do i=1,m
1820 xh = h2oexp(i,j,k,ik-1)*h2oexp(i,j,k,ik-1)
1821 h2oexp(i,j,k,ik) = xh*xh*xh
1822 enddo
1823 enddo
1824 enddo
1825
1826 elseif (mw(ib).eq.8) then
1827
1828 do k=1,np
1829 do j=1,n
1830 do i=1,m
1831 xh = h2oexp(i,j,k,ik-1)*h2oexp(i,j,k,ik-1)
1832 xh = xh*xh
1833 h2oexp(i,j,k,ik) = xh*xh
1834 enddo
1835 enddo
1836 enddo
1837
1838 elseif (mw(ib).eq.9) then
1839
1840 do k=1,np
1841 do j=1,n
1842 do i=1,m
1843 xh=h2oexp(i,j,k,ik-1)*h2oexp(i,j,k,ik-1)*h2oexp(i,j,k,ik-1)
1844 xh1 = xh*xh
1845 h2oexp(i,j,k,ik) = xh*xh1
1846 enddo
1847 enddo
1848 enddo
1849
1850 else
1851
1852 do k=1,np
1853 do j=1,n
1854 do i=1,m
1855 xh = h2oexp(i,j,k,ik-1)*h2oexp(i,j,k,ik-1)
1856 xh = xh*xh
1857 xh = xh*xh
1858 h2oexp(i,j,k,ik) = xh*xh
1859 enddo
1860 enddo
1861 enddo
1862
1863 endif
1864 enddo
1865
1866 return
1867 end
1868 c**********************************************************************
1869 subroutine conexps(ib,m,n,np,dcont,xke,conexp)
1870 c**********************************************************************
1871 c compute exponentials for continuum absorption in individual layers.
1872 c
1873 c---- input parameters
1874 c spectral band (ib)
1875 c number of grid intervals in zonal direction (m)
1876 c number of grid intervals in meridional direction (n)
1877 c number of layers (np)
1878 c layer scaled water vapor amount for continuum absorption (dcont)
1879 c absorption coefficients for the first k-distribution function
1880 c due to water vapor continuum absorption (xke)
1881 c
1882 c---- output parameters
1883 c 1 or 3 exponentials for each layer (conexp)
1884 c**********************************************************************
1885 implicit none
1886 integer ib,m,n,np,i,j,k,iq
1887
1888 c---- input parameters ------
1889
1890 _RL dcont(m,n,np)
1891
1892 c---- updated parameters -----
1893
1894 _RL conexp(m,n,np,3)
1895
1896 c---- static data -----
1897
1898 _RL xke(9)
1899
1900 c**********************************************************************
1901
1902 do k=1,np
1903 do j=1,n
1904 do i=1,m
1905 conexp(i,j,k,1) = exp(-dcont(i,j,k)*xke(ib))
1906 enddo
1907 enddo
1908 enddo
1909
1910 if (ib .eq. 3) then
1911
1912 c-----the absorption coefficients for sub-bands 3b (iq=2) and 3a (iq=3)
1913 c are, respectively, two and three times the absorption coefficient
1914 c for sub-band 3c (iq=1) (table 6).
1915
1916 do iq=2,3
1917 do k=1,np
1918 do j=1,n
1919 do i=1,m
1920 conexp(i,j,k,iq) = conexp(i,j,k,iq-1) *conexp(i,j,k,iq-1)
1921 enddo
1922 enddo
1923 enddo
1924 enddo
1925
1926 endif
1927
1928 return
1929 end
1930 c**********************************************************************
1931 subroutine co2exps(m,n,np,dco2,pa,dt,co2exp)
1932 c**********************************************************************
1933 c compute co2 exponentials for individual layers.
1934 c
1935 c---- input parameters
1936 c number of grid intervals in zonal direction (m)
1937 c number of grid intervals in meridional direction (n)
1938 c number of layers (np)
1939 c layer co2 amount (dco2)
1940 c layer pressure (pa)
1941 c layer temperature minus 250K (dt)
1942 c
1943 c---- output parameters
1944 c 6 exponentials for each layer (co2exp)
1945 c**********************************************************************
1946 implicit none
1947 integer m,n,np,i,j,k
1948
1949 c---- input parameters -----
1950
1951 _RL dco2(m,n,np),pa(m,n,np),dt(m,n,np)
1952
1953 c---- output parameters -----
1954
1955 _RL co2exp(m,n,np,6,2)
1956
1957 c---- temporary arrays -----
1958
1959 _RL xc
1960
1961 c**********************************************************************
1962
1963 do k=1,np
1964 do j=1,n
1965 do i=1,m
1966
1967 c-----compute the scaled co2 amount from eq. (27) for band-wings
1968 c (sub-bands 3a and 3c).
1969
1970 xc = dco2(i,j,k)*(pa(i,j,k)/300.0)**0.5
1971 1 *(1.+(0.0182+1.07e-4*dt(i,j,k))*dt(i,j,k))
1972
1973 c-----six exponentials by powers of 8 (table 7).
1974
1975 co2exp(i,j,k,1,1)=exp(-xc*2.656e-5)
1976
1977 xc=co2exp(i,j,k,1,1)*co2exp(i,j,k,1,1)
1978 xc=xc*xc
1979 co2exp(i,j,k,2,1)=xc*xc
1980
1981 xc=co2exp(i,j,k,2,1)*co2exp(i,j,k,2,1)
1982 xc=xc*xc
1983 co2exp(i,j,k,3,1)=xc*xc
1984
1985 xc=co2exp(i,j,k,3,1)*co2exp(i,j,k,3,1)
1986 xc=xc*xc
1987 co2exp(i,j,k,4,1)=xc*xc
1988
1989 xc=co2exp(i,j,k,4,1)*co2exp(i,j,k,4,1)
1990 xc=xc*xc
1991 co2exp(i,j,k,5,1)=xc*xc
1992
1993 xc=co2exp(i,j,k,5,1)*co2exp(i,j,k,5,1)
1994 xc=xc*xc
1995 co2exp(i,j,k,6,1)=xc*xc
1996
1997 c-----compute the scaled co2 amount from eq. (27) for band-center
1998 c region (sub-band 3b).
1999
2000 xc = dco2(i,j,k)*(pa(i,j,k)/30.0)**0.85
2001 1 *(1.+(0.0042+2.00e-5*dt(i,j,k))*dt(i,j,k))
2002
2003 co2exp(i,j,k,1,2)=exp(-xc*2.656e-3)
2004
2005 xc=co2exp(i,j,k,1,2)*co2exp(i,j,k,1,2)
2006 xc=xc*xc
2007 co2exp(i,j,k,2,2)=xc*xc
2008
2009 xc=co2exp(i,j,k,2,2)*co2exp(i,j,k,2,2)
2010 xc=xc*xc
2011 co2exp(i,j,k,3,2)=xc*xc
2012
2013 xc=co2exp(i,j,k,3,2)*co2exp(i,j,k,3,2)
2014 xc=xc*xc
2015 co2exp(i,j,k,4,2)=xc*xc
2016
2017 xc=co2exp(i,j,k,4,2)*co2exp(i,j,k,4,2)
2018 xc=xc*xc
2019 co2exp(i,j,k,5,2)=xc*xc
2020
2021 xc=co2exp(i,j,k,5,2)*co2exp(i,j,k,5,2)
2022 xc=xc*xc
2023 co2exp(i,j,k,6,2)=xc*xc
2024
2025 enddo
2026 enddo
2027 enddo
2028
2029 return
2030 end
2031 c**********************************************************************
2032 subroutine n2oexps(ib,m,n,np,dn2o,pa,dt,n2oexp)
2033 c**********************************************************************
2034 c compute n2o exponentials for individual layers.
2035 c
2036 c---- input parameters
2037 c spectral band (ib)
2038 c number of grid intervals in zonal direction (m)
2039 c number of grid intervals in meridional direction (n)
2040 c number of layers (np)
2041 c layer n2o amount (dn2o)
2042 c layer pressure (pa)
2043 c layer temperature minus 250K (dt)
2044 c
2045 c---- output parameters
2046 c 2 or 4 exponentials for each layer (n2oexp)
2047 c**********************************************************************
2048 implicit none
2049 integer ib,m,n,np,i,j,k
2050
2051 c---- input parameters -----
2052
2053 _RL dn2o(m,n,np),pa(m,n,np),dt(m,n,np)
2054
2055 c---- output parameters -----
2056
2057 _RL n2oexp(m,n,np,4)
2058
2059 c---- temporary arrays -----
2060
2061 _RL xc,xc1,xc2
2062
2063 c**********************************************************************
2064
2065 do k=1,np
2066 do j=1,n
2067 do i=1,m
2068
2069 c-----four exponential by powers of 21 for band 6
2070
2071 if (ib.eq.6) then
2072
2073 xc=dn2o(i,j,k)*(1.+(1.9297e-3+4.3750e-6*dt(i,j,k))*dt(i,j,k))
2074 n2oexp(i,j,k,1)=exp(-xc*6.31582e-2)
2075
2076 xc=n2oexp(i,j,k,1)*n2oexp(i,j,k,1)*n2oexp(i,j,k,1)
2077 xc1=xc*xc
2078 xc2=xc1*xc1
2079 n2oexp(i,j,k,2)=xc*xc1*xc2
2080
2081 c-----four exponential by powers of 8 for band 7
2082
2083 else
2084
2085 xc=dn2o(i,j,k)*(pa(i,j,k)/500.0)**0.48
2086 * *(1.+(1.3804e-3+7.4838e-6*dt(i,j,k))*dt(i,j,k))
2087 n2oexp(i,j,k,1)=exp(-xc*5.35779e-2)
2088
2089 xc=n2oexp(i,j,k,1)*n2oexp(i,j,k,1)
2090 xc=xc*xc
2091 n2oexp(i,j,k,2)=xc*xc
2092 xc=n2oexp(i,j,k,2)*n2oexp(i,j,k,2)
2093 xc=xc*xc
2094 n2oexp(i,j,k,3)=xc*xc
2095 xc=n2oexp(i,j,k,3)*n2oexp(i,j,k,3)
2096 xc=xc*xc
2097 n2oexp(i,j,k,4)=xc*xc
2098
2099 endif
2100
2101 enddo
2102 enddo
2103 enddo
2104
2105 return
2106 end
2107 c**********************************************************************
2108 subroutine ch4exps(ib,m,n,np,dch4,pa,dt,ch4exp)
2109 c**********************************************************************
2110 c compute ch4 exponentials for individual layers.
2111 c
2112 c---- input parameters
2113 c spectral band (ib)
2114 c number of grid intervals in zonal direction (m)
2115 c number of grid intervals in meridional direction (n)
2116 c number of layers (np)
2117 c layer ch4 amount (dch4)
2118 c layer pressure (pa)
2119 c layer temperature minus 250K (dt)
2120 c
2121 c---- output parameters
2122 c 1 or 4 exponentials for each layer (ch4exp)
2123 c**********************************************************************
2124 implicit none
2125 integer ib,m,n,np,i,j,k
2126
2127 c---- input parameters -----
2128
2129 _RL dch4(m,n,np),pa(m,n,np),dt(m,n,np)
2130
2131 c---- output parameters -----
2132
2133 _RL ch4exp(m,n,np,4)
2134
2135 c---- temporary arrays -----
2136
2137 _RL xc
2138
2139 c**********************************************************************
2140
2141 do k=1,np
2142 do j=1,n
2143 do i=1,m
2144
2145 c-----four exponentials for band 6
2146
2147 if (ib.eq.6) then
2148
2149 xc=dch4(i,j,k)*(1.+(1.7007e-2+1.5826e-4*dt(i,j,k))*dt(i,j,k))
2150 ch4exp(i,j,k,1)=exp(-xc*5.80708e-3)
2151
2152 c-----four exponentials by powers of 12 for band 7
2153
2154 else
2155
2156 xc=dch4(i,j,k)*(pa(i,j,k)/500.0)**0.65
2157 * *(1.+(5.9590e-4-2.2931e-6*dt(i,j,k))*dt(i,j,k))
2158 ch4exp(i,j,k,1)=exp(-xc*6.29247e-2)
2159
2160 xc=ch4exp(i,j,k,1)*ch4exp(i,j,k,1)*ch4exp(i,j,k,1)
2161 xc=xc*xc
2162 ch4exp(i,j,k,2)=xc*xc
2163
2164 xc=ch4exp(i,j,k,2)*ch4exp(i,j,k,2)*ch4exp(i,j,k,2)
2165 xc=xc*xc
2166 ch4exp(i,j,k,3)=xc*xc
2167
2168 xc=ch4exp(i,j,k,3)*ch4exp(i,j,k,3)*ch4exp(i,j,k,3)
2169 xc=xc*xc
2170 ch4exp(i,j,k,4)=xc*xc
2171
2172 endif
2173
2174 enddo
2175 enddo
2176 enddo
2177
2178 return
2179 end
2180 c**********************************************************************
2181 subroutine comexps(ib,m,n,np,dcom,dt,comexp)
2182 c**********************************************************************
2183 c compute co2-minor exponentials for individual layers.
2184 c
2185 c---- input parameters
2186 c spectral band (ib)
2187 c number of grid intervals in zonal direction (m)
2188 c number of grid intervals in meridional direction (n)
2189 c number of layers (np)
2190 c layer co2 amount (dcom)
2191 c layer temperature minus 250K (dt)
2192 c
2193 c---- output parameters
2194 c 2 exponentials for each layer (comexp)
2195 c**********************************************************************
2196 implicit none
2197 integer ib,m,n,np,i,j,k
2198
2199 c---- input parameters -----
2200
2201 _RL dcom(m,n,np),dt(m,n,np)
2202
2203 c---- output parameters -----
2204
2205 _RL comexp(m,n,np,2)
2206
2207 c---- temporary arrays -----
2208
2209 _RL xc,xc1,xc2
2210
2211 c**********************************************************************
2212
2213 do k=1,np
2214 do j=1,n
2215 do i=1,m
2216
2217 c-----two exponentials by powers of 60 for band 4
2218
2219 if (ib.eq.4) then
2220
2221 xc=dcom(i,j,k)*(1.+(3.5775e-2+4.0447e-4*dt(i,j,k))*dt(i,j,k))
2222 comexp(i,j,k,1)=exp(-xc*2.18947e-5)
2223
2224 xc=comexp(i,j,k,1)*comexp(i,j,k,1)*comexp(i,j,k,1)
2225 xc=xc*xc
2226 xc1=xc*xc
2227 xc=xc1*xc1
2228 xc=xc*xc
2229 comexp(i,j,k,2)=xc*xc1
2230
2231 c-----two exponentials by powers of 44 for band 5
2232
2233 else
2234
2235 xc=dcom(i,j,k)*(1.+(3.4268e-2+3.7401e-4*dt(i,j,k))*dt(i,j,k))
2236 comexp(i,j,k,1)=exp(-xc*4.74570e-5)
2237
2238 xc=comexp(i,j,k,1)*comexp(i,j,k,1)
2239 xc1=xc*xc
2240 xc2=xc1*xc1
2241 xc=xc2*xc2
2242 xc=xc*xc
2243 comexp(i,j,k,2)=xc1*xc2*xc
2244
2245 endif
2246
2247 enddo
2248 enddo
2249 enddo
2250
2251 return
2252 end
2253 c**********************************************************************
2254 subroutine cfcexps(ib,m,n,np,a1,b1,fk1,a2,b2,fk2,dcfc,dt,cfcexp)
2255 c**********************************************************************
2256 c compute cfc(-11, -12, -22) exponentials for individual layers.
2257 c
2258 c---- input parameters
2259 c spectral band (ib)
2260 c number of grid intervals in zonal direction (m)
2261 c number of grid intervals in meridional direction (n)
2262 c number of layers (np)
2263 c parameters for computing the scaled cfc amounts
2264 c for temperature scaling (a1,b1,a2,b2)
2265 c the absorption coefficients for the
2266 c first k-distribution function due to cfcs (fk1,fk2)
2267 c layer cfc amounts (dcfc)
2268 c layer temperature minus 250K (dt)
2269 c
2270 c---- output parameters
2271 c 1 exponential for each layer (cfcexp)
2272 c**********************************************************************
2273 implicit none
2274 integer ib,m,n,np,i,j,k
2275
2276 c---- input parameters -----
2277
2278 _RL dcfc(m,n,np),dt(m,n,np)
2279
2280 c---- output parameters -----
2281
2282 _RL cfcexp(m,n,np)
2283
2284 c---- static data -----
2285
2286 _RL a1,b1,fk1,a2,b2,fk2
2287
2288 c---- temporary arrays -----
2289
2290 _RL xf
2291
2292 c**********************************************************************
2293
2294 do k=1,np
2295 do j=1,n
2296 do i=1,m
2297
2298 c-----compute the scaled cfc amount (xf) and exponential (cfcexp)
2299
2300 if (ib.eq.4) then
2301 xf=dcfc(i,j,k)*(1.+(a1+b1*dt(i,j,k))*dt(i,j,k))
2302 cfcexp(i,j,k)=exp(-xf*fk1)
2303 else
2304 xf=dcfc(i,j,k)*(1.+(a2+b2*dt(i,j,k))*dt(i,j,k))
2305 cfcexp(i,j,k)=exp(-xf*fk2)
2306 endif
2307
2308 enddo
2309 enddo
2310 enddo
2311
2312 return
2313 end
2314 c**********************************************************************
2315 subroutine b10exps(m,n,np,dh2o,dcont,dco2,dn2o,pa,dt
2316 * ,h2oexp,conexp,co2exp,n2oexp)
2317 c**********************************************************************
2318 c compute band3a exponentials for individual layers.
2319 c
2320 c---- input parameters
2321 c number of grid intervals in zonal direction (m)
2322 c number of grid intervals in meridional direction (n)
2323 c number of layers (np)
2324 c layer h2o amount for line absorption (dh2o)
2325 c layer h2o amount for continuum absorption (dcont)
2326 c layer co2 amount (dco2)
2327 c layer n2o amount (dn2o)
2328 c layer pressure (pa)
2329 c layer temperature minus 250K (dt)
2330 c
2331 c---- output parameters
2332 c
2333 c exponentials for each layer (h2oexp,conexp,co2exp,n2oexp)
2334 c**********************************************************************
2335 implicit none
2336 integer m,n,np,i,j,k
2337
2338 c---- input parameters -----
2339
2340 _RL dh2o(m,n,np),dcont(m,n,np),dn2o(m,n,np)
2341 _RL dco2(m,n,np),pa(m,n,np),dt(m,n,np)
2342
2343 c---- output parameters -----
2344
2345 _RL h2oexp(m,n,np,6),conexp(m,n,np,3),co2exp(m,n,np,6,2)
2346 * ,n2oexp(m,n,np,4)
2347
2348 c---- temporary arrays -----
2349
2350 _RL xx,xx1,xx2,xx3
2351
2352 c**********************************************************************
2353
2354 do k=1,np
2355 do j=1,n
2356 do i=1,m
2357
2358 c-----compute the scaled h2o-line amount for the sub-band 3a
2359 c table 3, Chou et al. (JAS, 1993)
2360
2361 xx=dh2o(i,j,k)*(pa(i,j,k)/500.0)
2362 1 *(1.+(0.0149+6.20e-5*dt(i,j,k))*dt(i,j,k))
2363
2364 c-----six exponentials by powers of 8
2365 c the constant 0.10624 is equal to 1.66*0.064
2366
2367 h2oexp(i,j,k,1)=exp(-xx*0.10624)
2368
2369 xx=h2oexp(i,j,k,1)*h2oexp(i,j,k,1)
2370 xx=xx*xx
2371 h2oexp(i,j,k,2)=xx*xx
2372
2373 xx=h2oexp(i,j,k,2)*h2oexp(i,j,k,2)
2374 xx=xx*xx
2375 h2oexp(i,j,k,3)=xx*xx
2376
2377 xx=h2oexp(i,j,k,3)*h2oexp(i,j,k,3)
2378 xx=xx*xx
2379 h2oexp(i,j,k,4)=xx*xx
2380
2381 xx=h2oexp(i,j,k,4)*h2oexp(i,j,k,4)
2382 xx=xx*xx
2383 h2oexp(i,j,k,5)=xx*xx
2384
2385 xx=h2oexp(i,j,k,5)*h2oexp(i,j,k,5)
2386 xx=xx*xx
2387 h2oexp(i,j,k,6)=xx*xx
2388
2389 c-----compute the scaled co2 amount for the sub-band 3a
2390 c table 1, Chou et al. (JAS, 1993)
2391
2392 xx=dco2(i,j,k)*(pa(i,j,k)/300.0)**0.5
2393 1 *(1.+(0.0179+1.02e-4*dt(i,j,k))*dt(i,j,k))
2394
2395 c-----six exponentials by powers of 8
2396 c the constant 2.656e-5 is equal to 1.66*1.60e-5
2397
2398 co2exp(i,j,k,1,1)=exp(-xx*2.656e-5)
2399
2400 xx=co2exp(i,j,k,1,1)*co2exp(i,j,k,1,1)
2401 xx=xx*xx
2402 co2exp(i,j,k,2,1)=xx*xx
2403
2404 xx=co2exp(i,j,k,2,1)*co2exp(i,j,k,2,1)
2405 xx=xx*xx
2406 co2exp(i,j,k,3,1)=xx*xx
2407
2408 xx=co2exp(i,j,k,3,1)*co2exp(i,j,k,3,1)
2409 xx=xx*xx
2410 co2exp(i,j,k,4,1)=xx*xx
2411
2412 xx=co2exp(i,j,k,4,1)*co2exp(i,j,k,4,1)
2413 xx=xx*xx
2414 co2exp(i,j,k,5,1)=xx*xx
2415
2416 xx=co2exp(i,j,k,5,1)*co2exp(i,j,k,5,1)
2417 xx=xx*xx
2418 co2exp(i,j,k,6,1)=xx*xx
2419
2420 c-----one exponential of h2o continuum for sub-band 3a
2421 c tabl 5 of Chou et. al. (JAS, 1993)
2422 c the constant 1.04995e+2 is equal to 1.66*63.25
2423
2424 conexp(i,j,k,1)=exp(-dcont(i,j,k)*1.04995e+2)
2425
2426 c-----compute the scaled n2o amount for sub-band 3a
2427
2428 xx=dn2o(i,j,k)*(1.+(1.4476e-3+3.6656e-6*dt(i,j,k))*dt(i,j,k))
2429
2430 c-----two exponential2 by powers of 58
2431
2432 n2oexp(i,j,k,1)=exp(-xx*0.25238)
2433
2434 xx=n2oexp(i,j,k,1)*n2oexp(i,j,k,1)
2435 xx1=xx*xx
2436 xx1=xx1*xx1
2437 xx2=xx1*xx1
2438 xx3=xx2*xx2
2439 n2oexp(i,j,k,2)=xx*xx1*xx2*xx3
2440
2441 enddo
2442 enddo
2443 enddo
2444
2445 return
2446 end
2447 c**********************************************************************
2448 subroutine tablup(k1,k2,m,n,np,nx,nh,nt,sabs,spre,stem,w1,p1,
2449 * dwe,dpe,coef1,coef2,coef3,tran)
2450 c**********************************************************************
2451 c compute water vapor, co2 and o3 transmittances between levels
2452 c k1 and k2 for m x n soundings, using table look-up.
2453 c
2454 c calculations follow Eq. (40) of Chou and Suarez (1994)
2455 c
2456 c---- input ---------------------
2457 c indices for pressure levels (k1 and k2)
2458 c number of grid intervals in zonal direction (m)
2459 c number of grid intervals in meridional direction (n)
2460 c number of atmospheric layers (np)
2461 c number of pressure intervals in the table (nx)
2462 c number of absorber amount intervals in the table (nh)
2463 c number of tables copied (nt)
2464 c column-integrated absorber amount (sabs)
2465 c column absorber amount-weighted pressure (spre)
2466 c column absorber amount-weighted temperature (stem)
2467 c first value of absorber amount (log10) in the table (w1)
2468 c first value of pressure (log10) in the table (p1)
2469 c size of the interval of absorber amount (log10) in the table (dwe)
2470 c size of the interval of pressure (log10) in the table (dpe)
2471 c pre-computed coefficients (coef1, coef2, and coef3)
2472 c
2473 c---- updated ---------------------
2474 c transmittance (tran)
2475 c
2476 c Note:
2477 c (1) units of sabs are g/cm**2 for water vapor and
2478 c (cm-atm)stp for co2 and o3.
2479 c (2) units of spre and stem are, respectively, mb and K.
2480 c (3) there are nt identical copies of the tables (coef1, coef2, and
2481 c coef3). the prupose of using the multiple copies of tables is
2482 c to increase the speed in parallel (vectorized) computations.
2483 C if such advantage does not exist, nt can be set to 1.
2484 c
2485 c**********************************************************************
2486 implicit none
2487 integer k1,k2,m,n,np,nx,nh,nt,i,j
2488
2489 c---- input parameters -----
2490
2491 _RL w1,p1,dwe,dpe
2492 _RL sabs(m,n,np+1),spre(m,n,np+1),stem(m,n,np+1)
2493 _RL coef1(nx,nh,nt),coef2(nx,nh,nt),coef3(nx,nh,nt)
2494
2495 c---- update parameter -----
2496
2497 _RL tran(m,n)
2498
2499 c---- temporary variables -----
2500
2501 _RL x1,x2,x3,we,pe,fw,fp,pa,pb,pc,ax,ba,bb,t1,ca,cb,t2
2502 integer iw,ip,nn
2503
2504 c**********************************************************************
2505
2506 do j=1,n
2507 do i=1,m
2508
2509 nn=mod(i,nt)+1
2510
2511 x1=sabs(i,j,k2)-sabs(i,j,k1)
2512 x2=(spre(i,j,k2)-spre(i,j,k1))/x1
2513 x3=(stem(i,j,k2)-stem(i,j,k1))/x1
2514
2515 we=(log10(x1)-w1)/dwe
2516 pe=(log10(x2)-p1)/dpe
2517
2518 we=max(we,w1-2.*dwe)
2519 pe=max(pe,p1)
2520
2521 iw=int(we+1.5)
2522 ip=int(pe+1.5)
2523
2524 iw=min(iw,nh-1)
2525 iw=max(iw, 2)
2526
2527 ip=min(ip,nx-1)
2528 ip=max(ip, 1)
2529
2530 fw=we-float(iw-1)
2531 fp=pe-float(ip-1)
2532
2533 c-----linear interpolation in pressure
2534
2535 pa = coef1(ip,iw-1,nn)*(1.-fp)+coef1(ip+1,iw-1,nn)*fp
2536 pb = coef1(ip,iw, nn)*(1.-fp)+coef1(ip+1,iw, nn)*fp
2537 pc = coef1(ip,iw+1,nn)*(1.-fp)+coef1(ip+1,iw+1,nn)*fp
2538
2539 c-----quadratic interpolation in absorber amount for coef1
2540
2541 ax = (-pa*(1.-fw)+pc*(1.+fw)) *fw*0.5 + pb*(1.-fw*fw)
2542
2543 c-----linear interpolation in absorber amount for coef2 and coef3
2544
2545 ba = coef2(ip,iw, nn)*(1.-fp)+coef2(ip+1,iw, nn)*fp
2546 bb = coef2(ip,iw+1,nn)*(1.-fp)+coef2(ip+1,iw+1,nn)*fp
2547 t1 = ba*(1.-fw) + bb*fw
2548
2549 ca = coef3(ip,iw, nn)*(1.-fp)+coef3(ip+1,iw, nn)*fp
2550 cb = coef3(ip,iw+1,nn)*(1.-fp)+coef3(ip+1,iw+1,nn)*fp
2551 t2 = ca*(1.-fw) + cb*fw
2552
2553 c-----update the total transmittance between levels k1 and k2
2554
2555 tran(i,j)= (ax + (t1+t2*x3) * x3)*tran(i,j)
2556
2557 enddo
2558 enddo
2559
2560 return
2561 end
2562 c**********************************************************************
2563 subroutine h2okdis(ib,m,n,np,k,fkw,gkw,ne,h2oexp,conexp,
2564 * th2o,tcon,tran)
2565 c**********************************************************************
2566 c compute water vapor transmittance between levels k1 and k2 for
2567 c m x n soundings, using the k-distribution method.
2568 c
2569 c computations follow eqs. (34), (46), (50) and (52).
2570 c
2571 c---- input parameters
2572 c spectral band (ib)
2573 c number of grid intervals in zonal direction (m)
2574 c number of grid intervals in meridional direction (n)
2575 c number of levels (np)
2576 c current level (k)
2577 c planck-weighted k-distribution function due to
2578 c h2o line absorption (fkw)
2579 c planck-weighted k-distribution function due to
2580 c h2o continuum absorption (gkw)
2581 c number of terms used in each band to compute water vapor
2582 c continuum transmittance (ne)
2583 c exponentials for line absorption (h2oexp)
2584 c exponentials for continuum absorption (conexp)
2585 c
2586 c---- updated parameters
2587 c transmittance between levels k1 and k2 due to
2588 c water vapor line absorption (th2o)
2589 c transmittance between levels k1 and k2 due to
2590 c water vapor continuum absorption (tcon)
2591 c total transmittance (tran)
2592 c
2593 c**********************************************************************
2594 implicit none
2595 integer ib,m,n,np,k,i,j
2596
2597 c---- input parameters ------
2598
2599 _RL conexp(m,n,np,3),h2oexp(m,n,np,6)
2600 integer ne(9)
2601 _RL fkw(6,9),gkw(6,3)
2602
2603 c---- updated parameters -----
2604
2605 _RL th2o(m,n,6),tcon(m,n,3),tran(m,n)
2606
2607 c---- temporary arrays -----
2608
2609 _RL trnth2o
2610
2611 c-----tco2 are the six exp factors between levels k1 and k2
2612 c tran is the updated total transmittance between levels k1 and k2
2613
2614 c-----th2o is the 6 exp factors between levels k1 and k2 due to
2615 c h2o line absorption.
2616
2617 c-----tcon is the 3 exp factors between levels k1 and k2 due to
2618 c h2o continuum absorption.
2619
2620 c-----trnth2o is the total transmittance between levels k1 and k2 due
2621 c to both line and continuum absorption computed from eq. (52).
2622
2623 do j=1,n
2624 do i=1,m
2625 th2o(i,j,1) = th2o(i,j,1)*h2oexp(i,j,k,1)
2626 th2o(i,j,2) = th2o(i,j,2)*h2oexp(i,j,k,2)
2627 th2o(i,j,3) = th2o(i,j,3)*h2oexp(i,j,k,3)
2628 th2o(i,j,4) = th2o(i,j,4)*h2oexp(i,j,k,4)
2629 th2o(i,j,5) = th2o(i,j,5)*h2oexp(i,j,k,5)
2630 th2o(i,j,6) = th2o(i,j,6)*h2oexp(i,j,k,6)
2631 enddo
2632 enddo
2633
2634 if (ne(ib).eq.0) then
2635
2636 do j=1,n
2637 do i=1,m
2638
2639 trnth2o =(fkw(1,ib)*th2o(i,j,1)
2640 * + fkw(2,ib)*th2o(i,j,2)
2641 * + fkw(3,ib)*th2o(i,j,3)
2642 * + fkw(4,ib)*th2o(i,j,4)
2643 * + fkw(5,ib)*th2o(i,j,5)
2644 * + fkw(6,ib)*th2o(i,j,6))
2645
2646 tran(i,j)=tran(i,j)*trnth2o
2647
2648 enddo
2649 enddo
2650
2651 elseif (ne(ib).eq.1) then
2652
2653 do j=1,n
2654 do i=1,m
2655
2656 tcon(i,j,1)= tcon(i,j,1)*conexp(i,j,k,1)
2657
2658 trnth2o =(fkw(1,ib)*th2o(i,j,1)
2659 * + fkw(2,ib)*th2o(i,j,2)
2660 * + fkw(3,ib)*th2o(i,j,3)
2661 * + fkw(4,ib)*th2o(i,j,4)
2662 * + fkw(5,ib)*th2o(i,j,5)
2663 * + fkw(6,ib)*th2o(i,j,6))*tcon(i,j,1)
2664
2665 tran(i,j)=tran(i,j)*trnth2o
2666
2667 enddo
2668 enddo
2669
2670 else
2671
2672 do j=1,n
2673 do i=1,m
2674
2675 tcon(i,j,1)= tcon(i,j,1)*conexp(i,j,k,1)
2676 tcon(i,j,2)= tcon(i,j,2)*conexp(i,j,k,2)
2677 tcon(i,j,3)= tcon(i,j,3)*conexp(i,j,k,3)
2678
2679
2680 trnth2o = ( gkw(1,1)*th2o(i,j,1)
2681 * + gkw(2,1)*th2o(i,j,2)
2682 * + gkw(3,1)*th2o(i,j,3)
2683 * + gkw(4,1)*th2o(i,j,4)
2684 * + gkw(5,1)*th2o(i,j,5)
2685 * + gkw(6,1)*th2o(i,j,6) ) * tcon(i,j,1)
2686 * + ( gkw(1,2)*th2o(i,j,1)
2687 * + gkw(2,2)*th2o(i,j,2)
2688 * + gkw(3,2)*th2o(i,j,3)
2689 * + gkw(4,2)*th2o(i,j,4)
2690 * + gkw(5,2)*th2o(i,j,5)
2691 * + gkw(6,2)*th2o(i,j,6) ) * tcon(i,j,2)
2692 * + ( gkw(1,3)*th2o(i,j,1)
2693 * + gkw(2,3)*th2o(i,j,2)
2694 * + gkw(3,3)*th2o(i,j,3)
2695 * + gkw(4,3)*th2o(i,j,4)
2696 * + gkw(5,3)*th2o(i,j,5)
2697 * + gkw(6,3)*th2o(i,j,6) ) * tcon(i,j,3)
2698
2699 tran(i,j)=tran(i,j)*trnth2o
2700
2701 enddo
2702 enddo
2703
2704 endif
2705
2706 return
2707 end
2708 c**********************************************************************
2709 subroutine co2kdis(m,n,np,k,co2exp,tco2,tran)
2710 c**********************************************************************
2711 c compute co2 transmittances between levels k1 and k2 for
2712 c m x n soundings, using the k-distribution method with linear
2713 c pressure scaling. computations follow eq. (34).
2714 c
2715 c---- input parameters
2716 c number of grid intervals in zonal direction (m)
2717 c number of grid intervals in meridional direction (n)
2718 c number of levels (np)
2719 c current level (k)
2720 c exponentials for co2 absorption (co2exp)
2721 c
2722 c---- updated parameters
2723 c transmittance between levels k1 and k2 due to co2 absorption
2724 c for the various values of the absorption coefficient (tco2)
2725 c total transmittance (tran)
2726 c
2727 c**********************************************************************
2728 implicit none
2729 integer m,n,np,k,i,j
2730
2731 c---- input parameters -----
2732
2733 _RL co2exp(m,n,np,6,2)
2734
2735 c---- updated parameters -----
2736
2737 _RL tco2(m,n,6,2),tran(m,n)
2738
2739 c---- temporary arrays -----
2740
2741 _RL xc
2742
2743 c-----tco2 is the 6 exp factors between levels k1 and k2.
2744 c xc is the total co2 transmittance given by eq. (53).
2745
2746 do j=1,n
2747 do i=1,m
2748
2749 c-----band-wings
2750
2751 tco2(i,j,1,1)=tco2(i,j,1,1)*co2exp(i,j,k,1,1)
2752 xc= 0.1395 *tco2(i,j,1,1)
2753
2754 tco2(i,j,2,1)=tco2(i,j,2,1)*co2exp(i,j,k,2,1)
2755 xc=xc+0.1407 *tco2(i,j,2,1)
2756
2757 tco2(i,j,3,1)=tco2(i,j,3,1)*co2exp(i,j,k,3,1)
2758 xc=xc+0.1549 *tco2(i,j,3,1)
2759
2760 tco2(i,j,4,1)=tco2(i,j,4,1)*co2exp(i,j,k,4,1)
2761 xc=xc+0.1357 *tco2(i,j,4,1)
2762
2763 tco2(i,j,5,1)=tco2(i,j,5,1)*co2exp(i,j,k,5,1)
2764 xc=xc+0.0182 *tco2(i,j,5,1)
2765
2766 tco2(i,j,6,1)=tco2(i,j,6,1)*co2exp(i,j,k,6,1)
2767 xc=xc+0.0220 *tco2(i,j,6,1)
2768
2769 c-----band-center region
2770
2771 tco2(i,j,1,2)=tco2(i,j,1,2)*co2exp(i,j,k,1,2)
2772 xc=xc+0.0766 *tco2(i,j,1,2)
2773
2774 tco2(i,j,2,2)=tco2(i,j,2,2)*co2exp(i,j,k,2,2)
2775 xc=xc+0.1372 *tco2(i,j,2,2)
2776
2777 tco2(i,j,3,2)=tco2(i,j,3,2)*co2exp(i,j,k,3,2)
2778 xc=xc+0.1189 *tco2(i,j,3,2)
2779
2780 tco2(i,j,4,2)=tco2(i,j,4,2)*co2exp(i,j,k,4,2)
2781 xc=xc+0.0335 *tco2(i,j,4,2)
2782
2783 tco2(i,j,5,2)=tco2(i,j,5,2)*co2exp(i,j,k,5,2)
2784 xc=xc+0.0169 *tco2(i,j,5,2)
2785
2786 tco2(i,j,6,2)=tco2(i,j,6,2)*co2exp(i,j,k,6,2)
2787 xc=xc+0.0059 *tco2(i,j,6,2)
2788
2789 tran(i,j)=tran(i,j)*xc
2790
2791 enddo
2792 enddo
2793
2794 return
2795 end
2796 c**********************************************************************
2797 subroutine n2okdis(ib,m,n,np,k,n2oexp,tn2o,tran)
2798 c**********************************************************************
2799 c compute n2o transmittances between levels k1 and k2 for
2800 c m x n soundings, using the k-distribution method with linear
2801 c pressure scaling.
2802 c
2803 c---- input parameters
2804 c spectral band (ib)
2805 c number of grid intervals in zonal direction (m)
2806 c number of grid intervals in meridional direction (n)
2807 c number of levels (np)
2808 c current level (k)
2809 c exponentials for n2o absorption (n2oexp)
2810 c
2811 c---- updated parameters
2812 c transmittance between levels k1 and k2 due to n2o absorption
2813 c for the various values of the absorption coefficient (tn2o)
2814 c total transmittance (tran)
2815 c
2816 c**********************************************************************
2817 implicit none
2818 integer ib,m,n,np,k,i,j
2819
2820 c---- input parameters -----
2821
2822 _RL n2oexp(m,n,np,4)
2823
2824 c---- updated parameters -----
2825
2826 _RL tn2o(m,n,4),tran(m,n)
2827
2828 c---- temporary arrays -----
2829
2830 _RL xc
2831
2832 c-----tn2o is the 2 exp factors between levels k1 and k2.
2833 c xc is the total n2o transmittance
2834
2835 do j=1,n
2836 do i=1,m
2837
2838 c-----band 6
2839
2840 if (ib.eq.6) then
2841
2842 tn2o(i,j,1)=tn2o(i,j,1)*n2oexp(i,j,k,1)
2843 xc= 0.940414*tn2o(i,j,1)
2844
2845 tn2o(i,j,2)=tn2o(i,j,2)*n2oexp(i,j,k,2)
2846 xc=xc+0.059586*tn2o(i,j,2)
2847
2848 c-----band 7
2849
2850 else
2851
2852 tn2o(i,j,1)=tn2o(i,j,1)*n2oexp(i,j,k,1)
2853 xc= 0.561961*tn2o(i,j,1)
2854
2855 tn2o(i,j,2)=tn2o(i,j,2)*n2oexp(i,j,k,2)
2856 xc=xc+0.138707*tn2o(i,j,2)
2857
2858 tn2o(i,j,3)=tn2o(i,j,3)*n2oexp(i,j,k,3)
2859 xc=xc+0.240670*tn2o(i,j,3)
2860
2861 tn2o(i,j,4)=tn2o(i,j,4)*n2oexp(i,j,k,4)
2862 xc=xc+0.058662*tn2o(i,j,4)
2863
2864 endif
2865
2866 tran(i,j)=tran(i,j)*xc
2867
2868 enddo
2869 enddo
2870
2871 return
2872 end
2873 c**********************************************************************
2874 subroutine ch4kdis(ib,m,n,np,k,ch4exp,tch4,tran)
2875 c**********************************************************************
2876 c compute ch4 transmittances between levels k1 and k2 for
2877 c m x n soundings, using the k-distribution method with
2878 c linear pressure scaling.
2879 c
2880 c---- input parameters
2881 c spectral band (ib)
2882 c number of grid intervals in zonal direction (m)
2883 c number of grid intervals in meridional direction (n)
2884 c number of levels (np)
2885 c current level (k)
2886 c exponentials for ch4 absorption (ch4exp)
2887 c
2888 c---- updated parameters
2889 c transmittance between levels k1 and k2 due to ch4 absorption
2890 c for the various values of the absorption coefficient (tch4)
2891 c total transmittance (tran)
2892 c
2893 c**********************************************************************
2894 implicit none
2895 integer ib,m,n,np,k,i,j
2896
2897 c---- input parameters -----
2898
2899 _RL ch4exp(m,n,np,4)
2900
2901 c---- updated parameters -----
2902
2903 _RL tch4(m,n,4),tran(m,n)
2904
2905 c---- temporary arrays -----
2906
2907 _RL xc
2908
2909 c-----tch4 is the 2 exp factors between levels k1 and k2.
2910 c xc is the total ch4 transmittance
2911
2912 do j=1,n
2913 do i=1,m
2914
2915 c-----band 6
2916
2917 if (ib.eq.6) then
2918
2919 tch4(i,j,1)=tch4(i,j,1)*ch4exp(i,j,k,1)
2920 xc= tch4(i,j,1)
2921
2922 c-----band 7
2923
2924 else
2925
2926 tch4(i,j,1)=tch4(i,j,1)*ch4exp(i,j,k,1)
2927 xc= 0.610650*tch4(i,j,1)
2928
2929 tch4(i,j,2)=tch4(i,j,2)*ch4exp(i,j,k,2)
2930 xc=xc+0.280212*tch4(i,j,2)
2931
2932 tch4(i,j,3)=tch4(i,j,3)*ch4exp(i,j,k,3)
2933 xc=xc+0.107349*tch4(i,j,3)
2934
2935 tch4(i,j,4)=tch4(i,j,4)*ch4exp(i,j,k,4)
2936 xc=xc+0.001789*tch4(i,j,4)
2937
2938 endif
2939
2940 tran(i,j)=tran(i,j)*xc
2941
2942 enddo
2943 enddo
2944
2945 return
2946 end
2947 c**********************************************************************
2948 subroutine comkdis(ib,m,n,np,k,comexp,tcom,tran)
2949 c**********************************************************************
2950 c compute co2-minor transmittances between levels k1 and k2
2951 c for m x n soundings, using the k-distribution method
2952 c with linear pressure scaling.
2953 c
2954 c---- input parameters
2955 c spectral band (ib)
2956 c number of grid intervals in zonal direction (m)
2957 c number of grid intervals in meridional direction (n)
2958 c number of levels (np)
2959 c current level (k)
2960 c exponentials for co2-minor absorption (comexp)
2961 c
2962 c---- updated parameters
2963 c transmittance between levels k1 and k2 due to co2-minor absorption
2964 c for the various values of the absorption coefficient (tcom)
2965 c total transmittance (tran)
2966 c
2967 c**********************************************************************
2968 implicit none
2969 integer ib,m,n,np,k,i,j
2970
2971 c---- input parameters -----
2972
2973 _RL comexp(m,n,np,2)
2974
2975 c---- updated parameters -----
2976
2977 _RL tcom(m,n,2),tran(m,n)
2978
2979 c---- temporary arrays -----
2980
2981 _RL xc
2982
2983 c-----tcom is the 2 exp factors between levels k1 and k2.
2984 c xc is the total co2-minor transmittance
2985
2986 do j=1,n
2987 do i=1,m
2988
2989 c-----band 4
2990
2991 if (ib.eq.4) then
2992
2993 tcom(i,j,1)=tcom(i,j,1)*comexp(i,j,k,1)
2994 xc= 0.972025*tcom(i,j,1)
2995 tcom(i,j,2)=tcom(i,j,2)*comexp(i,j,k,2)
2996 xc=xc+0.027975*tcom(i,j,2)
2997
2998 c-----band 5
2999
3000 else
3001
3002 tcom(i,j,1)=tcom(i,j,1)*comexp(i,j,k,1)
3003 xc= 0.961324*tcom(i,j,1)
3004 tcom(i,j,2)=tcom(i,j,2)*comexp(i,j,k,2)
3005 xc=xc+0.038676*tcom(i,j,2)
3006
3007 endif
3008
3009 tran(i,j)=tran(i,j)*xc
3010
3011 enddo
3012 enddo
3013
3014 return
3015 end
3016 c**********************************************************************
3017 subroutine cfckdis(m,n,np,k,cfcexp,tcfc,tran)
3018 c**********************************************************************
3019 c compute cfc-(11,12,22) transmittances between levels k1 and k2
3020 c for m x n soundings, using the k-distribution method with
3021 c linear pressure scaling.
3022 c
3023 c---- input parameters
3024 c number of grid intervals in zonal direction (m)
3025 c number of grid intervals in meridional direction (n)
3026 c number of levels (np)
3027 c current level (k)
3028 c exponentials for cfc absorption (cfcexp)
3029 c
3030 c---- updated parameters
3031 c transmittance between levels k1 and k2 due to cfc absorption
3032 c for the various values of the absorption coefficient (tcfc)
3033 c total transmittance (tran)
3034 c
3035 c**********************************************************************
3036 implicit none
3037 integer m,n,np,k,i,j
3038
3039 c---- input parameters -----
3040
3041 _RL cfcexp(m,n,np)
3042
3043 c---- updated parameters -----
3044
3045 _RL tcfc(m,n),tran(m,n)
3046
3047 c-----tcfc is the exp factors between levels k1 and k2.
3048
3049 do j=1,n
3050 do i=1,m
3051
3052 tcfc(i,j)=tcfc(i,j)*cfcexp(i,j,k)
3053 tran(i,j)=tran(i,j)*tcfc(i,j)
3054
3055 enddo
3056 enddo
3057
3058 return
3059 end
3060 c**********************************************************************
3061 subroutine b10kdis(m,n,np,k,h2oexp,conexp,co2exp,n2oexp
3062 * ,th2o,tcon,tco2,tn2o,tran)
3063 c**********************************************************************
3064 c
3065 c compute h2o (line and continuum),co2,n2o transmittances between
3066 c levels k1 and k2 for m x n soundings, using the k-distribution
3067 c method with linear pressure scaling.
3068 c
3069 c---- input parameters
3070 c number of grid intervals in zonal direction (m)
3071 c number of grid intervals in meridional direction (n)
3072 c number of levels (np)
3073 c current level (k)
3074 c exponentials for h2o line absorption (h2oexp)
3075 c exponentials for h2o continuum absorption (conexp)
3076 c exponentials for co2 absorption (co2exp)
3077 c exponentials for n2o absorption (n2oexp)
3078 c
3079 c---- updated parameters
3080 c transmittance between levels k1 and k2 due to h2o line absorption
3081 c for the various values of the absorption coefficient (th2o)
3082 c transmittance between levels k1 and k2 due to h2o continuum
3083 c absorption for the various values of the absorption
3084 c coefficient (tcon)
3085 c transmittance between levels k1 and k2 due to co2 absorption
3086 c for the various values of the absorption coefficient (tco2)
3087 c transmittance between levels k1 and k2 due to n2o absorption
3088 c for the various values of the absorption coefficient (tn2o)
3089 c total transmittance (tran)
3090 c
3091 c**********************************************************************
3092 implicit none
3093 integer m,n,np,k,i,j
3094
3095 c---- input parameters -----
3096
3097 _RL h2oexp(m,n,np,6),conexp(m,n,np,3),co2exp(m,n,np,6,2)
3098 * ,n2oexp(m,n,np,4)
3099
3100 c---- updated parameters -----
3101
3102 _RL th2o(m,n,6),tcon(m,n,3),tco2(m,n,6,2),tn2o(m,n,4)
3103 * ,tran(m,n)
3104
3105 c---- temporary arrays -----
3106
3107 _RL xx
3108
3109 c-----initialize tran
3110
3111 do j=1,n
3112 do i=1,m
3113 tran(i,j)=1.0
3114 enddo
3115 enddo
3116
3117 c-----for h2o line
3118
3119 do j=1,n
3120 do i=1,m
3121
3122 th2o(i,j,1)=th2o(i,j,1)*h2oexp(i,j,k,1)
3123 xx= 0.3153*th2o(i,j,1)
3124
3125 th2o(i,j,2)=th2o(i,j,2)*h2oexp(i,j,k,2)
3126 xx=xx+0.4604*th2o(i,j,2)
3127
3128 th2o(i,j,3)=th2o(i,j,3)*h2oexp(i,j,k,3)
3129 xx=xx+0.1326*th2o(i,j,3)
3130
3131 th2o(i,j,4)=th2o(i,j,4)*h2oexp(i,j,k,4)
3132 xx=xx+0.0798*th2o(i,j,4)
3133
3134 th2o(i,j,5)=th2o(i,j,5)*h2oexp(i,j,k,5)
3135 xx=xx+0.0119*th2o(i,j,5)
3136
3137 tran(i,j)=tran(i,j)*xx
3138
3139 enddo
3140 enddo
3141
3142 c-----for h2o continuum
3143
3144 do j=1,n
3145 do i=1,m
3146
3147 tcon(i,j,1)=tcon(i,j,1)*conexp(i,j,k,1)
3148 tran(i,j)=tran(i,j)*tcon(i,j,1)
3149
3150 enddo
3151 enddo
3152
3153 c-----for co2
3154
3155 do j=1,n
3156 do i=1,m
3157
3158 tco2(i,j,1,1)=tco2(i,j,1,1)*co2exp(i,j,k,1,1)
3159 xx= 0.2673*tco2(i,j,1,1)
3160
3161 tco2(i,j,2,1)=tco2(i,j,2,1)*co2exp(i,j,k,2,1)
3162 xx=xx+ 0.2201*tco2(i,j,2,1)
3163
3164 tco2(i,j,3,1)=tco2(i,j,3,1)*co2exp(i,j,k,3,1)
3165 xx=xx+ 0.2106*tco2(i,j,3,1)
3166
3167 tco2(i,j,4,1)=tco2(i,j,4,1)*co2exp(i,j,k,4,1)
3168 xx=xx+ 0.2409*tco2(i,j,4,1)
3169
3170 tco2(i,j,5,1)=tco2(i,j,5,1)*co2exp(i,j,k,5,1)
3171 xx=xx+ 0.0196*tco2(i,j,5,1)
3172
3173 tco2(i,j,6,1)=tco2(i,j,6,1)*co2exp(i,j,k,6,1)
3174 xx=xx+ 0.0415*tco2(i,j,6,1)
3175
3176 tran(i,j)=tran(i,j)*xx
3177
3178 enddo
3179 enddo
3180
3181 c-----for n2o
3182
3183 do j=1,n
3184 do i=1,m
3185
3186 tn2o(i,j,1)=tn2o(i,j,1)*n2oexp(i,j,k,1)
3187 xx= 0.970831*tn2o(i,j,1)
3188
3189 tn2o(i,j,2)=tn2o(i,j,2)*n2oexp(i,j,k,2)
3190 xx=xx+0.029169*tn2o(i,j,2)
3191
3192 tran(i,j)=tran(i,j)*(xx-1.0)
3193
3194 enddo
3195 enddo
3196
3197 return
3198 end

  ViewVC Help
Powered by ViewVC 1.1.22