Skip to content

Conversation

peverwhee
Copy link
Collaborator

This PR:

  1. Brings in the new atmospheric physics submodule (currently a hash on my branch until RRTMGP SW module integration with CAM atmospheric_physics#262 is merged)
  2. Updates rrtmgp/radiation.F90 to use the new CCPPized interfaces.
  3. Removes the RRTMGP code external (as the external code now lives in atmospheric_physics) and updates the paths in configure to match the new location
  4. Remove code that has been moved to atmospheric_physics from rrtmgp_inputs_cam.F90

addresses #1192

@peverwhee peverwhee requested a review from nusbaume August 22, 2025 21:41
@peverwhee peverwhee self-assigned this Aug 22, 2025
Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing these changes into CAM @peverwhee! I just had a few small requests.

Comment on lines +892 to +894
real(r8) :: cld_tau(nswbands,state%ncol,pver) ! Cloud absorption optics depth (sw)
real(r8) :: snow_tau(nswbands,state%ncol,pver) ! Snow absorption optics depth (sw)
real(r8) :: grau_tau(nswbands,state%ncol,pver) ! Graupel absorption optics depth (sw)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might change the comments here slightly:

Suggested change
real(r8) :: cld_tau(nswbands,state%ncol,pver) ! Cloud absorption optics depth (sw)
real(r8) :: snow_tau(nswbands,state%ncol,pver) ! Snow absorption optics depth (sw)
real(r8) :: grau_tau(nswbands,state%ncol,pver) ! Graupel absorption optics depth (sw)
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)

Comment on lines +1149 to +1157
dei_idx = pbuf_get_index('DEI',errcode=err)
mu_idx = pbuf_get_index('MU',errcode=err)
lambda_idx = pbuf_get_index('LAMBDAC',errcode=err)
iciwp_idx = pbuf_get_index('ICIWP',errcode=err)
iclwp_idx = pbuf_get_index('ICLWP',errcode=err)
des_idx = pbuf_get_index('DES',errcode=err)
icswp_idx = pbuf_get_index('ICSWP',errcode=err)
icgrauwp_idx = pbuf_get_index('ICGRAUWP',errcode=err) ! Available when using MG3
degrau_idx = pbuf_get_index('DEGRAU',errcode=err) ! Available when using MG3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all of these variables optional (i.e. need the errcode=err output)? If not then I might only pass out the errcode for quantities that are truly optional (with maybe a comment in the code here explicitly stating that they are optional).

Comment on lines +1220 to +1222
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(:ncol,:), errmsg, errflg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check errflg here?

Suggested change
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(:ncol,:), errmsg, errflg)
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(:ncol,:), errmsg, errflg)
if (errflg /= 0) then
call endrun(sub//': '//errmsg)
end if

@@ -10,6 +10,7 @@ module rrtmgp_inputs_cam

use shr_kind_mod, only: r8=>shr_kind_r8
use ppgrid, only: pcols, pver, pverp
use cam_logfile, only: iulog
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Total nit-pick, but maybe line up the only: with the other two above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants