12 SUBROUTINE irrad_b(np, ple_dev, ta_dev, ta_devb, wa_dev, wa_devb, oa_dev&
13 & , oa_devb, tb_dev, tb_devb, co2, trace, n2o_dev, ch4_dev, cfc11_dev, &
14 & cfc12_dev, cfc22_dev, cwc_dev, cwc_devb, fcld_dev, fcld_devb, ict, icb&
15 & , reff_dev, reff_devb, ns, fs_dev, tg_dev, eg_dev, tv_dev, ev_dev, &
16 & rv_dev, na, nb, taua_dev, taua_devb, ssaa_dev, ssaa_devb, asya_dev, &
17 & asya_devb, flxu_dev, flxu_devb, flxd_dev, flxd_devb, dfdts_dev, &
18 & dfdts_devb, 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
44 REAL*8,
DIMENSION(np),
INTENT(IN) :: ta_dev, wa_dev, oa_dev, fcld_dev
45 REAL*8,
DIMENSION(np) :: ta_devb, wa_devb, oa_devb, fcld_devb
46 REAL*8,
DIMENSION(np),
INTENT(IN) :: n2o_dev, ch4_dev, cfc11_dev, &
47 & cfc12_dev, cfc22_dev
48 REAL*8,
DIMENSION(np + 1),
INTENT(IN) :: ple_dev
50 REAL*8,
DIMENSION(ns),
INTENT(IN) :: fs_dev, tg_dev, tv_dev
51 REAL*8,
DIMENSION(ns, 10),
INTENT(IN) :: eg_dev, ev_dev, rv_dev
53 REAL*8,
DIMENSION(np, 4),
INTENT(IN) :: cwc_dev, reff_dev
54 REAL*8,
DIMENSION(np, 4) :: cwc_devb, reff_devb
56 REAL*8,
DIMENSION(np, nb),
INTENT(INOUT) :: taua_dev, ssaa_dev, &
58 REAL*8,
DIMENSION(np, nb),
INTENT(INOUT) :: taua_devb
60 REAL*8,
DIMENSION(np + 1) :: flxu_dev
61 REAL*8,
DIMENSION(np+1) :: flxu_devb
62 REAL*8,
DIMENSION(np + 1) :: flxd_dev
63 REAL*8,
DIMENSION(np+1) :: flxd_devb
64 REAL*8,
DIMENSION(np + 1) :: dfdts_dev
65 REAL*8,
DIMENSION(np+1) :: dfdts_devb
67 REAL*8,
PARAMETER :: cons_grav=9.80665
68 INTEGER,
PARAMETER :: nx1=26
69 INTEGER,
PARAMETER :: no1=21
70 INTEGER,
PARAMETER :: nc1=30
71 INTEGER,
PARAMETER :: nh1=31
73 REAL*8 :: pa(0:np), dt(0:np)
76 REAL*8 :: x1b, x2b, x3b
77 REAL*8 :: dh2o(0:np), dcont(0:np), dco2(0:np), do3(0:np)
78 REAL*8 :: dh2ob(0:np), dcontb(0:np), dco2b(0:np), do3b(0:np)
79 REAL*8 :: dn2o(0:np), dch4(0:np)
80 REAL*8 :: df11(0:np), df12(0:np), df22(0:np)
81 REAL*8 :: th2o(6), tcon(3), tco2(6)
82 REAL*8 :: th2ob(6), tconb(3), tco2b(6)
83 REAL*8 :: tn2o(4), tch4(4), tcom(6)
84 REAL*8 :: tn2ob(4), tch4b(4), tcomb(6)
85 REAL*8 :: tf11, tf12, tf22
86 REAL*8 :: tf11b, tf12b, tf22b
87 REAL*8 :: blayer(0:np+1), blevel(0:np+1)
88 REAL*8 :: blayerb(0:np+1), blevelb(0:np+1)
89 REAL*8 :: bd(0:np+1), bu(0:np+1)
90 REAL*8 :: bdb(0:np+1), bub(0:np+1)
91 REAL*8 :: bs, dbs, rflxs
93 REAL*8 :: trant, tranal
94 REAL*8 :: trantb, tranalb
95 REAL*8 :: transfc(0:np+1)
96 REAL*8 :: transfcb(0:np+1)
97 REAL*8 :: flxu(0:np+1), flxd(0:np+1)
98 REAL*8 :: flxub(0:np+1), flxdb(0:np+1)
99 REAL*8 :: taerlyr(0:np)
100 REAL*8 :: taerlyrb(0:np)
106 INTEGER :: k, l,
ip, iw, ibn, ik, iq, isb, k1, k2, ne
109 REAL*8 :: cldhi, cldmd, cldlw, tcldlyr(0:np), fclr
110 REAL*8 :: cldhib, cldmdb, cldlwb, tcldlyrb(0:np), fclrb
111 REAL*8 :: x, xx, yy, p1, a1, b1, fk1, a2, b2, fk2
115 LOGICAL :: oznbnd, co2bnd, h2otable, conbnd, n2obnd
116 LOGICAL :: ch4bnd, combnd, f11bnd, f12bnd, f22bnd, b10bnd
117 LOGICAL :: do_aerosol
119 INTEGER,
PARAMETER :: max_num_tables=17
120 REAL*8 :: exptbl(0:np, max_num_tables)
121 REAL*8 :: exptblb(0:np, max_num_tables)
126 TYPE(band_table) :: h2oexp
127 TYPE(band_table) :: conexp
128 TYPE(band_table) :: co2exp
129 TYPE(band_table) :: n2oexp
130 TYPE(band_table) :: ch4exp
131 TYPE(band_table) :: comexp
132 TYPE(band_table) :: f11exp
133 TYPE(band_table) :: f12exp
134 TYPE(band_table) :: f22exp
137 REAL*8 :: fcld_col(np)
138 REAL*8 :: fcld_colb(np)
139 REAL*8 :: reff_col(np, 4)
140 REAL*8 :: reff_colb(np, 4)
141 REAL*8 :: cwc_col(np, 4)
142 REAL*8 :: cwc_colb(np, 4)
143 REAL*8 :: h2oexp_tmp(0:np, 5), conexp_tmp(0:np), co2exp_tmp(0:np, 6), &
144 & n2oexp_tmp(0:np, 2)
145 REAL*8 :: h2oexp_tmpb(0:np, 5), co2exp_tmpb(0:np, 6), n2oexp_tmpb(0:np&
156 REAL*8,
DIMENSION(np, nb),
INTENT(INOUT) :: asya_devb
157 REAL*8,
DIMENSION(np, nb),
INTENT(INOUT) :: ssaa_devb
173 pa(k) = 0.5*(ple_dev(k+1)+ple_dev(k))*0.01
174 dp(k) = (ple_dev(k+1)-ple_dev(k))*0.01
176 dp_pa(k) = ple_dev(k+1) - ple_dev(k)
177 dt(k) = ta_dev(k) - 250.0
193 dh2o(k) = 1.02*wa_dev(k)*dp(k)
194 do3(k) = 476.*oa_dev(k)*dp(k)
195 dco2(k) = 789.*co2*dp(k)
196 dch4(k) = 789.*ch4_dev(k)*dp(k)
197 dn2o(k) = 789.*n2o_dev(k)*dp(k)
198 df11(k) = 789.*cfc11_dev(k)*dp(k)
199 df12(k) = 789.*cfc12_dev(k)*dp(k)
200 df22(k) = 789.*cfc22_dev(k)*dp(k)
201 IF (dh2o(k) .LT. 1.e-10)
THEN 208 IF (do3(k) .LT. 1.e-6)
THEN 215 IF (dco2(k) .LT. 1.e-4)
THEN 222 xx = pa(k)*0.001618*wa_dev(k)*wa_dev(k)*dp(k)
223 dcont(k) = xx*exp(1800./ta_dev(k)-6.081)
225 fcld_col(k) = fcld_dev(k)
227 reff_col(k, l) = reff_dev(k, l)
228 cwc_col(k, l) = cwc_dev(k, l)
231 IF (ple_dev(1)*0.01 .LT. 0.005)
THEN 237 dp(0) = ple_dev(1)*0.01
242 dt(0) = ta_dev(1) - 250.0
243 dh2o(0) = 1.02*wa_dev(1)*dp(0)
244 do3(0) = 476.*oa_dev(1)*dp(0)
245 dco2(0) = 789.*co2*dp(0)
246 dch4(0) = 789.*ch4_dev(1)*dp(0)
247 dn2o(0) = 789.*n2o_dev(1)*dp(0)
248 df11(0) = 789.*cfc11_dev(1)*dp(0)
249 df12(0) = 789.*cfc12_dev(1)*dp(0)
250 df22(0) = 789.*cfc22_dev(1)*dp(0)
251 IF (dh2o(0) .LT. 1.e-10)
THEN 258 IF (do3(0) .LT. 1.e-6)
THEN 265 IF (dco2(0) .LT. 1.e-4)
THEN 270 xx = pa(0)*0.001618*wa_dev(1)*wa_dev(1)*dp(0)
271 dcont(0) = xx*exp(1800./ta_dev(1)-6.081)
280 IF (ibn .EQ. 10 .AND. (.NOT.trace))
THEN 294 h2otable = (ibn .EQ. 1 .OR. ibn .EQ. 2) .OR. ibn .EQ. 8
295 conbnd = ibn .GE. 2 .AND. ibn .LE. 7
298 n2obnd = ibn .EQ. 6 .OR. ibn .EQ. 7
299 ch4bnd = ibn .EQ. 6 .OR. ibn .EQ. 7
300 combnd = ibn .EQ. 4 .OR. ibn .EQ. 5
301 f11bnd = ibn .EQ. 4 .OR. ibn .EQ. 5
302 f12bnd = ibn .EQ. 4 .OR. ibn .EQ. 6
303 f22bnd = ibn .EQ. 4 .OR. ibn .EQ. 6
305 do_aerosol = na .GT. 0
445 CALL planck(ibn, cb, ta_dev(k), blayer(k))
448 blayer(0) = blayer(1)
450 blevel(0) = blayer(1)
455 CALL sfcflux(ibn, cb, dcb, ns, fs_dev, tg_dev, eg_dev, tv_dev, &
456 & ev_dev, rv_dev, bs, dbs, rflxs)
461 blevel(k) = (blayer(k-1)*dp(k)+blayer(k)*dp(k-1))/(dp(k-1)+dp(k)&
466 blevel(1) = blayer(1) + (blayer(1)-blayer(2))*dp(1)/(dp(1)+dp(2))
468 blevel(0) = blevel(1)
471 CALL planck(ibn, cb, tb_dev, blevel(np+1))
482 CALL getirtau1(ibn, np, dp_pa, fcld_col, reff_col, cwc_col, &
483 & tcldlyr, enn, aib_ir, awb_ir, aiw_ir, aww_ir, aig_ir, &
491 CALL mkicx(np, ict, icb, enn, icx, ncld)
501 IF (taua_dev(k, ibn) .GT. 0.001)
THEN 502 IF (ssaa_dev(k, ibn) .GT. 0.001)
THEN 504 asya_dev(k, ibn) = asya_dev(k, ibn)/ssaa_dev(k, ibn)
506 ssaa_dev(k, ibn) = ssaa_dev(k, ibn)/taua_dev(k, ibn)
508 ff = .5 + (.3739+(0.0076+0.1185*asya_dev(k, ibn))*asya_dev&
509 & (k, ibn))*asya_dev(k, ibn)
511 taua_dev(k, ibn) = taua_dev(k, ibn)*(1.-ssaa_dev(k, ibn)*&
517 taerlyr(k) = exp(-(1.66*taua_dev(k, ibn)))
529 IF (.NOT.h2otable .AND. (.NOT.b10bnd))
THEN 531 & h2oexp%end-h2oexp%start+1))
532 CALL h2oexps(ibn, np, dh2o, pa, dt, xkw, aw, bw, pm, mw, exptbl(&
533 & :, h2oexp%start:h2oexp%end))
544 IF (ibn .EQ. 3) ne = 3
546 & conexp%end-conexp%start+1))
547 CALL conexps(ibn, np, dcont, xke, exptbl(:, conexp%start:conexp%&
557 & *(n2oexp%end-n2oexp%start+1))
558 CALL n2oexps(ibn, np, dn2o, pa, dt, exptbl(:, n2oexp%start:&
567 & *(ch4exp%end-ch4exp%start+1))
568 CALL ch4exps(ibn, np, dch4, pa, dt, exptbl(:, ch4exp%start:&
577 & *(comexp%end-comexp%start+1))
578 CALL comexps(ibn, np, dco2, dt, exptbl(:, comexp%start:comexp%&
593 CALL cfcexps(ibn, np, a1, b1, fk1, a2, b2, fk2, df11, dt, &
594 & exptbl(:, f11exp%start:f11exp%end))
607 CALL cfcexps(ibn, np, a1, b1, fk1, a2, b2, fk2, df12, dt, &
608 & exptbl(:, f12exp%start:f12exp%end))
621 CALL cfcexps(ibn, np, a1, b1, fk1, a2, b2, fk2, df22, dt, &
622 & exptbl(:, f22exp%start:f22exp%end))
633 CALL b10exps(np, dh2o, dcont, dco2, dn2o, pa, dt, h2oexp_tmp, &
634 & exptbl(:, conexp%start:conexp%end), co2exp_tmp, &
636 exptbl(:, h2oexp%start:h2oexp%end) = h2oexp_tmp
637 exptbl(:, co2exp%start:co2exp%end) = co2exp_tmp
638 exptbl(:, n2oexp%start:n2oexp%end) = n2oexp_tmp
653 bu(np+1) = blayer(np+1)
658 IF (.NOT.h2otable)
THEN 679 CALL tablup(nx1, nh1, dh2o(k2-1), pa(k2-1), dt(k2-1), x1, x2&
680 & , x3, w11, p11, dwe, dpe, h11, h12, h13, trant)
690 CALL tablup(nx1, nh1, dh2o(k2-1), pa(k2-1), dt(k2-1), x1, x2&
691 & , x3, w11, p11, dwe, dpe, h21, h22, h23, trant)
701 CALL tablup(nx1, nh1, dh2o(k2-1), pa(k2-1), dt(k2-1), x1, x2&
702 & , x3, w11, p11, dwe, dpe, h81, h82, h83, trant)
711 tcon(1) = tcon(1)*exptbl(k2-1, conexp%start)
713 trant = trant*tcon(1)
718 ELSE IF (.NOT.b10bnd)
THEN 724 CALL h2okdis(ibn, np, arg1, fkw, gkw, ne, exptbl(:, h2oexp%&
725 & start:h2oexp%end), exptbl(:, conexp%start:conexp%end), &
737 CALL tablup(nx1, nc1, dco2(k2-1), pa(k2-1), dt(k2-1), x1, x2, &
738 & x3, w12, p12, dwe, dpe, c1, c2, c3, trant)
749 CALL tablup(nx1, no1, do3(k2-1), pa(k2-1), dt(k2-1), x1, x2, &
750 & x3, w13, p13, dwe, dpe, oo1, oo2, oo3, trant)
758 trant = trant*taerlyr(k2-1)
765 xx = (1.-enn(k2-1))*trant
766 IF (0.9999 .GT. xx)
THEN 775 IF (0.00001 .LT. yy)
THEN 782 xx = (blevel(k2-1)-blevel(k2))/log(yy)
784 bd(k2-1) = (blevel(k2)-blevel(k2-1)*yy)/(1.0-yy) - xx
786 bu(k2-1) = blevel(k2-1) + blevel(k2) - bd(k2-1)
803 IF (.NOT.h2otable)
THEN 883 CALL tablup(nx1, nh1, dh2o(k2-1), pa(k2-1), dt(k2-1), x1, &
884 & x2, x3, w11, p11, dwe, dpe, h11, h12, h13, trant)
894 CALL tablup(nx1, nh1, dh2o(k2-1), pa(k2-1), dt(k2-1), x1, &
895 & x2, x3, w11, p11, dwe, dpe, h21, h22, h23, trant)
905 CALL tablup(nx1, nh1, dh2o(k2-1), pa(k2-1), dt(k2-1), x1, &
906 & x2, x3, w11, p11, dwe, dpe, h81, h82, h83, trant)
914 tcon(1) = tcon(1)*exptbl(k2-1, conexp%start)
916 trant = trant*tcon(1)
921 ELSE IF (.NOT.b10bnd)
THEN 927 CALL h2okdis(ibn, np, arg1, fkw, gkw, ne, exptbl(:, h2oexp%&
928 & start:h2oexp%end), exptbl(:, conexp%start:conexp%end)&
929 & , th2o, tcon, trant)
940 CALL tablup(nx1, nc1, dco2(k2-1), pa(k2-1), dt(k2-1), x1, x2&
941 & , x3, w12, p12, dwe, dpe, c1, c2, c3, trant)
952 CALL tablup(nx1, no1, do3(k2-1), pa(k2-1), dt(k2-1), x1, x2&
953 & , x3, w13, p13, dwe, dpe, oo1, oo2, oo3, trant)
965 CALL n2okdis(ibn, np, arg1, exptbl(:, n2oexp%start:n2oexp%&
976 CALL ch4kdis(ibn, np, arg1, exptbl(:, ch4exp%start:ch4exp%&
987 CALL comkdis(ibn, np, arg1, exptbl(:, comexp%start:comexp%&
998 CALL cfckdis(np, arg1, exptbl(:, f11exp%start:f11exp%end)&
1009 CALL cfckdis(np, arg1, exptbl(:, f12exp%start:f12exp%end)&
1020 CALL cfckdis(np, arg1, exptbl(:, f22exp%start:f22exp%end)&
1032 CALL b10kdis(np, arg1, exptbl(:, h2oexp%start:h2oexp%end)&
1033 & , exptbl(:, conexp%start:conexp%end), exptbl(:, &
1034 & co2exp%start:co2exp%end), exptbl(:, n2oexp%start:&
1035 & n2oexp%end), th2o, tcon, tco2, tn2o, trant)
1043 IF (do_aerosol)
THEN 1045 tranal = tranal*taerlyr(k2-1)
1047 trant = trant*tranal
1052 IF (enn(k2-1) .GE. 0.001)
THEN 1056 CALL cldovlp(np, k1, k2, ict, icb, icx, ncld, enn, tcldlyr, &
1057 & cldhi, cldmd, cldlw)
1063 fclr = (1.0-cldhi)*(1.0-cldmd)*(1.0-cldlw)
1064 IF (k2 .EQ. k1 + 1 .AND. ibn .NE. 10)
THEN 1065 flxd(k2) = flxd(k2) + bd(k1)
1073 xx = -(trant*bd(k1))
1076 xx = trant*(bd(k1-1)-bd(k1))
1079 flxd(k2) = flxd(k2) + xx*fclr
1083 transfc(k1) = trant*fclr
1090 IF (.NOT.b10bnd)
THEN 1096 ad_count = ad_count + 1
1108 IF (branch .EQ. 0)
THEN 1171 flxdb(k) = flxdb(k) + flxd_devb(k)
1172 flxub(k) = flxub(k) + flxu_devb(k)
1175 IF (branch .NE. 0)
THEN 1177 flxdb(np+1) = flxdb(np+1) - rflxs*transfc(k)*flxub(k)
1178 transfcb(k) = transfcb(k) - rflxs*flxd(np+1)*flxub(k)
1180 blayerb(np+1) = blayerb(np+1) - flxub(np+1)
1186 IF (branch .NE. 0) transfcb(k1) = transfcb(k1) - dbs*dfdts_devb(&
1189 trantb = trantb + fclr*transfcb(k1)
1190 fclrb = fclrb + trant*transfcb(k1)
1191 transfcb(k1) = 0.0_8
1201 DO k2=np+1,ad_from,-1
1202 xxb = fclr*flxdb(k2)
1203 fclrb = fclrb + xx*flxdb(k2)
1205 IF (branch .EQ. 0)
THEN 1206 trantb = trantb - bd(k1)*xxb
1207 bdb(k1) = bdb(k1) - trant*xxb
1209 trantb = trantb + (bd(k1-1)-bd(k1))*xxb
1210 bdb(k1-1) = bdb(k1-1) + trant*xxb
1211 bdb(k1) = bdb(k1) - trant*xxb
1213 xx = trant*(bu(k2-1)-bu(k2))
1214 xxb = fclr*flxub(k1)
1215 fclrb = fclrb + xx*flxub(k1)
1217 trantb = trantb + (bu(k2-1)-bu(k2))*xxb
1218 bub(k2-1) = bub(k2-1) + trant*xxb
1219 bub(k2) = bub(k2) - trant*xxb
1221 IF (branch .EQ. 0)
THEN 1222 bdb(k1) = bdb(k1) + flxdb(k2)
1223 bub(k1) = bub(k1) - flxub(k1)
1226 cldhib = cldhib - (1.0-cldmd)*(1.0-cldlw)*fclrb
1227 cldmdb = cldmdb - (1.0-cldhi)*(1.0-cldlw)*fclrb
1228 cldlwb = cldlwb - (1.0-cldhi)*(1.0-cldmd)*fclrb
1230 IF (branch .EQ. 0)
THEN 1234 CALL cldovlp_b(np, k1, k2, ict, icb, icx, ncld, enn, ennb, &
1235 & tcldlyr, tcldlyrb, cldhi, cldhib, cldmd, cldmdb, &
1239 IF (branch .EQ. 0)
THEN 1241 tranalb = tranalb + trant*trantb
1242 trantb = tranal*trantb
1244 taerlyrb(k2-1) = taerlyrb(k2-1) + tranal*tranalb
1245 tranalb = taerlyr(k2-1)*tranalb
1248 IF (branch .EQ. 0)
THEN 1254 CALL b10kdis_b(np, arg1, exptbl(:, h2oexp%start:h2oexp%end)&
1255 & , exptblb(:, h2oexp%start:h2oexp%end), exptbl(:, &
1256 & conexp%start:conexp%end), exptblb(:, conexp%start:&
1257 & conexp%end), exptbl(:, co2exp%start:co2exp%end), &
1258 & exptblb(:, co2exp%start:co2exp%end), exptbl(:, &
1259 & n2oexp%start:n2oexp%end), exptblb(:, n2oexp%start:&
1260 & n2oexp%end), th2o, th2ob, tcon, tconb, tco2, tco2b&
1261 & , tn2o, tn2ob, trant, trantb)
1263 ELSE IF (branch .NE. 1)
THEN 1267 IF (branch .EQ. 0)
THEN 1271 CALL cfckdis_b(np, arg1, exptbl(:, f22exp%start:f22exp%end)&
1272 & , exptblb(:, f22exp%start:f22exp%end), tf22, tf22b&
1276 IF (branch .EQ. 0)
THEN 1280 CALL cfckdis_b(np, arg1, exptbl(:, f12exp%start:f12exp%end)&
1281 & , exptblb(:, f12exp%start:f12exp%end), tf12, tf12b&
1285 IF (branch .EQ. 0)
THEN 1289 CALL cfckdis_b(np, arg1, exptbl(:, f11exp%start:f11exp%end)&
1290 & , exptblb(:, f11exp%start:f11exp%end), tf11, tf11b&
1294 IF (branch .EQ. 0)
THEN 1298 CALL comkdis_b(ibn, np, arg1, exptbl(:, comexp%start:comexp%&
1299 & end), exptblb(:, comexp%start:comexp%end), tcom, &
1300 & tcomb, trant, trantb)
1303 IF (branch .EQ. 0)
THEN 1307 CALL ch4kdis_b(ibn, np, arg1, exptbl(:, ch4exp%start:ch4exp%&
1308 & end), exptblb(:, ch4exp%start:ch4exp%end), tch4, &
1309 & tch4b, trant, trantb)
1312 IF (branch .EQ. 0)
THEN 1316 CALL n2okdis_b(ibn, np, arg1, exptbl(:, n2oexp%start:n2oexp%&
1317 & end), exptblb(:, n2oexp%start:n2oexp%end), tn2o, &
1318 & tn2ob, trant, trantb)
1321 IF (branch .EQ. 0)
THEN 1326 CALL tablup_b(nx1, no1, do3(k2-1), do3b(k2-1), pa(k2-1), dt(&
1327 & k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, w13, &
1328 & p13, dwe, dpe, oo1, oo2, oo3, trant, trantb)
1331 IF (branch .EQ. 0)
THEN 1337 CALL tablup_b(nx1, nc1, dco2(k2-1), dco2b(k2-1), pa(k2-1), &
1338 & dt(k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, w12&
1339 & , p12, dwe, dpe, c1, c2, c3, trant, trantb)
1342 IF (branch .LT. 2)
THEN 1343 IF (branch .EQ. 0)
THEN 1345 tconb(1) = tconb(1) + trant*trantb
1346 trantb = tcon(1)*trantb
1348 exptblb(k2-1, conexp%start) = exptblb(k2-1, conexp%start) &
1349 & + tcon(1)*tconb(1)
1350 tconb(1) = exptbl(k2-1, conexp%start)*tconb(1)
1353 IF (branch .EQ. 0)
THEN 1358 CALL tablup_b(nx1, nh1, dh2o(k2-1), dh2ob(k2-1), pa(k2-1)&
1359 & , dt(k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, &
1360 & w11, p11, dwe, dpe, h81, h82, h83, trant, trantb)
1363 IF (branch .EQ. 0)
THEN 1368 CALL tablup_b(nx1, nh1, dh2o(k2-1), dh2ob(k2-1), pa(k2-1)&
1369 & , dt(k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, &
1370 & w11, p11, dwe, dpe, h21, h22, h23, trant, trantb)
1373 IF (branch .EQ. 0)
THEN 1378 CALL tablup_b(nx1, nh1, dh2o(k2-1), dh2ob(k2-1), pa(k2-1)&
1379 & , dt(k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, &
1380 & w11, p11, dwe, dpe, h11, h12, h13, trant, trantb)
1382 ELSE IF (branch .EQ. 2)
THEN 1387 CALL h2okdis_b(ibn, np, arg1, fkw, gkw, ne, exptbl(:, h2oexp&
1388 & %start:h2oexp%end), exptblb(:, h2oexp%start:h2oexp%&
1389 & end), exptbl(:, conexp%start:conexp%end), exptblb(:&
1390 & , conexp%start:conexp%end), th2o, th2ob, tcon, &
1391 & tconb, trant, trantb)
1398 IF (branch .EQ. 0)
THEN 1402 ELSE IF (branch .NE. 1)
THEN 1406 IF (branch .EQ. 0) tf22b = 0.0_8
1408 IF (branch .EQ. 0) tf12b = 0.0_8
1410 IF (branch .EQ. 0) tf11b = 0.0_8
1412 IF (branch .EQ. 0) tcomb = 0.0_8
1414 IF (branch .EQ. 0) tch4b = 0.0_8
1416 IF (branch .EQ. 0) tn2ob = 0.0_8
1419 IF (branch .EQ. 0) th2ob = 0.0_8
1427 bdb(k2-1) = bdb(k2-1) - bub(k2-1)
1428 tempb5 = bdb(k2-1)/(1.0-yy)
1433 blevelb(k2-1) = blevelb(k2-1) + bub(k2-1)
1434 blevelb(k2) = blevelb(k2) + tempb5 + bub(k2-1)
1437 blevelb(k2-1) = blevelb(k2-1) + tempb6 - yy*tempb5
1438 yyb = ((blevel(k2)-blevel(k2-1)*yy)/(1.0-yy)-blevel(k2-1))*&
1439 & tempb5 - (blevel(k2-1)-blevel(k2))*tempb6/(temp2*yy)
1441 blevelb(k2) = blevelb(k2) - tempb6
1443 IF (branch .NE. 0) yyb = 0.0_8
1445 IF (branch .EQ. 0)
THEN 1453 ennb(k2-1) = ennb(k2-1) - trant*xxb
1454 trantb = trantb + (1.-enn(k2-1))*xxb
1456 IF (branch .NE. 0)
THEN 1458 taerlyrb(k2-1) = taerlyrb(k2-1) + trant*trantb
1459 trantb = taerlyr(k2-1)*trantb
1462 IF (branch .EQ. 0)
THEN 1470 CALL tablup_b(nx1, no1, do3(k2-1), do3b(k2-1), pa(k2-1), dt(k2&
1471 & -1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, w13, p13, &
1472 & dwe, dpe, oo1, oo2, oo3, trant, trantb)
1479 IF (branch .EQ. 0)
THEN 1485 CALL tablup_b(nx1, nc1, dco2(k2-1), dco2b(k2-1), pa(k2-1), dt(&
1486 & k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, w12, p12&
1487 & , dwe, dpe, c1, c2, c3, trant, trantb)
1490 IF (branch .LT. 2)
THEN 1491 IF (branch .EQ. 0)
THEN 1494 tconb(1) = tconb(1) + trant*trantb
1495 trantb = tcon(1)*trantb
1497 exptblb(k2-1, conexp%start) = exptblb(k2-1, conexp%start) + &
1501 IF (branch .EQ. 0)
THEN 1506 CALL tablup_b(nx1, nh1, dh2o(k2-1), dh2ob(k2-1), pa(k2-1), &
1507 & dt(k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, w11&
1508 & , p11, dwe, dpe, h81, h82, h83, trant, trantb)
1511 IF (branch .EQ. 0)
THEN 1516 CALL tablup_b(nx1, nh1, dh2o(k2-1), dh2ob(k2-1), pa(k2-1), &
1517 & dt(k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, w11&
1518 & , p11, dwe, dpe, h21, h22, h23, trant, trantb)
1521 IF (branch .EQ. 0)
THEN 1526 CALL tablup_b(nx1, nh1, dh2o(k2-1), dh2ob(k2-1), pa(k2-1), &
1527 & dt(k2-1), dtb(k2-1), x1, x1b, x2, x2b, x3, x3b, w11&
1528 & , p11, dwe, dpe, h11, h12, h13, trant, trantb)
1530 ELSE IF (branch .EQ. 2)
THEN 1536 CALL h2okdis_b(ibn, np, arg1, fkw, gkw, ne, exptbl(:, h2oexp%&
1537 & start:h2oexp%end), exptblb(:, h2oexp%start:h2oexp%end&
1538 & ), exptbl(:, conexp%start:conexp%end), exptblb(:, &
1539 & conexp%start:conexp%end), th2o, th2ob, tcon, tconb, &
1545 IF (branch .EQ. 0) th2ob = 0.0_8
1549 blayerb(np+1) = blayerb(np+1) + bub(np+1)
1552 blayerb(1) = blayerb(1) + bdb(0)
1557 IF (branch .EQ. 0)
THEN 1558 n2oexp_tmpb = n2oexp_tmpb + exptblb(:, n2oexp%start:n2oexp%end)
1559 exptblb(:, n2oexp%start:n2oexp%end) = 0.0_8
1560 co2exp_tmpb = co2exp_tmpb + exptblb(:, co2exp%start:co2exp%end)
1561 exptblb(:, co2exp%start:co2exp%end) = 0.0_8
1562 h2oexp_tmpb = h2oexp_tmpb + exptblb(:, h2oexp%start:h2oexp%end)
1563 exptblb(:, h2oexp%start:h2oexp%end) = 0.0_8
1567 CALL b10exps_b(np, dh2o, dh2ob, dcont, dcontb, dco2, dn2o, pa, &
1568 & dt, dtb, h2oexp_tmp, h2oexp_tmpb, exptbl(:, conexp%&
1569 & start:conexp%end), exptblb(:, conexp%start:conexp%end)&
1570 & , co2exp_tmp, co2exp_tmpb, n2oexp_tmp, n2oexp_tmpb)
1571 ELSE IF (branch .NE. 1)
THEN 1575 IF (branch .EQ. 0)
THEN 1582 CALL cfcexps_b(ibn, np, a1, b1, fk1, a2, b2, fk2, df22, dt, dtb&
1583 & , exptbl(:, f22exp%start:f22exp%end), exptblb(:, f22exp&
1584 & %start:f22exp%end))
1587 IF (branch .EQ. 0)
THEN 1594 CALL cfcexps_b(ibn, np, a1, b1, fk1, a2, b2, fk2, df12, dt, dtb&
1595 & , exptbl(:, f12exp%start:f12exp%end), exptblb(:, f12exp&
1596 & %start:f12exp%end))
1599 IF (branch .EQ. 0)
THEN 1606 CALL cfcexps_b(ibn, np, a1, b1, fk1, a2, b2, fk2, df11, dt, dtb&
1607 & , exptbl(:, f11exp%start:f11exp%end), exptblb(:, f11exp&
1608 & %start:f11exp%end))
1611 IF (branch .EQ. 0)
THEN 1612 CALL popreal8array(exptbl(:, comexp%start:comexp%end), (np+1)*(&
1613 & comexp%end-comexp%start+1))
1614 CALL comexps_b(ibn, np, dco2, dt, dtb, exptbl(:, comexp%start:&
1615 & comexp%end), exptblb(:, comexp%start:comexp%end))
1618 IF (branch .EQ. 0)
THEN 1619 CALL popreal8array(exptbl(:, ch4exp%start:ch4exp%end), (np+1)*(&
1620 & ch4exp%end-ch4exp%start+1))
1621 CALL ch4exps_b(ibn, np, dch4, pa, dt, dtb, exptbl(:, ch4exp%&
1622 & start:ch4exp%end), exptblb(:, ch4exp%start:ch4exp%end))
1625 IF (branch .EQ. 0)
THEN 1626 CALL popreal8array(exptbl(:, n2oexp%start:n2oexp%end), (np+1)*(&
1627 & n2oexp%end-n2oexp%start+1))
1628 CALL n2oexps_b(ibn, np, dn2o, pa, dt, dtb, exptbl(:, n2oexp%&
1629 & start:n2oexp%end), exptblb(:, n2oexp%start:n2oexp%end))
1632 IF (branch .EQ. 0)
THEN 1633 CALL popreal8array(exptbl(:, conexp%start:conexp%end), (np+1)*(&
1634 & conexp%end-conexp%start+1))
1635 CALL conexps_b(ibn, np, dcont, dcontb, xke, exptbl(:, conexp%&
1636 & start:conexp%end), exptblb(:, conexp%start:conexp%end))
1640 IF (branch .EQ. 0)
THEN 1641 CALL popreal8array(exptbl(:, h2oexp%start:h2oexp%end), (np+1)*(&
1642 & h2oexp%end-h2oexp%start+1))
1643 CALL h2oexps_b(ibn, np, dh2o, dh2ob, pa, dt, dtb, xkw, aw, bw, &
1644 & pm, mw, exptbl(:, h2oexp%start:h2oexp%end), exptblb(:, &
1645 & h2oexp%start:h2oexp%end))
1646 exptblb(:, h2oexp%start:h2oexp%end) = 0.0_8
1649 IF (branch .EQ. 0)
THEN 1652 IF (branch .NE. 0)
THEN 1653 taua_devb(k, ibn) = taua_devb(k, ibn) - exp(-(1.66*taua_dev(&
1654 & k, ibn)))*1.66*taerlyrb(k)
1657 IF (branch .EQ. 0)
THEN 1658 ff = .5 + (.3739+(0.0076+0.1185*asya_dev(k, ibn))*asya_dev&
1659 & (k, ibn))*asya_dev(k, ibn)
1661 tempb1 = taua_dev(k, ibn)*taua_devb(k, ibn)
1662 ssaa_devb(k, ibn) = ssaa_devb(k, ibn) - ff*tempb1
1663 ffb = -(ssaa_dev(k, ibn)*tempb1)
1664 taua_devb(k, ibn) = (1.-ssaa_dev(k, ibn)*ff)*taua_devb(k, &
1666 tempb2 = asya_dev(k, ibn)*ffb
1667 temp1 = 0.1185*asya_dev(k, ibn) + 0.0076
1668 asya_devb(k, ibn) = asya_devb(k, ibn) + (temp1*asya_dev(k&
1669 & , ibn)+.3739)*ffb + (temp1+asya_dev(k, ibn)*0.1185)*&
1672 tempb3 = ssaa_devb(k, ibn)/taua_dev(k, ibn)
1673 taua_devb(k, ibn) = taua_devb(k, ibn) - ssaa_dev(k, ibn)*&
1674 & tempb3/taua_dev(k, ibn)
1676 tempb4 = asya_devb(k, ibn)/ssaa_dev(k, ibn)
1677 ssaa_devb(k, ibn) = tempb3 - asya_dev(k, ibn)*tempb4/&
1679 asya_devb(k, ibn) = tempb4
1695 CALL getirtau1_b(ibn, np, dp_pa, fcld_col, fcld_colb, reff_col, &
1696 & reff_colb, cwc_col, cwc_colb, tcldlyr, tcldlyrb, enn, &
1697 & ennb, aib_ir, awb_ir, aiw_ir, aww_ir, aig_ir, awg_ir, &
1700 CALL planck_b(ibn, cb, tb_dev, tb_devb, blevel(np+1), blevelb(np+1&
1702 blevelb(np+1) = 0.0_8
1704 blevelb(1) = blevelb(1) + blevelb(0)
1707 tempb0 = dp(1)*blevelb(1)/(dp(1)+dp(2))
1708 blayerb(1) = blayerb(1) + tempb0 + blevelb(1)
1709 blayerb(2) = blayerb(2) - tempb0
1713 tempb = blevelb(k)/(dp(k-1)+dp(k))
1714 blayerb(k-1) = blayerb(k-1) + dp(k)*tempb
1715 blayerb(k) = blayerb(k) + dp(k-1)*tempb
1718 blayerb(np+1) = 0.0_8
1722 blayerb(1) = blayerb(1) + blayerb(0) + blevelb(0)
1726 CALL planck_b(ibn, cb, ta_dev(k), ta_devb(k), blayer(k), blayerb&
1731 IF (branch .LT. 4)
THEN 1732 IF (branch .LT. 2)
THEN 1733 IF (branch .EQ. 0)
THEN 1746 ELSE IF (branch .EQ. 2)
THEN 1769 ELSE IF (branch .LT. 6)
THEN 1770 IF (branch .EQ. 4)
THEN 1793 ELSE IF (branch .EQ. 6)
THEN 1798 ELSE IF (branch .EQ. 7)
THEN 1807 dfdts_devb(k) = 0.0_8
1808 flxd_devb(k) = 0.0_8
1809 flxu_devb(k) = 0.0_8
1811 xx = pa(0)*0.001618*wa_dev(1)*wa_dev(1)*dp(0)
1812 temp0 = 1800./ta_dev(1)
1813 xxb = exp(temp0-6.081)*dcontb(0)
1814 ta_devb(1) = ta_devb(1) - exp(temp0-6.081)*xx*temp0*dcontb(0)/ta_dev(1&
1817 wa_devb(1) = wa_devb(1) + pa(0)*0.001618*dp(0)*2*wa_dev(1)*xxb
1819 IF (branch .EQ. 0) do3b(0) = 0.0_8
1821 IF (branch .EQ. 0) dh2ob(0) = 0.0_8
1822 oa_devb(1) = oa_devb(1) + dp(0)*476.*do3b(0)
1824 wa_devb(1) = wa_devb(1) + dp(0)*1.02*dh2ob(0)
1826 ta_devb(1) = ta_devb(1) + dtb(0)
1830 IF (branch .EQ. 0)
THEN 1837 cwc_devb(k, l) = cwc_devb(k, l) + cwc_colb(k, l)
1838 cwc_colb(k, l) = 0.0_8
1839 reff_devb(k, l) = reff_devb(k, l) + reff_colb(k, l)
1840 reff_colb(k, l) = 0.0_8
1842 fcld_devb(k) = fcld_devb(k) + fcld_colb(k)
1843 fcld_colb(k) = 0.0_8
1844 xx = pa(k)*0.001618*wa_dev(k)*wa_dev(k)*dp(k)
1845 temp = 1800./ta_dev(k)
1846 xxb = exp(temp-6.081)*dcontb(k)
1847 ta_devb(k) = ta_devb(k) - exp(temp-6.081)*xx*temp*dcontb(k)/ta_dev(k&
1850 wa_devb(k) = wa_devb(k) + pa(k)*0.001618*dp(k)*2*wa_dev(k)*xxb
1852 IF (branch .EQ. 0) do3b(k) = 0.0_8
1854 IF (branch .EQ. 0) dh2ob(k) = 0.0_8
1855 oa_devb(k) = oa_devb(k) + dp(k)*476.*do3b(k)
1857 wa_devb(k) = wa_devb(k) + dp(k)*1.02*dh2ob(k)
1859 ta_devb(k) = ta_devb(k) + dtb(k)
1868 SUBROUTINE planck_b(ibn, cb, t, tb, xlayer, xlayerb)
1871 INTEGER,
INTENT(IN) :: ibn
1873 REAL*8,
INTENT(IN) :: cb(6, 10)
1875 REAL*8,
INTENT(IN) :: t
1884 temp1 = cb(5, ibn) + cb(6, ibn)*t
1885 temp0 = cb(4, ibn) + t*temp1
1886 temp = cb(3, ibn) + t*temp0
1887 tempb = t**2*xlayerb
1888 tb = tb + (t**2*cb(6, ibn)+t*temp1+temp0)*tempb + (2*(t*temp)+cb(2, &
1896 SUBROUTINE h2oexps_b(ib, np, dh2o, dh2ob, pa, dt, dtb, xkw, aw, bw, pm, &
1897 & mw, h2oexp, h2oexpb)
1899 INTEGER :: ib, np, ik, k
1901 REAL*8 :: dh2o(0:np), pa(0:np), dt(0:np)
1902 REAL*8 :: dh2ob(0:np), dtb(0:np)
1904 REAL*8 :: h2oexp(0:np, 6)
1905 REAL*8 :: h2oexpb(0:np, 6)
1908 REAL*8 :: xkw(9), aw(9), bw(9), pm(9)
1924 xh = dh2o(k)*(pa(k)/500.)**pm(ib)*(1.+(aw(ib)+bw(ib)*dt(k))*dt(k))
1927 h2oexp(k, 1) = exp(-(xh*xkw(ib)))
1930 IF (mw(ib) .EQ. 6)
THEN 1932 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)
1934 h2oexp(k, ik) = xh*xh*xh
1936 ELSE IF (mw(ib) .EQ. 8)
THEN 1938 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)
1942 h2oexp(k, ik) = xh*xh
1944 ELSE IF (mw(ib) .EQ. 9)
THEN 1946 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)*h2oexp(k, ik-1)
1948 h2oexp(k, ik) = xh*xh*xh
1952 xh = h2oexp(k, ik-1)*h2oexp(k, ik-1)
1958 h2oexp(k, ik) = xh*xh
1966 IF (branch .LT. 2)
THEN 1967 IF (branch .EQ. 0)
THEN 1969 xhb = 2*xh*h2oexpb(k, ik)
1970 h2oexpb(k, ik) = 0.0_8
1976 h2oexpb(k, ik-1) = h2oexpb(k, ik-1) + 2*h2oexp(k, ik-1)*xhb
1979 xhb = 3*xh**2*h2oexpb(k, ik)
1980 h2oexpb(k, ik) = 0.0_8
1982 h2oexpb(k, ik-1) = h2oexpb(k, ik-1) + 3*h2oexp(k, ik-1)**2*xhb
1984 ELSE IF (branch .EQ. 2)
THEN 1986 xhb = 2*xh*h2oexpb(k, ik)
1987 h2oexpb(k, ik) = 0.0_8
1991 h2oexpb(k, ik-1) = h2oexpb(k, ik-1) + 2*h2oexp(k, ik-1)*xhb
1994 xhb = 3*xh**2*h2oexpb(k, ik)
1995 h2oexpb(k, ik) = 0.0_8
1997 h2oexpb(k, ik-1) = h2oexpb(k, ik-1) + 2*h2oexp(k, ik-1)*xhb
2000 xhb = -(exp(-(xkw(ib)*xh))*xkw(ib)*h2oexpb(k, 1))
2001 h2oexpb(k, 1) = 0.0_8
2003 temp = aw(ib) + bw(ib)*dt(k)
2004 tempb = (pa(k)/500.)**pm(ib)*xhb
2005 dh2ob(k) = dh2ob(k) + (temp*dt(k)+1.)*tempb
2006 dtb(k) = dtb(k) + (dh2o(k)*temp+dt(k)*dh2o(k)*bw(ib))*tempb
2014 SUBROUTINE conexps_b(ib, np, dcont, dcontb, xke, conexp, conexpb)
2016 INTEGER :: ib, np, k
2018 REAL*8 :: dcont(0:np)
2019 REAL*8 :: dcontb(0:np)
2021 REAL*8 :: conexp(0:np, 3)
2022 REAL*8 :: conexpb(0:np, 3)
2029 conexp(k, 1) = exp(-(dcont(k)*xke(ib)))
2035 conexp(k, 2) = conexp(k, 1)*conexp(k, 1)
2043 IF (branch .NE. 0)
THEN 2044 conexpb(k, 2) = conexpb(k, 2) + 2*conexp(k, 2)*conexpb(k, 3)
2045 conexpb(k, 3) = 0.0_8
2047 conexpb(k, 1) = conexpb(k, 1) + 2*conexp(k, 1)*conexpb(k, 2)
2048 conexpb(k, 2) = 0.0_8
2050 dcontb(k) = dcontb(k) - exp(-(xke(ib)*dcont(k)))*xke(ib)*conexpb(k, &
2052 conexpb(k, 1) = 0.0_8
2060 SUBROUTINE n2oexps_b(ib, np, dn2o, pa, dt, dtb, n2oexp, n2oexpb)
2062 INTEGER :: ib, k, np
2064 REAL*8 :: dn2o(0:np), pa(0:np), dt(0:np)
2067 REAL*8 :: n2oexp(0:np, 4)
2068 REAL*8 :: n2oexpb(0:np, 4)
2070 REAL*8 :: xc, xc1, xc2
2071 REAL*8 :: xcb, xc1b, xc2b
2081 xc = dn2o(k)*(1.+(1.9297e-3+4.3750e-6*dt(k))*dt(k))
2082 n2oexp(k, 1) = exp(-(xc*6.31582e-2))
2083 xc = n2oexp(k, 1)*n2oexp(k, 1)*n2oexp(k, 1)
2088 xc = dn2o(k)*(pa(k)/500.0)**0.48*(1.+(1.3804e-3+7.4838e-6*dt(k))*&
2090 n2oexp(k, 1) = exp(-(xc*5.35779e-2))
2091 xc = n2oexp(k, 1)*n2oexp(k, 1)
2095 n2oexp(k, 2) = xc*xc
2097 xc = n2oexp(k, 2)*n2oexp(k, 2)
2101 n2oexp(k, 3) = xc*xc
2103 xc = n2oexp(k, 3)*n2oexp(k, 3)
2111 IF (branch .EQ. 0)
THEN 2112 xcb = 2*xc*n2oexpb(k, 4)
2113 n2oexpb(k, 4) = 0.0_8
2117 n2oexpb(k, 3) = n2oexpb(k, 3) + 2*n2oexp(k, 3)*xcb
2119 xcb = 2*xc*n2oexpb(k, 3)
2120 n2oexpb(k, 3) = 0.0_8
2124 n2oexpb(k, 2) = n2oexpb(k, 2) + 2*n2oexp(k, 2)*xcb
2126 xcb = 2*xc*n2oexpb(k, 2)
2127 n2oexpb(k, 2) = 0.0_8
2130 n2oexpb(k, 1) = n2oexpb(k, 1) + 2*n2oexp(k, 1)*xcb
2131 xc = dn2o(k)*(pa(k)/500.0)**0.48*(1.+(1.3804e-3+7.4838e-6*dt(k))*&
2133 xcb = -(exp(-(5.35779e-2*xc))*5.35779e-2*n2oexpb(k, 1))
2134 n2oexpb(k, 1) = 0.0_8
2136 tempb = (pa(k)/500.0)**0.48*dn2o(k)*xcb
2137 dtb(k) = dtb(k) + (7.4838e-6*dt(k)+dt(k)*7.4838e-6+1.3804e-3)*&
2142 xc2b = xc*xc1*n2oexpb(k, 2)
2143 xc1b = 2*xc1*xc2b + xc2*xc*n2oexpb(k, 2)
2144 xcb = 2*xc*xc1b + xc2*xc1*n2oexpb(k, 2)
2145 n2oexpb(k, 2) = 0.0_8
2146 n2oexpb(k, 1) = n2oexpb(k, 1) + 3*n2oexp(k, 1)**2*xcb
2147 xc = dn2o(k)*(1.+(1.9297e-3+4.3750e-6*dt(k))*dt(k))
2148 xcb = -(exp(-(6.31582e-2*xc))*6.31582e-2*n2oexpb(k, 1))
2149 n2oexpb(k, 1) = 0.0_8
2151 dtb(k) = dtb(k) + (dn2o(k)*(4.3750e-6*dt(k)+1.9297e-3)+dt(k)*dn2o(&
2161 SUBROUTINE ch4exps_b(ib, np, dch4, pa, dt, dtb, ch4exp, ch4expb)
2163 INTEGER :: ib, np, k
2165 REAL*8 :: dch4(0:np), pa(0:np), dt(0:np)
2168 REAL*8 :: ch4exp(0:np, 4)
2169 REAL*8 :: ch4expb(0:np, 4)
2185 xc = dch4(k)*(pa(k)/500.0)**0.65*(1.+(5.9590e-4-2.2931e-6*dt(k))*&
2187 ch4exp(k, 1) = exp(-(xc*6.29247e-2))
2188 xc = ch4exp(k, 1)*ch4exp(k, 1)*ch4exp(k, 1)
2192 ch4exp(k, 2) = xc*xc
2194 xc = ch4exp(k, 2)*ch4exp(k, 2)*ch4exp(k, 2)
2198 ch4exp(k, 3) = xc*xc
2200 xc = ch4exp(k, 3)*ch4exp(k, 3)*ch4exp(k, 3)
2208 IF (branch .EQ. 0)
THEN 2209 xcb = 2*xc*ch4expb(k, 4)
2210 ch4expb(k, 4) = 0.0_8
2214 ch4expb(k, 3) = ch4expb(k, 3) + 3*ch4exp(k, 3)**2*xcb
2216 xcb = 2*xc*ch4expb(k, 3)
2217 ch4expb(k, 3) = 0.0_8
2221 ch4expb(k, 2) = ch4expb(k, 2) + 3*ch4exp(k, 2)**2*xcb
2223 xcb = 2*xc*ch4expb(k, 2)
2224 ch4expb(k, 2) = 0.0_8
2227 ch4expb(k, 1) = ch4expb(k, 1) + 3*ch4exp(k, 1)**2*xcb
2228 xc = dch4(k)*(pa(k)/500.0)**0.65*(1.+(5.9590e-4-2.2931e-6*dt(k))*&
2230 xcb = -(exp(-(6.29247e-2*xc))*6.29247e-2*ch4expb(k, 1))
2231 ch4expb(k, 1) = 0.0_8
2233 tempb = (pa(k)/500.0)**0.65*dch4(k)*xcb
2234 dtb(k) = dtb(k) + (5.9590e-4-dt(k)*2.2931e-6-2.2931e-6*dt(k))*&
2237 xc = dch4(k)*(1.+(1.7007e-2+1.5826e-4*dt(k))*dt(k))
2238 xcb = -(exp(-(5.80708e-3*xc))*5.80708e-3*ch4expb(k, 1))
2239 ch4expb(k, 1) = 0.0_8
2241 dtb(k) = dtb(k) + (dch4(k)*(1.5826e-4*dt(k)+1.7007e-2)+dt(k)*dch4(&
2251 SUBROUTINE comexps_b(ib, np, dcom, dt, dtb, comexp, comexpb)
2253 INTEGER :: ib, ik, np, k
2255 REAL*8 :: dcom(0:np), dt(0:np)
2258 REAL*8 :: comexp(0:np, 6)
2259 REAL*8 :: comexpb(0:np, 6)
2269 xc = dcom(k)*(1.+(3.5775e-2+4.0447e-4*dt(k))*dt(k))
2276 xc = dcom(k)*(1.+(3.4268e-2+3.7401e-4*dt(k))*dt(k))
2281 comexp(k, 1) = exp(-(xc*1.922e-7))
2284 xc = comexp(k, ik-1)*comexp(k, ik-1)
2288 comexp(k, ik) = xc*comexp(k, ik-1)
2295 xcb = xcb + comexp(k, ik-1)*comexpb(k, ik)
2296 comexpb(k, ik-1) = comexpb(k, ik-1) + xc*comexpb(k, ik)
2297 comexpb(k, ik) = 0.0_8
2301 comexpb(k, ik-1) = comexpb(k, ik-1) + 2*comexp(k, ik-1)*xcb
2304 xcb = xcb - exp(-(1.922e-7*xc))*1.922e-7*comexpb(k, 1)
2305 comexpb(k, 1) = 0.0_8
2307 IF (branch .EQ. 0)
THEN 2309 dtb(k) = dtb(k) + (dcom(k)*(3.7401e-4*dt(k)+3.4268e-2)+dt(k)*dcom(&
2314 IF (branch .EQ. 0)
THEN 2316 dtb(k) = dtb(k) + (dcom(k)*(4.0447e-4*dt(k)+3.5775e-2)+dt(k)*dcom(&
2327 SUBROUTINE cfcexps_b(ib, np, a1, b1, fk1, a2, b2, fk2, dcfc, dt, dtb, &
2330 INTEGER :: ib, np, k
2332 REAL*8 :: dcfc(0:np), dt(0:np)
2335 REAL*8 :: cfcexp(0:np)
2336 REAL*8 :: cfcexpb(0:np)
2338 REAL*8 :: a1, b1, fk1, a2, b2, fk2
2355 IF (branch .EQ. 0)
THEN 2356 xf = dcfc(k)*(1.+(a2+b2*dt(k))*dt(k))
2357 xfb = -(exp(-(fk2*xf))*fk2*cfcexpb(k))
2359 dtb(k) = dtb(k) + (dcfc(k)*(a2+b2*dt(k))+dt(k)*dcfc(k)*b2)*xfb
2361 xf = dcfc(k)*(1.+(a1+b1*dt(k))*dt(k))
2362 xfb = -(exp(-(fk1*xf))*fk1*cfcexpb(k))
2364 dtb(k) = dtb(k) + (dcfc(k)*(a1+b1*dt(k))+dt(k)*dcfc(k)*b1)*xfb
2375 SUBROUTINE b10exps_b(np, dh2o, dh2ob, dcont, dcontb, dco2, dn2o, pa, dt&
2376 & , dtb, h2oexp, h2oexpb, conexp, conexpb, co2exp, co2expb, n2oexp, &
2381 REAL*8 :: dh2o(0:np), dcont(0:np), dn2o(0:np)
2382 REAL*8 :: dh2ob(0:np), dcontb(0:np)
2383 REAL*8 :: dco2(0:np), pa(0:np), dt(0:np)
2386 REAL*8 :: h2oexp(0:np, 5), conexp(0:np), co2exp(0:np, 6), n2oexp(0:np&
2388 REAL*8 :: h2oexpb(0:np, 5), conexpb(0:np), co2expb(0:np, 6), n2oexpb(0&
2391 REAL*8 :: xx, xx1, xx2, xx3
2392 REAL*8 :: xxb, xx1b, xx2b, xx3b
2402 xx = dh2o(k)*(pa(k)/500.0)*(1.+(0.0149+6.20e-5*dt(k))*dt(k))
2404 h2oexp(k, 1) = exp(-(xx*0.10624))
2405 xx = h2oexp(k, 1)*h2oexp(k, 1)
2409 h2oexp(k, 2) = xx*xx
2411 xx = h2oexp(k, 2)*h2oexp(k, 2)
2415 h2oexp(k, 3) = xx*xx
2417 xx = h2oexp(k, 3)*h2oexp(k, 3)
2421 h2oexp(k, 4) = xx*xx
2423 xx = h2oexp(k, 4)*h2oexp(k, 4)
2429 xx = dco2(k)*(pa(k)/300.0)**0.5*(1.+(0.0179+1.02e-4*dt(k))*dt(k))
2431 co2exp(k, 1) = exp(-(xx*2.656e-5))
2432 xx = co2exp(k, 1)*co2exp(k, 1)
2436 co2exp(k, 2) = xx*xx
2438 xx = co2exp(k, 2)*co2exp(k, 2)
2442 co2exp(k, 3) = xx*xx
2444 xx = co2exp(k, 3)*co2exp(k, 3)
2448 co2exp(k, 4) = xx*xx
2450 xx = co2exp(k, 4)*co2exp(k, 4)
2454 co2exp(k, 5) = xx*xx
2456 xx = co2exp(k, 5)*co2exp(k, 5)
2461 xx = dn2o(k)*(1.+(1.4476e-3+3.6656e-6*dt(k))*dt(k))
2463 n2oexp(k, 1) = exp(-(xx*0.25238))
2464 xx = n2oexp(k, 1)*n2oexp(k, 1)
2473 tempb = xx2*xx3*n2oexpb(k, 2)
2474 tempb0 = xx*xx1*n2oexpb(k, 2)
2477 xx2b = 2*xx2*xx3b + xx3*tempb0
2478 xx1b = 2*xx1*xx2b + xx*tempb
2479 n2oexpb(k, 2) = 0.0_8
2483 xxb = xxb + 2*xx*xx1b
2484 n2oexpb(k, 1) = n2oexpb(k, 1) + 2*n2oexp(k, 1)*xxb
2485 xx = dn2o(k)*(1.+(1.4476e-3+3.6656e-6*dt(k))*dt(k))
2486 xxb = -(exp(-(0.25238*xx))*0.25238*n2oexpb(k, 1))
2487 n2oexpb(k, 1) = 0.0_8
2489 dtb(k) = dtb(k) + (dn2o(k)*(3.6656e-6*dt(k)+1.4476e-3)+dt(k)*dn2o(k)&
2491 xxb = 2*xx*co2expb(k, 6)
2492 co2expb(k, 6) = 0.0_8
2496 co2expb(k, 5) = co2expb(k, 5) + 2*co2exp(k, 5)*xxb
2498 xxb = 2*xx*co2expb(k, 5)
2499 co2expb(k, 5) = 0.0_8
2503 co2expb(k, 4) = co2expb(k, 4) + 2*co2exp(k, 4)*xxb
2505 xxb = 2*xx*co2expb(k, 4)
2506 co2expb(k, 4) = 0.0_8
2510 co2expb(k, 3) = co2expb(k, 3) + 2*co2exp(k, 3)*xxb
2512 xxb = 2*xx*co2expb(k, 3)
2513 co2expb(k, 3) = 0.0_8
2517 co2expb(k, 2) = co2expb(k, 2) + 2*co2exp(k, 2)*xxb
2519 xxb = 2*xx*co2expb(k, 2)
2520 co2expb(k, 2) = 0.0_8
2523 co2expb(k, 1) = co2expb(k, 1) + 2*co2exp(k, 1)*xxb
2524 xx = dco2(k)*(pa(k)/300.0)**0.5*(1.+(0.0179+1.02e-4*dt(k))*dt(k))
2525 xxb = -(exp(-(2.656e-5*xx))*2.656e-5*co2expb(k, 1))
2526 co2expb(k, 1) = 0.0_8
2528 tempb1 = (pa(k)/300.0)**0.5*dco2(k)*xxb
2529 dcontb(k) = dcontb(k) - exp(-(109.0*dcont(k)))*109.0*conexpb(k)
2531 xxb = 2*xx*h2oexpb(k, 5)
2532 h2oexpb(k, 5) = 0.0_8
2536 h2oexpb(k, 4) = h2oexpb(k, 4) + 2*h2oexp(k, 4)*xxb
2538 xxb = 2*xx*h2oexpb(k, 4)
2539 h2oexpb(k, 4) = 0.0_8
2543 h2oexpb(k, 3) = h2oexpb(k, 3) + 2*h2oexp(k, 3)*xxb
2545 xxb = 2*xx*h2oexpb(k, 3)
2546 h2oexpb(k, 3) = 0.0_8
2550 h2oexpb(k, 2) = h2oexpb(k, 2) + 2*h2oexp(k, 2)*xxb
2552 xxb = 2*xx*h2oexpb(k, 2)
2553 h2oexpb(k, 2) = 0.0_8
2556 h2oexpb(k, 1) = h2oexpb(k, 1) + 2*h2oexp(k, 1)*xxb
2557 xx = dh2o(k)*(pa(k)/500.0)*(1.+(0.0149+6.20e-5*dt(k))*dt(k))
2558 xxb = -(exp(-(0.10624*xx))*0.10624*h2oexpb(k, 1))
2559 h2oexpb(k, 1) = 0.0_8
2561 tempb2 = pa(k)*dh2o(k)*xxb/500.0
2562 dtb(k) = dtb(k) + (6.20e-5*dt(k)+dt(k)*6.20e-5+0.0149)*tempb2 + (&
2563 & 1.02e-4*dt(k)+dt(k)*1.02e-4+0.0179)*tempb1
2564 dh2ob(k) = dh2ob(k) + ((6.20e-5*dt(k)+0.0149)*dt(k)+1.)*pa(k)*xxb/&
2573 SUBROUTINE tablup_b(nx1, nh1, dw, dwb, p, dt, dtb, s1, s1b, s2, s2b, s3&
2574 & , s3b, w1, p1, dwe, dpe, coef1, coef2, coef3, tran, tranb)
2578 REAL*8 :: w1, p1, dwe, dpe
2581 REAL*8 :: coef1(nx1, nh1), coef2(nx1, nh1), coef3(nx1, nh1)
2583 REAL*8 :: s1, s2, s3, tran
2584 REAL*8 :: s1b, s2b, s3b, tranb
2586 REAL*8 :: we, pe, fw, fp, pa, pb, pc, ax, ba, bb, t1, ca, cb, t2
2587 REAL*8 :: web, peb, fwb, fpb, pab, pbb, pcb, axb, bab, bbb, t1b, cab, &
2589 REAL*8 :: x1, x2, x3, xx, x1c
2590 REAL*8 :: x1b, x2b, x3b, xxb, x1cb
2614 we = (log10(x1)-w1)*dwe
2615 pe = (log10(x2)-p1)*dpe
2617 IF (we .GT. y1)
THEN 2625 IF (pe .GT. y2)
THEN 2635 IF (iw .GT. nh1 - 1)
THEN 2645 fw = we -
REAL(iw - 1)
2647 IF (ip .GT. nx1 - 1)
THEN 2657 fp = pe -
REAL(ip - 1)
2659 pa = coef1(ip, iw-1) + (coef1(ip+1, iw-1)-coef1(ip, iw-1))*fp
2660 pb = coef1(ip, iw) + (coef1(ip+1, iw)-coef1(ip, iw))*fp
2661 pc = coef1(ip, iw+1) + (coef1(ip+1, iw+1)-coef1(ip, iw+1))*fp
2663 ax = ((pc+pa)*fw+(pc-pa))*fw*0.5 + pb*(1.-fw*fw)
2665 ba = coef2(ip, iw) + (coef2(ip+1, iw)-coef2(ip, iw))*fp
2666 bb = coef2(ip, iw+1) + (coef2(ip+1, iw+1)-coef2(ip, iw+1))*fp
2667 t1 = ba + (bb-ba)*fw
2668 ca = coef3(ip, iw) + (coef3(ip+1, iw)-coef3(ip, iw))*fp
2669 cb = coef3(ip, iw+1) + (coef3(ip+1, iw+1)-coef3(ip, iw+1))*fp
2670 t2 = ca + (cb-ca)*fw
2672 xx = ax + (t1+t2*x3)*x3
2673 IF (xx .GT. 0.9999999)
THEN 2680 IF (xx .LT. 0.0000001)
THEN 2690 IF (branch .EQ. 0) xxb = 0.0_8
2692 IF (branch .EQ. 0) xxb = 0.0_8
2697 x3b = (t1+t2*x3)*xxb + t2*tempb
2698 cab = (1.0_8-fw)*t2b
2700 bab = (1.0_8-fw)*t1b
2703 fwb = (bb-ba)*t1b + (0.5*((pc+pa)*fw+pc-pa)-pb*2*fw)*axb + (pc+pa)*&
2704 & tempb0 + (cb-ca)*t2b
2705 pcb = (fw+1.0_8)*tempb0
2706 pab = (fw-1.0)*tempb0
2707 pbb = (1.-fw**2)*axb
2708 fpb = (coef3(ip+1, iw)-coef3(ip, iw))*cab + (coef2(ip+1, iw)-coef2(ip&
2709 & , iw))*bab + (coef1(ip+1, iw)-coef1(ip, iw))*pbb + (coef1(ip+1, iw-1&
2710 & )-coef1(ip, iw-1))*pab + (coef1(ip+1, iw+1)-coef1(ip, iw+1))*pcb + (&
2711 & coef2(ip+1, iw+1)-coef2(ip, iw+1))*bbb + (coef3(ip+1, iw+1)-coef3(ip&
2716 IF (branch .EQ. 0) peb = 0.0_8
2718 IF (branch .EQ. 0) web = 0.0_8
2719 x2b = dpe*peb/(x2*log(10.0))
2720 x1b = dwe*web/(x1*log(10.0))
2722 x1cb = s2*x2b + s3*x3b
2724 s1b = s1b + x1b - x1cb/s1**2
2726 dwb = dwb + p*s2b + s1b + dt*s3b
2733 SUBROUTINE h2okdis_b(ib, np, k, fkw, gkw, ne, h2oexp, h2oexpb, conexp, &
2734 & conexpb, th2o, th2ob, tcon, tconb, tran, tranb)
2737 INTEGER :: ib, ne, np, k
2738 REAL*8 :: h2oexp(0:np, 6), conexp(0:np, 3)
2739 REAL*8 :: h2oexpb(0:np, 6), conexpb(0:np, 3)
2740 REAL*8 :: fkw(6, 9), gkw(6, 3)
2742 REAL*8 :: th2o(6), tcon(3), tran
2743 REAL*8 :: th2ob(6), tconb(3), tranb
2761 th2o(1) = th2o(1)*h2oexp(k, 1)
2763 th2o(2) = th2o(2)*h2oexp(k, 2)
2765 th2o(3) = th2o(3)*h2oexp(k, 3)
2767 th2o(4) = th2o(4)*h2oexp(k, 4)
2769 th2o(5) = th2o(5)*h2oexp(k, 5)
2771 th2o(6) = th2o(6)*h2oexp(k, 6)
2773 trnth2ob = tran*tranb
2774 th2ob(1) = th2ob(1) + fkw(1, ib)*trnth2ob
2775 th2ob(2) = th2ob(2) + fkw(2, ib)*trnth2ob
2776 th2ob(3) = th2ob(3) + fkw(3, ib)*trnth2ob
2777 th2ob(4) = th2ob(4) + fkw(4, ib)*trnth2ob
2778 th2ob(5) = th2ob(5) + fkw(5, ib)*trnth2ob
2779 th2ob(6) = th2ob(6) + fkw(6, ib)*trnth2ob
2780 ELSE IF (ne .EQ. 1)
THEN 2783 tcon(1) = tcon(1)*conexp(k, 1)
2784 trnth2ob = tran*tranb
2785 tempb = tcon(1)*trnth2ob
2786 th2ob(1) = th2ob(1) + fkw(1, ib)*tempb
2787 th2ob(2) = th2ob(2) + fkw(2, ib)*tempb
2788 th2ob(3) = th2ob(3) + fkw(3, ib)*tempb
2789 th2ob(4) = th2ob(4) + fkw(4, ib)*tempb
2790 th2ob(5) = th2ob(5) + fkw(5, ib)*tempb
2791 th2ob(6) = th2ob(6) + fkw(6, ib)*tempb
2792 tconb(1) = tconb(1) + (fkw(1, ib)*th2o(1)+fkw(2, ib)*th2o(2)+fkw(3, &
2793 & ib)*th2o(3)+fkw(4, ib)*th2o(4)+fkw(5, ib)*th2o(5)+fkw(6, ib)*th2o(&
2796 conexpb(k, 1) = conexpb(k, 1) + tcon(1)*tconb(1)
2797 tconb(1) = conexp(k, 1)*tconb(1)
2801 tcon(1) = tcon(1)*conexp(k, 1)
2803 tcon(2) = tcon(2)*conexp(k, 2)
2805 tcon(3) = tcon(3)*conexp(k, 3)
2807 trnth2ob = tran*tranb
2808 tempb0 = tcon(1)*trnth2ob
2809 tempb1 = tcon(2)*trnth2ob
2810 tempb2 = tcon(3)*trnth2ob
2811 th2ob(1) = th2ob(1) + gkw(1, 3)*tempb2 + gkw(1, 2)*tempb1 + gkw(1, 1&
2813 th2ob(2) = th2ob(2) + gkw(2, 3)*tempb2 + gkw(2, 2)*tempb1 + gkw(2, 1&
2815 th2ob(3) = th2ob(3) + gkw(3, 3)*tempb2 + gkw(3, 2)*tempb1 + gkw(3, 1&
2817 th2ob(4) = th2ob(4) + gkw(4, 3)*tempb2 + gkw(4, 2)*tempb1 + gkw(4, 1&
2819 th2ob(5) = th2ob(5) + gkw(5, 3)*tempb2 + gkw(5, 2)*tempb1 + gkw(5, 1&
2821 th2ob(6) = th2ob(6) + gkw(6, 3)*tempb2 + gkw(6, 2)*tempb1 + gkw(6, 1&
2823 tconb(1) = tconb(1) + (gkw(1, 1)*th2o(1)+gkw(2, 1)*th2o(2)+gkw(3, 1)&
2824 & *th2o(3)+gkw(4, 1)*th2o(4)+gkw(5, 1)*th2o(5)+gkw(6, 1)*th2o(6))*&
2826 tconb(2) = tconb(2) + (gkw(1, 2)*th2o(1)+gkw(2, 2)*th2o(2)+gkw(3, 2)&
2827 & *th2o(3)+gkw(4, 2)*th2o(4)+gkw(5, 2)*th2o(5)+gkw(6, 2)*th2o(6))*&
2829 tconb(3) = tconb(3) + (gkw(1, 3)*th2o(1)+gkw(2, 3)*th2o(2)+gkw(3, 3)&
2830 & *th2o(3)+gkw(4, 3)*th2o(4)+gkw(5, 3)*th2o(5)+gkw(6, 3)*th2o(6))*&
2833 conexpb(k, 3) = conexpb(k, 3) + tcon(3)*tconb(3)
2834 tconb(3) = conexp(k, 3)*tconb(3)
2836 conexpb(k, 2) = conexpb(k, 2) + tcon(2)*tconb(2)
2837 tconb(2) = conexp(k, 2)*tconb(2)
2839 conexpb(k, 1) = conexpb(k, 1) + tcon(1)*tconb(1)
2840 tconb(1) = conexp(k, 1)*tconb(1)
2843 h2oexpb(k, 6) = h2oexpb(k, 6) + th2o(6)*th2ob(6)
2844 th2ob(6) = h2oexp(k, 6)*th2ob(6)
2846 h2oexpb(k, 5) = h2oexpb(k, 5) + th2o(5)*th2ob(5)
2847 th2ob(5) = h2oexp(k, 5)*th2ob(5)
2849 h2oexpb(k, 4) = h2oexpb(k, 4) + th2o(4)*th2ob(4)
2850 th2ob(4) = h2oexp(k, 4)*th2ob(4)
2852 h2oexpb(k, 3) = h2oexpb(k, 3) + th2o(3)*th2ob(3)
2853 th2ob(3) = h2oexp(k, 3)*th2ob(3)
2855 h2oexpb(k, 2) = h2oexpb(k, 2) + th2o(2)*th2ob(2)
2856 th2ob(2) = h2oexp(k, 2)*th2ob(2)
2858 h2oexpb(k, 1) = h2oexpb(k, 1) + th2o(1)*th2ob(1)
2859 th2ob(1) = h2oexp(k, 1)*th2ob(1)
2866 SUBROUTINE n2okdis_b(ib, np, k, n2oexp, n2oexpb, tn2o, tn2ob, tran, &
2869 INTEGER :: ib, np, k
2871 REAL*8 :: n2oexp(0:np, 4)
2872 REAL*8 :: n2oexpb(0:np, 4)
2874 REAL*8 :: tn2o(4), tran
2875 REAL*8 :: tn2ob(4), tranb
2886 tn2o(1) = tn2o(1)*n2oexp(k, 1)
2887 xc = 0.940414*tn2o(1)
2889 tn2o(2) = tn2o(2)*n2oexp(k, 2)
2890 xc = xc + 0.059586*tn2o(2)
2895 tn2o(1) = tn2o(1)*n2oexp(k, 1)
2896 xc = 0.561961*tn2o(1)
2898 tn2o(2) = tn2o(2)*n2oexp(k, 2)
2899 xc = xc + 0.138707*tn2o(2)
2901 tn2o(3) = tn2o(3)*n2oexp(k, 3)
2902 xc = xc + 0.240670*tn2o(3)
2904 tn2o(4) = tn2o(4)*n2oexp(k, 4)
2905 xc = xc + 0.058662*tn2o(4)
2911 IF (branch .EQ. 0)
THEN 2912 tn2ob(2) = tn2ob(2) + 0.059586*xcb
2914 n2oexpb(k, 2) = n2oexpb(k, 2) + tn2o(2)*tn2ob(2)
2915 tn2ob(2) = n2oexp(k, 2)*tn2ob(2)
2916 tn2ob(1) = tn2ob(1) + 0.940414*xcb
2918 n2oexpb(k, 1) = n2oexpb(k, 1) + tn2o(1)*tn2ob(1)
2919 tn2ob(1) = n2oexp(k, 1)*tn2ob(1)
2921 tn2ob(4) = tn2ob(4) + 0.058662*xcb
2923 n2oexpb(k, 4) = n2oexpb(k, 4) + tn2o(4)*tn2ob(4)
2924 tn2ob(4) = n2oexp(k, 4)*tn2ob(4)
2925 tn2ob(3) = tn2ob(3) + 0.240670*xcb
2927 n2oexpb(k, 3) = n2oexpb(k, 3) + tn2o(3)*tn2ob(3)
2928 tn2ob(3) = n2oexp(k, 3)*tn2ob(3)
2929 tn2ob(2) = tn2ob(2) + 0.138707*xcb
2931 n2oexpb(k, 2) = n2oexpb(k, 2) + tn2o(2)*tn2ob(2)
2932 tn2ob(2) = n2oexp(k, 2)*tn2ob(2)
2933 tn2ob(1) = tn2ob(1) + 0.561961*xcb
2935 n2oexpb(k, 1) = n2oexpb(k, 1) + tn2o(1)*tn2ob(1)
2936 tn2ob(1) = n2oexp(k, 1)*tn2ob(1)
2944 SUBROUTINE ch4kdis_b(ib, np, k, ch4exp, ch4expb, tch4, tch4b, tran, &
2947 INTEGER :: ib, np, k
2949 REAL*8 :: ch4exp(0:np, 4)
2950 REAL*8 :: ch4expb(0:np, 4)
2952 REAL*8 :: tch4(4), tran
2953 REAL*8 :: tch4b(4), tranb
2964 tch4(1) = tch4(1)*ch4exp(k, 1)
2970 tch4(1) = tch4(1)*ch4exp(k, 1)
2971 xc = 0.610650*tch4(1)
2973 tch4(2) = tch4(2)*ch4exp(k, 2)
2974 xc = xc + 0.280212*tch4(2)
2976 tch4(3) = tch4(3)*ch4exp(k, 3)
2977 xc = xc + 0.107349*tch4(3)
2979 tch4(4) = tch4(4)*ch4exp(k, 4)
2980 xc = xc + 0.001789*tch4(4)
2986 IF (branch .EQ. 0)
THEN 2987 tch4b(1) = tch4b(1) + xcb
2989 ch4expb(k, 1) = ch4expb(k, 1) + tch4(1)*tch4b(1)
2990 tch4b(1) = ch4exp(k, 1)*tch4b(1)
2992 tch4b(4) = tch4b(4) + 0.001789*xcb
2994 ch4expb(k, 4) = ch4expb(k, 4) + tch4(4)*tch4b(4)
2995 tch4b(4) = ch4exp(k, 4)*tch4b(4)
2996 tch4b(3) = tch4b(3) + 0.107349*xcb
2998 ch4expb(k, 3) = ch4expb(k, 3) + tch4(3)*tch4b(3)
2999 tch4b(3) = ch4exp(k, 3)*tch4b(3)
3000 tch4b(2) = tch4b(2) + 0.280212*xcb
3002 ch4expb(k, 2) = ch4expb(k, 2) + tch4(2)*tch4b(2)
3003 tch4b(2) = ch4exp(k, 2)*tch4b(2)
3004 tch4b(1) = tch4b(1) + 0.610650*xcb
3006 ch4expb(k, 1) = ch4expb(k, 1) + tch4(1)*tch4b(1)
3007 tch4b(1) = ch4exp(k, 1)*tch4b(1)
3015 SUBROUTINE comkdis_b(ib, np, k, comexp, comexpb, tcom, tcomb, tran, &
3018 INTEGER :: ib, np, k
3020 REAL*8 :: comexp(0:np, 6)
3021 REAL*8 :: comexpb(0:np, 6)
3023 REAL*8 :: tcom(6), tran
3024 REAL*8 :: tcomb(6), tranb
3035 tcom(1) = tcom(1)*comexp(k, 1)
3036 xc = 0.12159*tcom(1)
3038 tcom(2) = tcom(2)*comexp(k, 2)
3039 xc = xc + 0.24359*tcom(2)
3041 tcom(3) = tcom(3)*comexp(k, 3)
3042 xc = xc + 0.24981*tcom(3)
3044 tcom(4) = tcom(4)*comexp(k, 4)
3045 xc = xc + 0.26427*tcom(4)
3047 tcom(5) = tcom(5)*comexp(k, 5)
3048 xc = xc + 0.07807*tcom(5)
3050 tcom(6) = tcom(6)*comexp(k, 6)
3051 xc = xc + 0.04267*tcom(6)
3056 tcom(1) = tcom(1)*comexp(k, 1)
3057 xc = 0.06869*tcom(1)
3059 tcom(2) = tcom(2)*comexp(k, 2)
3060 xc = xc + 0.14795*tcom(2)
3062 tcom(3) = tcom(3)*comexp(k, 3)
3063 xc = xc + 0.19512*tcom(3)
3065 tcom(4) = tcom(4)*comexp(k, 4)
3066 xc = xc + 0.33446*tcom(4)
3068 tcom(5) = tcom(5)*comexp(k, 5)
3069 xc = xc + 0.17199*tcom(5)
3071 tcom(6) = tcom(6)*comexp(k, 6)
3072 xc = xc + 0.08179*tcom(6)
3078 IF (branch .EQ. 0)
THEN 3079 tcomb(6) = tcomb(6) + 0.04267*xcb
3081 comexpb(k, 6) = comexpb(k, 6) + tcom(6)*tcomb(6)
3082 tcomb(6) = comexp(k, 6)*tcomb(6)
3083 tcomb(5) = tcomb(5) + 0.07807*xcb
3085 comexpb(k, 5) = comexpb(k, 5) + tcom(5)*tcomb(5)
3086 tcomb(5) = comexp(k, 5)*tcomb(5)
3087 tcomb(4) = tcomb(4) + 0.26427*xcb
3089 comexpb(k, 4) = comexpb(k, 4) + tcom(4)*tcomb(4)
3090 tcomb(4) = comexp(k, 4)*tcomb(4)
3091 tcomb(3) = tcomb(3) + 0.24981*xcb
3093 comexpb(k, 3) = comexpb(k, 3) + tcom(3)*tcomb(3)
3094 tcomb(3) = comexp(k, 3)*tcomb(3)
3095 tcomb(2) = tcomb(2) + 0.24359*xcb
3097 comexpb(k, 2) = comexpb(k, 2) + tcom(2)*tcomb(2)
3098 tcomb(2) = comexp(k, 2)*tcomb(2)
3099 tcomb(1) = tcomb(1) + 0.12159*xcb
3101 comexpb(k, 1) = comexpb(k, 1) + tcom(1)*tcomb(1)
3102 tcomb(1) = comexp(k, 1)*tcomb(1)
3104 tcomb(6) = tcomb(6) + 0.08179*xcb
3106 comexpb(k, 6) = comexpb(k, 6) + tcom(6)*tcomb(6)
3107 tcomb(6) = comexp(k, 6)*tcomb(6)
3108 tcomb(5) = tcomb(5) + 0.17199*xcb
3110 comexpb(k, 5) = comexpb(k, 5) + tcom(5)*tcomb(5)
3111 tcomb(5) = comexp(k, 5)*tcomb(5)
3112 tcomb(4) = tcomb(4) + 0.33446*xcb
3114 comexpb(k, 4) = comexpb(k, 4) + tcom(4)*tcomb(4)
3115 tcomb(4) = comexp(k, 4)*tcomb(4)
3116 tcomb(3) = tcomb(3) + 0.19512*xcb
3118 comexpb(k, 3) = comexpb(k, 3) + tcom(3)*tcomb(3)
3119 tcomb(3) = comexp(k, 3)*tcomb(3)
3120 tcomb(2) = tcomb(2) + 0.14795*xcb
3122 comexpb(k, 2) = comexpb(k, 2) + tcom(2)*tcomb(2)
3123 tcomb(2) = comexp(k, 2)*tcomb(2)
3124 tcomb(1) = tcomb(1) + 0.06869*xcb
3126 comexpb(k, 1) = comexpb(k, 1) + tcom(1)*tcomb(1)
3127 tcomb(1) = comexp(k, 1)*tcomb(1)
3135 SUBROUTINE cfckdis_b(np, k, cfcexp, cfcexpb, tcfc, tcfcb, tran, tranb)
3139 REAL*8 :: cfcexp(0:np)
3140 REAL*8 :: cfcexpb(0:np)
3142 REAL*8 :: tcfc, tran
3143 REAL*8 :: tcfcb, tranb
3146 tcfc = tcfc*cfcexp(k)
3147 tcfcb = tcfcb + tran*tranb
3150 cfcexpb(k) = cfcexpb(k) + tcfc*tcfcb
3151 tcfcb = cfcexp(k)*tcfcb
3160 SUBROUTINE b10kdis_b(np, k, h2oexp, h2oexpb, conexp, conexpb, co2exp, &
3161 & co2expb, n2oexp, n2oexpb, th2o, th2ob, tcon, tconb, tco2, tco2b, tn2o&
3162 & , tn2ob, tran, tranb)
3166 REAL*8 :: h2oexp(0:np, 5), conexp(0:np), co2exp(0:np, 6), n2oexp(0:np&
3168 REAL*8 :: h2oexpb(0:np, 5), conexpb(0:np), co2expb(0:np, 6), n2oexpb(0&
3171 REAL*8 :: th2o(6), tcon(3), tco2(6), tn2o(4), tran
3172 REAL*8 :: th2ob(6), tconb(3), tco2b(6), tn2ob(4), tranb
3178 th2o(1) = th2o(1)*h2oexp(k, 1)
3181 th2o(2) = th2o(2)*h2oexp(k, 2)
3182 xx = xx + 0.4604*th2o(2)
3184 th2o(3) = th2o(3)*h2oexp(k, 3)
3185 xx = xx + 0.1326*th2o(3)
3187 th2o(4) = th2o(4)*h2oexp(k, 4)
3188 xx = xx + 0.0798*th2o(4)
3190 th2o(5) = th2o(5)*h2oexp(k, 5)
3191 xx = xx + 0.0119*th2o(5)
3195 tcon(1) = tcon(1)*conexp(k)
3200 tco2(1) = tco2(1)*co2exp(k, 1)
3203 tco2(2) = tco2(2)*co2exp(k, 2)
3204 xx = xx + 0.2201*tco2(2)
3206 tco2(3) = tco2(3)*co2exp(k, 3)
3207 xx = xx + 0.2106*tco2(3)
3209 tco2(4) = tco2(4)*co2exp(k, 4)
3210 xx = xx + 0.2409*tco2(4)
3212 tco2(5) = tco2(5)*co2exp(k, 5)
3213 xx = xx + 0.0196*tco2(5)
3215 tco2(6) = tco2(6)*co2exp(k, 6)
3216 xx = xx + 0.0415*tco2(6)
3221 tn2o(1) = tn2o(1)*n2oexp(k, 1)
3223 xx = 0.970831*tn2o(1)
3225 tn2o(2) = tn2o(2)*n2oexp(k, 2)
3226 xx = xx + 0.029169*tn2o(2)
3228 tranb = (xx-1.0)*tranb
3229 tn2ob(2) = tn2ob(2) + 0.029169*xxb
3231 n2oexpb(k, 2) = n2oexpb(k, 2) + tn2o(2)*tn2ob(2)
3232 tn2ob(2) = n2oexp(k, 2)*tn2ob(2)
3234 tn2ob(1) = tn2ob(1) + 0.970831*xxb
3236 n2oexpb(k, 1) = n2oexpb(k, 1) + tn2o(1)*tn2ob(1)
3237 tn2ob(1) = n2oexp(k, 1)*tn2ob(1)
3241 tco2b(6) = tco2b(6) + 0.0415*xxb
3243 co2expb(k, 6) = co2expb(k, 6) + tco2(6)*tco2b(6)
3244 tco2b(6) = co2exp(k, 6)*tco2b(6)
3245 tco2b(5) = tco2b(5) + 0.0196*xxb
3247 co2expb(k, 5) = co2expb(k, 5) + tco2(5)*tco2b(5)
3248 tco2b(5) = co2exp(k, 5)*tco2b(5)
3249 tco2b(4) = tco2b(4) + 0.2409*xxb
3251 co2expb(k, 4) = co2expb(k, 4) + tco2(4)*tco2b(4)
3252 tco2b(4) = co2exp(k, 4)*tco2b(4)
3253 tco2b(3) = tco2b(3) + 0.2106*xxb
3255 co2expb(k, 3) = co2expb(k, 3) + tco2(3)*tco2b(3)
3256 tco2b(3) = co2exp(k, 3)*tco2b(3)
3257 tco2b(2) = tco2b(2) + 0.2201*xxb
3259 co2expb(k, 2) = co2expb(k, 2) + tco2(2)*tco2b(2)
3260 tco2b(2) = co2exp(k, 2)*tco2b(2)
3261 tco2b(1) = tco2b(1) + 0.2673*xxb
3263 co2expb(k, 1) = co2expb(k, 1) + tco2(1)*tco2b(1)
3264 tco2b(1) = co2exp(k, 1)*tco2b(1)
3266 tconb(1) = tconb(1) + tran*tranb
3267 tranb = tcon(1)*tranb
3269 conexpb(k) = conexpb(k) + tcon(1)*tconb(1)
3270 tconb(1) = conexp(k)*tconb(1)
3272 th2ob(5) = th2ob(5) + 0.0119*xxb
3274 h2oexpb(k, 5) = h2oexpb(k, 5) + th2o(5)*th2ob(5)
3275 th2ob(5) = h2oexp(k, 5)*th2ob(5)
3276 th2ob(4) = th2ob(4) + 0.0798*xxb
3278 h2oexpb(k, 4) = h2oexpb(k, 4) + th2o(4)*th2ob(4)
3279 th2ob(4) = h2oexp(k, 4)*th2ob(4)
3280 th2ob(3) = th2ob(3) + 0.1326*xxb
3282 h2oexpb(k, 3) = h2oexpb(k, 3) + th2o(3)*th2ob(3)
3283 th2ob(3) = h2oexp(k, 3)*th2ob(3)
3284 th2ob(2) = th2ob(2) + 0.4604*xxb
3286 h2oexpb(k, 2) = h2oexpb(k, 2) + th2o(2)*th2ob(2)
3287 th2ob(2) = h2oexp(k, 2)*th2ob(2)
3288 th2ob(1) = th2ob(1) + 0.3153*xxb
3290 h2oexpb(k, 1) = h2oexpb(k, 1) + th2o(1)*th2ob(1)
3291 th2ob(1) = h2oexp(k, 1)*th2ob(1)
3299 SUBROUTINE cldovlp_b(np, k1, k2, ict, icb, icx, ncld, enn, ennb, ett, &
3300 & ettb, cldhi, cldhib, cldmd, cldmdb, cldlw, cldlwb)
3302 INTEGER,
INTENT(IN) :: np, k1, k2, ict, icb, icx(0:np), ncld(3)
3303 REAL*8,
INTENT(IN) :: enn(0:np), ett(0:np)
3304 REAL*8 :: ennb(0:np), ettb(0:np)
3305 REAL*8,
INTENT(INOUT) :: cldhi, cldmd, cldlw
3306 REAL*8 :: cldhib, cldmdb, cldlwb
3307 INTEGER :: j, k, km, kx
3310 IF (km .LT. ict)
THEN 3313 IF (kx .EQ. 1 .OR. cldhi .EQ. 0.)
THEN 3314 ennb(km) = ennb(km) + cldhib
3322 IF (j .GE. k1 .AND. j .LE. km)
THEN 3324 cldhi = enn(j) + ett(j)*cldhi
3330 DO k=ict-1,ict-kx,-1
3332 IF (branch .NE. 0)
THEN 3335 ennb(j) = ennb(j) + cldhib
3336 ettb(j) = ettb(j) + cldhi*cldhib
3337 cldhib = ett(j)*cldhib
3344 ELSE IF (km .GE. ict .AND. km .LT. icb)
THEN 3347 IF (kx .EQ. 1 .OR. cldmd .EQ. 0.)
THEN 3348 ennb(km) = ennb(km) + cldmdb
3356 IF (j .GE. k1 .AND. j .LE. km)
THEN 3358 cldmd = enn(j) + ett(j)*cldmd
3364 DO k=icb-1,icb-kx,-1
3366 IF (branch .NE. 0)
THEN 3369 ennb(j) = ennb(j) + cldmdb
3370 ettb(j) = ettb(j) + cldmd*cldmdb
3371 cldmdb = ett(j)*cldmdb
3381 IF (kx .EQ. 1 .OR. cldlw .EQ. 0.)
THEN 3382 ennb(km) = ennb(km) + cldlwb
3390 IF (j .GE. k1 .AND. j .LE. km)
THEN 3392 cldlw = enn(j) + ett(j)*cldlw
3400 IF (branch .NE. 0)
THEN 3403 ennb(j) = ennb(j) + cldlwb
3404 ettb(j) = ettb(j) + cldlw*cldlwb
3405 cldlwb = ett(j)*cldlwb
3420 SUBROUTINE getirtau1_b(ib, nlevs, dp, fcld, fcldb, reff, reffb, &
3421 & hydromets, hydrometsb, tcldlyr, tcldlyrb, enn, ennb, aib_ir1, awb_ir1&
3422 & , aiw_ir1, aww_ir1, aig_ir1, awg_ir1, cons_grav)
3426 INTEGER,
INTENT(IN) :: ib
3428 INTEGER,
INTENT(IN) :: nlevs
3430 REAL*8,
INTENT(IN) :: dp(nlevs)
3432 REAL*8,
INTENT(IN) :: fcld(nlevs)
3433 REAL*8 :: fcldb(nlevs)
3435 REAL*8,
INTENT(IN) :: reff(nlevs, 4)
3436 REAL*8 :: reffb(nlevs, 4)
3438 REAL*8,
INTENT(IN) :: hydromets(nlevs, 4)
3439 REAL*8 :: hydrometsb(nlevs, 4)
3440 REAL*8,
INTENT(IN) :: aib_ir1(3, 10), awb_ir1(4, 10), aiw_ir1(4, 10)
3441 REAL*8,
INTENT(IN) :: aww_ir1(4, 10), aig_ir1(4, 10), awg_ir1(4, 10)
3442 REAL*8,
INTENT(IN) :: cons_grav
3445 REAL*8 :: tcldlyr(0:nlevs)
3446 REAL*8 :: tcldlyrb(0:nlevs)
3448 REAL*8 :: enn(0:nlevs)
3449 REAL*8 :: ennb(0:nlevs)
3469 REAL*8 :: taucld1, taucld2, taucld3, taucld4
3470 REAL*8 :: taucld1b, taucld2b, taucld3b, taucld4b
3471 REAL*8 :: g1, g2, g3, g4, gg
3472 REAL*8 :: g1b, g2b, g3b, g4b, ggb
3473 REAL*8 :: w1, w2, w3, w4, ww
3474 REAL*8 :: w1b, w2b, w3b, w4b, wwb
3476 REAL*8 :: ffb, taucb
3478 REAL*8 :: reff_snowb
3523 IF (reff(k, 1) .LE. 0.0)
THEN 3529 taucld1 = dp(k)*1.0e3/cons_grav*hydromets(k, 1)*(aib_ir1(1, ib)+&
3530 & aib_ir1(2, ib)/reff(k, 1)**aib_ir1(3, ib))
3534 taucld2 = dp(k)*1.0e3/cons_grav*hydromets(k, 2)*(awb_ir1(1, ib)+(&
3535 & awb_ir1(2, ib)+(awb_ir1(3, ib)+awb_ir1(4, ib)*reff(k, 2))*reff(k, &
3537 taucld3 = 0.00307*(dp(k)*1.0e3/cons_grav*hydromets(k, 3))
3538 IF (reff(k, 4) .GT. 112.0)
THEN 3544 reff_snow = reff(k, 4)
3547 IF (reff_snow .LE. 0.0)
THEN 3553 taucld4 = dp(k)*1.0e3/cons_grav*hydromets(k, 4)*(aib_ir1(1, ib)+&
3554 & aib_ir1(2, ib)/reff_snow**aib_ir1(3, ib))
3564 tauc = taucld1 + taucld2 + taucld3 + taucld4
3565 IF (tauc .GT. 0.02 .AND. fcld(k) .GT. 0.01)
THEN 3567 w1 = taucld1*(aiw_ir1(1, ib)+(aiw_ir1(2, ib)+(aiw_ir1(3, ib)+&
3568 & aiw_ir1(4, ib)*reff(k, 1))*reff(k, 1))*reff(k, 1))
3570 w2 = taucld2*(aww_ir1(1, ib)+(aww_ir1(2, ib)+(aww_ir1(3, ib)+&
3571 & aww_ir1(4, ib)*reff(k, 2))*reff(k, 2))*reff(k, 2))
3574 w4 = taucld4*(aiw_ir1(1, ib)+(aiw_ir1(2, ib)+(aiw_ir1(3, ib)+&
3575 & aiw_ir1(4, ib)*reff_snow)*reff_snow)*reff_snow)
3576 ww = (w1+w2+w3+w4)/tauc
3578 g1 = w1*(aig_ir1(1, ib)+(aig_ir1(2, ib)+(aig_ir1(3, ib)+aig_ir1(4&
3579 & , ib)*reff(k, 1))*reff(k, 1))*reff(k, 1))
3581 g2 = w2*(awg_ir1(1, ib)+(awg_ir1(2, ib)+(awg_ir1(3, ib)+awg_ir1(4&
3582 & , ib)*reff(k, 2))*reff(k, 2))*reff(k, 2))
3585 g4 = w4*(aig_ir1(1, ib)+(aig_ir1(2, ib)+(aig_ir1(3, ib)+aig_ir1(4&
3586 & , ib)*reff_snow)*reff_snow)*reff_snow)
3587 IF (w1 + w2 + w3 + w4 .GE. 0.)
THEN 3588 abs0 = w1 + w2 + w3 + w4
3590 abs0 = -(w1+w2+w3+w4)
3592 IF (abs0 .GT. 0.0)
THEN 3594 gg = (g1+g2+g3+g4)/(w1+w2+w3+w4)
3603 ff = 0.5 + (0.3739+(0.0076+0.1185*gg)*gg)*gg
3604 IF (1. - ww*ff .LT. 0.0)
THEN 3619 tcldlyr(k) = exp(-(1.66*tauc))
3628 IF (branch .EQ. 0)
THEN 3638 fcldb(k) = fcldb(k) + (1.0-tcldlyr(k))*ennb(k)
3639 tcldlyrb(k) = tcldlyrb(k) - fcld(k)*ennb(k)
3642 taucb = -(exp(-(1.66*tauc))*1.66*tcldlyrb(k))
3647 taucld3 = 0.00307*(dp(k)*1.0e3/cons_grav*hydromets(k, 3))
3649 ww = (w1+w2+w3+w4)/tauc
3650 ff = 0.5 + (0.3739+(0.0076+0.1185*gg)*gg)*gg
3652 IF (branch .EQ. 0)
THEN 3661 ggb = ((0.1185*gg+0.0076)*gg+gg*(0.1185*gg+0.0076)+gg**2*0.1185+&
3665 IF (branch .EQ. 0)
THEN 3677 tempb11 = ggb/(w1+w2+w3+w4)
3678 tempb12 = -((g1+g2+g3+g4)*tempb11/(w1+w2+w3+w4))
3690 temp16 = aig_ir1(3, ib) + aig_ir1(4, ib)*reff_snow
3691 temp15 = aig_ir1(2, ib) + temp16*reff_snow
3693 w4b = w4b + tempb5 + (aig_ir1(1, ib)+temp15*reff_snow)*g4b
3694 w3b = w3b + tempb5 + 0.95*g3b
3696 temp14 = awg_ir1(3, ib) + awg_ir1(4, ib)*reff(k, 2)
3697 temp13 = awg_ir1(2, ib) + temp14*reff(k, 2)
3698 tempb7 = w2*reff(k, 2)*g2b
3699 w2b = w2b + tempb5 + (awg_ir1(1, ib)+temp13*reff(k, 2))*g2b
3700 reffb(k, 2) = reffb(k, 2) + w2*temp13*g2b + (temp14+reff(k, 2)*&
3701 & awg_ir1(4, ib))*tempb7
3703 temp12 = aig_ir1(3, ib) + aig_ir1(4, ib)*reff(k, 1)
3704 temp11 = aig_ir1(2, ib) + temp12*reff(k, 1)
3705 tempb8 = w1*reff(k, 1)*g1b
3706 w1b = w1b + tempb5 + (aig_ir1(1, ib)+temp11*reff(k, 1))*g1b
3707 reffb(k, 1) = reffb(k, 1) + w1*temp11*g1b + (temp12+reff(k, 1)*&
3708 & aig_ir1(4, ib))*tempb8
3709 taucb = taucb - (w1+w2+w3+w4)*tempb5/tauc
3711 temp10 = aiw_ir1(3, ib) + aiw_ir1(4, ib)*reff_snow
3712 temp9 = aiw_ir1(2, ib) + temp10*reff_snow
3713 tempb6 = taucld4*w4b
3714 reff_snowb = (temp9+reff_snow*temp10+reff_snow**2*aiw_ir1(4, ib))*&
3715 & tempb6 + (temp15+reff_snow*temp16+reff_snow**2*aig_ir1(4, ib))*&
3717 taucld4b = (aiw_ir1(1, ib)+temp9*reff_snow)*w4b
3720 temp8 = aww_ir1(3, ib) + aww_ir1(4, ib)*reff(k, 2)
3721 temp7 = aww_ir1(2, ib) + temp8*reff(k, 2)
3722 tempb9 = taucld2*reff(k, 2)*w2b
3723 taucld2b = (aww_ir1(1, ib)+temp7*reff(k, 2))*w2b
3724 reffb(k, 2) = reffb(k, 2) + taucld2*temp7*w2b + (temp8+reff(k, 2)*&
3725 & aww_ir1(4, ib))*tempb9
3727 temp6 = aiw_ir1(3, ib) + aiw_ir1(4, ib)*reff(k, 1)
3728 temp5 = aiw_ir1(2, ib) + temp6*reff(k, 1)
3729 tempb10 = taucld1*reff(k, 1)*w1b
3730 taucld1b = (aiw_ir1(1, ib)+temp5*reff(k, 1))*w1b
3731 reffb(k, 1) = reffb(k, 1) + taucld1*temp5*w1b + (temp6+reff(k, 1)*&
3732 & aiw_ir1(4, ib))*tempb10
3735 taucld1b = taucld1b + taucb
3736 taucld2b = taucld2b + taucb
3737 taucld3b = taucld3b + taucb
3738 taucld4b = taucld4b + taucb
3740 IF (branch .EQ. 0)
THEN 3744 temp4 = reff_snow**aib_ir1(3, ib)
3745 temp3 = aib_ir1(2, ib)/temp4
3746 tempb3 = dp(k)*1.0e3*taucld4b
3747 hydrometsb(k, 4) = hydrometsb(k, 4) + (aib_ir1(1, ib)+temp3)*&
3749 IF (.NOT.(reff_snow .LE. 0.0 .AND. (aib_ir1(3, ib) .EQ. 0.0 .OR. &
3750 & aib_ir1(3, ib) .NE. int(aib_ir1(3, ib))))) reff_snowb = &
3751 & reff_snowb - temp3*hydromets(k, 4)*aib_ir1(3, ib)*reff_snow**(&
3752 & aib_ir1(3, ib)-1)*tempb3/(temp4*cons_grav)
3755 IF (branch .EQ. 0)
THEN 3759 reffb(k, 4) = reffb(k, 4) + reff_snowb
3761 hydrometsb(k, 3) = hydrometsb(k, 3) + dp(k)*1.0e3*0.00307*taucld3b/&
3764 temp2 = awb_ir1(3, ib) + awb_ir1(4, ib)*reff(k, 2)
3765 temp1 = awb_ir1(2, ib) + temp2*reff(k, 2)
3766 tempb0 = dp(k)*1.0e3*taucld2b
3767 tempb1 = hydromets(k, 2)*tempb0/cons_grav
3768 tempb2 = reff(k, 2)*tempb1
3769 hydrometsb(k, 2) = hydrometsb(k, 2) + (awb_ir1(1, ib)+temp1*reff(k, &
3770 & 2))*tempb0/cons_grav
3771 reffb(k, 2) = reffb(k, 2) + temp1*tempb1 + (temp2+reff(k, 2)*awb_ir1&
3774 IF (branch .EQ. 0)
THEN 3776 temp0 = reff(k, 1)**aib_ir1(3, ib)
3777 temp = aib_ir1(2, ib)/temp0
3778 tempb = dp(k)*1.0e3*taucld1b
3779 hydrometsb(k, 1) = hydrometsb(k, 1) + (aib_ir1(1, ib)+temp)*tempb/&
3781 IF (.NOT.(reff(k, 1) .LE. 0.0 .AND. (aib_ir1(3, ib) .EQ. 0.0 .OR. &
3782 & aib_ir1(3, ib) .NE. int(aib_ir1(3, ib))))) reffb(k, 1) = reffb&
3783 & (k, 1) - temp*hydromets(k, 1)*aib_ir1(3, ib)*reff(k, 1)**(&
3784 & aib_ir1(3, ib)-1)*tempb/(temp0*cons_grav)
subroutine, public b10exps(np, dh2o, dcont, dco2, dn2o, pa, dt, h2oexp, conexp, co2exp, n2oexp)
subroutine, public h2okdis(ib, np, k, fkw, gkw, ne, h2oexp, conexp, th2o, tcon, tran)
subroutine popinteger4(x)
subroutine b10kdis_b(np, k, h2oexp, h2oexpb, conexp, conexpb, co2exp, co2expb, n2oexp, n2oexpb, th2o, th2ob, tcon, tconb, tco2, tco2b, tn2o, tn2ob, tran, tranb)
subroutine popcontrol2b(cc)
subroutine, public ch4exps(ib, np, dch4, pa, dt, ch4exp)
subroutine, public cfckdis(np, k, cfcexp, tcfc, tran)
subroutine, public ch4kdis(ib, np, k, ch4exp, tch4, tran)
void popinteger4array(int *x, int n)
void popreal8array(double *x, int n)
subroutine, public cfcexps(ib, np, a1, b1, fk1, a2, b2, fk2, dcfc, dt, cfcexp)
integer, parameter, public ip
subroutine, public n2oexps(ib, np, dn2o, pa, dt, n2oexp)
subroutine, public n2okdis(ib, np, k, n2oexp, tn2o, tran)
subroutine, public comexps(ib, np, dcom, dt, comexp)
subroutine pushcontrol1b(cc)
subroutine, public cldovlp(np, k1, k2, ict, icb, icx, ncld, enn, ett, cldhi, cldmd, cldlw)
subroutine, public planck(ibn, cb, t, xlayer)
subroutine tablup_b(nx1, nh1, dw, dwb, p, dt, dtb, s1, s1b, s2, s2b, s3, s3b, w1, p1, dwe, dpe, coef1, coef2, coef3, tran, tranb)
subroutine, public conexps(ib, np, dcont, xke, conexp)
subroutine planck_b(ibn, cb, t, tb, xlayer, xlayerb)
void pushinteger4array(int *x, int n)
subroutine pushcontrol2b(cc)
subroutine n2oexps_b(ib, np, dn2o, pa, dt, dtb, n2oexp, n2oexpb)
void pushreal8array(double *x, int n)
subroutine cfcexps_b(ib, np, a1, b1, fk1, a2, b2, fk2, dcfc, dt, dtb, cfcexp, cfcexpb)
subroutine, public h2oexps(ib, np, dh2o, pa, dt, xkw, aw, bw, pm, mw, h2oexp)
subroutine conexps_b(ib, np, dcont, dcontb, xke, conexp, conexpb)
subroutine, public tablup(nx1, nh1, dw, p, dt, s1, s2, s3, w1, p1, dwe, dpe, coef1, coef2, coef3, tran)
subroutine, public sfcflux(ibn, cb, dcb, ns, fs, tg, eg, tv, ev, rv, bs, dbs, rflxs)
subroutine b10exps_b(np, dh2o, dh2ob, dcont, dcontb, dco2, dn2o, pa, dt, dtb, h2oexp, h2oexpb, conexp, conexpb, co2exp, co2expb, n2oexp, n2oexpb)
subroutine comexps_b(ib, np, dcom, dt, dtb, comexp, comexpb)
subroutine cldovlp_b(np, k1, k2, ict, icb, icx, ncld, enn, ennb, ett, ettb, cldhi, cldhib, cldmd, cldmdb, cldlw, cldlwb)
subroutine, public getirtau1(ib, nlevs, dp, fcld, reff, hydromets, tcldlyr, enn, aib_ir1, awb_ir1, aiw_ir1, aww_ir1, aig_ir1, awg_ir1, CONS_GRAV)
subroutine, public b10kdis(np, k, h2oexp, conexp, co2exp, n2oexp, th2o, tcon, tco2, tn2o, tran)
subroutine comkdis_b(ib, np, k, comexp, comexpb, tcom, tcomb, tran, tranb)
subroutine getirtau1_b(ib, nlevs, dp, fcld, fcldb, reff, reffb, hydromets, hydrometsb, tcldlyr, tcldlyrb, enn, ennb, aib_ir1, awb_ir1, aiw_ir1, aww_ir1, aig_ir1, awg_ir1, cons_grav)
subroutine popcontrol1b(cc)
subroutine h2oexps_b(ib, np, dh2o, dh2ob, pa, dt, dtb, xkw, aw, bw, pm, mw, h2oexp, h2oexpb)
subroutine ch4exps_b(ib, np, dch4, pa, dt, dtb, ch4exp, ch4expb)
subroutine n2okdis_b(ib, np, k, n2oexp, n2oexpb, tn2o, tn2ob, tran, tranb)
subroutine popcontrol4b(cc)
subroutine, public comkdis(ib, np, k, comexp, tcom, tran)
subroutine h2okdis_b(ib, np, k, fkw, gkw, ne, h2oexp, h2oexpb, conexp, conexpb, th2o, th2ob, tcon, tconb, tran, tranb)
subroutine cfckdis_b(np, k, cfcexp, cfcexpb, tcfc, tcfcb, tran, tranb)
subroutine, public irrad_b(np, ple_dev, ta_dev, ta_devb, wa_dev, wa_devb, oa_dev, oa_devb, tb_dev, tb_devb, co2, trace, n2o_dev, ch4_dev, cfc11_dev, cfc12_dev, cfc22_dev, cwc_dev, cwc_devb, fcld_dev, fcld_devb, ict, icb, reff_dev, reff_devb, ns, fs_dev, tg_dev, eg_dev, tv_dev, ev_dev, rv_dev, na, nb, taua_dev, taua_devb, ssaa_dev, ssaa_devb, asya_dev, asya_devb, flxu_dev, flxu_devb, flxd_dev, flxd_devb, dfdts_dev, dfdts_devb, 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 pushcontrol4b(cc)
subroutine ch4kdis_b(ib, np, k, ch4exp, ch4expb, tch4, tch4b, tran, tranb)
subroutine, public mkicx(np, ict, icb, enn, icx, ncld)
subroutine pushinteger4(x)