Skip to content

cam6_4_101: Write cam_in%cflx for all constituents, not just Q #1336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 additions & 3 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
===============================================================

Tag name: cam6_4_101
Originator(s): jimmielin
Date: July 1, 2025
One-line Summary: Write cam_in%cflx for all constituents in snapshots, not just Q
Github PR URL: https://github.com/ESCOMP/CAM/pull/1336

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- For CAM snaphots, write cam_in%cflx for all constituents instead of just Q as it was declared horiz_only. Now write out as cam_in_cflx_(constituent name) - https://github.com/ESCOMP/CAM/issues/1335

Describe any changes made to build system: N/A

Describe any changes made to the namelist: N/A

List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes: N/A

Code reviewed by: cacraig

List all files eliminated: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:
M src/control/cam_snapshot_common.F90
- fix #1335
M src/control/cam_history.F90
- fix typo in comment

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:

SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL)
- pre-existing failure due to build-namelist error requiring CLM/CTSM external update

derecho/nvhpc/aux_cam: All PASS

izumi/nag/aux_cam: All PASS

izumi/gnu/aux_cam: All PASS

CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: B4B - only new fields to snapshots

===============================================================

Tag name: cam6_4_100
Originator(s): peverwhee, gdicker1
Date: 26 June 2025
Expand Down Expand Up @@ -69,7 +121,7 @@ Github PR URL: https://github.com/ESCOMP/CAM/pull/1331

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

. Resolve #1329 - Create an F compset for CAM4
. Resolve #1329 - Create an F compset for CAM4
- Add compset FHIST_C4

. Modify some MPAS tests.
Expand All @@ -79,7 +131,7 @@ Purpose of changes (include the issue number and title text for each relevant Gi
. Resolve #1332 - ne0ARCTICne30x4 test fails with 1280 tasks and fixed CTSM,
because of too few processors
- increase pe count from 1280 to 1920. Make this the default in the
config_pes.xml file.
config_pes.xml file.

. Resolve #1326 - Add MPAS-O and MPAS-SI from EarthWorksOrg/EarthWorks
- add "mpaso" as a valid value in the configure definition file
Expand Down Expand Up @@ -157,7 +209,7 @@ cime_config/testdefs/testlist_cam.xml
ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon
. Increase PEs for ARCTIC test by modifying config_pes.xml and remove the
specification from the test definition.
Replace
Replace
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s
by
SMS_D_Ln9.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s
Expand Down
2 changes: 1 addition & 1 deletion src/control/cam_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7023,7 +7023,7 @@ end subroutine cam_history_snapshot_deactivate

subroutine cam_history_snapshot_activate(name, tape)

! This subroutine activates (set aftflag to true) for the requested tape number
! This subroutine activates (set actflag to true) for the requested tape number

character(len=*), intent(in) :: name
integer, intent(in) :: tape
Expand Down
39 changes: 35 additions & 4 deletions src/control/cam_snapshot_common.F90
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,16 @@ subroutine cam_in_snapshot_init(cam_snapshot_before_num, cam_snapshot_after_num,
! This subroutine does the addfld calls for cam_in fields
!--------------------------------------------------------

use constituents, only: cnst_name

type(cam_in_t), intent(in) :: cam_in

integer,intent(in) :: cam_snapshot_before_num, cam_snapshot_after_num
integer, intent(in) :: cam_snapshot_before_num, cam_snapshot_after_num

! for constituent loop.
integer :: mcnst
character(len=64) :: fname
character(len=128) :: lname

ncam_in_var = 0

Expand Down Expand Up @@ -464,8 +471,15 @@ subroutine cam_in_snapshot_init(cam_snapshot_before_num, cam_snapshot_after_num,
call snapshot_addfld( ncam_in_var, cam_in_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'cam_in%shf', 'cam_in_shf', 'unset', horiz_only)

call snapshot_addfld( ncam_in_var, cam_in_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'cam_in%cflx', 'cam_in_cflx', 'unset', horiz_only)
! cam_in%cflx is sized (pcols, pcnst); because the constituent indices at the model that reads this
! data may not match the indices in the model outputting the snapshot,
! cam_in%cflx is split into a series of snapshot variables cam_in_cflx_(constituent name).
do mcnst = 1, pcnst
fname = 'cam_in_cflx_'//trim(cnst_name(mcnst))
lname = 'cam_in_cflx_'//trim(cnst_name(mcnst))
call snapshot_addfld( ncam_in_var, cam_in_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
fname, lname, 'kg m-2 s-1', horiz_only)
enddo

call snapshot_addfld( ncam_in_var, cam_in_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'cam_in%wsx', 'cam_in_wsx', 'unset', horiz_only)
Expand Down Expand Up @@ -988,11 +1002,15 @@ end subroutine tend_snapshot_all_outfld

subroutine cam_in_snapshot_all_outfld(lchnk, file_num, cam_in)

use constituents, only: cnst_name

integer, intent(in) :: lchnk
integer, intent(in) :: file_num
type(cam_in_t), intent(in) :: cam_in

integer :: i
integer :: mcnst
character(len=64) :: fname

do i=1, ncam_in_var

Expand Down Expand Up @@ -1057,14 +1075,27 @@ subroutine cam_in_snapshot_all_outfld(lchnk, file_num, cam_in)
call outfld(cam_in_snapshot(i)%standard_name, cam_in%dstflx, pcols, lchnk)

case default
call endrun('ERROR in cam_in_snapshot_all_outfld: no match found for '//trim(cam_in_snapshot(i)%ddt_string))
if (cam_in_snapshot(i)%ddt_string(1:12) == 'cam_in_cflx_') then
! This case is handled below in a loop (not looked up here as it would be i*pcnst iterations)
else
call endrun('ERROR in cam_in_snapshot_all_outfld: no match found for '//trim(cam_in_snapshot(i)%ddt_string))
endif

end select

call cam_history_snapshot_deactivate(trim(cam_in_snapshot(i)%standard_name))

end do

! Handle cam_in%cflx constituent loop
do mcnst = 1, pcnst
fname = 'cam_in_cflx_'//trim(cnst_name(mcnst))

call cam_history_snapshot_activate(trim(fname), file_num)
call outfld(fname, cam_in%cflx(:,mcnst), pcols, lchnk)
call cam_history_snapshot_deactivate(trim(fname))
end do

end subroutine cam_in_snapshot_all_outfld

subroutine cam_out_snapshot_all_outfld(lchnk, file_num, cam_out)
Expand Down