12 SUBROUTINE irrad_d(np, ple_dev, ta_dev, ta_devd, wa_dev, wa_devd, oa_dev&
13 & , oa_devd, tb_dev, tb_devd, co2, trace, n2o_dev, ch4_dev, cfc11_dev, &
14 & cfc12_dev, cfc22_dev, cwc_dev, cwc_devd, fcld_dev, fcld_devd, ict, icb&
15 & , reff_dev, reff_devd, ns, fs_dev, tg_dev, eg_dev, tv_dev, ev_dev, &
16 & rv_dev, na, nb, taua_dev, taua_devd, ssaa_dev, ssaa_devd, asya_dev, &
17 & asya_devd, flxu_dev, flxu_devd, flxd_dev, flxd_devd, dfdts_dev, &
18 & dfdts_devd, aib_ir, awb_ir, aiw_ir, aww_ir, aig_ir, awg_ir, xkw, xke, &
19 & mw, aw, bw, pm, fkw, gkw, cb, dcb, w11, w12, w13, p11, p12, p13, dwe, &
20 & dpe, c1, c2, c3, oo1, oo2, oo3, h11, h12, h13, h21, h22, h23, h81, h82&
24 REAL*8,
INTENT(IN) :: aib_ir(3, 10), awb_ir(4, 10), aiw_ir(4, 10)
25 REAL*8,
INTENT(IN) :: aww_ir(4, 10), aig_ir(4, 10), awg_ir(4, 10)
26 INTEGER,
INTENT(IN) :: mw(9)
27 REAL*8,
INTENT(IN) :: xkw(9), xke(9), aw(9), bw(9), pm(9)
28 REAL*8,
INTENT(IN) :: fkw(6, 9), gkw(6, 3), cb(6, 10), dcb(5, 10)
29 REAL*8,
INTENT(IN) :: w11, w12, w13, p11, p12
30 REAL*8,
INTENT(IN) :: p13, dwe, dpe
31 REAL*8,
INTENT(IN) :: c1(26, 30), c2(26, 30), c3(26, 30)
32 REAL*8,
INTENT(IN) :: oo1(26, 21), oo2(26, 21), oo3(26, 21)
33 REAL*8,
INTENT(IN) :: h11(26, 31), h12(26, 31), h13(26, 31)
34 REAL*8,
INTENT(IN) :: h21(26, 31), h22(26, 31), h23(26, 31)
35 REAL*8,
INTENT(IN) :: h81(26, 31), h82(26, 31), h83(26, 31)
37 INTEGER,
INTENT(IN) :: np, ict, icb, ns, na, nb
38 LOGICAL,
INTENT(IN) :: trace
39 REAL*8,
INTENT(IN) :: co2
41 REAL*8,
INTENT(IN) :: tb_dev
42 REAL*8,
INTENT(IN) :: tb_devd
44 REAL*8,
DIMENSION(np),
INTENT(IN) :: ta_dev, wa_dev, oa_dev, fcld_dev
45 REAL*8,
DIMENSION(np),
INTENT(IN) :: ta_devd, wa_devd, oa_devd, &
47 REAL*8,
DIMENSION(np),
INTENT(IN) :: n2o_dev, ch4_dev, cfc11_dev, &
48 & cfc12_dev, cfc22_dev
49 REAL*8,
DIMENSION(np + 1),
INTENT(IN) :: ple_dev
51 REAL*8,
DIMENSION(ns),
INTENT(IN) :: fs_dev, tg_dev, tv_dev
52 REAL*8,
DIMENSION(ns, 10),
INTENT(IN) :: eg_dev, ev_dev, rv_dev
54 REAL*8,
DIMENSION(np, 4),
INTENT(IN) :: cwc_dev, reff_dev
55 REAL*8,
DIMENSION(np, 4),
INTENT(IN) :: cwc_devd, reff_devd
57 REAL*8,
DIMENSION(np, nb),
INTENT(INOUT) :: taua_dev, ssaa_dev, &
59 REAL*8,
DIMENSION(np, nb),
INTENT(INOUT) :: taua_devd, ssaa_devd, &
62 REAL*8,
DIMENSION(np + 1),
INTENT(OUT) :: flxu_dev
63 REAL*8,
DIMENSION(np+1),
INTENT(OUT) :: flxu_devd
64 REAL*8,
DIMENSION(np + 1),
INTENT(OUT) :: flxd_dev
65 REAL*8,
DIMENSION(np+1),
INTENT(OUT) :: flxd_devd
66 REAL*8,
DIMENSION(np + 1),
INTENT(OUT) :: dfdts_dev
67 REAL*8,
DIMENSION(np+1),
INTENT(OUT) :: dfdts_devd
69 REAL*8,
PARAMETER :: cons_grav=9.80665
70 INTEGER,
PARAMETER :: nx1=26
71 INTEGER,
PARAMETER :: no1=21
72 INTEGER,
PARAMETER :: nc1=30
73 INTEGER,
PARAMETER :: nh1=31
75 REAL*8 :: pa(0:np), dt(0:np)
76 REAL*8 :: pad(0:np), dtd(0:np)
78 REAL*8 :: x1d, x2d, x3d
79 REAL*8 :: dh2o(0:np), dcont(0:np), dco2(0:np), do3(0:np)
80 REAL*8 :: dh2od(0:np), dcontd(0:np), dco2d(0:np), do3d(0:np)
81 REAL*8 :: dn2o(0:np), dch4(0:np)
82 REAL*8 :: dn2od(0:np), dch4d(0:np)
83 REAL*8 :: df11(0:np), df12(0:np), df22(0:np)
84 REAL*8 :: df11d(0:np), df12d(0:np), df22d(0:np)
85 REAL*8 :: th2o(6), tcon(3), tco2(6)
86 REAL*8 :: th2od(6), tcond(3), tco2d(6)
87 REAL*8 :: tn2o(4), tch4(4), tcom(6)
88 REAL*8 :: tn2od(4), tch4d(4), tcomd(6)
89 REAL*8 :: tf11, tf12, tf22
90 REAL*8 :: tf11d, tf12d, tf22d
91 REAL*8 :: blayer(0:np+1), blevel(0:np+1)
92 REAL*8 :: blayerd(0:np+1), bleveld(0:np+1)
93 REAL*8 :: bd(0:np+1), bu(0:np+1)
94 REAL*8 :: bdd(0:np+1), bud(0:np+1)
95 REAL*8 :: bs, dbs, rflxs
98 REAL*8 :: trant, tranal
99 REAL*8 :: trantd, tranald
100 REAL*8 :: transfc(0:np+1)
101 REAL*8 :: transfcd(0:np+1)
102 REAL*8 :: flxu(0:np+1), flxd(0:np+1)
103 REAL*8 :: flxud(0:np+1), flxdd(0:np+1)
104 REAL*8 :: taerlyr(0:np)
105 REAL*8 :: taerlyrd(0:np)
111 INTEGER :: k, l,
ip, iw, ibn, ik, iq, isb, k1, k2, ne
114 REAL*8 :: cldhi, cldmd, cldlw, tcldlyr(0:np), fclr
115 REAL*8 :: cldhid, cldmdd, cldlwd, tcldlyrd(0:np), fclrd
116 REAL*8 :: x, xx, yy, p1, a1, b1, fk1, a2, b2, fk2
120 LOGICAL :: oznbnd, co2bnd, h2otable, conbnd, n2obnd
121 LOGICAL :: ch4bnd, combnd, f11bnd, f12bnd, f22bnd, b10bnd
122 LOGICAL :: do_aerosol
124 INTEGER,
PARAMETER :: max_num_tables=17
125 REAL*8 :: exptbl(0:np, max_num_tables)
126 REAL*8 :: exptbld(0:np, max_num_tables)
131 TYPE(band_table) :: h2oexp
132 TYPE(band_table) :: conexp
133 TYPE(band_table) :: co2exp
134 TYPE(band_table) :: n2oexp
135 TYPE(band_table) :: ch4exp
136 TYPE(band_table) :: comexp
137 TYPE(band_table) :: f11exp
138 TYPE(band_table) :: f12exp
139 TYPE(band_table) :: f22exp
143 REAL*8 :: fcld_col(np)
144 REAL*8 :: fcld_cold(np)
145 REAL*8 :: reff_col(np, 4)
146 REAL*8 :: reff_cold(np, 4)
147 REAL*8 :: cwc_col(np, 4)
148 REAL*8 :: cwc_cold(np, 4)
149 REAL*8 :: h2oexp_tmp(0:np, 5), conexp_tmp(0:np), co2exp_tmp(0:np, 6), &
150 & n2oexp_tmp(0:np, 2)
151 REAL*8 :: h2oexp_tmpd(0:np, 5), co2exp_tmpd(0:np, 6), n2oexp_tmpd(0:np&
168 pa(k) = 0.5*(ple_dev(k+1)+ple_dev(k))*0.01
170 dp(k) = (ple_dev(k+1)-ple_dev(k))*0.01
173 dp_pa(k) = ple_dev(k+1) - ple_dev(k)
175 dt(k) = ta_dev(k) - 250.0
191 dh2od(k) = 1.02*dp(k)*wa_devd(k)
192 dh2o(k) = 1.02*wa_dev(k)*dp(k)
193 do3d(k) = 476.*dp(k)*oa_devd(k)
194 do3(k) = 476.*oa_dev(k)*dp(k)
196 dco2(k) = 789.*co2*dp(k)
198 dch4(k) = 789.*ch4_dev(k)*dp(k)
200 dn2o(k) = 789.*n2o_dev(k)*dp(k)
202 df11(k) = 789.*cfc11_dev(k)*dp(k)
204 df12(k) = 789.*cfc12_dev(k)*dp(k)
206 df22(k) = 789.*cfc22_dev(k)*dp(k)
207 IF (dh2o(k) .LT. 1.e-10)
THEN 213 IF (do3(k) .LT. 1.e-6)
THEN 219 IF (dco2(k) .LT. 1.e-4)
THEN 228 xxd = pa(k)*0.001618*dp(k)*(wa_devd(k)*wa_dev(k)+wa_dev(k)*wa_devd(k&
230 xx = pa(k)*0.001618*wa_dev(k)*wa_dev(k)*dp(k)
231 dcontd(k) = xxd*exp(1800./ta_dev(k)-6.081) - xx*1800.*ta_devd(k)*exp&
232 & (1800./ta_dev(k)-6.081)/ta_dev(k)**2
233 dcont(k) = xx*exp(1800./ta_dev(k)-6.081)
235 fcld_cold(k) = fcld_devd(k)
236 fcld_col(k) = fcld_dev(k)
238 reff_cold(k, l) = reff_devd(k, l)
239 reff_col(k, l) = reff_dev(k, l)
240 cwc_cold(k, l) = cwc_devd(k, l)
241 cwc_col(k, l) = cwc_dev(k, l)
244 IF (ple_dev(1)*0.01 .LT. 0.005)
THEN 249 dp(0) = ple_dev(1)*0.01
254 dt(0) = ta_dev(1) - 250.0
255 dh2od(0) = 1.02*dp(0)*wa_devd(1)
256 dh2o(0) = 1.02*wa_dev(1)*dp(0)
257 do3d(0) = 476.*dp(0)*oa_devd(1)
258 do3(0) = 476.*oa_dev(1)*dp(0)
260 dco2(0) = 789.*co2*dp(0)
262 dch4(0) = 789.*ch4_dev(1)*dp(0)
264 dn2o(0) = 789.*n2o_dev(1)*dp(0)
266 df11(0) = 789.*cfc11_dev(1)*dp(0)
268 df12(0) = 789.*cfc12_dev(1)*dp(0)
270 df22(0) = 789.*cfc22_dev(1)*dp(0)
271 IF (dh2o(0) .LT. 1.e-10)
THEN 277 IF (do3(0) .LT. 1.e-6)
THEN 283 IF (dco2(0) .LT. 1.e-4)
THEN 290 xxd = pa(0)*0.001618*dp(0)*(wa_devd(1)*wa_dev(1)+wa_dev(1)*wa_devd(1))
291 xx = pa(0)*0.001618*wa_dev(1)*wa_dev(1)*dp(0)
292 dcontd(0) = xxd*exp(1800./ta_dev(1)-6.081) - xx*1800.*ta_devd(1)*exp(&
293 & 1800./ta_dev(1)-6.081)/ta_dev(1)**2
294 dcont(0) = xx*exp(1800./ta_dev(1)-6.081)
298 transfcd(np+1) = 0.0_8
306 dfdts_devd(k) = 0.0_8
332 IF (ibn .EQ. 10 .AND. (.NOT.trace))
THEN 346 h2otable = (ibn .EQ. 1 .OR. ibn .EQ. 2) .OR. ibn .EQ. 8
347 conbnd = ibn .GE. 2 .AND. ibn .LE. 7
350 n2obnd = ibn .EQ. 6 .OR. ibn .EQ. 7
351 ch4bnd = ibn .EQ. 6 .OR. ibn .EQ. 7
352 combnd = ibn .EQ. 4 .OR. ibn .EQ. 5
353 f11bnd = ibn .EQ. 4 .OR. ibn .EQ. 5
354 f12bnd = ibn .EQ. 4 .OR. ibn .EQ. 6
355 f22bnd = ibn .EQ. 4 .OR. ibn .EQ. 6
357 do_aerosol = na .GT. 0
430 CALL planck_d(ibn, cb, ta_dev(k), ta_devd(k), blayer(k), blayerd&
434 blayerd(0) = blayerd(1)
435 blayer(0) = blayer(1)
436 bleveld(0) = blayerd(1)
437 blevel(0) = blayer(1)
440 CALL sfcflux(ibn, cb, dcb, ns, fs_dev, tg_dev, eg_dev, tv_dev, &
441 & ev_dev, rv_dev, bs, dbs, rflxs)
442 blayerd(np+1) = 0.0_8
446 bleveld(k) = (dp(k)*blayerd(k-1)+dp(k-1)*blayerd(k))/(dp(k-1)+dp&
448 blevel(k) = (blayer(k-1)*dp(k)+blayer(k)*dp(k-1))/(dp(k-1)+dp(k)&
452 bleveld(1) = blayerd(1) + dp(1)*(blayerd(1)-blayerd(2))/(dp(1)+dp(&
454 blevel(1) = blayer(1) + (blayer(1)-blayer(2))*dp(1)/(dp(1)+dp(2))
455 bleveld(0) = bleveld(1)
456 blevel(0) = blevel(1)
458 CALL planck_d(ibn, cb, tb_dev, tb_devd, blevel(np+1), bleveld(np+1&
468 CALL getirtau1_d(ibn, np, dp_pa, fcld_col, fcld_cold, reff_col, &
469 & reff_cold, cwc_col, cwc_cold, tcldlyr, tcldlyrd, enn, &
470 & ennd, aib_ir, awb_ir, aiw_ir, aww_ir, aig_ir, awg_ir, &
475 CALL mkicx(np, ict, icb, enn, icx, ncld)
485 IF (taua_dev(k, ibn) .GT. 0.001)
THEN 486 IF (ssaa_dev(k, ibn) .GT. 0.001)
THEN 487 asya_devd(k, ibn) = (asya_devd(k, ibn)*ssaa_dev(k, ibn)-&
488 & asya_dev(k, ibn)*ssaa_devd(k, ibn))/ssaa_dev(k, ibn)**2
489 asya_dev(k, ibn) = asya_dev(k, ibn)/ssaa_dev(k, ibn)
490 ssaa_devd(k, ibn) = (ssaa_devd(k, ibn)*taua_dev(k, ibn)-&
491 & ssaa_dev(k, ibn)*taua_devd(k, ibn))/taua_dev(k, ibn)**2
492 ssaa_dev(k, ibn) = ssaa_dev(k, ibn)/taua_dev(k, ibn)
494 ffd = (0.1185*asya_devd(k, ibn)*asya_dev(k, ibn)+(0.0076+&
495 & 0.1185*asya_dev(k, ibn))*asya_devd(k, ibn))*asya_dev(k, &
496 & ibn) + (.3739+(0.0076+0.1185*asya_dev(k, ibn))*asya_dev(&
497 & k, ibn))*asya_devd(k, ibn)
498 ff = .5 + (.3739+(0.0076+0.1185*asya_dev(k, ibn))*asya_dev&
499 & (k, ibn))*asya_dev(k, ibn)
500 taua_devd(k, ibn) = taua_devd(k, ibn)*(1.-ssaa_dev(k, ibn)&
501 & *ff) + taua_dev(k, ibn)*(-(ssaa_devd(k, ibn)*ff)-&
502 & ssaa_dev(k, ibn)*ffd)
503 taua_dev(k, ibn) = taua_dev(k, ibn)*(1.-ssaa_dev(k, ibn)*&
506 taerlyrd(k) = -(1.66*taua_devd(k, ibn)*exp(-(1.66*taua_dev(k&
508 taerlyr(k) = exp(-(1.66*taua_dev(k, ibn)))
514 IF (.NOT.h2otable .AND. (.NOT.b10bnd))
THEN 515 CALL h2oexps_d(ibn, np, dh2o, dh2od, pa, dt, dtd, xkw, aw, bw, &
516 & pm, mw, exptbl(:, h2oexp%start:h2oexp%end), exptbld(:, &
517 & h2oexp%start:h2oexp%end))
526 IF (ibn .EQ. 3) ne = 3
527 CALL conexps_d(ibn, np, dcont, dcontd, xke, exptbl(:, conexp%&
528 & start:conexp%end), exptbld(:, conexp%start:conexp%end))
532 IF (n2obnd)
CALL n2oexps_d(ibn, np, dn2o, pa, dt, dtd, exptbl(:&
533 & , n2oexp%start:n2oexp%end), exptbld(:, &
534 & n2oexp%start:n2oexp%end))
536 IF (ch4bnd)
CALL ch4exps_d(ibn, np, dch4, pa, dt, dtd, exptbl(:&
537 & , ch4exp%start:ch4exp%end), exptbld(:, &
538 & ch4exp%start:ch4exp%end))
540 IF (combnd)
CALL comexps_d(ibn, np, dco2, dt, dtd, exptbl(:, &
541 & comexp%start:comexp%end), exptbld(:, comexp&
542 & %start:comexp%end))
552 CALL cfcexps_d(ibn, np, a1, b1, fk1, a2, b2, fk2, df11, dt, &
553 & dtd, exptbl(:, f11exp%start:f11exp%end), exptbld(:, &
554 & f11exp%start:f11exp%end))
564 CALL cfcexps_d(ibn, np, a1, b1, fk1, a2, b2, fk2, df12, dt, &
565 & dtd, exptbl(:, f12exp%start:f12exp%end), exptbld(:, &
566 & f12exp%start:f12exp%end))
576 CALL cfcexps_d(ibn, np, a1, b1, fk1, a2, b2, fk2, df22, dt, &
577 & dtd, exptbl(:, f22exp%start:f22exp%end), exptbld(:, &
578 & f22exp%start:f22exp%end))
583 CALL b10exps_d(np, dh2o, dh2od, dcont, dcontd, dco2, dn2o, pa&
584 & , dt, dtd, h2oexp_tmp, h2oexp_tmpd, exptbl(:, conexp%&
585 & start:conexp%end), exptbld(:, conexp%start:conexp%end&
586 & ), co2exp_tmp, co2exp_tmpd, n2oexp_tmp, n2oexp_tmpd)
587 exptbld(:, h2oexp%start:h2oexp%end) = h2oexp_tmpd
588 exptbl(:, h2oexp%start:h2oexp%end) = h2oexp_tmp
589 exptbld(:, co2exp%start:co2exp%end) = co2exp_tmpd
590 exptbl(:, co2exp%start:co2exp%end) = co2exp_tmp
591 exptbld(:, n2oexp%start:n2oexp%end) = n2oexp_tmpd
592 exptbl(:, n2oexp%start:n2oexp%end) = n2oexp_tmp
601 bud(np+1) = blayerd(np+1)
602 bu(np+1) = blayer(np+1)
607 IF (.NOT.h2otable)
THEN 624 CALL tablup_d(nx1, nh1, dh2o(k2-1), dh2od(k2-1), pa(k2-1), &
625 & dt(k2-1), dtd(k2-1), x1, x1d, x2, x2d, x3, x3d, w11&
626 & , p11, dwe, dpe, h11, h12, h13, trant, trantd)
633 IF (ibn .EQ. 2)
CALL tablup_d(nx1, nh1, dh2o(k2-1), dh2od(k2-1&
634 & ), pa(k2-1), dt(k2-1), dtd(k2-1), x1, &
635 & x1d, x2, x2d, x3, x3d, w11, p11, dwe, &
636 & dpe, h21, h22, h23, trant, trantd)
637 IF (ibn .EQ. 8)
CALL tablup_d(nx1, nh1, dh2o(k2-1), dh2od(k2-1&
638 & ), pa(k2-1), dt(k2-1), dtd(k2-1), x1, &
639 & x1d, x2, x2d, x3, x3d, w11, p11, dwe, &
640 & dpe, h81, h82, h83, trant, trantd)
645 tcond(1) = tcon(1)*exptbld(k2-1, conexp%start)
646 tcon(1) = tcon(1)*exptbl(k2-1, conexp%start)
647 trantd = trantd*tcon(1) + trant*tcond(1)
648 trant = trant*tcon(1)
650 ELSE IF (.NOT.b10bnd)
THEN 653 CALL h2okdis_d(ibn, np, k2 - 1, fkw, gkw, ne, exptbl(:, h2oexp&
654 & %start:h2oexp%end), exptbld(:, h2oexp%start:h2oexp%&
655 & end), exptbl(:, conexp%start:conexp%end), exptbld(:, &
656 & conexp%start:conexp%end), th2o, th2od, tcon, tcond, &
670 CALL tablup_d(nx1, nc1, dco2(k2-1), dco2d(k2-1), pa(k2-1), dt(&
671 & k2-1), dtd(k2-1), x1, x1d, x2, x2d, x3, x3d, w12, p12&
672 & , dwe, dpe, c1, c2, c3, trant, trantd)
675 IF (oznbnd)
CALL tablup_d(nx1, no1, do3(k2-1), do3d(k2-1), pa(k2&
676 & -1), dt(k2-1), dtd(k2-1), x1, x1d, x2, x2d, &
677 & x3, x3d, w13, p13, dwe, dpe, oo1, oo2, oo3, &
681 trantd = trantd*taerlyr(k2-1) + trant*taerlyrd(k2-1)
682 trant = trant*taerlyr(k2-1)
685 xxd = (1.-enn(k2-1))*trantd - ennd(k2-1)*trant
686 xx = (1.-enn(k2-1))*trant
687 IF (0.9999 .GT. xx)
THEN 694 IF (0.00001 .LT. yy)
THEN 700 xxd = ((bleveld(k2-1)-bleveld(k2))*log(yy)-(blevel(k2-1)-blevel(&
701 & k2))*yyd/yy)/log(yy)**2
702 xx = (blevel(k2-1)-blevel(k2))/log(yy)
703 bdd(k2-1) = ((bleveld(k2)-bleveld(k2-1)*yy-blevel(k2-1)*yyd)*(&
704 & 1.0-yy)+(blevel(k2)-blevel(k2-1)*yy)*yyd)/(1.0-yy)**2 - xxd
705 bd(k2-1) = (blevel(k2)-blevel(k2-1)*yy)/(1.0-yy) - xx
706 bud(k2-1) = bleveld(k2-1) + bleveld(k2) - bdd(k2-1)
707 bu(k2-1) = blevel(k2-1) + blevel(k2) - bd(k2-1)
722 IF (.NOT.h2otable)
THEN 790 CALL tablup_d(nx1, nh1, dh2o(k2-1), dh2od(k2-1), pa(k2-1)&
791 & , dt(k2-1), dtd(k2-1), x1, x1d, x2, x2d, x3, x3d, &
792 & w11, p11, dwe, dpe, h11, h12, h13, trant, trantd)
796 IF (ibn .EQ. 2)
CALL tablup_d(nx1, nh1, dh2o(k2-1), dh2od(k2&
797 & -1), pa(k2-1), dt(k2-1), dtd(k2-1), &
798 & x1, x1d, x2, x2d, x3, x3d, w11, p11&
799 & , dwe, dpe, h21, h22, h23, trant, &
801 IF (ibn .EQ. 8)
CALL tablup_d(nx1, nh1, dh2o(k2-1), dh2od(k2&
802 & -1), pa(k2-1), dt(k2-1), dtd(k2-1), &
803 & x1, x1d, x2, x2d, x3, x3d, w11, p11&
804 & , dwe, dpe, h81, h82, h83, trant, &
808 tcond(1) = tcond(1)*exptbl(k2-1, conexp%start) + tcon(1)*&
809 & exptbld(k2-1, conexp%start)
810 tcon(1) = tcon(1)*exptbl(k2-1, conexp%start)
811 trantd = trantd*tcon(1) + trant*tcond(1)
812 trant = trant*tcon(1)
814 ELSE IF (.NOT.b10bnd)
THEN 816 CALL h2okdis_d(ibn, np, k2 - 1, fkw, gkw, ne, exptbl(:, &
817 & h2oexp%start:h2oexp%end), exptbld(:, h2oexp%start:&
818 & h2oexp%end), exptbl(:, conexp%start:conexp%end), &
819 & exptbld(:, conexp%start:conexp%end), th2o, th2od, &
820 & tcon, tcond, trant, trantd)
827 CALL tablup_d(nx1, nc1, dco2(k2-1), dco2d(k2-1), pa(k2-1), &
828 & dt(k2-1), dtd(k2-1), x1, x1d, x2, x2d, x3, x3d, w12&
829 & , p12, dwe, dpe, c1, c2, c3, trant, trantd)
831 IF (oznbnd)
CALL tablup_d(nx1, no1, do3(k2-1), do3d(k2-1), pa(&
832 & k2-1), dt(k2-1), dtd(k2-1), x1, x1d, x2, &
833 & x2d, x3, x3d, w13, p13, dwe, dpe, oo1, oo2&
834 & , oo3, trant, trantd)
838 IF (n2obnd)
CALL n2okdis_d(ibn, np, k2 - 1, exptbl(:, n2oexp&
839 & %start:n2oexp%end), exptbld(:, n2oexp%&
840 & start:n2oexp%end), tn2o, tn2od, trant, &
843 IF (ch4bnd)
CALL ch4kdis_d(ibn, np, k2 - 1, exptbl(:, ch4exp&
844 & %start:ch4exp%end), exptbld(:, ch4exp%&
845 & start:ch4exp%end), tch4, tch4d, trant, &
848 IF (combnd)
CALL comkdis_d(ibn, np, k2 - 1, exptbl(:, comexp&
849 & %start:comexp%end), exptbld(:, comexp%&
850 & start:comexp%end), tcom, tcomd, trant, &
853 IF (f11bnd)
CALL cfckdis_d(np, k2 - 1, exptbl(:, f11exp%&
854 & start:f11exp%end), exptbld(:, f11exp%&
855 & start:f11exp%end), tf11, tf11d, trant, &
858 IF (f12bnd)
CALL cfckdis_d(np, k2 - 1, exptbl(:, f12exp%&
859 & start:f12exp%end), exptbld(:, f12exp%&
860 & start:f12exp%end), tf12, tf12d, trant, &
863 IF (f22bnd)
CALL cfckdis_d(np, k2 - 1, exptbl(:, f22exp%&
864 & start:f22exp%end), exptbld(:, f22exp%&
865 & start:f22exp%end), tf22, tf22d, trant, &
868 IF (b10bnd)
CALL b10kdis_d(np, k2 - 1, exptbl(:, h2oexp%&
869 & start:h2oexp%end), exptbld(:, h2oexp%&
870 & start:h2oexp%end), exptbl(:, conexp%&
871 & start:conexp%end), exptbld(:, conexp%&
872 & start:conexp%end), exptbl(:, co2exp%&
873 & start:co2exp%end), exptbld(:, co2exp%&
874 & start:co2exp%end), exptbl(:, n2oexp%&
875 & start:n2oexp%end), exptbld(:, n2oexp%&
876 & start:n2oexp%end), th2o, th2od, tcon, &
877 & tcond, tco2, tco2d, tn2o, tn2od, trant&
881 tranald = tranald*taerlyr(k2-1) + tranal*taerlyrd(k2-1)
882 tranal = tranal*taerlyr(k2-1)
883 trantd = trantd*tranal + trant*tranald
886 IF (enn(k2-1) .GE. 0.001)
CALL cldovlp_d(np, k1, k2, ict, icb&
887 & , icx, ncld, enn, ennd, &
888 & tcldlyr, tcldlyrd, cldhi, &
889 & cldhid, cldmd, cldmdd, &
891 fclrd = (-(cldhid*(1.0-cldmd))-(1.0-cldhi)*cldmdd)*(1.0-cldlw)&
892 & - (1.0-cldhi)*(1.0-cldmd)*cldlwd
893 fclr = (1.0-cldhi)*(1.0-cldmd)*(1.0-cldlw)
894 IF (k2 .EQ. k1 + 1 .AND. ibn .NE. 10)
THEN 895 flxud(k1) = flxud(k1) - bud(k1)
896 flxu(k1) = flxu(k1) - bu(k1)
897 flxdd(k2) = flxdd(k2) + bdd(k1)
898 flxd(k2) = flxd(k2) + bd(k1)
900 xxd = trantd*(bu(k2-1)-bu(k2)) + trant*(bud(k2-1)-bud(k2))
901 xx = trant*(bu(k2-1)-bu(k2))
902 flxud(k1) = flxud(k1) + xxd*fclr + xx*fclrd
903 flxu(k1) = flxu(k1) + xx*fclr
906 xxd = -(trantd*bd(k1)+trant*bdd(k1))
909 xxd = trantd*(bd(k1-1)-bd(k1)) + trant*(bdd(k1-1)-bdd(k1))
910 xx = trant*(bd(k1-1)-bd(k1))
912 flxdd(k2) = flxdd(k2) + xxd*fclr + xx*fclrd
913 flxd(k2) = flxd(k2) + xx*fclr
915 transfcd(k1) = trantd*fclr + trant*fclrd
916 transfc(k1) = trant*fclr
918 dfdts_devd(k1) = dfdts_devd(k1) - dbs*transfcd(k1)
919 dfdts_dev(k1) = dfdts_dev(k1) - dbs*transfc(k1)
922 IF (.NOT.b10bnd)
THEN 924 flxud(np+1) = -blayerd(np+1)
925 flxu(np+1) = -blayer(np+1)
926 dfdts_dev(np+1) = dfdts_dev(np+1) - dbs
928 flxud(k) = flxud(k) - rflxs*(flxdd(np+1)*transfc(k)+flxd(np+1)&
930 flxu(k) = flxu(k) - flxd(np+1)*transfc(k)*rflxs
935 flxu_devd(k) = flxu_devd(k) + flxud(k)
936 flxu_dev(k) = flxu_dev(k) + flxu(k)
937 flxd_devd(k) = flxd_devd(k) + flxdd(k)
938 flxd_dev(k) = flxd_dev(k) + flxd(k)
951 SUBROUTINE planck_d(ibn, cb, t, td, xlayer, xlayerd)
954 INTEGER,
INTENT(IN) :: ibn
956 REAL*8,
INTENT(IN) :: cb(6, 10)
958 REAL*8,
INTENT(IN) :: t
959 REAL*8,
INTENT(IN) :: td
961 REAL*8,
INTENT(OUT) :: xlayer
962 REAL*8,
INTENT(OUT) :: xlayerd
963 xlayerd = td*(t*(t*(t*(t*cb(6, ibn)+cb(5, ibn))+cb(4, ibn))+cb(3, ibn)&
964 & )+cb(2, ibn)) + t*(td*(t*(t*(t*cb(6, ibn)+cb(5, ibn))+cb(4, ibn))+cb&
965 & (3, ibn))+t*(td*(t*(t*cb(6, ibn)+cb(5, ibn))+cb(4, ibn))+t*(td*(t*cb&
966 & (6, ibn)+cb(5, ibn))+t*cb(6, ibn)*td)))
967 xlayer = t*(t*(t*(t*(t*cb(6, ibn)+cb(5, ibn))+cb(4, ibn))+cb(3, ibn))+&
968 & cb(2, ibn)) + cb(1, ibn)
975 SUBROUTINE h2oexps_d(ib, np, dh2o, dh2od, pa, dt, dtd, xkw, aw, bw, pm, &
976 & mw, h2oexp, h2oexpd)
978 INTEGER :: ib, np, ik, k
980 REAL*8 :: dh2o(0:np), pa(0:np), dt(0:np)
981 REAL*8 :: dh2od(0:np), dtd(0:np)
983 REAL*8 :: h2oexp(0:np, 6)
984 REAL*8 :: h2oexpd(0:np, 6)
987 REAL*8 :: xkw(9), aw(9), bw(9), pm(9)
1004 xhd = pwr1*(dh2od(k)*(1.+(aw(ib)+bw(ib)*dt(k))*dt(k))+dh2o(k)*(bw(ib&
1005 & )*dtd(k)*dt(k)+(aw(ib)+bw(ib)*dt(k))*dtd(k)))
1006 xh = dh2o(k)*pwr1*(1.+(aw(ib)+bw(ib)*dt(k))*dt(k))
1009 h2oexpd(k, 1) = -(xkw(ib)*xhd*exp(-(xh*xkw(ib))))
1010 h2oexp(k, 1) = exp(-(xh*xkw(ib)))
1013 IF (mw(ib) .EQ. 6)
THEN 1014 xhd = h2oexpd(k, ik-1)*h2oexp(k, ik-1) + h2oexp(k, ik-1)*h2oexpd&
1016 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)
1017 h2oexpd(k, ik) = (xhd*xh+xh*xhd)*xh + xh**2*xhd
1018 h2oexp(k, ik) = xh*xh*xh
1019 ELSE IF (mw(ib) .EQ. 8)
THEN 1020 xhd = h2oexpd(k, ik-1)*h2oexp(k, ik-1) + h2oexp(k, ik-1)*h2oexpd&
1022 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)
1023 xhd = xhd*xh + xh*xhd
1025 h2oexpd(k, ik) = xhd*xh + xh*xhd
1026 h2oexp(k, ik) = xh*xh
1027 ELSE IF (mw(ib) .EQ. 9)
THEN 1028 xhd = (h2oexpd(k, ik-1)*h2oexp(k, ik-1)+h2oexp(k, ik-1)*h2oexpd(&
1029 & k, ik-1))*h2oexp(k, ik-1) + h2oexp(k, ik-1)**2*h2oexpd(k, ik-1&
1031 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)*h2oexp(k, ik-1)
1032 h2oexpd(k, ik) = (xhd*xh+xh*xhd)*xh + xh**2*xhd
1033 h2oexp(k, ik) = xh*xh*xh
1035 xhd = h2oexpd(k, ik-1)*h2oexp(k, ik-1) + h2oexp(k, ik-1)*h2oexpd&
1037 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)
1038 xhd = xhd*xh + xh*xhd
1040 xhd = xhd*xh + xh*xhd
1042 h2oexpd(k, ik) = xhd*xh + xh*xhd
1043 h2oexp(k, ik) = xh*xh
1053 SUBROUTINE conexps_d(ib, np, dcont, dcontd, xke, conexp, conexpd)
1055 INTEGER :: ib, np, k
1057 REAL*8 :: dcont(0:np)
1058 REAL*8 :: dcontd(0:np)
1060 REAL*8 :: conexp(0:np, 3)
1061 REAL*8 :: conexpd(0:np, 3)
1067 conexpd(k, 1) = -(xke(ib)*dcontd(k)*exp(-(dcont(k)*xke(ib))))
1068 conexp(k, 1) = exp(-(dcont(k)*xke(ib)))
1073 conexpd(k, 2) = conexpd(k, 1)*conexp(k, 1) + conexp(k, 1)*conexpd(&
1075 conexp(k, 2) = conexp(k, 1)*conexp(k, 1)
1076 conexpd(k, 3) = conexpd(k, 2)*conexp(k, 2) + conexp(k, 2)*conexpd(&
1078 conexp(k, 3) = conexp(k, 2)*conexp(k, 2)
1087 SUBROUTINE n2oexps_d(ib, np, dn2o, pa, dt, dtd, n2oexp, n2oexpd)
1089 INTEGER :: ib, k, np
1091 REAL*8 :: dn2o(0:np), pa(0:np), dt(0:np)
1094 REAL*8 :: n2oexp(0:np, 4)
1095 REAL*8 :: n2oexpd(0:np, 4)
1097 REAL*8 :: xc, xc1, xc2
1098 REAL*8 :: xcd, xc1d, xc2d
1105 xcd = dn2o(k)*(4.3750e-6*dtd(k)*dt(k)+(1.9297e-3+4.3750e-6*dt(k))*&
1107 xc = dn2o(k)*(1.+(1.9297e-3+4.3750e-6*dt(k))*dt(k))
1108 n2oexpd(k, 1) = -(6.31582e-2*xcd*exp(-(xc*6.31582e-2)))
1109 n2oexp(k, 1) = exp(-(xc*6.31582e-2))
1110 xcd = (n2oexpd(k, 1)*n2oexp(k, 1)+n2oexp(k, 1)*n2oexpd(k, 1))*&
1111 & n2oexp(k, 1) + n2oexp(k, 1)**2*n2oexpd(k, 1)
1112 xc = n2oexp(k, 1)*n2oexp(k, 1)*n2oexp(k, 1)
1113 xc1d = xcd*xc + xc*xcd
1115 xc2d = xc1d*xc1 + xc1*xc1d
1117 n2oexpd(k, 2) = (xcd*xc1+xc*xc1d)*xc2 + xc*xc1*xc2d
1118 n2oexp(k, 2) = xc*xc1*xc2
1121 xcd = dn2o(k)*(pa(k)/500.0)**0.48*(7.4838e-6*dtd(k)*dt(k)+(&
1122 & 1.3804e-3+7.4838e-6*dt(k))*dtd(k))
1123 xc = dn2o(k)*(pa(k)/500.0)**0.48*(1.+(1.3804e-3+7.4838e-6*dt(k))*&
1125 n2oexpd(k, 1) = -(5.35779e-2*xcd*exp(-(xc*5.35779e-2)))
1126 n2oexp(k, 1) = exp(-(xc*5.35779e-2))
1127 xcd = n2oexpd(k, 1)*n2oexp(k, 1) + n2oexp(k, 1)*n2oexpd(k, 1)
1128 xc = n2oexp(k, 1)*n2oexp(k, 1)
1129 xcd = xcd*xc + xc*xcd
1131 n2oexpd(k, 2) = xcd*xc + xc*xcd
1132 n2oexp(k, 2) = xc*xc
1133 xcd = n2oexpd(k, 2)*n2oexp(k, 2) + n2oexp(k, 2)*n2oexpd(k, 2)
1134 xc = n2oexp(k, 2)*n2oexp(k, 2)
1135 xcd = xcd*xc + xc*xcd
1137 n2oexpd(k, 3) = xcd*xc + xc*xcd
1138 n2oexp(k, 3) = xc*xc
1139 xcd = n2oexpd(k, 3)*n2oexp(k, 3) + n2oexp(k, 3)*n2oexpd(k, 3)
1140 xc = n2oexp(k, 3)*n2oexp(k, 3)
1141 xcd = xcd*xc + xc*xcd
1143 n2oexpd(k, 4) = xcd*xc + xc*xcd
1144 n2oexp(k, 4) = xc*xc
1153 SUBROUTINE ch4exps_d(ib, np, dch4, pa, dt, dtd, ch4exp, ch4expd)
1155 INTEGER :: ib, np, k
1157 REAL*8 :: dch4(0:np), pa(0:np), dt(0:np)
1160 REAL*8 :: ch4exp(0:np, 4)
1161 REAL*8 :: ch4expd(0:np, 4)
1170 xcd = dch4(k)*(1.5826e-4*dtd(k)*dt(k)+(1.7007e-2+1.5826e-4*dt(k))*&
1172 xc = dch4(k)*(1.+(1.7007e-2+1.5826e-4*dt(k))*dt(k))
1173 ch4expd(k, 1) = -(5.80708e-3*xcd*exp(-(xc*5.80708e-3)))
1174 ch4exp(k, 1) = exp(-(xc*5.80708e-3))
1177 xcd = dch4(k)*(pa(k)/500.0)**0.65*((5.9590e-4-2.2931e-6*dt(k))*dtd&
1178 & (k)-2.2931e-6*dtd(k)*dt(k))
1179 xc = dch4(k)*(pa(k)/500.0)**0.65*(1.+(5.9590e-4-2.2931e-6*dt(k))*&
1181 ch4expd(k, 1) = -(6.29247e-2*xcd*exp(-(xc*6.29247e-2)))
1182 ch4exp(k, 1) = exp(-(xc*6.29247e-2))
1183 xcd = (ch4expd(k, 1)*ch4exp(k, 1)+ch4exp(k, 1)*ch4expd(k, 1))*&
1184 & ch4exp(k, 1) + ch4exp(k, 1)**2*ch4expd(k, 1)
1185 xc = ch4exp(k, 1)*ch4exp(k, 1)*ch4exp(k, 1)
1186 xcd = xcd*xc + xc*xcd
1188 ch4expd(k, 2) = xcd*xc + xc*xcd
1189 ch4exp(k, 2) = xc*xc
1190 xcd = (ch4expd(k, 2)*ch4exp(k, 2)+ch4exp(k, 2)*ch4expd(k, 2))*&
1191 & ch4exp(k, 2) + ch4exp(k, 2)**2*ch4expd(k, 2)
1192 xc = ch4exp(k, 2)*ch4exp(k, 2)*ch4exp(k, 2)
1193 xcd = xcd*xc + xc*xcd
1195 ch4expd(k, 3) = xcd*xc + xc*xcd
1196 ch4exp(k, 3) = xc*xc
1197 xcd = (ch4expd(k, 3)*ch4exp(k, 3)+ch4exp(k, 3)*ch4expd(k, 3))*&
1198 & ch4exp(k, 3) + ch4exp(k, 3)**2*ch4expd(k, 3)
1199 xc = ch4exp(k, 3)*ch4exp(k, 3)*ch4exp(k, 3)
1200 xcd = xcd*xc + xc*xcd
1202 ch4expd(k, 4) = xcd*xc + xc*xcd
1203 ch4exp(k, 4) = xc*xc
1212 SUBROUTINE comexps_d(ib, np, dcom, dt, dtd, comexp, comexpd)
1214 INTEGER :: ib, ik, np, k
1216 REAL*8 :: dcom(0:np), dt(0:np)
1219 REAL*8 :: comexp(0:np, 6)
1220 REAL*8 :: comexpd(0:np, 6)
1229 xcd = dcom(k)*(4.0447e-4*dtd(k)*dt(k)+(3.5775e-2+4.0447e-4*dt(k))*&
1231 xc = dcom(k)*(1.+(3.5775e-2+4.0447e-4*dt(k))*dt(k))
1234 xcd = dcom(k)*(3.7401e-4*dtd(k)*dt(k)+(3.4268e-2+3.7401e-4*dt(k))*&
1236 xc = dcom(k)*(1.+(3.4268e-2+3.7401e-4*dt(k))*dt(k))
1238 comexpd(k, 1) = -(1.922e-7*xcd*exp(-(xc*1.922e-7)))
1239 comexp(k, 1) = exp(-(xc*1.922e-7))
1241 xcd = comexpd(k, ik-1)*comexp(k, ik-1) + comexp(k, ik-1)*comexpd(k&
1243 xc = comexp(k, ik-1)*comexp(k, ik-1)
1244 xcd = xcd*xc + xc*xcd
1246 comexpd(k, ik) = xcd*comexp(k, ik-1) + xc*comexpd(k, ik-1)
1247 comexp(k, ik) = xc*comexp(k, ik-1)
1256 SUBROUTINE cfcexps_d(ib, np, a1, b1, fk1, a2, b2, fk2, dcfc, dt, dtd, &
1259 INTEGER :: ib, np, k
1261 REAL*8 :: dcfc(0:np), dt(0:np)
1264 REAL*8 :: cfcexp(0:np)
1265 REAL*8 :: cfcexpd(0:np)
1267 REAL*8 :: a1, b1, fk1, a2, b2, fk2
1276 xfd = dcfc(k)*(b1*dtd(k)*dt(k)+(a1+b1*dt(k))*dtd(k))
1277 xf = dcfc(k)*(1.+(a1+b1*dt(k))*dt(k))
1278 cfcexpd(k) = -(fk1*xfd*exp(-(xf*fk1)))
1279 cfcexp(k) = exp(-(xf*fk1))
1281 xfd = dcfc(k)*(b2*dtd(k)*dt(k)+(a2+b2*dt(k))*dtd(k))
1282 xf = dcfc(k)*(1.+(a2+b2*dt(k))*dt(k))
1283 cfcexpd(k) = -(fk2*xfd*exp(-(xf*fk2)))
1284 cfcexp(k) = exp(-(xf*fk2))
1294 SUBROUTINE b10exps_d(np, dh2o, dh2od, dcont, dcontd, dco2, dn2o, pa, dt&
1295 & , dtd, h2oexp, h2oexpd, conexp, conexpd, co2exp, co2expd, n2oexp, &
1300 REAL*8 :: dh2o(0:np), dcont(0:np), dn2o(0:np)
1301 REAL*8 :: dh2od(0:np), dcontd(0:np)
1302 REAL*8 :: dco2(0:np), pa(0:np), dt(0:np)
1305 REAL*8 :: h2oexp(0:np, 5), conexp(0:np), co2exp(0:np, 6), n2oexp(0:np&
1307 REAL*8 :: h2oexpd(0:np, 5), conexpd(0:np), co2expd(0:np, 6), n2oexpd(0&
1310 REAL*8 :: xx, xx1, xx2, xx3
1311 REAL*8 :: xxd, xx1d, xx2d, xx3d
1316 xxd = pa(k)*(dh2od(k)*(1.+(0.0149+6.20e-5*dt(k))*dt(k))+dh2o(k)*(&
1317 & 6.20e-5*dtd(k)*dt(k)+(0.0149+6.20e-5*dt(k))*dtd(k)))/500.0
1318 xx = dh2o(k)*(pa(k)/500.0)*(1.+(0.0149+6.20e-5*dt(k))*dt(k))
1320 h2oexpd(k, 1) = -(0.10624*xxd*exp(-(xx*0.10624)))
1321 h2oexp(k, 1) = exp(-(xx*0.10624))
1322 xxd = h2oexpd(k, 1)*h2oexp(k, 1) + h2oexp(k, 1)*h2oexpd(k, 1)
1323 xx = h2oexp(k, 1)*h2oexp(k, 1)
1324 xxd = xxd*xx + xx*xxd
1326 h2oexpd(k, 2) = xxd*xx + xx*xxd
1327 h2oexp(k, 2) = xx*xx
1328 xxd = h2oexpd(k, 2)*h2oexp(k, 2) + h2oexp(k, 2)*h2oexpd(k, 2)
1329 xx = h2oexp(k, 2)*h2oexp(k, 2)
1330 xxd = xxd*xx + xx*xxd
1332 h2oexpd(k, 3) = xxd*xx + xx*xxd
1333 h2oexp(k, 3) = xx*xx
1334 xxd = h2oexpd(k, 3)*h2oexp(k, 3) + h2oexp(k, 3)*h2oexpd(k, 3)
1335 xx = h2oexp(k, 3)*h2oexp(k, 3)
1336 xxd = xxd*xx + xx*xxd
1338 h2oexpd(k, 4) = xxd*xx + xx*xxd
1339 h2oexp(k, 4) = xx*xx
1340 xxd = h2oexpd(k, 4)*h2oexp(k, 4) + h2oexp(k, 4)*h2oexpd(k, 4)
1341 xx = h2oexp(k, 4)*h2oexp(k, 4)
1342 xxd = xxd*xx + xx*xxd
1344 h2oexpd(k, 5) = xxd*xx + xx*xxd
1345 h2oexp(k, 5) = xx*xx
1347 conexpd(k) = -(109.0*dcontd(k)*exp(-(dcont(k)*109.0)))
1348 conexp(k) = exp(-(dcont(k)*109.0))
1350 xxd = dco2(k)*(pa(k)/300.0)**0.5*(1.02e-4*dtd(k)*dt(k)+(0.0179+&
1351 & 1.02e-4*dt(k))*dtd(k))
1352 xx = dco2(k)*(pa(k)/300.0)**0.5*(1.+(0.0179+1.02e-4*dt(k))*dt(k))
1354 co2expd(k, 1) = -(2.656e-5*xxd*exp(-(xx*2.656e-5)))
1355 co2exp(k, 1) = exp(-(xx*2.656e-5))
1356 xxd = co2expd(k, 1)*co2exp(k, 1) + co2exp(k, 1)*co2expd(k, 1)
1357 xx = co2exp(k, 1)*co2exp(k, 1)
1358 xxd = xxd*xx + xx*xxd
1360 co2expd(k, 2) = xxd*xx + xx*xxd
1361 co2exp(k, 2) = xx*xx
1362 xxd = co2expd(k, 2)*co2exp(k, 2) + co2exp(k, 2)*co2expd(k, 2)
1363 xx = co2exp(k, 2)*co2exp(k, 2)
1364 xxd = xxd*xx + xx*xxd
1366 co2expd(k, 3) = xxd*xx + xx*xxd
1367 co2exp(k, 3) = xx*xx
1368 xxd = co2expd(k, 3)*co2exp(k, 3) + co2exp(k, 3)*co2expd(k, 3)
1369 xx = co2exp(k, 3)*co2exp(k, 3)
1370 xxd = xxd*xx + xx*xxd
1372 co2expd(k, 4) = xxd*xx + xx*xxd
1373 co2exp(k, 4) = xx*xx
1374 xxd = co2expd(k, 4)*co2exp(k, 4) + co2exp(k, 4)*co2expd(k, 4)
1375 xx = co2exp(k, 4)*co2exp(k, 4)
1376 xxd = xxd*xx + xx*xxd
1378 co2expd(k, 5) = xxd*xx + xx*xxd
1379 co2exp(k, 5) = xx*xx
1380 xxd = co2expd(k, 5)*co2exp(k, 5) + co2exp(k, 5)*co2expd(k, 5)
1381 xx = co2exp(k, 5)*co2exp(k, 5)
1382 xxd = xxd*xx + xx*xxd
1384 co2expd(k, 6) = xxd*xx + xx*xxd
1385 co2exp(k, 6) = xx*xx
1387 xxd = dn2o(k)*(3.6656e-6*dtd(k)*dt(k)+(1.4476e-3+3.6656e-6*dt(k))*&
1389 xx = dn2o(k)*(1.+(1.4476e-3+3.6656e-6*dt(k))*dt(k))
1391 n2oexpd(k, 1) = -(0.25238*xxd*exp(-(xx*0.25238)))
1392 n2oexp(k, 1) = exp(-(xx*0.25238))
1393 xxd = n2oexpd(k, 1)*n2oexp(k, 1) + n2oexp(k, 1)*n2oexpd(k, 1)
1394 xx = n2oexp(k, 1)*n2oexp(k, 1)
1395 xx1d = xxd*xx + xx*xxd
1397 xx1d = xx1d*xx1 + xx1*xx1d
1399 xx2d = xx1d*xx1 + xx1*xx1d
1401 xx3d = xx2d*xx2 + xx2*xx2d
1403 n2oexpd(k, 2) = (xxd*xx1+xx*xx1d)*xx2*xx3 + xx*xx1*(xx2d*xx3+xx2*&
1405 n2oexp(k, 2) = xx*xx1*xx2*xx3
1413 SUBROUTINE tablup_d(nx1, nh1, dw, dwd, p, dt, dtd, s1, s1d, s2, s2d, s3&
1414 & , s3d, w1, p1, dwe, dpe, coef1, coef2, coef3, tran, trand)
1418 REAL*8 :: w1, p1, dwe, dpe
1421 REAL*8 :: coef1(nx1, nh1), coef2(nx1, nh1), coef3(nx1, nh1)
1423 REAL*8 :: s1, s2, s3, tran
1424 REAL*8 :: s1d, s2d, s3d, trand
1426 REAL*8 :: we, pe, fw, fp, pa, pb, pc, ax, ba, bb, t1, ca, cb, t2
1427 REAL*8 :: wed, ped, fwd, fpd, pad, pbd, pcd, axd, bad, bbd, t1d, cad, &
1429 REAL*8 :: x1, x2, x3, xx, x1c
1430 REAL*8 :: x1d, x2d, x3d, xxd, x1cd
1445 s3d = s3d + dtd*dw + dt*dwd
1451 x2d = s2d*x1c + s2*x1cd
1453 x3d = s3d*x1c + s3*x1cd
1458 wed = dwe*x1d/(x1*log(10.0))
1459 we = (log10(x1)-w1)*dwe
1460 ped = dpe*x2d/(x2*log(10.0))
1461 pe = (log10(x2)-p1)*dpe
1463 IF (we .GT. y1)
THEN 1470 IF (pe .GT. y2)
THEN 1479 IF (iw .GT. nh1 - 1)
THEN 1490 fw = we -
REAL(iw - 1)
1492 IF (ip .GT. nx1 - 1)
THEN 1503 fp = pe -
REAL(ip - 1)
1505 pad = (coef1(ip+1, iw-1)-coef1(ip, iw-1))*fpd
1506 pa = coef1(ip, iw-1) + (coef1(ip+1, iw-1)-coef1(ip, iw-1))*fp
1507 pbd = (coef1(ip+1, iw)-coef1(ip, iw))*fpd
1508 pb = coef1(ip, iw) + (coef1(ip+1, iw)-coef1(ip, iw))*fp
1509 pcd = (coef1(ip+1, iw+1)-coef1(ip, iw+1))*fpd
1510 pc = coef1(ip, iw+1) + (coef1(ip+1, iw+1)-coef1(ip, iw+1))*fp
1512 axd = 0.5*(((pcd+pad)*fw+(pc+pa)*fwd+pcd-pad)*fw+((pc+pa)*fw+(pc-pa))*&
1513 & fwd) + pbd*(1.-fw*fw) + pb*(-(fwd*fw)-fw*fwd)
1514 ax = ((pc+pa)*fw+(pc-pa))*fw*0.5 + pb*(1.-fw*fw)
1516 bad = (coef2(ip+1, iw)-coef2(ip, iw))*fpd
1517 ba = coef2(ip, iw) + (coef2(ip+1, iw)-coef2(ip, iw))*fp
1518 bbd = (coef2(ip+1, iw+1)-coef2(ip, iw+1))*fpd
1519 bb = coef2(ip, iw+1) + (coef2(ip+1, iw+1)-coef2(ip, iw+1))*fp
1520 t1d = bad + (bbd-bad)*fw + (bb-ba)*fwd
1521 t1 = ba + (bb-ba)*fw
1522 cad = (coef3(ip+1, iw)-coef3(ip, iw))*fpd
1523 ca = coef3(ip, iw) + (coef3(ip+1, iw)-coef3(ip, iw))*fp
1524 cbd = (coef3(ip+1, iw+1)-coef3(ip, iw+1))*fpd
1525 cb = coef3(ip, iw+1) + (coef3(ip+1, iw+1)-coef3(ip, iw+1))*fp
1526 t2d = cad + (cbd-cad)*fw + (cb-ca)*fwd
1527 t2 = ca + (cb-ca)*fw
1529 xxd = axd + (t1d+t2d*x3+t2*x3d)*x3 + (t1+t2*x3)*x3d
1530 xx = ax + (t1+t2*x3)*x3
1531 IF (xx .GT. 0.9999999)
THEN 1537 IF (xx .LT. 0.0000001)
THEN 1543 trand = trand*xx + tran*xxd
1551 SUBROUTINE h2okdis_d(ib, np, k, fkw, gkw, ne, h2oexp, h2oexpd, conexp, &
1552 & conexpd, th2o, th2od, tcon, tcond, tran, trand)
1555 INTEGER :: ib, ne, np, k
1556 REAL*8 :: h2oexp(0:np, 6), conexp(0:np, 3)
1557 REAL*8 :: h2oexpd(0:np, 6), conexpd(0:np, 3)
1558 REAL*8 :: fkw(6, 9), gkw(6, 3)
1560 REAL*8 :: th2o(6), tcon(3), tran
1561 REAL*8 :: th2od(6), tcond(3), trand
1574 th2od(1) = th2od(1)*h2oexp(k, 1) + th2o(1)*h2oexpd(k, 1)
1575 th2o(1) = th2o(1)*h2oexp(k, 1)
1576 th2od(2) = th2od(2)*h2oexp(k, 2) + th2o(2)*h2oexpd(k, 2)
1577 th2o(2) = th2o(2)*h2oexp(k, 2)
1578 th2od(3) = th2od(3)*h2oexp(k, 3) + th2o(3)*h2oexpd(k, 3)
1579 th2o(3) = th2o(3)*h2oexp(k, 3)
1580 th2od(4) = th2od(4)*h2oexp(k, 4) + th2o(4)*h2oexpd(k, 4)
1581 th2o(4) = th2o(4)*h2oexp(k, 4)
1582 th2od(5) = th2od(5)*h2oexp(k, 5) + th2o(5)*h2oexpd(k, 5)
1583 th2o(5) = th2o(5)*h2oexp(k, 5)
1584 th2od(6) = th2od(6)*h2oexp(k, 6) + th2o(6)*h2oexpd(k, 6)
1585 th2o(6) = th2o(6)*h2oexp(k, 6)
1588 trnth2od = fkw(1, ib)*th2od(1) + fkw(2, ib)*th2od(2) + fkw(3, ib)*&
1589 & th2od(3) + fkw(4, ib)*th2od(4) + fkw(5, ib)*th2od(5) + fkw(6, ib)*&
1591 trnth2o = fkw(1, ib)*th2o(1) + fkw(2, ib)*th2o(2) + fkw(3, ib)*th2o(&
1592 & 3) + fkw(4, ib)*th2o(4) + fkw(5, ib)*th2o(5) + fkw(6, ib)*th2o(6)
1593 trand = tran*trnth2od
1595 ELSE IF (ne .EQ. 1)
THEN 1597 tcond(1) = tcond(1)*conexp(k, 1) + tcon(1)*conexpd(k, 1)
1598 tcon(1) = tcon(1)*conexp(k, 1)
1599 trnth2od = (fkw(1, ib)*th2od(1)+fkw(2, ib)*th2od(2)+fkw(3, ib)*th2od&
1600 & (3)+fkw(4, ib)*th2od(4)+fkw(5, ib)*th2od(5)+fkw(6, ib)*th2od(6))*&
1601 & tcon(1) + (fkw(1, ib)*th2o(1)+fkw(2, ib)*th2o(2)+fkw(3, ib)*th2o(3&
1602 & )+fkw(4, ib)*th2o(4)+fkw(5, ib)*th2o(5)+fkw(6, ib)*th2o(6))*tcond(&
1604 trnth2o = (fkw(1, ib)*th2o(1)+fkw(2, ib)*th2o(2)+fkw(3, ib)*th2o(3)+&
1605 & fkw(4, ib)*th2o(4)+fkw(5, ib)*th2o(5)+fkw(6, ib)*th2o(6))*tcon(1)
1606 trand = tran*trnth2od
1610 tcond(1) = tcond(1)*conexp(k, 1) + tcon(1)*conexpd(k, 1)
1611 tcon(1) = tcon(1)*conexp(k, 1)
1612 tcond(2) = tcond(2)*conexp(k, 2) + tcon(2)*conexpd(k, 2)
1613 tcon(2) = tcon(2)*conexp(k, 2)
1614 tcond(3) = tcond(3)*conexp(k, 3) + tcon(3)*conexpd(k, 3)
1615 tcon(3) = tcon(3)*conexp(k, 3)
1617 trnth2od = (gkw(1, 1)*th2od(1)+gkw(2, 1)*th2od(2)+gkw(3, 1)*th2od(3)&
1618 & +gkw(4, 1)*th2od(4)+gkw(5, 1)*th2od(5)+gkw(6, 1)*th2od(6))*tcon(1)&
1619 & + (gkw(1, 1)*th2o(1)+gkw(2, 1)*th2o(2)+gkw(3, 1)*th2o(3)+gkw(4, 1)&
1620 & *th2o(4)+gkw(5, 1)*th2o(5)+gkw(6, 1)*th2o(6))*tcond(1) + (gkw(1, 2&
1621 & )*th2od(1)+gkw(2, 2)*th2od(2)+gkw(3, 2)*th2od(3)+gkw(4, 2)*th2od(4&
1622 & )+gkw(5, 2)*th2od(5)+gkw(6, 2)*th2od(6))*tcon(2) + (gkw(1, 2)*th2o&
1623 & (1)+gkw(2, 2)*th2o(2)+gkw(3, 2)*th2o(3)+gkw(4, 2)*th2o(4)+gkw(5, 2&
1624 & )*th2o(5)+gkw(6, 2)*th2o(6))*tcond(2) + (gkw(1, 3)*th2od(1)+gkw(2&
1625 & , 3)*th2od(2)+gkw(3, 3)*th2od(3)+gkw(4, 3)*th2od(4)+gkw(5, 3)*&
1626 & th2od(5)+gkw(6, 3)*th2od(6))*tcon(3) + (gkw(1, 3)*th2o(1)+gkw(2, 3&
1627 & )*th2o(2)+gkw(3, 3)*th2o(3)+gkw(4, 3)*th2o(4)+gkw(5, 3)*th2o(5)+&
1628 & gkw(6, 3)*th2o(6))*tcond(3)
1629 trnth2o = (gkw(1, 1)*th2o(1)+gkw(2, 1)*th2o(2)+gkw(3, 1)*th2o(3)+gkw&
1630 & (4, 1)*th2o(4)+gkw(5, 1)*th2o(5)+gkw(6, 1)*th2o(6))*tcon(1) + (gkw&
1631 & (1, 2)*th2o(1)+gkw(2, 2)*th2o(2)+gkw(3, 2)*th2o(3)+gkw(4, 2)*th2o(&
1632 & 4)+gkw(5, 2)*th2o(5)+gkw(6, 2)*th2o(6))*tcon(2) + (gkw(1, 3)*th2o(&
1633 & 1)+gkw(2, 3)*th2o(2)+gkw(3, 3)*th2o(3)+gkw(4, 3)*th2o(4)+gkw(5, 3)&
1634 & *th2o(5)+gkw(6, 3)*th2o(6))*tcon(3)
1635 trand = tran*trnth2od
1644 SUBROUTINE n2okdis_d(ib, np, k, n2oexp, n2oexpd, tn2o, tn2od, tran, &
1647 INTEGER :: ib, np, k
1649 REAL*8 :: n2oexp(0:np, 4)
1650 REAL*8 :: n2oexpd(0:np, 4)
1652 REAL*8 :: tn2o(4), tran
1653 REAL*8 :: tn2od(4), trand
1662 tn2od(1) = tn2od(1)*n2oexp(k, 1) + tn2o(1)*n2oexpd(k, 1)
1663 tn2o(1) = tn2o(1)*n2oexp(k, 1)
1664 xcd = 0.940414*tn2od(1)
1665 xc = 0.940414*tn2o(1)
1666 tn2od(2) = tn2od(2)*n2oexp(k, 2) + tn2o(2)*n2oexpd(k, 2)
1667 tn2o(2) = tn2o(2)*n2oexp(k, 2)
1668 xcd = xcd + 0.059586*tn2od(2)
1669 xc = xc + 0.059586*tn2o(2)
1672 tn2od(1) = tn2od(1)*n2oexp(k, 1) + tn2o(1)*n2oexpd(k, 1)
1673 tn2o(1) = tn2o(1)*n2oexp(k, 1)
1674 xcd = 0.561961*tn2od(1)
1675 xc = 0.561961*tn2o(1)
1676 tn2od(2) = tn2od(2)*n2oexp(k, 2) + tn2o(2)*n2oexpd(k, 2)
1677 tn2o(2) = tn2o(2)*n2oexp(k, 2)
1678 xcd = xcd + 0.138707*tn2od(2)
1679 xc = xc + 0.138707*tn2o(2)
1680 tn2od(3) = tn2od(3)*n2oexp(k, 3) + tn2o(3)*n2oexpd(k, 3)
1681 tn2o(3) = tn2o(3)*n2oexp(k, 3)
1682 xcd = xcd + 0.240670*tn2od(3)
1683 xc = xc + 0.240670*tn2o(3)
1684 tn2od(4) = tn2od(4)*n2oexp(k, 4) + tn2o(4)*n2oexpd(k, 4)
1685 tn2o(4) = tn2o(4)*n2oexp(k, 4)
1686 xcd = xcd + 0.058662*tn2od(4)
1687 xc = xc + 0.058662*tn2o(4)
1689 trand = trand*xc + tran*xcd
1697 SUBROUTINE ch4kdis_d(ib, np, k, ch4exp, ch4expd, tch4, tch4d, tran, &
1700 INTEGER :: ib, np, k
1702 REAL*8 :: ch4exp(0:np, 4)
1703 REAL*8 :: ch4expd(0:np, 4)
1705 REAL*8 :: tch4(4), tran
1706 REAL*8 :: tch4d(4), trand
1715 tch4d(1) = tch4d(1)*ch4exp(k, 1) + tch4(1)*ch4expd(k, 1)
1716 tch4(1) = tch4(1)*ch4exp(k, 1)
1721 tch4d(1) = tch4d(1)*ch4exp(k, 1) + tch4(1)*ch4expd(k, 1)
1722 tch4(1) = tch4(1)*ch4exp(k, 1)
1723 xcd = 0.610650*tch4d(1)
1724 xc = 0.610650*tch4(1)
1725 tch4d(2) = tch4d(2)*ch4exp(k, 2) + tch4(2)*ch4expd(k, 2)
1726 tch4(2) = tch4(2)*ch4exp(k, 2)
1727 xcd = xcd + 0.280212*tch4d(2)
1728 xc = xc + 0.280212*tch4(2)
1729 tch4d(3) = tch4d(3)*ch4exp(k, 3) + tch4(3)*ch4expd(k, 3)
1730 tch4(3) = tch4(3)*ch4exp(k, 3)
1731 xcd = xcd + 0.107349*tch4d(3)
1732 xc = xc + 0.107349*tch4(3)
1733 tch4d(4) = tch4d(4)*ch4exp(k, 4) + tch4(4)*ch4expd(k, 4)
1734 tch4(4) = tch4(4)*ch4exp(k, 4)
1735 xcd = xcd + 0.001789*tch4d(4)
1736 xc = xc + 0.001789*tch4(4)
1738 trand = trand*xc + tran*xcd
1746 SUBROUTINE comkdis_d(ib, np, k, comexp, comexpd, tcom, tcomd, tran, &
1749 INTEGER :: ib, np, k
1751 REAL*8 :: comexp(0:np, 6)
1752 REAL*8 :: comexpd(0:np, 6)
1754 REAL*8 :: tcom(6), tran
1755 REAL*8 :: tcomd(6), trand
1764 tcomd(1) = tcomd(1)*comexp(k, 1) + tcom(1)*comexpd(k, 1)
1765 tcom(1) = tcom(1)*comexp(k, 1)
1766 xcd = 0.12159*tcomd(1)
1767 xc = 0.12159*tcom(1)
1768 tcomd(2) = tcomd(2)*comexp(k, 2) + tcom(2)*comexpd(k, 2)
1769 tcom(2) = tcom(2)*comexp(k, 2)
1770 xcd = xcd + 0.24359*tcomd(2)
1771 xc = xc + 0.24359*tcom(2)
1772 tcomd(3) = tcomd(3)*comexp(k, 3) + tcom(3)*comexpd(k, 3)
1773 tcom(3) = tcom(3)*comexp(k, 3)
1774 xcd = xcd + 0.24981*tcomd(3)
1775 xc = xc + 0.24981*tcom(3)
1776 tcomd(4) = tcomd(4)*comexp(k, 4) + tcom(4)*comexpd(k, 4)
1777 tcom(4) = tcom(4)*comexp(k, 4)
1778 xcd = xcd + 0.26427*tcomd(4)
1779 xc = xc + 0.26427*tcom(4)
1780 tcomd(5) = tcomd(5)*comexp(k, 5) + tcom(5)*comexpd(k, 5)
1781 tcom(5) = tcom(5)*comexp(k, 5)
1782 xcd = xcd + 0.07807*tcomd(5)
1783 xc = xc + 0.07807*tcom(5)
1784 tcomd(6) = tcomd(6)*comexp(k, 6) + tcom(6)*comexpd(k, 6)
1785 tcom(6) = tcom(6)*comexp(k, 6)
1786 xcd = xcd + 0.04267*tcomd(6)
1787 xc = xc + 0.04267*tcom(6)
1790 tcomd(1) = tcomd(1)*comexp(k, 1) + tcom(1)*comexpd(k, 1)
1791 tcom(1) = tcom(1)*comexp(k, 1)
1792 xcd = 0.06869*tcomd(1)
1793 xc = 0.06869*tcom(1)
1794 tcomd(2) = tcomd(2)*comexp(k, 2) + tcom(2)*comexpd(k, 2)
1795 tcom(2) = tcom(2)*comexp(k, 2)
1796 xcd = xcd + 0.14795*tcomd(2)
1797 xc = xc + 0.14795*tcom(2)
1798 tcomd(3) = tcomd(3)*comexp(k, 3) + tcom(3)*comexpd(k, 3)
1799 tcom(3) = tcom(3)*comexp(k, 3)
1800 xcd = xcd + 0.19512*tcomd(3)
1801 xc = xc + 0.19512*tcom(3)
1802 tcomd(4) = tcomd(4)*comexp(k, 4) + tcom(4)*comexpd(k, 4)
1803 tcom(4) = tcom(4)*comexp(k, 4)
1804 xcd = xcd + 0.33446*tcomd(4)
1805 xc = xc + 0.33446*tcom(4)
1806 tcomd(5) = tcomd(5)*comexp(k, 5) + tcom(5)*comexpd(k, 5)
1807 tcom(5) = tcom(5)*comexp(k, 5)
1808 xcd = xcd + 0.17199*tcomd(5)
1809 xc = xc + 0.17199*tcom(5)
1810 tcomd(6) = tcomd(6)*comexp(k, 6) + tcom(6)*comexpd(k, 6)
1811 tcom(6) = tcom(6)*comexp(k, 6)
1812 xcd = xcd + 0.08179*tcomd(6)
1813 xc = xc + 0.08179*tcom(6)
1815 trand = trand*xc + tran*xcd
1823 SUBROUTINE cfckdis_d(np, k, cfcexp, cfcexpd, tcfc, tcfcd, tran, trand)
1827 REAL*8 :: cfcexp(0:np)
1828 REAL*8 :: cfcexpd(0:np)
1830 REAL*8 :: tcfc, tran
1831 REAL*8 :: tcfcd, trand
1833 tcfcd = tcfcd*cfcexp(k) + tcfc*cfcexpd(k)
1834 tcfc = tcfc*cfcexp(k)
1835 trand = trand*tcfc + tran*tcfcd
1844 SUBROUTINE b10kdis_d(np, k, h2oexp, h2oexpd, conexp, conexpd, co2exp, &
1845 & co2expd, n2oexp, n2oexpd, th2o, th2od, tcon, tcond, tco2, tco2d, tn2o&
1846 & , tn2od, tran, trand)
1850 REAL*8 :: h2oexp(0:np, 5), conexp(0:np), co2exp(0:np, 6), n2oexp(0:np&
1852 REAL*8 :: h2oexpd(0:np, 5), conexpd(0:np), co2expd(0:np, 6), n2oexpd(0&
1855 REAL*8 :: th2o(6), tcon(3), tco2(6), tn2o(4), tran
1856 REAL*8 :: th2od(6), tcond(3), tco2d(6), tn2od(4), trand
1861 th2od(1) = th2od(1)*h2oexp(k, 1) + th2o(1)*h2oexpd(k, 1)
1862 th2o(1) = th2o(1)*h2oexp(k, 1)
1863 xxd = 0.3153*th2od(1)
1865 th2od(2) = th2od(2)*h2oexp(k, 2) + th2o(2)*h2oexpd(k, 2)
1866 th2o(2) = th2o(2)*h2oexp(k, 2)
1867 xxd = xxd + 0.4604*th2od(2)
1868 xx = xx + 0.4604*th2o(2)
1869 th2od(3) = th2od(3)*h2oexp(k, 3) + th2o(3)*h2oexpd(k, 3)
1870 th2o(3) = th2o(3)*h2oexp(k, 3)
1871 xxd = xxd + 0.1326*th2od(3)
1872 xx = xx + 0.1326*th2o(3)
1873 th2od(4) = th2od(4)*h2oexp(k, 4) + th2o(4)*h2oexpd(k, 4)
1874 th2o(4) = th2o(4)*h2oexp(k, 4)
1875 xxd = xxd + 0.0798*th2od(4)
1876 xx = xx + 0.0798*th2o(4)
1877 th2od(5) = th2od(5)*h2oexp(k, 5) + th2o(5)*h2oexpd(k, 5)
1878 th2o(5) = th2o(5)*h2oexp(k, 5)
1879 xxd = xxd + 0.0119*th2od(5)
1880 xx = xx + 0.0119*th2o(5)
1884 tcond(1) = tcond(1)*conexp(k) + tcon(1)*conexpd(k)
1885 tcon(1) = tcon(1)*conexp(k)
1886 trand = trand*tcon(1) + tran*tcond(1)
1889 tco2d(1) = tco2d(1)*co2exp(k, 1) + tco2(1)*co2expd(k, 1)
1890 tco2(1) = tco2(1)*co2exp(k, 1)
1891 xxd = 0.2673*tco2d(1)
1893 tco2d(2) = tco2d(2)*co2exp(k, 2) + tco2(2)*co2expd(k, 2)
1894 tco2(2) = tco2(2)*co2exp(k, 2)
1895 xxd = xxd + 0.2201*tco2d(2)
1896 xx = xx + 0.2201*tco2(2)
1897 tco2d(3) = tco2d(3)*co2exp(k, 3) + tco2(3)*co2expd(k, 3)
1898 tco2(3) = tco2(3)*co2exp(k, 3)
1899 xxd = xxd + 0.2106*tco2d(3)
1900 xx = xx + 0.2106*tco2(3)
1901 tco2d(4) = tco2d(4)*co2exp(k, 4) + tco2(4)*co2expd(k, 4)
1902 tco2(4) = tco2(4)*co2exp(k, 4)
1903 xxd = xxd + 0.2409*tco2d(4)
1904 xx = xx + 0.2409*tco2(4)
1905 tco2d(5) = tco2d(5)*co2exp(k, 5) + tco2(5)*co2expd(k, 5)
1906 tco2(5) = tco2(5)*co2exp(k, 5)
1907 xxd = xxd + 0.0196*tco2d(5)
1908 xx = xx + 0.0196*tco2(5)
1909 tco2d(6) = tco2d(6)*co2exp(k, 6) + tco2(6)*co2expd(k, 6)
1910 tco2(6) = tco2(6)*co2exp(k, 6)
1911 xxd = xxd + 0.0415*tco2d(6)
1912 xx = xx + 0.0415*tco2(6)
1913 trand = trand*xx + tran*xxd
1916 tn2od(1) = tn2od(1)*n2oexp(k, 1) + tn2o(1)*n2oexpd(k, 1)
1917 tn2o(1) = tn2o(1)*n2oexp(k, 1)
1918 xxd = 0.970831*tn2od(1)
1919 xx = 0.970831*tn2o(1)
1920 tn2od(2) = tn2od(2)*n2oexp(k, 2) + tn2o(2)*n2oexpd(k, 2)
1921 tn2o(2) = tn2o(2)*n2oexp(k, 2)
1922 xxd = xxd + 0.029169*tn2od(2)
1923 xx = xx + 0.029169*tn2o(2)
1924 trand = trand*(xx-1.0) + tran*xxd
1925 tran = tran*(xx-1.0)
1933 SUBROUTINE cldovlp_d(np, k1, k2, ict, icb, icx, ncld, enn, ennd, ett, &
1934 & ettd, cldhi, cldhid, cldmd, cldmdd, cldlw, cldlwd)
1936 INTEGER,
INTENT(IN) :: np, k1, k2, ict, icb, icx(0:np), ncld(3)
1937 REAL*8,
INTENT(IN) :: enn(0:np), ett(0:np)
1938 REAL*8,
INTENT(IN) :: ennd(0:np), ettd(0:np)
1939 REAL*8,
INTENT(INOUT) :: cldhi, cldmd, cldlw
1940 REAL*8,
INTENT(INOUT) :: cldhid, cldmdd, cldlwd
1941 INTEGER :: j, k, km, kx
1943 IF (km .LT. ict)
THEN 1946 IF (kx .EQ. 1 .OR. cldhi .EQ. 0.)
THEN 1956 IF (j .GE. k1 .AND. j .LE. km)
THEN 1957 cldhid = ennd(j) + ettd(j)*cldhi + ett(j)*cldhid
1958 cldhi = enn(j) + ett(j)*cldhi
1965 ELSE IF (km .GE. ict .AND. km .LT. icb)
THEN 1968 IF (kx .EQ. 1 .OR. cldmd .EQ. 0.)
THEN 1978 IF (j .GE. k1 .AND. j .LE. km)
THEN 1979 cldmdd = ennd(j) + ettd(j)*cldmd + ett(j)*cldmdd
1980 cldmd = enn(j) + ett(j)*cldmd
1990 IF (kx .EQ. 1 .OR. cldlw .EQ. 0.)
THEN 2000 IF (j .GE. k1 .AND. j .LE. km)
THEN 2001 cldlwd = ennd(j) + ettd(j)*cldlw + ett(j)*cldlwd
2002 cldlw = enn(j) + ett(j)*cldlw
2016 SUBROUTINE getirtau1_d(ib, nlevs, dp, fcld, fcldd, reff, reffd, &
2017 & hydromets, hydrometsd, tcldlyr, tcldlyrd, enn, ennd, aib_ir1, awb_ir1&
2018 & , aiw_ir1, aww_ir1, aig_ir1, awg_ir1, cons_grav)
2022 INTEGER,
INTENT(IN) :: ib
2024 INTEGER,
INTENT(IN) :: nlevs
2026 REAL*8,
INTENT(IN) :: dp(nlevs)
2028 REAL*8,
INTENT(IN) :: fcld(nlevs)
2029 REAL*8,
INTENT(IN) :: fcldd(nlevs)
2031 REAL*8,
INTENT(IN) :: reff(nlevs, 4)
2032 REAL*8,
INTENT(IN) :: reffd(nlevs, 4)
2034 REAL*8,
INTENT(IN) :: hydromets(nlevs, 4)
2035 REAL*8,
INTENT(IN) :: hydrometsd(nlevs, 4)
2036 REAL*8,
INTENT(IN) :: aib_ir1(3, 10), awb_ir1(4, 10), aiw_ir1(4, 10)
2037 REAL*8,
INTENT(IN) :: aww_ir1(4, 10), aig_ir1(4, 10), awg_ir1(4, 10)
2038 REAL*8,
INTENT(IN) :: cons_grav
2041 REAL*8,
INTENT(OUT) :: tcldlyr(0:nlevs)
2042 REAL*8,
INTENT(OUT) :: tcldlyrd(0:nlevs)
2044 REAL*8,
INTENT(OUT) :: enn(0:nlevs)
2045 REAL*8,
INTENT(OUT) :: ennd(0:nlevs)
2065 REAL*8 :: taucld1, taucld2, taucld3, taucld4
2066 REAL*8 :: taucld1d, taucld2d, taucld3d, taucld4d
2067 REAL*8 :: g1, g2, g3, g4, gg
2068 REAL*8 :: g1d, g2d, g3d, g4d, ggd
2069 REAL*8 :: w1, w2, w3, w4, ww
2070 REAL*8 :: w1d, w2d, w3d, w4d, wwd
2072 REAL*8 :: ffd, taucd
2074 REAL*8 :: reff_snowd
2092 IF (reff(k, 1) .LE. 0.0)
THEN 2096 IF (reff(k, 1) .GT. 0.0 .OR. (reff(k, 1) .LT. 0.0 .AND. aib_ir1(3&
2097 & , ib) .EQ. int(aib_ir1(3, ib))))
THEN 2098 pwr1d = aib_ir1(3, ib)*reff(k, 1)**(aib_ir1(3, ib)-1)*reffd(k, 1&
2100 ELSE IF (reff(k, 1) .EQ. 0.0 .AND. aib_ir1(3, ib) .EQ. 1.0)
THEN 2105 pwr1 = reff(k, 1)**aib_ir1(3, ib)
2106 taucld1d = dp(k)*1.0e3*(hydrometsd(k, 1)*(aib_ir1(1, ib)+aib_ir1(2&
2107 & , ib)/pwr1)-hydromets(k, 1)*aib_ir1(2, ib)*pwr1d/pwr1**2)/&
2109 taucld1 = dp(k)*1.0e3/cons_grav*hydromets(k, 1)*(aib_ir1(1, ib)+&
2110 & aib_ir1(2, ib)/pwr1)
2112 taucld2d = dp(k)*1.0e3*(hydrometsd(k, 2)*(awb_ir1(1, ib)+(awb_ir1(2&
2113 & , ib)+(awb_ir1(3, ib)+awb_ir1(4, ib)*reff(k, 2))*reff(k, 2))*reff(&
2114 & k, 2))+hydromets(k, 2)*((awb_ir1(4, ib)*reffd(k, 2)*reff(k, 2)+(&
2115 & awb_ir1(3, ib)+awb_ir1(4, ib)*reff(k, 2))*reffd(k, 2))*reff(k, 2)+&
2116 & (awb_ir1(2, ib)+(awb_ir1(3, ib)+awb_ir1(4, ib)*reff(k, 2))*reff(k&
2117 & , 2))*reffd(k, 2)))/cons_grav
2118 taucld2 = dp(k)*1.0e3/cons_grav*hydromets(k, 2)*(awb_ir1(1, ib)+(&
2119 & awb_ir1(2, ib)+(awb_ir1(3, ib)+awb_ir1(4, ib)*reff(k, 2))*reff(k, &
2121 taucld3d = 0.00307*dp(k)*1.0e3*hydrometsd(k, 3)/cons_grav
2122 taucld3 = 0.00307*(dp(k)*1.0e3/cons_grav*hydromets(k, 3))
2123 IF (reff(k, 4) .GT. 112.0)
THEN 2127 reff_snowd = reffd(k, 4)
2128 reff_snow = reff(k, 4)
2130 IF (reff_snow .LE. 0.0)
THEN 2134 IF (reff_snow .GT. 0.0 .OR. (reff_snow .LT. 0.0 .AND. aib_ir1(3, &
2135 & ib) .EQ. int(aib_ir1(3, ib))))
THEN 2136 pwr1d = aib_ir1(3, ib)*reff_snow**(aib_ir1(3, ib)-1)*reff_snowd
2137 ELSE IF (reff_snow .EQ. 0.0 .AND. aib_ir1(3, ib) .EQ. 1.0)
THEN 2142 pwr1 = reff_snow**aib_ir1(3, ib)
2143 taucld4d = dp(k)*1.0e3*(hydrometsd(k, 4)*(aib_ir1(1, ib)+aib_ir1(2&
2144 & , ib)/pwr1)-hydromets(k, 4)*aib_ir1(2, ib)*pwr1d/pwr1**2)/&
2146 taucld4 = dp(k)*1.0e3/cons_grav*hydromets(k, 4)*(aib_ir1(1, ib)+&
2147 & aib_ir1(2, ib)/pwr1)
2155 taucd = taucld1d + taucld2d + taucld3d + taucld4d
2156 tauc = taucld1 + taucld2 + taucld3 + taucld4
2157 IF (tauc .GT. 0.02 .AND. fcld(k) .GT. 0.01)
THEN 2158 w1d = taucld1d*(aiw_ir1(1, ib)+(aiw_ir1(2, ib)+(aiw_ir1(3, ib)+&
2159 & aiw_ir1(4, ib)*reff(k, 1))*reff(k, 1))*reff(k, 1)) + taucld1*((&
2160 & aiw_ir1(4, ib)*reffd(k, 1)*reff(k, 1)+(aiw_ir1(3, ib)+aiw_ir1(4&
2161 & , ib)*reff(k, 1))*reffd(k, 1))*reff(k, 1)+(aiw_ir1(2, ib)+(&
2162 & aiw_ir1(3, ib)+aiw_ir1(4, ib)*reff(k, 1))*reff(k, 1))*reffd(k, 1&
2164 w1 = taucld1*(aiw_ir1(1, ib)+(aiw_ir1(2, ib)+(aiw_ir1(3, ib)+&
2165 & aiw_ir1(4, ib)*reff(k, 1))*reff(k, 1))*reff(k, 1))
2166 w2d = taucld2d*(aww_ir1(1, ib)+(aww_ir1(2, ib)+(aww_ir1(3, ib)+&
2167 & aww_ir1(4, ib)*reff(k, 2))*reff(k, 2))*reff(k, 2)) + taucld2*((&
2168 & aww_ir1(4, ib)*reffd(k, 2)*reff(k, 2)+(aww_ir1(3, ib)+aww_ir1(4&
2169 & , ib)*reff(k, 2))*reffd(k, 2))*reff(k, 2)+(aww_ir1(2, ib)+(&
2170 & aww_ir1(3, ib)+aww_ir1(4, ib)*reff(k, 2))*reff(k, 2))*reffd(k, 2&
2172 w2 = taucld2*(aww_ir1(1, ib)+(aww_ir1(2, ib)+(aww_ir1(3, ib)+&
2173 & aww_ir1(4, ib)*reff(k, 2))*reff(k, 2))*reff(k, 2))
2176 w4d = taucld4d*(aiw_ir1(1, ib)+(aiw_ir1(2, ib)+(aiw_ir1(3, ib)+&
2177 & aiw_ir1(4, ib)*reff_snow)*reff_snow)*reff_snow) + taucld4*((&
2178 & aiw_ir1(4, ib)*reff_snowd*reff_snow+(aiw_ir1(3, ib)+aiw_ir1(4, &
2179 & ib)*reff_snow)*reff_snowd)*reff_snow+(aiw_ir1(2, ib)+(aiw_ir1(3&
2180 & , ib)+aiw_ir1(4, ib)*reff_snow)*reff_snow)*reff_snowd)
2181 w4 = taucld4*(aiw_ir1(1, ib)+(aiw_ir1(2, ib)+(aiw_ir1(3, ib)+&
2182 & aiw_ir1(4, ib)*reff_snow)*reff_snow)*reff_snow)
2183 wwd = ((w1d+w2d+w3d+w4d)*tauc-(w1+w2+w3+w4)*taucd)/tauc**2
2184 ww = (w1+w2+w3+w4)/tauc
2185 g1d = w1d*(aig_ir1(1, ib)+(aig_ir1(2, ib)+(aig_ir1(3, ib)+aig_ir1(&
2186 & 4, ib)*reff(k, 1))*reff(k, 1))*reff(k, 1)) + w1*((aig_ir1(4, ib)&
2187 & *reffd(k, 1)*reff(k, 1)+(aig_ir1(3, ib)+aig_ir1(4, ib)*reff(k, 1&
2188 & ))*reffd(k, 1))*reff(k, 1)+(aig_ir1(2, ib)+(aig_ir1(3, ib)+&
2189 & aig_ir1(4, ib)*reff(k, 1))*reff(k, 1))*reffd(k, 1))
2190 g1 = w1*(aig_ir1(1, ib)+(aig_ir1(2, ib)+(aig_ir1(3, ib)+aig_ir1(4&
2191 & , ib)*reff(k, 1))*reff(k, 1))*reff(k, 1))
2192 g2d = w2d*(awg_ir1(1, ib)+(awg_ir1(2, ib)+(awg_ir1(3, ib)+awg_ir1(&
2193 & 4, ib)*reff(k, 2))*reff(k, 2))*reff(k, 2)) + w2*((awg_ir1(4, ib)&
2194 & *reffd(k, 2)*reff(k, 2)+(awg_ir1(3, ib)+awg_ir1(4, ib)*reff(k, 2&
2195 & ))*reffd(k, 2))*reff(k, 2)+(awg_ir1(2, ib)+(awg_ir1(3, ib)+&
2196 & awg_ir1(4, ib)*reff(k, 2))*reff(k, 2))*reffd(k, 2))
2197 g2 = w2*(awg_ir1(1, ib)+(awg_ir1(2, ib)+(awg_ir1(3, ib)+awg_ir1(4&
2198 & , ib)*reff(k, 2))*reff(k, 2))*reff(k, 2))
2201 g4d = w4d*(aig_ir1(1, ib)+(aig_ir1(2, ib)+(aig_ir1(3, ib)+aig_ir1(&
2202 & 4, ib)*reff_snow)*reff_snow)*reff_snow) + w4*((aig_ir1(4, ib)*&
2203 & reff_snowd*reff_snow+(aig_ir1(3, ib)+aig_ir1(4, ib)*reff_snow)*&
2204 & reff_snowd)*reff_snow+(aig_ir1(2, ib)+(aig_ir1(3, ib)+aig_ir1(4&
2205 & , ib)*reff_snow)*reff_snow)*reff_snowd)
2206 g4 = w4*(aig_ir1(1, ib)+(aig_ir1(2, ib)+(aig_ir1(3, ib)+aig_ir1(4&
2207 & , ib)*reff_snow)*reff_snow)*reff_snow)
2208 IF (w1 + w2 + w3 + w4 .GE. 0.)
THEN 2209 abs0 = w1 + w2 + w3 + w4
2211 abs0 = -(w1+w2+w3+w4)
2213 IF (abs0 .GT. 0.0)
THEN 2214 ggd = ((g1d+g2d+g3d+g4d)*(w1+w2+w3+w4)-(g1+g2+g3+g4)*(w1d+w2d+&
2215 & w3d+w4d))/(w1+w2+w3+w4)**2
2216 gg = (g1+g2+g3+g4)/(w1+w2+w3+w4)
2223 ffd = (0.1185*ggd*gg+(0.0076+0.1185*gg)*ggd)*gg + (0.3739+(0.0076+&
2224 & 0.1185*gg)*gg)*ggd
2225 ff = 0.5 + (0.3739+(0.0076+0.1185*gg)*gg)*gg
2226 IF (1. - ww*ff .LT. 0.0)
THEN 2230 max1d = -(wwd*ff) - ww*ffd
2234 taucd = max1d*tauc + max1*taucd
2238 tcldlyrd(k) = -(1.66*taucd*exp(-(1.66*tauc)))
2239 tcldlyr(k) = exp(-(1.66*tauc))
2241 ennd(k) = fcldd(k)*(1.0-tcldlyr(k)) - fcld(k)*tcldlyrd(k)
2242 enn(k) = fcld(k)*(1.0-tcldlyr(k))
subroutine n2okdis_d(ib, np, k, n2oexp, n2oexpd, tn2o, tn2od, tran, trand)
subroutine h2oexps_d(ib, np, dh2o, dh2od, pa, dt, dtd, xkw, aw, bw, pm, mw, h2oexp, h2oexpd)
subroutine planck_d(ibn, cb, t, td, xlayer, xlayerd)
subroutine tablup_d(nx1, nh1, dw, dwd, p, dt, dtd, s1, s1d, s2, s2d, s3, s3d, w1, p1, dwe, dpe, coef1, coef2, coef3, tran, trand)
integer, parameter, public ip
subroutine getirtau1_d(ib, nlevs, dp, fcld, fcldd, reff, reffd, hydromets, hydrometsd, tcldlyr, tcldlyrd, enn, ennd, aib_ir1, awb_ir1, aiw_ir1, aww_ir1, aig_ir1, awg_ir1, cons_grav)
subroutine, public irrad_d(np, ple_dev, ta_dev, ta_devd, wa_dev, wa_devd, oa_dev, oa_devd, tb_dev, tb_devd, co2, trace, n2o_dev, ch4_dev, cfc11_dev, cfc12_dev, cfc22_dev, cwc_dev, cwc_devd, fcld_dev, fcld_devd, ict, icb, reff_dev, reff_devd, ns, fs_dev, tg_dev, eg_dev, tv_dev, ev_dev, rv_dev, na, nb, taua_dev, taua_devd, ssaa_dev, ssaa_devd, asya_dev, asya_devd, flxu_dev, flxu_devd, flxd_dev, flxd_devd, dfdts_dev, dfdts_devd, aib_ir, awb_ir, aiw_ir, aww_ir, aig_ir, awg_ir, xkw, xke, mw, aw, bw, pm, fkw, gkw, cb, dcb, w11, w12, w13, p11, p12, p13, dwe, dpe, c1, c2, c3, oo1, oo2, oo3, h11, h12, h13, h21, h22, h23, h81, h82, h83)
subroutine n2oexps_d(ib, np, dn2o, pa, dt, dtd, n2oexp, n2oexpd)
subroutine comkdis_d(ib, np, k, comexp, comexpd, tcom, tcomd, tran, trand)
subroutine ch4kdis_d(ib, np, k, ch4exp, ch4expd, tch4, tch4d, tran, trand)
subroutine cldovlp_d(np, k1, k2, ict, icb, icx, ncld, enn, ennd, ett, ettd, cldhi, cldhid, cldmd, cldmdd, cldlw, cldlwd)
subroutine, public sfcflux(ibn, cb, dcb, ns, fs, tg, eg, tv, ev, rv, bs, dbs, rflxs)
subroutine cfckdis_d(np, k, cfcexp, cfcexpd, tcfc, tcfcd, tran, trand)
subroutine h2okdis_d(ib, np, k, fkw, gkw, ne, h2oexp, h2oexpd, conexp, conexpd, th2o, th2od, tcon, tcond, tran, trand)
subroutine b10kdis_d(np, k, h2oexp, h2oexpd, conexp, conexpd, co2exp, co2expd, n2oexp, n2oexpd, th2o, th2od, tcon, tcond, tco2, tco2d, tn2o, tn2od, tran, trand)
subroutine cfcexps_d(ib, np, a1, b1, fk1, a2, b2, fk2, dcfc, dt, dtd, cfcexp, cfcexpd)
subroutine conexps_d(ib, np, dcont, dcontd, xke, conexp, conexpd)
subroutine comexps_d(ib, np, dcom, dt, dtd, comexp, comexpd)
subroutine, public mkicx(np, ict, icb, enn, icx, ncld)
subroutine b10exps_d(np, dh2o, dh2od, dcont, dcontd, dco2, dn2o, pa, dt, dtd, h2oexp, h2oexpd, conexp, conexpd, co2exp, co2expd, n2oexp, n2oexpd)
subroutine ch4exps_d(ib, np, dch4, pa, dt, dtd, ch4exp, ch4expd)