Skip to content

Commit a239db6

Browse files
authored
Merge pull request #1379 from JulioTBacmeister/my_branch_radmods
cam6_4_111: Making blending region consistent with p_top for radiation schemes
2 parents 83541e4 + add761a commit a239db6

7 files changed

Lines changed: 142 additions & 51 deletions

File tree

bld/build-namelist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ elsif ($rad_pkg =~ m/rrtmgp/) {
739739
my $abs_path = quote_string(set_abs_filepath($rel_path, $cam_dir));
740740
$nl->set_variable_value('radiation_nl', 'rrtmgp_coefs_sw_file', $abs_path);
741741

742-
add_default($nl, 'p_top_for_rrtmgp');
742+
add_default($nl, 'p_top_for_equil_rad');
743743

744744
}
745745

@@ -3339,7 +3339,7 @@ if ($cfg->get('microphys') =~ /^mg/) {
33393339
add_default($nl, 'micro_mg_accre_sees_auto');
33403340
add_default($nl, 'micro_mg_vtrms_factor');
33413341
add_default($nl, 'micro_mg_implicit_fall');
3342-
add_default($nl, 'pumas_stochastic_tau_kernel_filename', 'val'=>"$cfgdir/../src/atmos_phys/pumas/pumas/KBARF_tau_kernel.dat");
3342+
add_default($nl, 'pumas_stochastic_tau_kernel_filename', 'val'=>"$cfgdir/../src/atmos_phys/schemes/pumas/pumas/KBARF_tau_kernel.dat");
33433343

33443344
#set path for stochastic_tau_kernel_filename
33453345
my $cam_dir = $cfg->get('cam_dir');

bld/namelist_files/namelist_defaults_cam.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,11 @@
575575
<rrtmgp_coefs_lw_file>src/physics/rrtmgp/data/rrtmgp-gas-lw-g128.nc</rrtmgp_coefs_lw_file>
576576
<rrtmgp_coefs_sw_file>src/physics/rrtmgp/data/rrtmgp-gas-sw-g112.nc</rrtmgp_coefs_sw_file>
577577

578-
<p_top_for_rrtmgp> 10.D0 </p_top_for_rrtmgp>
579-
<p_top_for_rrtmgp waccmx="1" > 1.D0 </p_top_for_rrtmgp>
580-
<p_top_for_rrtmgp waccm_phys="1" > 1.D0 </p_top_for_rrtmgp>
578+
<!-- Pressure top for blending region for radiation heating -->
579+
<p_top_for_equil_rad> 0.D0 </p_top_for_equil_rad>
580+
<p_top_for_equil_rad waccmx="1" > 1.D0 </p_top_for_equil_rad>
581+
<p_top_for_equil_rad waccm_phys="1" > 1.D0 </p_top_for_equil_rad>
582+
<p_top_for_equil_rad rad="rrtmgp"> 2.D0 </p_top_for_equil_rad>
581583

582584
<!-- CAM-RT absorptivity/emissivity lookup table -->
583585
<absems_data rad="camrt">atm/cam/rad/abs_ems_factors_fastvx.c030508.nc</absems_data>

bld/namelist_files/namelist_definition.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5771,11 +5771,12 @@ Calculate radiative effect of graupel/hail (using snow optics)
57715771
Default: FALSE
57725772
</entry>
57735773

5774-
<entry id="p_top_for_rrtmgp" type="real" category="radiation"
5775-
group="radiation_nl" valid_values="" >
5776-
Top pressure level for RRTMGP
5774+
<entry id="p_top_for_equil_rad" type="real" category="radiation"
5775+
group="radheat_nl" valid_values="" >
5776+
Top pressure level for non-LTE blending region
57775777
Default: 1.0 for WACCM/WACCMX
5778-
10. for all other CAM runs
5778+
2. for all other RRTMGP runs
5779+
0.0 for all other runs
57795780
</entry>
57805781

57815782
<entry id="use_rad_dt_cosz" type="logical" category="radiation"

doc/ChangeLog

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,92 @@
1+
===============================================================
2+
3+
Tag name: cam6_4_111
4+
Originator(s): JulioTBacmeister, cacraigucar, peverwhee
5+
Date: August 29, 2025
6+
One-line Summary: Making blending region consistent with p_top for radiation schemes
7+
Github PR URL: https://github.com/ESCOMP/CAM/pull/1379
8+
9+
Purpose of changes (include the issue number and title text for each relevant GitHub issue):
10+
- Rename p_top_for_rrtmgp to the more generic p_top_for_equil_rad
11+
- Move p_top_for_equil_rad to radheat namelist group and read in radheat_readnl
12+
- Use p_top_for_equil_rad to set minimum pressure for blending layer in radheat_init
13+
- Update stochastic tau PUMAS file path to match new location
14+
15+
Describe any changes made to build system: N/A
16+
17+
Describe any changes made to the namelist:
18+
M bld/build-namelist
19+
M bld/namelist_files/namelist_defaults_cam.xml
20+
M bld/namelist_files/namelist_definition.xml
21+
- Rename p_top_for_rrtmgp to p_top_for_equil_rad
22+
- Update default for RRTMGP (cam7 physics) to 2
23+
- Correct the stochastic tau pumas file path
24+
25+
List any changes to the defaults for the boundary datasets: N/A
26+
27+
Describe any substantial timing or memory changes: N/A
28+
29+
Code reviewed by: cacraigucar, peverwhee
30+
31+
List all files eliminated: N/A
32+
33+
List all files added and what they do: N/A
34+
35+
List all existing files that have been modified, and describe the changes:
36+
M src/physics/cam/radheat.F90
37+
- remove unused variables
38+
- read in p_top_for_equil_rad in readnl
39+
- use p_top_for_equil_rad as minimum lw pressure
40+
41+
M src/physics/rrtmgp/radiation.F90
42+
- Remove p_top_for_rrtmgp from readnl
43+
- "use" p_top_for_equil_rad in radiation_init to pass into rrtmgp_inputs_setup_init
44+
45+
M src/physics/waccm/radheat.F90
46+
- Add p_top_for_equil_rad to readnl routine
47+
48+
If there were any failures reported from running test_driver.sh on any test
49+
platform, and checkin with these failures has been OK'd by the gatekeeper,
50+
then copy the lines from the td.*.status files for the failed tests to the
51+
appropriate machine below. All failed tests must be justified.
52+
53+
derecho/intel/aux_cam:
54+
ERP_Ld3.ne30pg3_ne30pg3_mt232.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details:
55+
SMS_D_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_MTso.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
56+
SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mt232.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details:
57+
- diffs for MT configuration due to namelist default change
58+
59+
ERC_D_Ln9.mpasa120_mpasa120.FHISTC_LTso.derecho_intel.cam-outfrq9s_mpasa120 (Overall: NLFAIL) details:
60+
ERC_D_Ln9.mpasa120_mpasa120.QPC7.derecho_intel.cam-outfrq9s_mpasa120 (Overall: NLFAIL) details:
61+
ERC_D_Ln9.ne30pg2_ne30pg2_mt232.QPC7.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
62+
ERI_D_Ln18.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq3s_eri (Overall: NLFAIL) details:
63+
ERP_Ld3.ne16pg3_ne16pg3_mg17.FHISTC_WAt1ma.derecho_intel.cam-reduced_hist1d (Overall: NLFAIL) details:
64+
ERP_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WAma.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
65+
ERR_Ln9.ne16pg3_ne16pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq9s_bwic (Overall: NLFAIL) details:
66+
ERS_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s_ctem (Overall: NLFAIL) details:
67+
SMS_C2_D_Ln9.ne16pg3_ne16pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
68+
SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: NLFAIL) details:
69+
- nlfails for all RRTMGP configurations due to namelist name change
70+
71+
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL)
72+
- pre-existing failure due to build-namelist error requiring CLM/CTSM external update.
73+
74+
derecho/nvhpc/aux_cam:
75+
ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: NLFAIL) details:
76+
- nlfail for all RRTMGP configurations due to namelist name change
77+
78+
izumi/nag/aux_cam:
79+
ERC_D_Ln9.mpasa480_mpasa480_mt232.QPC7.izumi_nag.cam-outfrq9s_mpasa480 (Overall: NLFAIL) details:
80+
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-cosp_rad_diags (Overall: NLFAIL) details:
81+
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-outfrq9s_nochem (Overall: NLFAIL) details:
82+
- nlfails for all RRTMGP configurations due to namelist name change
83+
84+
izumi/gnu/aux_cam:
85+
ERC_D_Ln9.mpasa480_mpasa480_mt232.FHISTC_LTso.izumi_gnu.cam-outfrq9s_mpasa480 (Overall: NLFAIL) details:
86+
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_gnu.cam-sat_lcltod (Overall: NLFAIL) details:
87+
ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPC7.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
88+
SMS_D_Ln3.ne3pg3_ne3pg3_mt232.PC7.izumi_gnu.cam-pc7_ne3pg3 (Overall: NLFAIL) details:
89+
- nlfails for all RRTMGP configurations due to namelist name change
190

291
===============================================================
392

src/physics/cam/radheat.F90

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,12 @@ module radheat
3939

4040
public :: radheat_disable_waccm ! disable waccm heating in the upper atm
4141

42+
real(r8), public :: p_top_for_equil_rad = 0._r8
43+
4244
! Private variables for merging heating rates
4345
real(r8):: qrs_wt(pver) ! merge weight for cam solar heating
4446
real(r8):: qrl_wt(pver) ! merge weight for cam long wave heating
4547

46-
! sw merge region
47-
! highest altitude (lowest pressure) of merge region (Pa)
48-
real(r8) :: min_pressure_sw= 5._r8
49-
! lowest altitude (lowest pressure) of merge region (Pa)
50-
real(r8) :: max_pressure_sw=50._r8
51-
5248
! lw merge region
5349
! highest altitude (lowest pressure) of merge region (Pa)
5450
real(r8) :: min_pressure_lw= 5._r8
@@ -61,10 +57,36 @@ module radheat
6157
contains
6258
!===============================================================================
6359
subroutine radheat_readnl(nlfile)
64-
65-
character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
66-
67-
! No options for this version of radheat; this is just a stub.
60+
! Read radheat_nl namelist group
61+
use namelist_utils, only: find_group_name
62+
use spmd_utils, only: mpicom, mstrid=>masterprocid, mpi_real8
63+
use cam_abortutils, only: endrun
64+
65+
character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
66+
67+
! Local variables
68+
integer :: unitn, ierr
69+
integer :: dtime ! timestep size
70+
character(len=32) :: errmsg
71+
character(len=*), parameter :: sub = 'radheat_readnl'
72+
73+
namelist /radheat_nl/ p_top_for_equil_rad
74+
!-----------------------------------------------------------------------------
75+
76+
if (masterproc) then
77+
open( newunit=unitn, file=trim(nlfile), status='old' )
78+
call find_group_name(unitn, 'radheat_nl', status=ierr)
79+
if (ierr == 0) then
80+
read(unitn, radheat_nl, iostat=ierr, iomsg=errmsg)
81+
if (ierr /= 0) then
82+
call endrun(sub//': ERROR reading namelist: '//trim(errmsg))
83+
end if
84+
end if
85+
close(unitn)
86+
end if
87+
88+
call mpi_bcast(p_top_for_equil_rad, 1, mpi_real8, mstrid, mpicom, ierr)
89+
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: p_top_for_equil_rad")
6890

6991
end subroutine radheat_readnl
7092

@@ -92,8 +114,6 @@ subroutine radheat_init(pref_mid)
92114
! local vars
93115
real(r8) :: co2_mw, o1_mw, o2_mw, o3_mw, no_mw, n2_mw ! molecular weights
94116

95-
real(r8) :: delta_merge_sw ! range of merge region
96-
real(r8) :: midpoint_sw ! midpoint of merge region
97117
real(r8) :: delta_merge_lw ! range of merge region
98118
real(r8) :: midpoint_lw ! midpoint of merge region
99119
real(r8) :: psh(pver) ! pressure scale height
@@ -116,43 +136,22 @@ subroutine radheat_init(pref_mid)
116136
! set max/min pressures for merging regions.
117137

118138
if (camrt) then
119-
min_pressure_sw = 1e5_r8*exp(-10._r8)
120-
max_pressure_sw = 1e5_r8*exp(-9._r8)
121139
min_pressure_lw = 1e5_r8*exp(-10._r8)
122140
max_pressure_lw = 1e5_r8*exp(-8.57_r8)
123141
else
124-
min_pressure_sw = 5._r8
125-
max_pressure_sw = 50._r8
126-
min_pressure_lw = 10._r8
142+
min_pressure_lw = p_top_for_equil_rad
127143
max_pressure_lw = 50._r8
128144
endif
129145

130-
delta_merge_sw = max_pressure_sw - min_pressure_sw
131146
delta_merge_lw = max_pressure_lw - min_pressure_lw
132147

133-
midpoint_sw = (max_pressure_sw + min_pressure_sw)/2._r8
134148
midpoint_lw = (max_pressure_lw + min_pressure_lw)/2._r8
135149

136150
do k=1,pver
137151

138152
! pressure scale heights for camrt merging (cam4)
139153
psh(k)=log(1e5_r8/pref_mid(k))
140154

141-
if ( pref_mid(k) .le. min_pressure_sw ) then
142-
qrs_wt(k) = 0._r8
143-
else if( pref_mid(k) .ge. max_pressure_sw) then
144-
qrs_wt(k) = 1._r8
145-
else
146-
if (camrt) then
147-
! camrt
148-
qrs_wt(k) = 1._r8 - tanh( (psh(k) - 9._r8)/.75_r8 )
149-
else
150-
! rrtmg
151-
qrs_wt(k) = 0.5_r8 + 1.5_r8*((pref_mid(k)-midpoint_sw)/delta_merge_sw) &
152-
- 2._r8*((pref_mid(k)-midpoint_sw)/delta_merge_sw)**3._r8
153-
endif
154-
endif
155-
156155
if ( pref_mid(k) .le. min_pressure_lw ) then
157156
qrl_wt(k)= 0._r8
158157
else if( pref_mid(k) .ge. max_pressure_lw) then

src/physics/rrtmgp/radiation.F90

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ module radiation
148148
logical :: graupel_in_rad = .false. ! graupel in radiation code
149149
logical :: use_rad_uniform_angle = .false. ! if true, use the namelist rad_uniform_angle for the coszrs calculation
150150

151-
real(r8) :: p_top_for_rrtmgp = 0._r8 ! top pressure for RRTMGP
152-
153151
! Gathered indices of day and night columns
154152
integer :: nday ! Number of daylight columns
155153
integer :: nnite ! Number of night columns
@@ -275,7 +273,7 @@ subroutine radiation_readnl(nlfile)
275273
namelist /radiation_nl/ &
276274
rrtmgp_coefs_lw_file, rrtmgp_coefs_sw_file, iradsw, iradlw, &
277275
irad_always, use_rad_dt_cosz, spectralflux, use_rad_uniform_angle, &
278-
rad_uniform_angle, graupel_in_rad, p_top_for_rrtmgp
276+
rad_uniform_angle, graupel_in_rad
279277
!-----------------------------------------------------------------------------
280278

281279
if (masterproc) then
@@ -311,8 +309,6 @@ subroutine radiation_readnl(nlfile)
311309
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: rad_uniform_angle")
312310
call mpi_bcast(graupel_in_rad, 1, mpi_logical, mstrid, mpicom, ierr)
313311
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: graupel_in_rad")
314-
call mpi_bcast(p_top_for_rrtmgp, 1, mpi_real8, mstrid, mpicom, ierr)
315-
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: p_top_for_rrtmgp")
316312

317313
if (use_rad_uniform_angle .and. rad_uniform_angle == -99._r8) then
318314
call endrun(sub//': ERROR - use_rad_uniform_angle is set to .true,' &
@@ -420,6 +416,7 @@ subroutine radiation_init(pbuf2d)
420416
use rad_constituents, only: iceopticsfile, liqopticsfile
421417
use rrtmgp_lw_gas_optics, only: rrtmgp_lw_gas_optics_init
422418
use rrtmgp_sw_gas_optics, only: rrtmgp_sw_gas_optics_init
419+
use radheat, only: p_top_for_equil_rad
423420

424421
! Initialize the radiation and cloud optics.
425422
! Add fields to the history buffer.
@@ -471,7 +468,7 @@ subroutine radiation_init(pbuf2d)
471468
call rrtmgp_inputs_setup_init(ktopcam, ktoprad, nlaycam, sw_low_bounds, sw_high_bounds, nswbands, &
472469
pref_edge, nlay, pver, pverp, kdist_sw, kdist_lw, qrl_unused, is_first_step(), use_rad_dt_cosz, &
473470
get_step_size(), get_nstep(), iradsw, dt_avg, irad_always, is_first_restart_step(), &
474-
p_top_for_rrtmgp, nlwbands, nradgas, gasnamelength, idx_sw_diag, idx_nir_diag, idx_uv_diag, &
471+
p_top_for_equil_rad, nlwbands, nradgas, gasnamelength, idx_sw_diag, idx_nir_diag, idx_uv_diag, &
475472
idx_sw_cloudsim, idx_lw_diag, idx_lw_cloudsim, nswgpts, nlwgpts, nlayp, nextsw_cday, &
476473
get_curr_calday(), band2gpt_sw, errmsg, errflg)
477474
if (errflg /= 0) then

src/physics/waccm/radheat.F90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module radheat
4646
logical :: nlte_limit_co2 = .false. ! if true apply upper limit to co2 in the Fomichev scheme
4747
logical :: nlte_use_aliarms = .false. ! If true, use ALI-ARMS for the cooling rate calculation
4848
integer :: nlte_aliarms_every_X = 1 ! Call aliarms every X times radiation is called
49+
real(r8), public :: p_top_for_equil_rad = 0._r8 ! Pressure top for blending layer
4950

5051
! Private variables for merging heating rates
5152
real(r8):: qrs_wt(pver) ! merge weight for cam solar heating
@@ -77,7 +78,7 @@ subroutine radheat_readnl(nlfile)
7778
use namelist_utils, only: find_group_name
7879
use units, only: getunit, freeunit
7980
use cam_abortutils, only: endrun
80-
use spmd_utils, only : mpicom, masterprocid, mpi_logical, mpi_integer
81+
use spmd_utils, only : mpicom, masterprocid, mpi_logical, mpi_integer, mpi_real8
8182

8283
use waccm_forcing, only: waccm_forcing_readnl
8384

@@ -87,7 +88,7 @@ subroutine radheat_readnl(nlfile)
8788
integer :: unitn, ierr
8889
character(len=*), parameter :: subname = 'radheat_readnl'
8990

90-
namelist /radheat_nl/ nlte_use_mo, nlte_limit_co2, nlte_use_aliarms,nlte_aliarms_every_X
91+
namelist /radheat_nl/ nlte_use_mo, nlte_limit_co2, nlte_use_aliarms,nlte_aliarms_every_X, p_top_for_equil_rad
9192

9293
if (masterproc) then
9394
unitn = getunit()
@@ -112,6 +113,8 @@ subroutine radheat_readnl(nlfile)
112113
if (ierr /= 0) call endrun("radheat_readnl: FATAL: mpi_bcast: nlte_use_aliarms")
113114
call mpi_bcast (nlte_aliarms_every_X, 1, mpi_integer, masterprocid, mpicom, ierr)
114115
if (ierr /= 0) call endrun("radheat_readnl: FATAL: mpi_bcast: nlte_aliarms_every_X")
116+
call mpi_bcast(p_top_for_equil_rad, 1, mpi_real8, masterprocid, mpicom, ierr)
117+
if (ierr /= 0) call endrun("radheat_readnl: FATAL: mpi_bcast: p_top_for_equil_rad")
115118

116119
! Have waccm_forcing read its namelist as well.
117120
call waccm_forcing_readnl(nlfile)

0 commit comments

Comments
 (0)