Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[submodule "atmos_phys"]
path = src/atmos_phys
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_19_001
fxtag = atmos_phys0_20_000
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics

Expand Down
72 changes: 72 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,75 @@
===============================================================

Tag name: cam6_4_137
Originator(s): peverwhee
Date: Dec 19, 2025
One-line Summary: Incorporate final RRTMGP mods to complete CPU-ized ccppization
Github PR URL: https://github.com/ESCOMP/CAM/pull/1424

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- Brings in latest atmospheric physics tag, which contains all fortran and
metadata for RRTMGP schemes
- Add missing snapshot field (cam_out%flwds)
- Modify constituents stubs to include new necessary interfaces so schemes can
build

Describe any changes made to build system: N/A

Describe any changes made to the namelist: N/A

List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes: N/A

Code reviewed by: nusbaume

List all files eliminated:
D utils/cam_ccpp/machine.F90
- using ccpp_kinds instead

List all files added and what they do:
A utils/cam_ccpp/ccpp_scheme_utils.F90
- stubs so the interstitial CAM-SIMA schemes will build

List all existing files that have been modified, and describe the changes:
M .gitmodules
M src/atmos_phys
M src/physics/rrtmgp/radiation.F90
M src/physics/cam/radheat.F90
M src/utils/cam_ccpp/ccpp_constituent_prop_mod.F90
- Bring in updated atmos_phys tag; bring in mods to constituent utils and
rrtmgp interfaces

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam: all b4b
SMS_D_Ln9_P1536x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
- intermittent failure in CTSM code (lnd_set_decomp_and_domain.F90)
- This test passed on the first try during this run.

derecho/nvhpc/aux_cam:
FAIL ERS_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_nvhpc.cam-outfrq9s_gpu_default
-pre-existing failure -- exceeds wallclock time limit
NOTE: Jian has determined this is due to changes on derecho with the the last upgrade.
He has reported the issue to CISL. Note cam6_4_128 is the last CAM tag with
baselines to use for comparison but answer changes are expected starting with
cam6_4_130.

izumi/nag/aux_cam: all b4b

izumi/gnu/aux_cam: all b4b

Summarize any changes to answers, i.e.,
- what code configurations: All which use moving mountain gravity wave
- what platforms/compilers: all
- nature of change (roundoff; larger than roundoff but same climate; new
climate):

If bitwise differences were observed, how did you show they were no worse
than roundoff?

