Skip to content

Commit ea7aa78

Browse files
committed
reorder the optical properties just like the bands
1 parent 7a0e51e commit ea7aa78

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

components/eam/src/physics/cam/modal_aer_opt.F90

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ subroutine modal_aero_sw(list_idx, dt, state, pbuf, nnite, idxnite, is_cmip6_vol
534534

535535
! Local variables
536536
integer :: i, ifld, isw, k, l, m, nc, ns, ilev_tropp
537+
integer :: isw_p
537538
integer :: lchnk ! chunk id
538539
integer :: ncol ! number of active columns in the chunk
539540
integer :: nmodes
@@ -1238,22 +1239,37 @@ subroutine modal_aero_sw(list_idx, dt, state, pbuf, nnite, idxnite, is_cmip6_vol
12381239
wa(i,k,isw) = wa(i,k,isw) + dopaer(i)*palb(i)
12391240
ga(i,k,isw) = ga(i,k,isw) + dopaer(i)*palb(i)*pasm(i)
12401241
fa(i,k,isw) = fa(i,k,isw) + dopaer(i)*palb(i)*pasm(i)*pasm(i)
1241-
aertaubndsw(i,k,isw) = tauxar(i,k,isw)
1242-
if (tauxar(i,k,isw) > 0._r8) then
1243-
aerssabndsw(i,k,isw) = wa(i,k,isw)/tauxar(i,k,isw)
1242+
end do
1243+
1244+
end do ! pver
1245+
1246+
end do ! sw bands
1247+
1248+
do isw = 1, nswbands
1249+
! For RRTMGP-specific output, reorder the RRTMG bands, such that
1250+
! isw becomes RRTMGP and isw_p becomes RRTMG argument ---
1251+
! an example, for isw=1 (RRTMGP), use isw_p=14 (RRTMG).
1252+
if (output_aer_props_rrtmgp == 1) then
1253+
isw_p = rrtmg_to_rrtmgp_swbands(isw)
1254+
else
1255+
isw_p = isw
1256+
end if
1257+
do k = top_lev, pver
1258+
do i = 1, ncol
1259+
aertaubndsw(i,k,isw) = tauxar(i,k,isw_p)
1260+
if (tauxar(i,k,isw_p) > 0._r8) then
1261+
aerssabndsw(i,k,isw) = wa(i,k,isw_p)/tauxar(i,k,isw_p)
12441262
else
12451263
aerssabndsw(i,k,isw) = 1._r8
12461264
end if
1247-
if (wa(i,k,isw) > 0._r8) then
1248-
aerasmbndsw(i,k,isw) = ga(i,k,isw)/wa(i,k,isw)
1265+
if (wa(i,k,isw_p) > 0._r8) then
1266+
aerasmbndsw(i,k,isw) = ga(i,k,isw_p)/wa(i,k,isw_p)
12491267
else
12501268
aerasmbndsw(i,k,isw) = 0._r8
12511269
end if
1252-
end do
1253-
1254-
end do ! pver
1255-
1256-
end do ! sw bands
1270+
end do ! 1, ncol
1271+
end do ! top_lev, pver
1272+
end do ! 1, nswbands
12571273

12581274
! mode diagnostics
12591275
! The diagnostics are currently only output for the climate list. Code mods will

0 commit comments

Comments
 (0)