Skip to content

Commit

Permalink
Fix bugs found with GNU regression tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nusbaume committed Jan 5, 2025
1 parent bcdd606 commit 8582fd5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/physics/cam/clubb_intr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2118,6 +2118,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
use cam_logfile, only: iulog
use tropopause, only: tropopause_findChemTrop
use time_manager, only: get_nstep, is_first_restart_step
use perf_mod, only: t_startf, t_stopf

#ifdef CLUBB_SGS
use hb_diff, only: pblintd
Expand Down Expand Up @@ -2153,8 +2154,6 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
use macrop_driver, only: liquid_macro_tend
use clubb_mf, only: integrate_mf

use perf_mod

#endif

implicit none
Expand Down Expand Up @@ -2192,12 +2191,14 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! Local Variables !
! ---------------------------------------------------- !

integer :: i !Must be delcared outside "CLUBB_SGS" ifdef for det_s and det_ice zero-ing loops

#ifdef CLUBB_SGS

type(physics_state) :: state1 ! Local copy of state variable
type(physics_ptend) :: ptend_loc ! Local tendency from processes, added up to return as ptend_all

integer :: i, j, k, t, ixind, nadv
integer :: j, k, t, ixind, nadv
integer :: ixcldice, ixcldliq, ixnumliq, ixnumice, ixq
integer :: itim_old
integer :: ncol, lchnk ! # of columns, and chunk identifier
Expand Down Expand Up @@ -4478,7 +4479,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
dpdlfliq(:ncol,:pver) = ptend_loc%q(:ncol,:pver,ixcldliq)*state1%pdeldry(:ncol,:pver)/state1%pdel(:ncol,:pver)
dpdlfice(:ncol,:pver) = ptend_loc%q(:ncol,:pver,ixcldice)*state1%pdeldry(:ncol,:pver)/state1%pdel(:ncol,:pver)
dpdlft(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpairv(:ncol,:pver, lchnk)
detnliquid(:ncol,:pver) = ptend_loc%q(:,:,ixnumliq)
detnliquid(:ncol,:pver) = ptend_loc%q(:ncol,:pver,ixnumliq)

call physics_ptend_sum(ptend_loc,ptend_all,ncol)
call physics_update(state1,ptend_loc,hdtime)
Expand Down

0 comments on commit 8582fd5

Please sign in to comment.