Skip to content

Commit 904f80f

Browse files
authored
Merge pull request #1508 from fvitt/carma_cam7
cam6_4_169: CARMA with RRTMGP
2 parents c07cf27 + 3982666 commit 904f80f

14 files changed

Lines changed: 266 additions & 193 deletions

bld/configure

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -989,13 +989,6 @@ if ($rad_pkg eq 'camrt') {
989989
" with aerosol package $chem_pkg\n";
990990
}
991991
}
992-
elsif ($rad_pkg =~ m/rrtmg/) {
993-
994-
# RRTMGP not currently working with CARMA
995-
if ($rad_pkg eq 'rrtmgp' and $carma_pkg ne 'none') {
996-
die "configure ERROR: The CARMA microphysics package does not currently work with RRTMGP\n";
997-
}
998-
}
999992

1000993
$cfg_ref->set('rad', $rad_pkg);
1001994

cime_config/testdefs/testlist_cam.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,16 @@
324324
</options>
325325
</test>
326326

327+
<test compset="QPC7" grid="ne3pg3_ne3pg3_mt232" name="SMS_D_Ln9" testmods="cam/carma_test_tracers">
328+
<machines>
329+
<machine name="izumi" compiler="nag" category="aux_cam"/>
330+
</machines>
331+
<options>
332+
<option name="comment" >CAM7, CARMA test tracers</option>
333+
<option name="wallclock">00:30:00</option>
334+
</options>
335+
</test>
336+
327337
<test compset="FCARMA2000climo" grid="f19_f19_mg17" name="SMS_D_Ln9" testmods="cam/outfrq9s" supported="false">
328338
<machines>
329339
<machine name="derecho" compiler="intel" category="aux_cam"/>
@@ -334,6 +344,15 @@
334344
<option name="comment">CARMA trop_strat model test</option>
335345
</options>
336346
</test>
347+
<test compset="FWmaCARMAHIST" grid="f19_f19_mg17" name="SMS_D_Ln9" testmods="cam/outfrq9s" supported="false">
348+
<machines>
349+
<machine name="derecho" compiler="intel" category="carma"/>
350+
</machines>
351+
<options>
352+
<option name="wallclock">00:40:00</option>
353+
<option name="comment">CARMA WACCM trop_strat model test</option>
354+
</options>
355+
</test>
337356

338357
<test compset="FHIST_C5" grid="f10_f10_mt232" name="TMC_D_Ln9" testmods="cam/mc_ttrac">
339358
<machines>

doc/ChangeLog

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,83 @@
11
===============================================================
22

3+
Tag name: cam6_4_169
4+
Originator(s): fvitt
5+
Date: 28 Apr 2026
6+
One-line Summary: Enable CARMA with cam7 physics and RRTMGP radiation
7+
Github PR URL: https://github.com/ESCOMP/CAM/pull/1508
8+
9+
Purpose of changes (include the issue number and title text for each relevant GitHub issue):
10+
11+
- Enables the use of CARMA with RRTMGP / cam7 physics -- issue #1430
12+
- Improve performance of CARMA
13+
14+
Describe any changes made to build system: N/A
15+
16+
Describe any changes made to the namelist: N/A
17+
18+
List any changes to the defaults for the boundary datasets: N/A
19+
20+
Describe any substantial timing or memory changes: N/A
21+
22+
Code reviewed by: peverwhee
23+
24+
List all files eliminated: N/A
25+
26+
List all files added and what they do: N/A
27+
28+
List all existing files that have been modified, and describe the changes:
29+
30+
M bld/configure
31+
- allow both carma and rrtmgp in same configuration
32+
33+
M cime_config/testdefs/testlist_cam.xml
34+
- add QPC7 with carma_test_tracers aux_cam test
35+
- add FCARMAHIST carma test
36+
37+
M src/chemistry/aerosol/aero_convproc.F90
38+
M src/chemistry/aerosol/aerosol_properties_mod.F90
39+
M src/chemistry/aerosol/aerosol_state_mod.F90
40+
M src/chemistry/aerosol/bulk_aerosol_properties_mod.F90
41+
M src/chemistry/aerosol/carma_aerosol_properties_mod.F90
42+
M src/chemistry/aerosol/modal_aerosol_properties_mod.F90
43+
M src/physics/cam/ndrop.F90
44+
- improve efficiency by getting aerosol concentrations (number and volumn)
45+
for all columns and levels at once
46+
47+
M src/physics/cam/physpkg.F90
48+
M src/physics/cam7/physpkg.F90
49+
- register carma after rrtmgp
50+
51+
M src/physics/carma/cam/carma_intr.F90
52+
- allow the option to create optics files when rrtmgp is used
53+
54+
M src/physics/rrtmgp/radiation.F90
55+
- initialize at registration time
56+
57+
If there were any failures reported from running test_driver.sh on any test
58+
platform, and checkin with these failures has been OK'd by the gatekeeper,
59+
then copy the lines from the td.*.status files for the failed tests to the
60+
appropriate machine below. All failed tests must be justified.
61+
62+
derecho/intel/aux_cam: All PASS
63+
64+
derecho/nvhpc/aux_cam: All PASS
65+
66+
izumi/nag/aux_cam:
67+
68+
FAIL ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-outfrq3s_subcol COMPARE_base_rest
69+
- pre-existing failure -- see https://github.com/ESCOMP/CAM/issues/1514
70+
71+
DIFF SMS_D_Ln9.ne3pg3_ne3pg3_mt232.QPC7.izumi_nag.cam-carma_test_tracers
72+
-new test
73+
74+
izumi/gnu/aux_cam: All PASS
75+
76+
Summarize any changes to answers: bit-for-bit
77+
78+
===============================================================
79+
===============================================================
80+
381
Tag name: cam6_4_168
482
Originator(s): jimmielin, cacraig, sjsprecious
583
Date: April 24, 2026

