Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
101 changes: 99 additions & 2 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,8 @@ subroutine diag_init_dry(pbuf2d)

! State before physics
call addfld ('TBP', (/ 'lev' /), 'A','K', 'Temperature (before physics)')
call addfld ('UBP', (/ 'lev' /), 'A','m/s2', 'Zonal wind (before physics)')
call addfld ('VBP', (/ 'lev' /), 'A','m/s2', 'Meridional Wind (before physics)')
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 +214,11 @@ 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')


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 +340,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 +365,68 @@ 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

! outfld calls in physpkg
call addfld ( 'UTEND_DCONV', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by deep convection')
call addfld ( 'VTEND_DCONV', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by deep convection')
call register_vector_field ( 'UTEND_DCONV', 'VTEND_DCONV')
call addfld ( 'UTEND_SHCONV', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by shallow convection')
call addfld ( 'VTEND_SHCONV', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by shallow convection')
call register_vector_field ( 'UTEND_SHCONV', 'VTEND_SHCONV')
call addfld ( 'UTEND_MACROP', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by macrophysics')
call addfld ( 'VTEND_MACROP', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by macrophysics')
call register_vector_field ( 'UTEND_MACROP', 'VTEND_MACROP')
call addfld ( 'UTEND_VDIFF', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by vert. diffus.')
call addfld ( 'VTEND_VDIFF', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by vert. diffus.')
call register_vector_field ( 'UTEND_VDIFF', 'VTEND_VDIFF')
call addfld ( 'UTEND_RAYLEIGH', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by Rayleigh Fric.')
call addfld ( 'VTEND_RAYLEIGH', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by Rayleigh Fric.')
call register_vector_field ( 'UTEND_RAYLEIGH', 'VTEND_RAYLEIGH')
call addfld ( 'UTEND_GWDTOT', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by all GWs')
call addfld ( 'VTEND_GWDTOT', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by all GWs')
call register_vector_field ( 'UTEND_GWDTOT', 'VTEND_GWDTOT')
call addfld ( 'UTEND_QBORLX', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by QBO relaxation')
call addfld ( 'VTEND_QBORLX', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by QBO relaxation')
call register_vector_field ( 'UTEND_QBORLX', 'VTEND_QBORLX')
call addfld ( 'UTEND_LUNART', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by lunar tides')
call addfld ( 'VTEND_LUNART', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by lunar tides')
call register_vector_field ( 'UTEND_LUNART', 'VTEND_LUNART')
call addfld ( 'UTEND_IONDRG', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by ion drag')
call addfld ( 'VTEND_IONDRG', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by ion drag')
call register_vector_field ( 'UTEND_IONDRG', 'VTEND_IONDRG')
call addfld ( 'UTEND_NDG', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by nudging')
call addfld ( 'VTEND_NDG', (/ 'lev' /), 'A', 'm/s2', 'Meridional wind tendency by nudging')
call register_vector_field ( 'UTEND_NDG', 'VTEND_NDG')
if ( history_budget ) then
call add_default ( 'UTEND_DCONV' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_DCONV' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_SHCONV' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_SHCONV' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_MACROP' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_MACROP' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_VDIFF' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_VDIFF' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_RAYLEIGH' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_RAYLEIGH' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_GWDTOT' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_GWDTOT' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_QBORLX' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_QBORLX' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_LUNART' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_LUNART' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_IONDRG' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_IONDRG' , history_budget_histfile_num, ' ')
call add_default ( 'UTEND_NDG' , history_budget_histfile_num, ' ')
call add_default ( 'VTEND_NDG' , history_budget_histfile_num, ' ')
end if

! create history variables for fourier coefficients of the diurnal
Expand Down Expand Up @@ -613,6 +686,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 +937,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 +962,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 +2099,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 +2126,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
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
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
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 +2315,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
15 changes: 14 additions & 1 deletion 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 ! dtcore index in physics buffer
integer :: dvcore_idx = 0 ! dtcore 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('UTEND_CORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),ducore_idx)
call pbuf_add_field('VTEND_CORE','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('UTEND_CORE', 'phys_register', ducore_idx)
call pbuf_register_subcol('VTEND_CORE', 'phys_register', dvcore_idx)
end if

end subroutine check_energy_register
Expand Down Expand Up @@ -173,7 +179,7 @@ subroutine check_energy_init()
! Initialize the energy conservation module
!
!-----------------------------------------------------------------------
use cam_history, only: addfld, add_default, horiz_only
use cam_history, only: addfld, add_default, horiz_only, register_vector_field
use phys_control, only: phys_getopts

implicit none
Expand All @@ -193,12 +199,19 @@ subroutine check_energy_init()
call addfld('TEFIX', horiz_only, 'A', 'J/m2', 'Total energy after fixer')
call addfld('EFIX', horiz_only, 'A', 'W/m2', 'Effective sensible heat flux due to energy fixer')
call addfld('DTCORE', (/ 'lev' /), 'A', 'K/s' , 'T tendency due to dynamical core')
call addfld('UTEND_CORE', (/ 'lev' /), 'A', 'm/s2' , 'U tendency due to dynamical core')
call addfld('VTEND_CORE', (/ 'lev' /), 'A', 'm/s2' , 'V tendency due to dynamical core')
call register_vector_field('UTEND_CORE','VTEND_CORE')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside the check_energy module seems like an odd place for these addfld calls for dycore tendencies diagnostics. Should those be with the other added addfld calls in cam_diagnostics or in phys_init (in the some module source file as the corresponding outfld calls)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. @gold2718 and @nusbaume - what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, and would probably vote to move them to cam_diagnostics, mostly because I think physpkg has enough going on, and I don't want to start adding extra addfld calls to it if we can avoid it.

However, would this move include DTCORE, which I suspect the added tendencies were modeled after? Does anyone know if there is a reason for DTCORE to be located in check_energy?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our usual standard is that the addfld call should be in the same module as the corresponding outfld call. Otherwise, it risks being removed in a cleanup pass.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gold2718 that's a good point! However, in that case I might vote to move most of the addfld and outfld calls to their respective physics parameterization interfaces. For example, I would move UTEND_RAYLEIGH inside rayleigh_friction_tend, instead of having it exist in tphysac.

Obviously some of the quantities, like UTEND_TOT, may not have a clear location, in which case I am happy to put them in either cam_diagnostics or somewhere in physpkg (whatever we decide).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siouxyalie I think having the tendency named after the process instead of the particular parameterization makes complete sense, at least for this particular diagnostic.

However, you can still go one-level down, at least for many of these processes, as subroutines like convect_shallow_tend and vertical_diffusion_tend are designed to manage multiple different parameterizations (e.g. between CAM4 and CAM5 physics) in the same location, so the diagnostic can still be independent of the exact parameterization chosen. I agree that the same should be done for the temperature and humidity tendency diagnostics as well, although we don't have to do that for this PR unless you are really feeling up to it (as we can always just make an issue instead and save it for later).

For ?TEND_MACROP, the argument could be made that labeling CLUBB just "MACROP" is not really accurate, as CLUBB also includes shallow convection and vertical diffusion. So if someone was comparing CAM4 to CAM6 and wasn't knowledgeable it would look as if CAM6 had no shallow convection but a huge cloud macrophysics tendency, when in reality this isn't actually the case.

So, I might argue that ?TEND_MACROP should only represent the tendencies from macrop_driver_tend, and just use TEND_CLUBB for CLUBB (as that would remove the redundancy). I also believe you could pass in the macmic sub-stepping info into macrop_driver_tend similar to what is done for clubb_tend_cam and calculate the (properly scaled) tendencies there, again like what is done for ?TEND_CLUBB. However, I don't know this section of the code that well, so it is entirely possible that I am missing something (maybe the other SEs can chime in if they think that is wise or not)?

Finally, if I am the only one pushing for this larger change and the other SEs don't think it is necessary then I am happy to concede, especially if it holds up this PR for too long.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe very strongly that the budget terms should all be consistently written out in the tphysac/tphysbc routines.

One constraint of these budget terms is that adding up all the individual budget terms should yield the total budget term. After much discussion between @siouxyalie and I, we determined that this is up to the user to verify - setting up a test was becoming very cumbersome. He also thought it was standard practice for users to do this verification.

With that in mind, if a new parameterization is added and the individual budget terms for that parameterization are not output the total budget will not match. At that point unless the outputting of the budget terms are in a single routine, the user will have a more difficult task of trying to identify the parameterization which is missing the term. Now it is a simple matter of scanning through the calls and seeing which is missing the outfld calls. Also, as people love to "find examples", this approach will prompt them to create budget terms for the new parameterization.

With that in mind, if the outfld calls are in tphysac/tphysbc, @gold2718 where would you like the addfld calls to reside? The outfld calls I see at this level have their addfld calls in check_energy (as @siouxyalie) pointed out.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said above, if the outfld calls are to stay in physpkg.F90 (a temporary solution as it will obviously not translate to the new infrastructure), then the addfld calls should also be there. Is there a problem with that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem other than it shows my indecisiveness of which rule we were going to break - the addfld being in the same module or keeping the interfaces in physpkg "clean". After thinking about it more, I agree with your confirmation of the proper place for the addfld calls. My alternate approach doesn't look so good in the light of Monday morning.

@siouxyalie - this means that you will pull all of your addfld calls for your new outfld calls out of the places where you put them and put them all in the phys_init routine inside physpkg.F90. I would suggest you make a section at the very end of the routine with them. You will also need to add at the top of phys_init a "use cam_history, only: addfld".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this guidance. On it.


if ( history_budget ) then
call add_default ('DTCORE', history_budget_histfile_num, ' ')
call add_default ('UTEND_CORE', history_budget_histfile_num, ' ')
call add_default ('VTEND_CORE', history_budget_histfile_num, ' ')
end if
if ( history_waccm ) then
call add_default ('DTCORE', 1, ' ')
call add_default ('UTEND_CORE', 1, ' ')
call add_default ('VTEND_CORE', 1, ' ')
end if

end subroutine check_energy_init
Expand Down
Loading