cam6_4_098: CAM updates to bring in CCPP-ized RRTMGP longwave modules#1290
Conversation
…ean-up cesm-log logging; add rrtmgp paths to configure
cacraigucar
left a comment
There was a problem hiding this comment.
First section of review - have not reviewed the big sections yet
nusbaume
left a comment
There was a problem hiding this comment.
Thanks @peverwhee! I had a few requests related to code style and comments, but nothing that requires a re-review.
| allocate(abs_lw_liq_out(nmu,nlambda,nlwbands), stat=ierr, errmsg=errmsg) | ||
| call handle_allocate_error(ierr, sub, 'abs_lw_liq_out') | ||
| abs_lw_liq_out = abs_lw_liq | ||
| allocate(abs_lw_ice_out(n_g_d,nlwbands), stat=ierr, errmsg=errmsg) | ||
| call handle_allocate_error(ierr, sub, 'abs_lw_ice_out') | ||
| abs_lw_ice_out = abs_lw_ice | ||
| allocate(g_mu_out(nmu), stat=ierr, errmsg=errmsg) | ||
| call handle_allocate_error(ierr, sub, 'g_mu_out') | ||
| g_mu_out = g_mu | ||
| allocate(g_lambda_out(nmu,nlambda), stat=ierr, errmsg=errmsg) | ||
| call handle_allocate_error(ierr, sub, 'g_lambda_out') | ||
| g_lambda_out = g_lambda | ||
| allocate(g_d_eff_out(n_g_d), stat=ierr, errmsg=errmsg) | ||
| call handle_allocate_error(ierr, sub, 'g_d_eff_out') | ||
| g_d_eff_out = g_d_eff |
There was a problem hiding this comment.
I don't think we need the errmsg output here as it isn't actually being used anywhere.
| !========================================================================================= | ||
|
|
||
| subroutine get_sw_spectral_boundaries(low_boundaries, high_boundaries, units) | ||
| subroutine get_sw_spectral_boundaries(low_boundaries, high_boundaries, units) |
There was a problem hiding this comment.
Why the indent here? It looked like it was already lined-up correctly (but maybe that is just Github fooling me)?
| use radiation_utils, only: get_sw_spectral_boundaries_ccpp | ||
| use radiation_utils, only: get_lw_spectral_boundaries_ccpp |
There was a problem hiding this comment.
To better match the (newer) CAM coding standards, should we move these two use statements down into their respective CAM subroutines (i.e. lessen their scope)?
| integer, intent(in) :: numactivecols ! number of columns, ncol for LW, nday for SW | ||
|
|
||
| type(ty_gas_concs), intent(inout) :: gas_concs ! the result is VRM inside gas_concs | ||
| type(ty_gas_concs_ccpp), intent(inout) :: gas_concs ! the result is VRM inside gas_concs |
There was a problem hiding this comment.
I'm pretty sure the comment here is referring to "Volume Mixing Ratios":
| type(ty_gas_concs_ccpp), intent(inout) :: gas_concs ! the result is VRM inside gas_concs | |
| type(ty_gas_concs_ccpp), intent(inout) :: gas_concs ! the result is VMR inside gas_concs |
| integer, intent(in) :: nlay ! number of layers in radiation calculation (may include "extra layer") | ||
| integer, intent(in) :: nday ! number of daylight columns | ||
| integer, intent(in) :: idxday(pcols) ! indices of daylight columns in the chunk | ||
| integer, intent(in) :: nswgpts |
There was a problem hiding this comment.
Add a comment here? for example:
| integer, intent(in) :: nswgpts | |
| integer, intent(in) :: nswgpts ! number of shortwave g-points |
| ! toa_flux is the reference solar source from RRTMGP data. | ||
| !$acc data copyin(kdist_sw,pmid_day,pint_day,t_day,gas_concs_sw) & | ||
| !$acc copy(atm_optics_sw) & | ||
| !$acc data copyin(kdist_sw%gas_props,pmid_day,pint_day,t_day,gas_concs_sw%gas_concs) & |
There was a problem hiding this comment.
Just adding a note here that we should double-check with CISL that this is the correct way to handle the OpenACC calls.
Summary
Brings in (via atmospheric_physics) new CCPP-ized longwave routines. Modifies CAM side to use new CCPP interfaces, while maintaining RRTMG functionality.
Addresses #1192
Main modules updated:
Updates configure as well to include new rrtmgp paths (always build utils because RRTMG requires access to radiation_utils.F90)
Testing
Tests are b4b.