Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3940361
Made edits to output a complete horizontal momentum tendency budget. …
lignumvit Sep 24, 2020
4af221c
Changed the changelog
lignumvit Sep 26, 2020
9daa69c
Merge remote-tracking branch 'upstream/cam_development' into uvbudget
cacraigucar Jan 7, 2021
9367e6f
Update to cam6_3_007
cacraigucar Jan 7, 2021
e8921fb
Changed the UTEND_CORE, VTEND_CORE physics buffer variable names to D…
lignumvit Jan 28, 2021
acda43a
Moved addfld calls for ?TEND_* parameterization tendencies from cam_d…
lignumvit Jan 29, 2021
c40e013
Added a comment line.
lignumvit Jan 29, 2021
6118faa
Moved addfld calls for ?TEND_CORE variablers from check energy to
lignumvit Jan 29, 2021
e4cafa7
Moved the pbug_get_index calls for DUCORE, DVCORE into phys_init
lignumvit Jan 29, 2021
628c61a
Corrected units for UBP, VBP.
lignumvit Feb 2, 2021
3e545be
Added register_vector_field call for UBP, VBP.
lignumvit Feb 2, 2021
36e9b57
Added U, V to comment where UTEND_TOT, VTEND_TOT are computed.
lignumvit Feb 2, 2021
1d80a41
Added U, V to comment prior to retrieving variables from physics buffer.
lignumvit Feb 2, 2021
a027992
Removed register_vector_field from check_energy as it's not used.
lignumvit Feb 2, 2021
beb9a2c
Added U, V to comment prior to storing T, U, V into physics buffer.
lignumvit Feb 2, 2021
1341dc8
Added comment where ducore_idx, dvcore_idx are declared.
lignumvit Feb 2, 2021
eaed8dd
Made ?TEND_CORE variable long_names consistent with other ?TEND_*
lignumvit Feb 2, 2021
7366663
Added U, V to comment preceeding where ?TEND_CORE is computed.
lignumvit Feb 2, 2021
2315590
Removed unecessary ls=.false. where a macrop physics tendency structure
lignumvit Feb 2, 2021
7ab1db2
Broke up if statements bracketing ?TEND_* outfld calls so that if a
lignumvit Feb 2, 2021
f7890f4
Fixed comments that incorrectly referred to temperature.
lignumvit Feb 2, 2021
0ec281e
Merge tag 'cam6_3_010' into uvbudget
cacraigucar Mar 1, 2021
6940b63
Merge tag 'cam6_3_011' into uvbudget
cacraigucar Mar 1, 2021
55376ec
Update ChangeLog
cacraigucar Mar 3, 2021
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
57 changes: 57 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
===============================================================

Tag name: cam6_3_012
Originator(s): ckruse, cacraig
Date: March 3, 2021
One-line Summary: Add Horizontal Momentum Tendency Budget Variables
Github PR URL: https://github.com/ESCOMP/CAM/pull/232

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- Add Horizontal Momemntum Tendency Budget Variables (#226)
- Output U and V tendencies after every physics parameterization when history_budget is set to true. For ease
of use, all tendencies are output, even if they are zero or are output under a different name.

Describe any changes made to build system:

Describe any changes made to the namelist:
- "history_budget" now also outputs the horizontal momentum tendency variables after every physics parameterization

List any changes to the defaults for the boundary datasets:

Describe any substantial timing or memory changes:

Code reviewed by: cacraig, goldy, fvitt, nusbaume

List all files eliminated:

List all files added and what they do:

List all existing files that have been modified, and describe the changes:
M src/physics/cam/cam_diagnostics.F90
M src/physics/cam/check_energy.F90
M src/physics/cam/physpkg.F90
- Add logic to output horizontal momementum tendencies after every physics parameterization

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.

cheyenne/intel/aux_cam: all BFB

izumi/nag/aux_cam:
SMS_D_Ln7.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: DIFF) details:
FAIL SMS_D_Ln7.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_011_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
- expected new output fields

DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
FAIL DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae COMPARE_base_da
FAIL DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_011_nag: ERROR BFAIL some baseline files were missing
- continued known failing test

izumi/pgi/aux_cam:
ERC_D_Ln9.f10_f10_mg37.QPC4.izumi_pgi.cam-outfrq3s_diags (Overall: DIFF) details:
FAIL ERC_D_Ln9.f10_f10_mg37.QPC4.izumi_pgi.cam-outfrq3s_diags BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_011_pgi: FIELDLIST field lists differ (otherwise bit-for-bit)
- expected new output fields

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

Tag name: cam6_3_011
Originator(s): jet
Date: 1 Mar 2021
Expand Down
55 changes: 50 additions & 5 deletions src/physics/cam/cam_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ module cam_diagnostics
integer :: kvh_idx = 0
integer :: cush_idx = 0
integer :: t_ttend_idx = 0
integer :: t_utend_idx = 0
integer :: t_vtend_idx = 0

integer :: prec_dp_idx = 0
integer :: snow_dp_idx = 0
Expand Down Expand Up @@ -150,6 +152,8 @@ subroutine diag_register_dry()

! Request physics buffer space for fields that persist across timesteps.
call pbuf_add_field('T_TTEND', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), t_ttend_idx)
call pbuf_add_field('T_UTEND', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), t_utend_idx)
call pbuf_add_field('T_VTEND', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), t_vtend_idx)
end subroutine diag_register_dry

subroutine diag_register_moist()
Expand Down Expand Up @@ -195,6 +199,9 @@ subroutine diag_init_dry(pbuf2d)

