Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmielin committed Nov 21, 2024
1 parent 902c495 commit bc5428f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/control/cam_snapshot_common.F90
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,8 @@ subroutine state_snapshot_all_outfld(lchnk, file_num, state)
call outfld(state_snapshot(i)%standard_name, state%te_cur(:, dyn_te_idx), pcols, lchnk)

case ('air_composition_cp_or_cv_dycore')
! this field is not part of physics state (it is in air_composition)
! but describes the atmospheric thermodynamic state and thus saved within the snapshot
call outfld(state_snapshot(i)%standard_name, cp_or_cv_dycore(:,:,lchnk), pcols, lchnk)

case default
Expand Down
15 changes: 9 additions & 6 deletions src/physics/cam/check_energy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ subroutine tot_energy_phys(state, outfld_name_suffix,vc)
lchnk = state%lchnk
ncol = state%ncol

! The "vertical coordinate" parameter is equivalent to the dynamical core
! energy formula parameter, which controls the dycore energy formula used
! by get_hydrostatic_energy.
if (present(vc)) then
vc_loc = vc
else
Expand Down Expand Up @@ -758,11 +761,11 @@ subroutine check_energy_cam_chng(state, tend, name, nstep, ztodt, &
type(physics_tend ), intent(inout) :: tend
character*(*),intent(in) :: name ! parameterization name for fluxes
integer , intent(in) :: nstep ! current timestep number
real(r8), intent(in) :: ztodt ! 2 delta t (model time increment)
real(r8), intent(in) :: flx_vap(:) ! (pcols) - boundary flux of vapor (kg/m2/s)
real(r8), intent(in) :: flx_cnd(:) ! (pcols) -boundary flux of liquid+ice (m/s) (precip?)
real(r8), intent(in) :: flx_ice(:) ! (pcols) -boundary flux of ice (m/s) (snow?)
real(r8), intent(in) :: flx_sen(:) ! (pcols) -boundary flux of sensible heat (w/m2)
real(r8), intent(in) :: ztodt ! physics timestep (s)
real(r8), intent(in) :: flx_vap(:) ! (pcols) - boundary flux of vapor (kg/m2/s)
real(r8), intent(in) :: flx_cnd(:) ! (pcols) - boundary flux of lwe liquid+ice (m/s)
real(r8), intent(in) :: flx_ice(:) ! (pcols) - boundary flux of lwe ice (m/s)
real(r8), intent(in) :: flx_sen(:) ! (pcols) - boundary flux of sensible heat (W/m2)

integer :: lchnk ! chunk identifier
integer :: ncol ! number of atmospheric columns
Expand All @@ -785,7 +788,7 @@ subroutine check_energy_cam_chng(state, tend, name, nstep, ztodt, &

scaling_dycore(:ncol,:) = cpairv(:ncol,:,lchnk)/local_cp_or_cv_dycore(:ncol,:) ! cp/cv scaling
endif
elseif(state%psetcols > pcols) then
else if(state%psetcols > pcols) then
! Subcolumns
if(.not. all(cpairv(:,:,:) == cpair)) then
call endrun('check_energy_chng: cpairv is not allowed to vary when subcolumns are turned on')
Expand Down

0 comments on commit bc5428f

Please sign in to comment.