Skip to content

Commit c50f118

Browse files
authored
Merge pull request #1520 from fvitt/derecho_gnu_fixes
cam6_4_162: Derecho gnu compiler workarounds
2 parents da38e55 + 2168666 commit c50f118

6 files changed

Lines changed: 145 additions & 21 deletions

File tree

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
path = src/physics/ali_arms
2424
url = https://github.com/ESCOMP/ALI-ARMS
2525
fxrequired = AlwaysRequired
26-
fxtag = ALI_ARMS_v1.0.1
26+
fxtag = ALI_ARMS_v1.0.2
2727
fxDONOTUSEurl = https://github.com/ESCOMP/ALI-ARMS
2828

2929
[submodule "atmos_phys"]

doc/ChangeLog

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

3+
Tag name: cam6_4_162
4+
Originator(s): fvitt
5+
Date: 2 Apr 2026
6+
One-line Summary: Fix issue with aerosol optics diagnostics; GNU Fortran compiler workarounds
7+
Github PR URLs:
8+
https://github.com/ESCOMP/CAM/pull/1500
9+
https://github.com/ESCOMP/CAM/pull/1520
10+
11+
Purpose of changes (include the issue number and title text for each relevant GitHub issue):
12+
13+
Fix issues with aerosol optics diagnostics for bulk and prescribed volcanic aerosols
14+
-- issue #1497
15+
16+
Fix compile errors with GNU Fortran 14.3.0 on Derecho
17+
-- issues #1512 and #1519
18+
19+
Describe any changes made to build system: N/A
20+
21+
Describe any changes made to the namelist: N/A
22+
23+
List any changes to the defaults for the boundary datasets: N/A
24+
25+
Describe any substantial timing or memory changes: N/A
26+
27+
Code reviewed by: cacraigucar, jimmielin
28+
29+
List all files eliminated: N/A
30+
31+
List all files added and what they do:
32+
33+
List all existing files that have been modified, and describe the changes:
34+
M .gitmodules
35+
M src/physics/ali_arms
36+
- update ALI-ARMS tag -- gnu compiler fix
37+
38+
M src/chemistry/mozart/mo_tuvx.F90
39+
- gnu compiler bug workaround
40+
41+
M src/chemistry/aerosol/bulk_aerosol_state_mod.F90
42+
- define volume functions used in aerosol optics diags
43+
44+
M src/physics/cam/aerosol_optics_cam.F90
45+
- changes for bulk and prescribed volcanic aerosol optics diags
46+
47+
If there were any failures reported from running test_driver.sh on any test
48+
platform, and checkin with these failures has been OK'd by the gatekeeper,
49+
then copy the lines from the td.*.status files for the failed tests to the
50+
appropriate machine below. All failed tests must be justified.
51+
52+
derecho/intel/aux_cam:
53+
DIFF ERC_D_Ln9.f09_f09_mt232.FHIST_BDRD.derecho_intel.cam-outfrq9s
54+
DIFF ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s
55+
DIFF ERC_D_Ln9.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120
56+
DIFF ERC_D_Ln9.mpasa120_mpasa120.FHISTC_LTso.derecho_intel.cam-outfrq9s_mpasa120
57+
DIFF ERC_D_Ln9.ne30pg3_ne30pg3_mt232.F1850C_LTso.derecho_intel.cam-outfrq9s
58+
DIFF ERC_Ln9.C96_C96_mt232.F2000climo.derecho_intel.cam-outfrq9s
59+
DIFF ERI_D_Ln18.f09_f09_mt232.FHIST.derecho_intel.cam-outfrq3s_eri
60+
DIFF ERI_D_Ln18.f19_f19_mt232.FHIST_C5.derecho_intel.cam-outfrq3s_eri
61+
DIFF ERI_D_Ln18.ne16pg3_ne16pg3_mt232.FHIST_C4.derecho_intel.cam-outfrq3s_eri
62+
DIFF ERI_D_Ln18.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq3s_eri
63+
DIFF ERP_D_Ln9.ne30pg3_ne30pg3_mt232.F1850C_MTso.derecho_intel.cam-outfrq9s
64+
DIFF ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h
65+
DIFF ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s
66+
DIFF ERR_Ln9.ne16pg3_ne16pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq9s_bwic
67+
DIFF SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s
68+
DIFF SMS_D_Ln9.f19_f19_mt232.FHIST_C5.derecho_intel.cam-mam7
69+
DIFF SMS_D_Ln9.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s
70+
DIFF SMS_D_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_MTso.derecho_intel.cam-outfrq9s
71+
- expected differences in aerosol optical properties, otherwise bit-for-bit
72+
73+
derecho/nvhpc/aux_cam:
74+
FAIL ERS_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_nvhpc.cam-outfrq9s_gpu_default BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_161_nvhpc: DIFF
75+
- expected differences in aerosol optical properties, otherwise bit-for-bit
76+
77+
FAIL ERS_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_nvhpc.cam-outfrq9s_gpu_default COMPARE_base_rest
78+
- pre-existing failure -- see https://github.com/ESCOMP/CAM/issues/1513
79+
80+
izumi/nag/aux_cam:
81+
FAIL ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-outfrq3s_subcol
82+
- pre-existing failure -- see https://github.com/ESCOMP/CAM/issues/1514
83+
84+
DIFF ERC_D_Ln9.f10_f10_mt232.FHIST.izumi_nag.cam-outfrq3s_cospsathist
85+
DIFF ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-cosp_rad_diags
86+
DIFF ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-outfrq9s_nochem
87+
DIFF SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem
88+
DIFF SMS_D_Ln9.f10_f10_mt232.F1850.izumi_nag.cam-outfrq9s
89+
DIFF TMC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-mc_ttrac
90+
- expected differences in aerosol optical properties, otherwise bit-for-bit
91+
92+
izumi/gnu/aux_cam:
93+
DIFF ERC_D_Ln9.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags
94+
DIFF ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-rad_diag
95+
DIFF ERC_D_Ln9.f19_f19_mt232.FHIST.izumi_gnu.cam-lonlat_fv_diags
96+
DIFF ERC_D_Ln9.mpasa480_mpasa480_mt232.FHISTC_LTso.izumi_gnu.cam-outfrq9s_mpasa480
97+
DIFF ERC_D_Ln9.ne3pg3_ne3pg3_mt232.F1850_C4.izumi_gnu.cam-co2rmp
98+
DIFF ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_gnu.cam-sat_lcltod
99+
DIFF ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHIST.izumi_gnu.cam-nochem_clubbmf
100+
DIFF ERS_Ln9_P24x1.mpasa480_mpasa480.F2000climo.izumi_gnu.cam-outfrq9s_mpasa480
101+
DIFF PLB_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-ttrac_loadbal0
102+
DIFF PLB_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-ttrac_loadbal1
103+
DIFF PLB_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-ttrac_loadbal3
104+
DIFF SMS_D_Ln3.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc
105+
DIFF SMS_D_Ln9.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee
106+
DIFF SMS_D_Ln9.f19_f19_mt232.FW4madSD.izumi_gnu.cam-outfrq9s
107+
DIFF SUB_D_Ln9.ne3pg3_ne3pg3_mt232.FHIST.izumi_gnu.cam-outfrq9s
108+
- expected differences in aerosol optical properties, otherwise bit-for-bit
109+
110+
Summarize any changes to answers:
111+
112+
changes in aerosol optics diagnostics , otherwise bit-for-bit
113+
114+
===============================================================
115+
===============================================================
116+
3117
Tag name: cam6_4_161
4118
Originator(s): fvitt
5119
Date: 27 Mar 2026