! State before physics
call addfld ('TBP', (/ 'lev' /), 'A','K', 'Temperature (before physics)')
call addfld ('UBP', (/ 'lev' /), 'A','m/s', 'Zonal wind (before physics)')
call addfld ('VBP', (/ 'lev' /), 'A','m/s', 'Meridional Wind (before physics)')
call register_vector_field('UBP','VBP')
call addfld (bpcnst(1), (/ 'lev' /), 'A','kg/kg', trim(cnst_longname(1))//' (before physics)')
! State after physics
call addfld ('TAP', (/ 'lev' /), 'A','K', 'Temperature (after physics)' )
Expand All @@ -208,7 +215,12 @@ subroutine diag_init_dry(pbuf2d)
call addfld ('TFIX', horiz_only, 'A', 'K/s', 'T fixer (T equivalent of Energy correction)')
end if
call addfld ('TTEND_TOT', (/ 'lev' /), 'A', 'K/s', 'Total temperature tendency')


! outfld calls in diag_phys_tend_writeout
call addfld ('UTEND_TOT', (/ 'lev' /), 'A', 'm/s2', 'Total zonal wind tendency')
call addfld ('VTEND_TOT', (/ 'lev' /), 'A', 'm/s2', 'Total meridional wind tendency')
call register_vector_field('UTEND_TOT','VTEND_TOT')

! Debugging negative water output fields
call addfld ('INEGCLPTEND ', (/ 'lev' /), 'A', 'kg/kg/s', 'Cloud ice tendency due to clipping neg values after microp')
call addfld ('LNEGCLPTEND ', (/ 'lev' /), 'A', 'kg/kg/s', 'Cloud liq tendency due to clipping neg values after microp')
Expand Down Expand Up @@ -330,9 +342,13 @@ subroutine diag_init_dry(pbuf2d)
call add_default ('U ' , history_budget_histfile_num, ' ')
call add_default ('V ' , history_budget_histfile_num, ' ')
call add_default ('TTEND_TOT' , history_budget_histfile_num, ' ')
call add_default ('UTEND_TOT' , history_budget_histfile_num, ' ')
call add_default ('VTEND_TOT' , history_budget_histfile_num, ' ')

! State before physics (FV)
call add_default ('TBP ' , history_budget_histfile_num, ' ')
call add_default ('UBP ' , history_budget_histfile_num, ' ')
call add_default ('VBP ' , history_budget_histfile_num, ' ')
call add_default (bpcnst(1) , history_budget_histfile_num, ' ')
! State after physics (FV)
call add_default ('TAP ' , history_budget_histfile_num, ' ')
Expand All @@ -351,9 +367,14 @@ subroutine diag_init_dry(pbuf2d)
end if

! outfld calls in diag_phys_tend_writeout
call addfld ('PTTEND', (/ 'lev' /), 'A', 'K/s','T total physics tendency' )
call addfld ('PTTEND', (/ 'lev' /), 'A', 'K/s','T total physics tendency')
call addfld ('UTEND_PHYSTOT', (/ 'lev' /), 'A', 'm/s2','U total physics tendency')
call addfld ('VTEND_PHYSTOT', (/ 'lev' /), 'A', 'm/s2','V total physics tendency')
call register_vector_field('UTEND_PHYSTOT','VTEND_PHYSTOT')
if ( history_budget ) then
call add_default ('PTTEND' , history_budget_histfile_num, ' ')
call add_default ('UTEND_PHYSTOT' , history_budget_histfile_num, ' ')
call add_default ('VTEND_PHYSTOT' , history_budget_histfile_num, ' ')
end if

! create history variables for fourier coefficients of the diurnal
Expand Down Expand Up @@ -613,6 +634,8 @@ subroutine diag_init_moist(pbuf2d)
if ( history_budget ) then
call add_default (cnst_name(1), history_budget_histfile_num, ' ')
call add_default ('PTTEND' , history_budget_histfile_num, ' ')
call add_default ('UTEND_PHYSTOT' , history_budget_histfile_num, ' ')
call add_default ('VTEND_PHYSTOT' , history_budget_histfile_num, ' ')
call add_default (ptendnam( 1), history_budget_histfile_num, ' ')
if (ixcldliq > 0) then
call add_default (ptendnam(ixcldliq), history_budget_histfile_num, ' ')
Expand Down Expand Up @@ -862,6 +885,8 @@ subroutine diag_conv_tend_ini(state,pbuf)

integer :: i, k, m, lchnk, ncol
real(r8), pointer, dimension(:,:) :: t_ttend
real(r8), pointer, dimension(:,:) :: t_utend
real(r8), pointer, dimension(:,:) :: t_vtend

lchnk = state%lchnk
ncol = state%ncol
Expand All @@ -885,6 +910,10 @@ subroutine diag_conv_tend_ini(state,pbuf)
do m = 1, dyn_time_lvls
call pbuf_get_field(pbuf, t_ttend_idx, t_ttend, start=(/1,1,m/), kount=(/pcols,pver,1/))
t_ttend(:ncol,:) = state%t(:ncol,:)
call pbuf_get_field(pbuf, t_utend_idx, t_utend, start=(/1,1,m/), kount=(/pcols,pver,1/))
t_utend(:ncol,:) = state%u(:ncol,:)
call pbuf_get_field(pbuf, t_vtend_idx, t_vtend, start=(/1,1,m/), kount=(/pcols,pver,1/))
t_vtend(:ncol,:) = state%v(:ncol,:)
end do
end if

Expand Down Expand Up @@ -2018,6 +2047,8 @@ subroutine diag_phys_tend_writeout_dry(state, pbuf, tend, ztodt)
real(r8) :: heat_glob ! global energy integral (FV only)
! CAM pointers to get variables from the physics buffer
real(r8), pointer, dimension(:,:) :: t_ttend
real(r8), pointer, dimension(:,:) :: t_utend
real(r8), pointer, dimension(:,:) :: t_vtend
integer :: itim_old,m

!-----------------------------------------------------------------------
Expand All @@ -2043,19 +2074,31 @@ subroutine diag_phys_tend_writeout_dry(state, pbuf, tend, ztodt)
ftem3(:ncol,:pver) = tend%dtdt(:ncol,:pver)
end if
call outfld('PTTEND',ftem3, pcols, lchnk )
ftem3(:ncol,:pver) = tend%dudt(:ncol,:pver)
call outfld('UTEND_PHYSTOT',ftem3, pcols, lchnk )
ftem3(:ncol,:pver) = tend%dvdt(:ncol,:pver)
call outfld('VTEND_PHYSTOT',ftem3, pcols, lchnk )

! Total (physics+dynamics, everything!) tendency for Temperature

!! get temperature stored in physics buffer
!! get temperature, U, and V stored in physics buffer
itim_old = pbuf_old_tim_idx()
call pbuf_get_field(pbuf, t_ttend_idx, t_ttend, start=(/1,1,itim_old/), kount=(/pcols,pver,1/))
call pbuf_get_field(pbuf, t_utend_idx, t_utend, start=(/1,1,itim_old/), kount=(/pcols,pver,1/))
call pbuf_get_field(pbuf, t_vtend_idx, t_vtend, start=(/1,1,itim_old/), kount=(/pcols,pver,1/))

!! calculate and outfld the total temperature tendency
!! calculate and outfld the total temperature, U, and V tendencies
ftem3(:ncol,:) = (state%t(:ncol,:) - t_ttend(:ncol,:))/ztodt
call outfld('TTEND_TOT', ftem3, pcols, lchnk)
ftem3(:ncol,:) = (state%u(:ncol,:) - t_utend(:ncol,:))/ztodt
call outfld('UTEND_TOT', ftem3, pcols, lchnk)
ftem3(:ncol,:) = (state%v(:ncol,:) - t_vtend(:ncol,:))/ztodt
call outfld('VTEND_TOT', ftem3, pcols, lchnk)

!! update physics buffer with this time-step's temperature
!! update physics buffer with this time-step's temperature, U, and V
t_ttend(:ncol,:) = state%t(:ncol,:)
t_utend(:ncol,:) = state%u(:ncol,:)
t_vtend(:ncol,:) = state%v(:ncol,:)

end subroutine diag_phys_tend_writeout_dry

Expand Down Expand Up @@ -2220,6 +2263,8 @@ subroutine diag_state_b4_phys_write_dry (state)
lchnk = state%lchnk

call outfld('TBP', state%t, pcols, lchnk )
call outfld('UBP', state%u, pcols, lchnk )
call outfld('VBP', state%v, pcols, lchnk )

end subroutine diag_state_b4_phys_write_dry

Expand Down
6 changes: 6 additions & 0 deletions src/physics/cam/check_energy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ module check_energy

integer :: teout_idx = 0 ! teout index in physics buffer
integer :: dtcore_idx = 0 ! dtcore index in physics buffer
integer :: ducore_idx = 0 ! ducore index in physics buffer
integer :: dvcore_idx = 0 ! dvcore index in physics buffer

type check_tracers_data
real(r8) :: tracer(pcols,pcnst) ! initial vertically integrated total (kinetic + static) energy
Expand Down Expand Up @@ -137,9 +139,13 @@ subroutine check_energy_register()

call pbuf_add_field('TEOUT', 'global',dtype_r8 , (/pcols,dyn_time_lvls/), teout_idx)
call pbuf_add_field('DTCORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),dtcore_idx)
call pbuf_add_field('DUCORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),ducore_idx)
call pbuf_add_field('DVCORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),dvcore_idx)
if(is_subcol_on()) then
call pbuf_register_subcol('TEOUT', 'phys_register', teout_idx)
call pbuf_register_subcol('DTCORE', 'phys_register', dtcore_idx)
call pbuf_register_subcol('DUCORE', 'phys_register', ducore_idx)
call pbuf_register_subcol('DVCORE', 'phys_register', dvcore_idx)
end if

end subroutine check_energy_register
Expand Down
Loading