-
Notifications
You must be signed in to change notification settings - Fork 157
CAM updates to bring in CCPP-ized RRTMGP longwave modules #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cam_development
Are you sure you want to change the base?
Conversation
…ean-up cesm-log logging; add rrtmgp paths to configure
src/physics/rrtmgp/radiation.F90
Outdated
call rrtmgp_post_run(qrs(:ncol,:), qrl(:ncol,:), fsns(:ncol), state%pdel(:ncol,:), atm_optics_sw, cloud_sw, aer_sw, & | ||
fsw, fswc, sources_lw, cloud_lw, aer_lw, flw, flwc, cam_out%netsw(:ncol), errmsg, errflg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flwds
is missing from the calling list (I discovered this while working on the metadata)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First section of review - have not reviewed the big sections yet
if (ierr /= 0) then | ||
call endrun(sub//': Failed to allocate abs_lw_liq_out - message: '//errmsg) | ||
end if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that handle_alloc_error
is the preferred method for handling errors during allocation? This is in cam_abortutils
@@ -278,6 +290,36 @@ subroutine cloud_rad_props_init() | |||
call mpibcast(abs_lw_ice, n_g_d*nlwbands, mpir8, 0, mpicom, ierr) | |||
#endif | |||
|
|||
! Set output variables | |||
tiny_out = tiny | |||
nmu_out = nmu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is being used for allocaion size, where is nmu defined? Does a check or some other safeguard need to be put into place, to make sure it is set prior to calling this routine? The same comment goes for nlambda.
call get_mu_lambda_weights_ccpp(nmu, nlambda, g_mu, g_lambda, lamc, pgam, mu_wgts, & | ||
lambda_wgts, errmsg, errflg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here about how to make sure nmu and nlambda are set before this routine is called.
call calculate_net_heating_run(ncol, ptend%s(:ncol,:), qrl(:ncol,:), qrs(:ncol,:), fsns, fsnt, flns, & | ||
flnt, .true., net_flx(:ncol), errmsg, errflg) | ||
#else | ||
ptend%s(:ncol,:) = (qrs(:ncol,:) + qrl(:ncol,:)) | ||
call calculate_net_heating_run(ncol, ptend%s(:ncol,:), qrl(:ncol,:), qrs(:ncol,:), fsns, fsnt, flns, & | ||
flnt, .false., net_flx(:ncol), errmsg, errflg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Technically, you don't need to set single column arrays to only use
:ncol
, but it might help with clarity. - Need to check errflg and write out errmsg if there is an error
@@ -55,7 +57,7 @@ subroutine rad_solar_var_init( ) | |||
call endrun('rad_solar_var_init: Error allocating space for irrad') | |||
end if | |||
|
|||
call get_sw_spectral_boundaries(radbinmin, radbinmax, 'nm') | |||
call get_sw_spectral_boundaries_ccpp(radbinmin, radbinmax, 'nm', errmsg, errflg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably check errflg and use it to write out errmsg if an error is returned
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.