src/chemistry/aerosol/bulk_aerosol_state_mod.F90

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module bulk_aerosol_state_mod
22
use shr_kind_mod, only: r8 => shr_kind_r8
33
use rad_constituents, only: rad_cnst_get_aer_mmr
44
use cam_abortutils, only: endrun
5-
5+
66
use physics_buffer, only: physics_buffer_desc
77
use physics_types, only: physics_state
88

@@ -336,8 +336,13 @@ function dry_volume(self, aero_props, list_idx, bin_idx, ncol, nlev) result(vol)
336336
integer, intent(in) :: nlev ! number of levels
337337

338338
real(r8) :: vol(ncol,nlev) ! m3/kg
339+
real(r8), pointer :: mmr(:,:) ! kg/kg
340+
real(r8) :: dens ! kg/m3
341+
342+
call aero_props%get(bin_idx, 1, density=dens)
343+
call self%get_ambient_mmr(list_idx, 1, bin_idx, mmr)
339344

340-
vol = -huge(1._r8)
345+
vol(:ncol,:nlev) = mmr(:ncol,:nlev)/dens
341346

342347
end function dry_volume
343348

@@ -356,7 +361,8 @@ function wet_volume(self, aero_props, list_idx, bin_idx, ncol, nlev) result(vol)
356361