src/chemistry/aerosol/aero_convproc.F90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,8 +1711,8 @@ subroutine activate_convproc( aero_props, &
17111711
character(len=32) :: spec_type
17121712

17131713
real(r8) :: tmpa, tmpb, tmpc ! working variable
1714-
real(r8) :: naerosol_a(1) ! number conc (1/m3)
1715-
real(r8) :: vaerosol_a(1) ! volume conc (m3/m3)
1714+
real(r8) :: naerosol_a(1,1) ! number conc (1/m3)
1715+
real(r8) :: vaerosol_a(1,1) ! volume conc (m3/m3)
17161716

17171717
!-----------------------------------------------------------------------
17181718

@@ -1779,12 +1779,12 @@ subroutine activate_convproc( aero_props, &
17791779
tmpa = tmpa + max( conent(2,mm), 0.0_r8 )
17801780
naerosol(m) = tmpa * rhoair
17811781

1782-
naerosol_a(1) = naerosol(m)
1783-
vaerosol_a(1) = vaerosol(m)
1782+
naerosol_a(1,1) = naerosol(m)
1783+
vaerosol_a(1,1) = vaerosol(m)
17841784

17851785
call aero_props%apply_number_limits( naerosol_a, vaerosol_a, 1, 1, m )
17861786

1787-
naerosol(m) = naerosol_a(1)
1787+
naerosol(m) = naerosol_a(1,1)
17881788
end do
17891789

17901790
! call Razzak-Ghan activation routine with single updraft
@@ -1918,8 +1918,8 @@ subroutine activate_convproc_method2( aero_props, &
19181918
character(len=32) :: spec_type
19191919

19201920
real(r8) :: tmpa, tmpb, tmpc ! working variable
1921-
real(r8) :: naerosol_a(1) ! number conc (1/m3)
1922-
real(r8) :: vaerosol_a(1) ! volume conc (m3/m3)
1921+
real(r8) :: naerosol_a(1,1) ! number conc (1/m3)
1922+
real(r8) :: vaerosol_a(1,1) ! volume conc (m3/m3)
19231923

19241924
!-----------------------------------------------------------------------
19251925

@@ -1999,12 +1999,12 @@ subroutine activate_convproc_method2( aero_props, &
19991999
tmpa = tmpa + max( conu(2,mm), 0.0_r8 )
20002000
naerosol(m) = tmpa * rhoair
20012001

2002-
naerosol_a(1) = naerosol(m)
2003-
vaerosol_a(1) = vaerosol(m)
2002+
naerosol_a(1,1) = naerosol(m)
2003+
vaerosol_a(1,1) = vaerosol(m)
20042004

20052005
call aero_props%apply_number_limits( naerosol_a, vaerosol_a, 1, 1, m )
20062006

2007-
naerosol(m) = naerosol_a(1)
2007+
naerosol(m) = naerosol_a(1,1)
20082008

20092009
end do
20102010

src/chemistry/aerosol/aerosol_properties_mod.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ end function aero_icenuc_updates_mmr
250250
!------------------------------------------------------------------------------
251251
! apply max / min to number concentration
252252
!------------------------------------------------------------------------------
253-
subroutine aero_apply_num_limits( self, naerosol, vaerosol, istart, istop, m )
253+
subroutine aero_apply_num_limits( self, naerosol, vaerosol, ncol, nlev, m )
254254
import :: aerosol_properties, r8
255255
class(aerosol_properties), intent(in) :: self
256-
real(r8), intent(inout) :: naerosol(:) ! number conc (1/m3)
257-
real(r8), intent(in) :: vaerosol(:) ! volume conc (m3/m3)
258-
integer, intent(in) :: istart ! start column index (1 <= istart <= istop <= pcols)
259-
integer, intent(in) :: istop ! stop column index
256+
real(r8), intent(inout) :: naerosol(:,:) ! number conc (1/m3)
257+
real(r8), intent(in) :: vaerosol(:,:) ! volume conc (m3/m3)
258+
integer, intent(in) :: ncol ! number of columns
259+
integer, intent(in) :: nlev ! number of vert levels
260260
integer, intent(in) :: m ! mode or bin index
261261

262262
end subroutine aero_apply_num_limits

src/chemistry/aerosol/aerosol_state_mod.F90

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ end subroutine set_list_idx
303303
!------------------------------------------------------------------------------
304304
! returns aerosol number, volume concentrations, and bulk hygroscopicity
305305
!------------------------------------------------------------------------------
306-
subroutine loadaer( self, aero_props, istart, istop, k, m, cs, phase, &
306+
subroutine loadaer( self, aero_props, ncol, nlev, m, cs, phase, &
307307
naerosol, vaerosol, hygro, errnum, errstr, pom_hygro)
308308

309309
use aerosol_properties_mod, only: aerosol_properties
@@ -312,17 +312,15 @@ subroutine loadaer( self, aero_props, istart, istop, k, m, cs, phase, &
312312
class(aerosol_state), intent(in) :: self
313313
class(aerosol_properties), intent(in) :: aero_props
314314

315-
integer, intent(in) :: istart ! start column index (1 <= istart <= istop <= pcols)
316-
integer, intent(in) :: istop ! stop column index
317-
integer, intent(in) :: k ! level index
315+
integer, intent(in) :: ncol, nlev
318316
integer, intent(in) :: m ! mode or bin index
319317
real(r8), intent(in) :: cs(:,:) ! air density (kg/m3)
320318
integer, intent(in) :: phase ! phase of aerosol: 1 for interstitial, 2 for cloud-borne, 3 for sum
321319

322320
! output arguments
323-
real(r8), intent(out) :: naerosol(:) ! number conc (1/m3)
324-
real(r8), intent(out) :: vaerosol(:) ! volume conc (m3/m3)
325-
real(r8), intent(out) :: hygro(:) ! bulk hygroscopicity of mode
321+
real(r8), intent(out) :: naerosol(:,:) ! number conc (1/m3)
322+
real(r8), intent(out) :: vaerosol(:,:) ! volume conc (m3/m3)
323+
real(r8), intent(out) :: hygro(:,:) ! bulk hygroscopicity of mode
326324

327325
integer , intent(out) :: errnum
328326
character(len=*), intent(out) :: errstr
@@ -335,15 +333,13 @@ subroutine loadaer( self, aero_props, istart, istop, k, m, cs, phase, &
335333
real(r8) :: specdens, spechygro
336334
character(len=aero_name_len) :: spectype
337335

338-
real(r8) :: vol(istart:istop) ! aerosol volume mixing ratio
339-
integer :: i, l
336+
real(r8) :: vol(ncol,nlev) ! aerosol volume mixing ratio
337+
integer :: l
340338
!-------------------------------------------------------------------------------
341339
errnum = 0
342340

343-
do i = istart, istop
344-
vaerosol(i) = 0._r8
345-
hygro(i) = 0._r8
346-
end do
341+
vaerosol(:,:) = 0._r8
342+
hygro(:,:) = 0._r8
347343

348344
do l = 1, aero_props%nspecies(m)
349345

@@ -357,59 +353,42 @@ subroutine loadaer( self, aero_props, istart, istop, k, m, cs, phase, &
357353
endif
358354

359355
if (phase == 3) then
360-
do i = istart, istop
361-
vol(i) = max(raer(i,k) + qqcw(i,k), 0._r8)/specdens
362-
end do
356+
vol(:ncol,:) = max(raer(:ncol,:) + qqcw(:ncol,:), 0._r8)/specdens
363357
else if (phase == 2) then
364-
do i = istart, istop
365-
vol(i) = max(qqcw(i,k), 0._r8)/specdens
366-
end do
358+
vol(:ncol,:) = max(qqcw(:ncol,:), 0._r8)/specdens
367359
else if (phase == 1) then
368-
do i = istart, istop
369-
vol(i) = max(raer(i,k), 0._r8)/specdens
370-
end do
360+
vol(:ncol,:) = max(raer(:ncol,:), 0._r8)/specdens
371361
else
372362
errnum = -1
373363
write(errstr,*)'phase = ',phase,' in aerosol_state::loadaer not recognized'
374364
return
375365
end if
376366

377-
do i = istart, istop
378-
vaerosol(i) = vaerosol(i) + vol(i)
379-
hygro(i) = hygro(i) + vol(i)*spechygro
380-
end do
381-
367+
vaerosol(:ncol,:) = vaerosol(:ncol,:) + vol(:ncol,:)
368+
hygro(:ncol,:) = hygro(:ncol,:) + vol(:ncol,:)*spechygro
382369
end do
383370

384-
do i = istart, istop
385-
if (vaerosol(i) > 1.0e-30_r8) then
386-
hygro(i) = hygro(i)/(vaerosol(i))
387-
vaerosol(i) = vaerosol(i)*cs(i,k)
388-
else
389-
hygro(i) = 0.0_r8
390-
vaerosol(i) = 0.0_r8
391-
end if
392-
end do
371+
where(vaerosol(:ncol,:) > 1.0e-30_r8)
372+
hygro(:ncol,:) = hygro(:ncol,:)/(vaerosol(:ncol,:))
373+
vaerosol(:ncol,:) = vaerosol(:ncol,:)*cs(:ncol,:)
374+
elsewhere
375+
hygro(:ncol,:) = 0._r8
376+
vaerosol(:ncol,:) = 0._r8
377+
end where
393378

394379
! aerosol number mixing ratios (#/kg)
395380
call self%get_ambient_num(m, raer)
396381
call self%get_cldbrne_num(m, qqcw)
397382
if (phase == 3) then
398-
do i = istart, istop
399-
naerosol(i) = (raer(i,k) + qqcw(i,k))*cs(i,k) ! #/kg -> #/m3
400-
end do
383+
naerosol(:ncol,:) = (raer(:ncol,:) + qqcw(:ncol,:))*cs(:ncol,:) ! #/kg -> #/m3
401384
else if (phase == 2) then
402-
do i = istart, istop
403-
naerosol(i) = qqcw(i,k)*cs(i,k)
404-
end do
385+
naerosol(:ncol,:) = qqcw(:ncol,:)*cs(:ncol,:)
405386
else
406-
do i = istart, istop
407-
naerosol(i) = raer(i,k)*cs(i,k)
408-
end do
387+
naerosol(:ncol,:) = raer(:ncol,:)*cs(:ncol,:)
409388
end if
410389

411390
! adjust number
412-
call aero_props%apply_number_limits( naerosol, vaerosol, istart, istop, m )
391+
call aero_props%apply_number_limits( naerosol, vaerosol, ncol, nlev, m )
413392

414393
end subroutine loadaer
415394

src/chemistry/aerosol/bulk_aerosol_properties_mod.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,12 @@ end function icenuc_updates_mmr
362362
!------------------------------------------------------------------------------
363363
! apply max / min to number concentration
364364
!------------------------------------------------------------------------------
365-
subroutine apply_number_limits( self, naerosol, vaerosol, istart, istop, m )
365+
subroutine apply_number_limits( self, naerosol, vaerosol, ncol, nlev, m )
366366
class(bulk_aerosol_properties), intent(in) :: self
367-
real(r8), intent(inout) :: naerosol(:) ! number conc (1/m3)
368-
real(r8), intent(in) :: vaerosol(:) ! volume conc (m3/m3)
369-
integer, intent(in) :: istart ! start column index (1 <= istart <= istop <= pcols)
370-
integer, intent(in) :: istop ! stop column index
367+
real(r8), intent(inout) :: naerosol(:,:) ! number conc (1/m3)
368+
real(r8), intent(in) :: vaerosol(:,:) ! volume conc (m3/m3)
369+
integer, intent(in) :: ncol ! number of columns
370+
integer, intent(in) :: nlev ! number of vert levels
371371
integer, intent(in) :: m ! mode or bin index
372372

373373
call endrun('ERROR: bulk_aerosol_properties_mod%apply_number_limits not yet implemented')

src/chemistry/aerosol/carma_aerosol_properties_mod.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,12 @@ end function icenuc_updates_mmr
488488
!------------------------------------------------------------------------------
489489
! apply max / min to number concentration
490490
!------------------------------------------------------------------------------
491-
subroutine apply_number_limits( self, naerosol, vaerosol, istart, istop, m )
491+
subroutine apply_number_limits( self, naerosol, vaerosol, ncol, nlev, m )
492492
class(carma_aerosol_properties), intent(in) :: self
493-
real(r8), intent(inout) :: naerosol(:) ! number conc (1/m3)
494-
real(r8), intent(in) :: vaerosol(:) ! volume conc (m3/m3)
495-
integer, intent(in) :: istart ! start column index (1 <= istart <= istop <= pcols)
496-
integer, intent(in) :: istop ! stop column index
493+
real(r8), intent(inout) :: naerosol(:,:) ! number conc (1/m3)
494+
real(r8), intent(in) :: vaerosol(:,:) ! volume conc (m3/m3)
495+
integer, intent(in) :: ncol ! number of columns
496+
integer, intent(in) :: nlev ! number of vert levels
497497
integer, intent(in) :: m ! mode or bin index
498498

499499
end subroutine apply_number_limits

0 commit comments

Comments
 (0)