===============================================================

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_phys
Submodule atmos_phys updated 80 files
+421 −0 schemes/radiation_utils/solar_irradiance_data.F90
+223 −0 schemes/radiation_utils/solar_irradiance_data.meta
+157 −0 schemes/radiation_utils/solar_irradiance_data_namelist.xml
+2 −1 schemes/rrtmgp/objects/ccpp_fluxes.meta
+1 −1 schemes/rrtmgp/objects/ccpp_fluxes_byband.meta
+1 −1 schemes/rrtmgp/objects/ccpp_gas_concentrations.meta
+5 −1 schemes/rrtmgp/objects/ccpp_gas_optics_rrtmgp.meta
+4 −1 schemes/rrtmgp/objects/ccpp_optical_props.meta
+1 −1 schemes/rrtmgp/objects/ccpp_source_functions.meta
+166 −0 schemes/rrtmgp/rrtmgp_constituents.F90
+65 −0 schemes/rrtmgp/rrtmgp_constituents.meta
+105 −0 schemes/rrtmgp/rrtmgp_constituents_namelist.xml
+19 −22 schemes/rrtmgp/rrtmgp_inputs.F90
+334 −0 schemes/rrtmgp/rrtmgp_inputs.meta
+27 −15 schemes/rrtmgp/rrtmgp_inputs_setup.F90
+256 −0 schemes/rrtmgp/rrtmgp_inputs_setup.meta
+39 −0 schemes/rrtmgp/rrtmgp_lw_aerosols.F90
+31 −0 schemes/rrtmgp/rrtmgp_lw_aerosols.meta
+70 −0 schemes/rrtmgp/rrtmgp_lw_calculate_fluxes.F90
+109 −0 schemes/rrtmgp/rrtmgp_lw_calculate_fluxes.meta
+40 −0 schemes/rrtmgp/rrtmgp_lw_calculate_heating_rate.F90
+67 −0 schemes/rrtmgp/rrtmgp_lw_calculate_heating_rate.meta
+6 −23 schemes/rrtmgp/rrtmgp_lw_cloud_optics.F90
+191 −0 schemes/rrtmgp/rrtmgp_lw_cloud_optics.meta
+88 −87 schemes/rrtmgp/rrtmgp_lw_gas_optics.F90
+141 −0 schemes/rrtmgp/rrtmgp_lw_gas_optics.meta
+91 −0 schemes/rrtmgp/rrtmgp_lw_gas_optics_namelist.xml
+3 −4 schemes/rrtmgp/rrtmgp_lw_gas_optics_pre.F90
+94 −0 schemes/rrtmgp/rrtmgp_lw_gas_optics_pre.meta
+25 −16 schemes/rrtmgp/rrtmgp_lw_mcica_subcol_gen.F90
+106 −0 schemes/rrtmgp/rrtmgp_lw_mcica_subcol_gen.meta
+3 −3 schemes/rrtmgp/rrtmgp_lw_rte.F90
+129 −0 schemes/rrtmgp/rrtmgp_lw_rte.meta
+9 −2 schemes/rrtmgp/rrtmgp_post.F90
+148 −0 schemes/rrtmgp/rrtmgp_post.meta
+49 −35 schemes/rrtmgp/rrtmgp_pre.F90
+301 −0 schemes/rrtmgp/rrtmgp_pre.meta
+329 −0 schemes/rrtmgp/rrtmgp_pre_namelist.xml
+41 −0 schemes/rrtmgp/rrtmgp_subcycle.F90
+52 −0 schemes/rrtmgp/rrtmgp_subcycle.meta
+42 −0 schemes/rrtmgp/rrtmgp_sw_aerosols.F90
+37 −0 schemes/rrtmgp/rrtmgp_sw_aerosols.meta
+111 −0 schemes/rrtmgp/rrtmgp_sw_calculate_fluxes.F90
+139 −0 schemes/rrtmgp/rrtmgp_sw_calculate_fluxes.meta
+39 −0 schemes/rrtmgp/rrtmgp_sw_calculate_heating_rate.F90
+67 −0 schemes/rrtmgp/rrtmgp_sw_calculate_heating_rate.meta
+27 −18 schemes/rrtmgp/rrtmgp_sw_cloud_optics.F90
+277 −0 schemes/rrtmgp/rrtmgp_sw_cloud_optics.meta
+97 −96 schemes/rrtmgp/rrtmgp_sw_gas_optics.F90
+119 −0 schemes/rrtmgp/rrtmgp_sw_gas_optics.meta
+91 −0 schemes/rrtmgp/rrtmgp_sw_gas_optics_namelist.xml
+4 −5 schemes/rrtmgp/rrtmgp_sw_gas_optics_pre.F90
+97 −0 schemes/rrtmgp/rrtmgp_sw_gas_optics_pre.meta
+15 −13 schemes/rrtmgp/rrtmgp_sw_mcica_subcol_gen.F90
+121 −0 schemes/rrtmgp/rrtmgp_sw_mcica_subcol_gen.meta
+9 −8 schemes/rrtmgp/rrtmgp_sw_rte.F90
+119 −0 schemes/rrtmgp/rrtmgp_sw_rte.meta
+21 −72 schemes/rrtmgp/rrtmgp_sw_solar_var.F90
+98 −0 schemes/rrtmgp/rrtmgp_sw_solar_var.meta
+80 −0 schemes/rrtmgp/rrtmgp_sw_solar_var_setup.F90
+38 −0 schemes/rrtmgp/rrtmgp_sw_solar_var_setup.meta
+97 −0 schemes/rrtmgp/rrtmgp_variables.F90
+139 −0 schemes/rrtmgp/rrtmgp_variables.meta
+3 −3 schemes/rrtmgp/utils/calculate_net_heating.F90
+79 −0 schemes/rrtmgp/utils/calculate_net_heating.meta
+1 −1 schemes/rrtmgp/utils/radiation_tools.F90
+31 −0 schemes/rrtmgp/utils/rrtmgp_cloud_optics_setup.meta
+130 −0 schemes/rrtmgp/utils/rrtmgp_cloud_optics_setup_namelist.xml
+61 −0 schemes/rrtmgp/utils/rrtmgp_dry_static_energy_tendency.meta
+97 −0 schemes/sima_diagnostics/rrtmgp_cloud_diagnostics.F90
+113 −0 schemes/sima_diagnostics/rrtmgp_cloud_diagnostics.meta
+80 −0 schemes/sima_diagnostics/rrtmgp_diagnostics.F90
+101 −0 schemes/sima_diagnostics/rrtmgp_diagnostics.meta
+158 −0 schemes/sima_diagnostics/rrtmgp_lw_diagnostics.F90
+173 −0 schemes/sima_diagnostics/rrtmgp_lw_diagnostics.meta
+218 −0 schemes/sima_diagnostics/rrtmgp_sw_diagnostics.F90
+221 −0 schemes/sima_diagnostics/rrtmgp_sw_diagnostics.meta
+0 −1 schemes/sima_diagnostics/scheme_diagnostics_template.F90
+49 −4 suites/suite_cam4.xml
+53 −0 test/test_suites/suite_rrtmgp.xml
3 changes: 3 additions & 0 deletions src/control/cam_snapshot_common.F90
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ subroutine cam_out_snapshot_init(cam_snapshot_before_num, cam_snapshot_after_num
call snapshot_addfld( ncam_out_var, cam_out_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'cam_out%solld', 'cam_out_solld', 'W m-2', horiz_only)

call snapshot_addfld( ncam_out_var, cam_out_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'cam_out%flwds', 'cam_out_flwds', 'W m-2', horiz_only)

call snapshot_addfld( ncam_out_var, cam_out_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'cam_out%netsw', 'cam_out_netsw', 'unset', horiz_only)

Expand Down
8 changes: 4 additions & 4 deletions src/physics/cam/radheat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ subroutine radheat_tend(state, pbuf, ptend, qrl, qrs, fsns, &
ptend%s(:ncol,k) = (qrs_mrg(:ncol,k) + qrl_mrg(:ncol,k))
endif
enddo
call calculate_net_heating_run(ncol, ptend%s(:ncol,:), qrl_mrg(:ncol,:), qrs_mrg(:ncol,:), .true., &
fsns(:ncol), fsnt(:ncol), flns(:ncol), flnt(:ncol), net_flx(:ncol), &
call calculate_net_heating_run(ncol, qrl_mrg(:ncol,:), qrs_mrg(:ncol,:), .true., &
fsns(:ncol), fsnt(:ncol), flns(:ncol), flnt(:ncol), ptend%s(:ncol,:), net_flx(:ncol), &
errmsg, errflg)
#else
call calculate_net_heating_run(ncol, ptend%s(:ncol,:), qrl_mrg(:ncol,:), qrs_mrg(:ncol,:), .false., &
fsns(:ncol), fsnt(:ncol), flns(:ncol), flnt(:ncol), net_flx(:ncol), &
call calculate_net_heating_run(ncol, qrl_mrg(:ncol,:), qrs_mrg(:ncol,:), .false., &
fsns(:ncol), fsnt(:ncol), flns(:ncol), flnt(:ncol), ptend%s(:ncol,:), net_flx(:ncol), &
errmsg, errflg)
#endif

Expand Down
100 changes: 60 additions & 40 deletions src/physics/rrtmgp/radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ module radiation

integer :: nlwgpts
integer :: nswgpts
integer :: changeseed
integer :: irad_always_modified

real(kind=r8) :: tiny

Expand Down Expand Up @@ -413,7 +415,7 @@ subroutine radiation_init(pbuf2d)
use rrtmgp_inputs_setup, only: rrtmgp_inputs_setup_init
use rrtmgp_inputs_cam, only: rrtmgp_inputs_cam_init
use rrtmgp_cloud_optics_setup, only: rrtmgp_cloud_optics_setup_init
use rrtmgp_sw_solar_var, only: rrtmgp_sw_solar_var_init
use rrtmgp_sw_solar_var_setup, only: rrtmgp_sw_solar_var_setup_init
use solar_irrad_data, only: do_spctrl_scaling, has_spectrum
use cloud_rad_props, only: cloud_rad_props_init
use rad_constituents, only: iceopticsfile, liqopticsfile
Expand Down Expand Up @@ -447,33 +449,37 @@ subroutine radiation_init(pbuf2d)
integer :: ierr, istat, errflg

integer :: dtime
real(r8) :: dtime_r8

character(len=*), parameter :: sub = 'radiation_init'
!-----------------------------------------------------------------------

! Initialize available_gases object
call rrtmgp_pre_init(nradgas, gaslist, available_gases, gaslist_lc, errmsg, errflg)
call rrtmgp_pre_init(nradgas, available_gases, gaslist, gaslist_lc, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if

! Read RRTMGP coefficients files and initialize kdist objects.
call rrtmgp_lw_gas_optics_init(kdist_lw, coefs_lw_file, available_gases, errmsg, errflg)
call rrtmgp_lw_gas_optics_init(coefs_lw_file, available_gases, kdist_lw, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': lw '//errmsg)
end if
call rrtmgp_sw_gas_optics_init(kdist_sw, coefs_sw_file, available_gases, errmsg, errflg)
call rrtmgp_sw_gas_optics_init(coefs_sw_file, available_gases, kdist_sw, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': sw '//errmsg)
end if

dtime = get_step_size()
dtime_r8 = real(dtime, r8)

! Set up inputs to RRTMGP
call rrtmgp_inputs_setup_init(ktopcam, ktoprad, nlaycam, sw_low_bounds, sw_high_bounds, nswbands, &
pref_edge, nlay, pver, pverp, kdist_sw, kdist_lw, qrl_unused, is_first_step(), use_rad_dt_cosz, &
get_step_size(), get_nstep(), iradsw, dt_avg, irad_always, is_first_restart_step(), &
p_top_for_equil_rad, nlwbands, nradgas, gasnamelength, idx_sw_diag, idx_nir_diag, idx_uv_diag, &
idx_sw_cloudsim, idx_lw_diag, idx_lw_cloudsim, nswgpts, nlwgpts, nlayp, nextsw_cday, &
get_curr_calday(), band2gpt_sw, errmsg, errflg)
call rrtmgp_inputs_setup_init(nswbands, nlwbands, pref_edge, pver, pverp, kdist_sw, kdist_lw, qrl_unused, &
is_first_step(), use_rad_dt_cosz, dtime_r8, get_nstep(), iradsw, dt_avg, irad_always, &
is_first_restart_step(), p_top_for_equil_rad, nradgas, gasnamelength, get_curr_calday(), &
ktopcam, ktoprad, nlaycam, sw_low_bounds, sw_high_bounds, idx_sw_diag, idx_nir_diag, &
idx_uv_diag, idx_sw_cloudsim, idx_lw_diag, idx_lw_cloudsim, nswgpts, nlwgpts, changeseed, &
nlay, nlayp, nextsw_cday, band2gpt_sw, irad_always_modified, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand All @@ -485,7 +491,7 @@ subroutine radiation_init(pbuf2d)
! Set radconstants module-level index variables that we're setting in CCPP-ized scheme now
call radconstants_init(idx_sw_diag, idx_nir_diag, idx_uv_diag, idx_lw_diag)

call rrtmgp_sw_solar_var_init(nswbands, do_spctrl_scaling, has_spectrum, errmsg, errflg)
call rrtmgp_sw_solar_var_setup_init(nswbands, do_spctrl_scaling, has_spectrum, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand Down Expand Up @@ -884,6 +890,7 @@ subroutine radiation_tend( &
real(r8) :: cld_lw_abs(nlwbands,state%ncol,pver) ! Cloud absorption optics depth
real(r8) :: snow_lw_abs(nlwbands,state%ncol,pver) ! Snow absorption optics depth
real(r8) :: grau_lw_abs(nlwbands,state%ncol,pver) ! Graupel absorption optics depth
real(r8) :: c_cld_lw_abs(nlwbands,state%ncol,pver)
real(r8) :: cld_tau(nswbands,state%ncol,pver) ! Cloud absorption optical depth (sw)
real(r8) :: snow_tau(nswbands,state%ncol,pver) ! Snow absorption optical depth (sw)
real(r8) :: grau_tau(nswbands,state%ncol,pver) ! Graupel absorption optical depth (sw)
Expand All @@ -909,6 +916,8 @@ subroutine radiation_tend( &
real(r8), pointer :: icswp(:,:)
real(r8), pointer :: icgrauwp(:,:)
real(r8), pointer :: degrau(:,:)
real(r8), pointer :: icgrauwp_in(:,:)
real(r8), pointer :: degrau_in(:,:)

real(r8), pointer, dimension(:,:,:) :: su => NULL() ! shortwave spectral flux up
real(r8), pointer, dimension(:,:,:) :: sd => NULL() ! shortwave spectral flux down
Expand Down Expand Up @@ -999,8 +1008,11 @@ subroutine radiation_tend( &
real(r8) :: gb_snow_lw(pcols,pver) ! grid-box mean LW snow optical depth

logical :: is_mpas ! Flag for whether the dycore is MPAS
logical :: dosw_heat, dolw_heat
real(r8) :: ftem(pcols,pver) ! Temporary workspace for outfld variables
real(r8), target :: zero_variable(1,1)
integer :: dtime
real(r8) :: dtime_r8

character(len=512) :: errmsg
integer :: errflg, err
Expand Down Expand Up @@ -1042,8 +1054,12 @@ subroutine radiation_tend( &
end do
end if

dtime = get_step_size()
dtime_r8 = real(dtime, r8)

! Get next SW radiation timestep
call rrtmgp_pre_timestep_init(get_nstep(), get_step_size(), iradsw, irad_always, offset, errmsg, errflg)
call rrtmgp_pre_timestep_init(ncol, coszrs, get_nstep(), dtime_r8, iradsw, &
irad_always_modified, offset, idxday, nday, idxnite, nnite, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand All @@ -1054,9 +1070,9 @@ subroutine radiation_tend( &

! Determine if we're running radiation (sw and/or lw) this timestep,
! find daylight and nighttime indices, and initialize fluxes
call rrtmgp_pre_run(coszrs(:ncol), get_nstep(), get_step_size(), iradsw, iradlw, irad_always, &
ncol, next_cday, idxday, nday, idxnite, nnite, dosw, dolw, nlay, nlwbands, &
nswbands, spectralflux, nextsw_cday, fsw, fswc, flw, flwc, errmsg, errflg)
call rrtmgp_pre_run(coszrs(:ncol), get_nstep(), dtime_r8, iradsw, iradlw, irad_always_modified, &
ncol, next_cday, idxday, nday, idxnite, nnite, nlay, nlwbands, nswbands, spectralflux, &
nextsw_cday, dosw, dolw, dosw_heat, dolw_heat, fsw, fswc, flw, flwc, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand Down Expand Up @@ -1159,9 +1175,15 @@ subroutine radiation_tend( &
call pbuf_get_field(pbuf, des_idx, des)
if (icgrauwp_idx > 0) then
call pbuf_get_field(pbuf, icgrauwp_idx, icgrauwp)
icgrauwp_in => icgrauwp(:ncol,:)
else
icgrauwp_in => zero_variable
end if
if (degrau_idx > 0) then
call pbuf_get_field(pbuf, degrau_idx, degrau)
degrau_in => degrau(:ncol,:)
else
degrau_in => zero_variable
end if

do_graupel = ((icgrauwp_idx > 0) .and. (degrau_idx > 0) .and. associated(cldfgrau)) .and. graupel_in_rad
Expand All @@ -1172,16 +1194,14 @@ subroutine radiation_tend( &
! Prepare state variables, daylit columns, albedos for RRTMGP
! Also calculate modified cloud fraction
call rrtmgp_inputs_run(dosw, dolw, associated(cldfsnow), associated(cldfgrau), &
is_mpas, state%pmid(:ncol,:), state%pint(:ncol,:), state%t(:ncol,:), &
nday, idxday, cldfprime(:ncol,:), coszrs(:ncol), kdist_sw, t_sfc, &
emis_sfc, t_rad, pmid_rad, pint_rad, t_day, pmid_day, &
pint_day, coszrs_day, alb_dir, alb_dif, cam_in%lwup(:ncol), stebol, &
(.not. is_mpas), state%pmid(:ncol,:), state%pint(:ncol,:), state%t(:ncol,:), &
nday, idxday, coszrs(:ncol), kdist_sw, kdist_lw, cam_in%lwup(:ncol), stebol, &
ncol, ktopcam, ktoprad, nswbands, cam_in%asdir(:ncol), cam_in%asdif(:ncol), &
sw_low_bounds, sw_high_bounds, cam_in%aldir(:ncol), cam_in%aldif(:ncol), nlay, &
pverp, pver, cld(:ncol,:), cldfsnow_in, cldfgrau_in, &
graupel_in_rad, gasnamelength, gaslist_lc, gas_concs_lw, aer_lw, atm_optics_lw, &
kdist_lw, sources_lw, aer_sw, atm_optics_sw, gas_concs_sw, &
errmsg, errflg)
pverp, pver, cld(:ncol,:), cldfsnow_in, cldfgrau_in, graupel_in_rad, gaslist_lc, &
cldfprime(:ncol,:), t_sfc, emis_sfc, t_rad, pmid_rad, pint_rad, t_day, pmid_day, &
pint_day, coszrs_day, alb_dir, alb_dif, gas_concs_lw, aer_lw, atm_optics_lw, &
sources_lw, aer_sw, atm_optics_sw, gas_concs_sw, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand All @@ -1197,11 +1217,11 @@ subroutine radiation_tend( &
if (dosw) then

! Set cloud optical properties in cloud_sw object.
call rrtmgp_sw_cloud_optics_run(dosw, ncol, pver, ktopcam, ktoprad, nlay, nswgpts, nday, idxday, &
call rrtmgp_sw_cloud_optics_run(dosw, ncol, pver, ktopcam, ktoprad, nswgpts, nday, idxday, &
fillvalue, nswbands, iulog, mu(:ncol,:), lambda(:ncol,:), nnite, idxnite, cld, cldfsnow_in, &
cldfgrau_in, cldfprime(:ncol,:), cld_tau(:,:ncol,:), grau_tau(:,:ncol,:), snow_tau(:,:ncol,:), &
degrau(:ncol,:), dei(:ncol,:), des(:ncol,:), iclwp(:ncol,:), iciwp(:ncol,:), icswp(:ncol,:), &
icgrauwp(:ncol,:), tiny, idx_sw_diag, do_graupel, do_snow, kdist_sw, c_cld_tau(:,:ncol,:), &
cldfgrau_in, cldfprime(:ncol,:), degrau_in, dei(:ncol,:), des(:ncol,:), iclwp(:ncol,:), &
iciwp(:ncol,:), icswp(:ncol,:), icgrauwp_in, tiny, idx_sw_diag, do_graupel, do_snow, &
kdist_sw, cld_tau(:,:ncol,:), grau_tau(:,:ncol,:), snow_tau(:,:ncol,:), c_cld_tau(:,:ncol,:), &
c_cld_tau_w(:,:ncol,:), c_cld_tau_w_g(:,:ncol,:), rd%tot_cld_vistau(:ncol,:), &
rd%tot_icld_vistau(:ncol,:), rd%liq_icld_vistau(:ncol,:), rd%ice_icld_vistau(:ncol,:), &
rd%snow_icld_vistau(:ncol,:), rd%grau_icld_vistau(:ncol,:), errmsg, errflg)
Expand All @@ -1216,7 +1236,7 @@ subroutine radiation_tend( &

call rrtmgp_sw_mcica_subcol_gen_run(dosw, kdist_sw, nswbands, nswgpts, nday, nlay, &
pver, tiny, idxday, ktopcam, ktoprad, cldfprime, c_cld_tau, &
c_cld_tau_w, c_cld_tau_w_g, cloud_sw, pmid_day, errmsg, errflg)
c_cld_tau_w, c_cld_tau_w_g, pmid_day, cloud_sw, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand Down Expand Up @@ -1254,8 +1274,8 @@ subroutine radiation_tend( &
!$acc end data

! Scale the solar source
call rrtmgp_sw_solar_var_run(toa_flux, band2gpt_sw, nswbands, sol_irrad, we, nbins, sol_tsi, &
do_spctrl_scaling, sfac, eccf, errmsg, errflg)
call rrtmgp_sw_solar_var_run(toa_flux, 2, band2gpt_sw, nswbands, sol_irrad, we, nbins, sol_tsi, &
nday, dosw, do_spctrl_scaling, sfac, eccf, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand Down Expand Up @@ -1305,11 +1325,11 @@ subroutine radiation_tend( &
if (dolw) then

! Set cloud optical properties in cloud_lw object.
call rrtmgp_lw_cloud_optics_run(dolw, ncol, nlay, nlaycam, cld(:ncol,:), cldfsnow_in, &
cldfgrau_in, cldfprime(:ncol,:), kdist_lw, cloud_lw, lambda(:ncol,:), mu(:ncol,:), &
call rrtmgp_lw_cloud_optics_run(dolw, ncol, nlay, cld(:ncol,:), cldfsnow_in, &
cldfgrau_in, cldfprime(:ncol,:), kdist_lw, lambda(:ncol,:), mu(:ncol,:), &
iclwp(:ncol,:), iciwp(:ncol,:), tiny, dei(:ncol,:), icswp(:ncol,:), des(:ncol,:), &
icgrauwp(:ncol,:), degrau(:ncol,:), nlwbands, do_snow, do_graupel, pver, ktopcam, &
tauc, cldf, cld_lw_abs, snow_lw_abs, grau_lw_abs, errmsg, errflg)
icgrauwp_in, degrau_in, nlwbands, do_snow, do_graupel, pver, ktopcam, &
cloud_lw, cld_lw_abs, snow_lw_abs, grau_lw_abs, c_cld_lw_abs, errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand All @@ -1320,9 +1340,9 @@ subroutine radiation_tend( &
grau_lw_abs_cloudsim(:ncol,:) = grau_lw_abs(idx_lw_cloudsim,:,:)

! Create McICA stochastic arrays for lw cloud optical properties
call rrtmgp_lw_mcica_subcol_gen_run(dolw, ktoprad, &
kdist_lw, nlwbands, nlwgpts, ncol, pver, nlaycam, nlwgpts, &
state%pmid(:ncol,:), cldf, tauc, cloud_lw, errmsg, errflg )
call rrtmgp_lw_mcica_subcol_gen_run(dolw, ktoprad, ktopcam, &
kdist_lw, nlwbands, changeseed, ncol, pver, nlaycam, cldfprime(:ncol,:), &
c_cld_lw_abs, nlwgpts, state%pmid(:ncol,:), cloud_lw, errmsg, errflg )
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand Down Expand Up @@ -1485,9 +1505,9 @@ subroutine radiation_tend( &
cam_out%netsw(:) = 0._r8

! Calculate radiative heating (Q*dp), set netsw flux, and do object cleanup
call rrtmgp_post_run(qrs_prime(:ncol,:), qrl_prime(:ncol,:), fsns(:ncol), state%pdel(:ncol,:), atm_optics_sw, cloud_sw, &
aer_sw, fsw, fswc, atm_optics_lw, sources_lw, cloud_lw, aer_lw, flw, flwc, qrs(:ncol,:), qrl(:ncol,:), &
cam_out%netsw(:ncol), errmsg, errflg)
call rrtmgp_post_run(nlay, dolw, qrs_prime(:ncol,:), qrl_prime(:ncol,:), fsns(:ncol), state%pdel(:ncol,:), &
atm_optics_sw, cloud_sw, aer_sw, fsw, fswc, atm_optics_lw, sources_lw, cloud_lw, aer_lw, flw, flwc,&
cam_out%flwds(:ncol), qrs(:ncol,:), qrl(:ncol,:), cam_out%netsw(:ncol), errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if
Expand Down
Loading