357362
real(r8) :: vol(ncol,nlev) ! m3/kg
358363

359-
vol = -huge(1._r8)
364+
vol = self%dry_volume(aero_props, list_idx, bin_idx, ncol, nlev) &
365+
+ self%water_volume(aero_props, list_idx, bin_idx, ncol, nlev)
360366

361367
end function wet_volume
362368

@@ -375,7 +381,7 @@ function water_volume(self, aero_props, list_idx, bin_idx, ncol, nlev) result(vo
375381

376382
real(r8) :: vol(ncol,nlev) ! m3/kg
377383

378-
vol = -huge(1._r8)
384+
vol = 0._r8
379385

380386
end function water_volume
381387

src/chemistry/mozart/mo_tuvx.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ subroutine tuvx_get_photo_rates( pbuf, ncol, lchnk, height_mid, &
617617
integer :: ipht, k, idose
618618
integer :: i_col ! column index
619619
integer :: i_level ! vertical level index
620+
integer :: i_thrd ! index for current OMP thread
620621
real(r8) :: sza ! solar zenith angle [degrees]
621622
real(r8) :: cpe_rates(ncol,pverp+1,number_of_heating_rates) ! heating rates from TUV-x
622623
real(r8), pointer :: cpe_jo2_a(:,:) ! heating rate for jo2_a in physics buffer
@@ -649,7 +650,8 @@ subroutine tuvx_get_photo_rates( pbuf, ncol, lchnk, height_mid, &
649650
cpe_jo3_a(:,:) = 0.0_r8
650651
cpe_jo3_b(:,:) = 0.0_r8
651652

652-
associate( tuvx => tuvx_ptrs( thread_id( ) ) )
653+
i_thrd = thread_id()
654+
associate( tuvx => tuvx_ptrs( i_thrd ) )
653655

654656
allocate( photo_rates( pcols, pver+2, tuvx%n_photo_rates_ + tuvx%n_euv_rates_ &
655657
+ tuvx%n_special_rates_ ) )

src/physics/ali_arms

Submodule ali_arms updated 1 file

src/physics/cam/aerosol_optics_cam.F90

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,24 +1080,25 @@ subroutine update_diags( is_coarse_dust )
10801080
sumhygro = hygrosulf(icol) + hygropom(icol) + hygrosoa(icol) + hygrobc(icol) + &
10811081
hygrodust(icol) + hygrosslt(icol)
10821082

1083-
scatdust(icol) = (scatdust(icol) + scath2o*hygrodust(icol)/sumhygro)/sumscat
1084-
absdust(icol) = (absdust(icol) + absh2o*hygrodust(icol)/sumhygro)/sumabs
1083+
if (sumscat/=0._r8 .and. sumabs/=0._r8 .and. sumhygro/=0._r8) then
1084+
scatdust(icol) = (scatdust(icol) + scath2o*hygrodust(icol)/sumhygro)/sumscat
1085+
absdust(icol) = (absdust(icol) + absh2o*hygrodust(icol)/sumhygro)/sumabs
10851086

1086-
scatsulf(icol) = (scatsulf(icol) + scath2o*hygrosulf(icol)/sumhygro)/sumscat
1087-
abssulf(icol) = (abssulf(icol) + absh2o*hygrosulf(icol)/sumhygro)/sumabs
1087+
scatsulf(icol) = (scatsulf(icol) + scath2o*hygrosulf(icol)/sumhygro)/sumscat
1088+
abssulf(icol) = (abssulf(icol) + absh2o*hygrosulf(icol)/sumhygro)/sumabs
10881089

1089-
scatpom(icol) = (scatpom(icol) + scath2o*hygropom(icol)/sumhygro)/sumscat
1090-
abspom(icol) = (abspom(icol) + absh2o*hygropom(icol)/sumhygro)/sumabs
1090+
scatpom(icol) = (scatpom(icol) + scath2o*hygropom(icol)/sumhygro)/sumscat
1091+
abspom(icol) = (abspom(icol) + absh2o*hygropom(icol)/sumhygro)/sumabs
10911092

1092-
scatsoa(icol) = (scatsoa(icol) + scath2o*hygrosoa(icol)/sumhygro)/sumscat
1093-
abssoa(icol) = (abssoa(icol) + absh2o*hygrosoa(icol)/sumhygro)/sumabs
1093+
scatsoa(icol) = (scatsoa(icol) + scath2o*hygrosoa(icol)/sumhygro)/sumscat
1094+
abssoa(icol) = (abssoa(icol) + absh2o*hygrosoa(icol)/sumhygro)/sumabs
10941095

1095-
scatbc(icol)= (scatbc(icol) + scath2o*hygrobc(icol)/sumhygro)/sumscat
1096-
absbc(icol) = (absbc(icol) + absh2o*hygrobc(icol)/sumhygro)/sumabs
1097-
1098-
scatsslt(icol) = (scatsslt(icol) + scath2o*hygrosslt(icol)/sumhygro)/sumscat
1099-
abssslt(icol) = (abssslt(icol) + absh2o*hygrosslt(icol)/sumhygro)/sumabs
1096+
scatbc(icol)= (scatbc(icol) + scath2o*hygrobc(icol)/sumhygro)/sumscat
1097+
absbc(icol) = (absbc(icol) + absh2o*hygrobc(icol)/sumhygro)/sumabs
11001098

1099+
scatsslt(icol) = (scatsslt(icol) + scath2o*hygrosslt(icol)/sumhygro)/sumscat
1100+
abssslt(icol) = (abssslt(icol) + absh2o*hygrosslt(icol)/sumhygro)/sumabs
1101+
end if
11011102

11021103
aodabsbc(icol) = aodabsbc(icol) + absbc(icol)*dopaer(icol)*(1.0_r8-palb(icol))
11031104

@@ -1149,7 +1150,6 @@ subroutine update_diags( is_coarse_dust )
11491150
! dmleung 20 Oct 2025 ++
11501151
! Then, all these diagnostics are outputted based on the modified dust AOD.
11511152
! We simply apply dopaer/dopaer0 (>1 for coarse mode) to the absorption diagnostics.
1152-
aodvis(icol) = aodvis(icol) + dopaer(icol)
11531153
aodabs(icol) = aodabs(icol) + mass(icol,ilev) * pabs(icol) * dopaer(icol)/dopaer0(icol) ! dmleung
11541154
extinct(icol,ilev) = extinct(icol,ilev) + dopaer(icol)*air_density(icol,ilev)/mass(icol,ilev)
11551155
absorb(icol,ilev) = absorb(icol,ilev) + air_density(icol,ilev) * pabs(icol) * dopaer(icol)/dopaer0(icol) ! dmleung
@@ -1161,6 +1161,8 @@ subroutine update_diags( is_coarse_dust )
11611161

11621162
end if
11631163

1164+
aodvis(icol) = aodvis(icol) + dopaer(icol)
1165+
11641166
if (ilev<=troplev(icol)) then
11651167
aodvisst(icol) = aodvisst(icol) + dopaer(icol)
11661168
end if

0 commit comments

Comments
 (0)