Skip to content

Commit c40556c

Browse files
authored
Merge pull request #1288 from jimmielin/hplin/geopotential_t_water_species
cam6_4_080: Derive new geopotential fields whenever water species are updated (not just water vapor)
2 parents 0b82b2e + 04f6f2e commit c40556c

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

doc/ChangeLog

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
1+
===============================================================
2+
3+
Tag name: cam6_4_080
4+
Originator(s): jimmielin
5+
Date: March 25, 2025
6+
One-line Summary: Derive new geopotential fields whenever water species are updated (not just water vapor)
7+
Github PR URL: https://github.com/ESCOMP/CAM/pull/1288
8+
9+
Purpose of changes (include the issue number and title text for each relevant GitHub issue):
10+
- Fixes: geopotential_t should be recomputed if any water species are updated, not just water vapor (#1286)
11+
12+
Describe any changes made to build system: N/A
13+
14+
Describe any changes made to the namelist: N/A
15+
16+
List any changes to the defaults for the boundary datasets: N/A
17+
18+
Describe any substantial timing or memory changes: N/A
19+
20+
Code reviewed by: PeterHjortLauritzen, cacraig
21+
22+
List all files eliminated: N/A
23+
24+
List all files added and what they do: N/A
25+
26+
List all existing files that have been modified, and describe the changes:
27+
M src/physics/cam/physics_types.F90
28+
- call geopotential_t if any water species have tendencies, not just water vapor.
29+
30+
If there were any failures reported from running test_driver.sh on any test
31+
platform, and checkin with these failures has been OK'd by the gatekeeper,
32+
then copy the lines from the td.*.status files for the failed tests to the
33+
appropriate machine below. All failed tests must be justified.
34+
35+
derecho/intel/aux_cam:
36+
SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s_amie (Overall: DIFF) details:
37+
- expected baseline change due to fix included in this PR
38+
39+
ERP_D_Ln9.ne30pg3_ne30pg3_mt232.QPC7.derecho_intel.cam-outfrq3s_cosp (Overall: FAIL) details:
40+
ERS_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
41+
- pre-existing failures: Two restart tests have answer changes due to moving mountain update in cam6_4_078 (#1284)
42+
43+
ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
44+
SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: PASS) details:
45+
- pre-existing failures due to HEMCO not having reproducible results (issues #1018 and #856)
46+
47+
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
48+
- pre-existing failures due to build-namelist error requiring CLM/CTSM external update
49+
50+
derecho/nvhpc/aux_cam: ALL PASS
51+
52+
izumi/nag/aux_cam:
53+
ERC_D_Ln9.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
54+
ERC_D_Ln9.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
55+
SMS_D_Ln3.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
56+
SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
57+
- expected baseline changes due to fix included in this PR
58+
59+
izumi/gnu/aux_cam:
60+
ERC_D_Ln9.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: DIFF) details:
61+
- expected baseline change due to fix included in this PR
162

263
===============================================================
364

src/physics/cam/physics_types.F90

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ subroutine physics_update(state, ptend, dt, tend)
211211
use scamMod, only: scm_crm_mode, single_column
212212
use phys_control, only: phys_getopts
213213
use cam_thermo, only: cam_thermo_dry_air_update ! Routine which updates physconst variables (WACCM-X)
214-
use air_composition, only: dry_air_species_num
214+
use air_composition, only: dry_air_species_num, thermodynamic_active_species_num, thermodynamic_active_species_idx
215215
use qneg_module , only: qneg3
216216

217217
!------------------------------Arguments--------------------------------
@@ -231,6 +231,7 @@ subroutine physics_update(state, ptend, dt, tend)
231231
integer :: ixnumsnow, ixnumrain
232232
integer :: ncol ! number of columns
233233
integer :: ixh, ixh2 ! constituent indices for H, H2
234+
logical :: derive_new_geopotential ! derive new geopotential fields?
234235

235236
real(r8) :: zvirv(state%psetcols,pver) ! Local zvir array pointer
236237

@@ -419,9 +420,23 @@ subroutine physics_update(state, ptend, dt, tend)
419420
end do
420421
end if
421422

422-
! Derive new geopotential fields if heating or water tendency not 0.
423+
! Derive new geopotential fields if heating or water species tendency not 0.
424+
derive_new_geopotential = .false.
425+
if(ptend%ls) then
426+
! Heating tendency not 0
427+
derive_new_geopotential = .true.
428+
else
429+
! Check all water species and if there are nonzero tendencies
430+
const_water_loop: do m = dry_air_species_num + 1, thermodynamic_active_species_num
431+
if(ptend%lq(thermodynamic_active_species_idx(m))) then
432+
! does water species have tendency?
433+
derive_new_geopotential = .true.
434+
exit const_water_loop
435+
endif
436+
enddo const_water_loop
437+
endif
423438

424-
if (ptend%ls .or. ptend%lq(1)) then
439+
if (derive_new_geopotential) then
425440
call geopotential_t ( &
426441
state%lnpint, state%lnpmid, state%pint , state%pmid , state%pdel , state%rpdel , &
427442
state%t , state%q(:,:,:), rairv_loc(:,:), gravit , zvirv , &

0 commit comments

Comments
 (0)