Skip to content

Commit 39a2cbf

Browse files
author
Haipeng Lin
committed
Changes to address atmos_phys reviewer comments.
1 parent b938772 commit 39a2cbf

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

src/physics/cam/microp_aero.F90

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ subroutine microp_aero_init(phys_state,pbuf2d)
183183
character(len=*), parameter :: routine = 'microp_aero_init'
184184
logical :: history_amwg
185185

186+
character(len=512) :: errmsg
187+
integer :: errflg
188+
186189
class(aerosol_properties), pointer :: aero_props_bulk => null()
187190

188191
!-----------------------------------------------------------------------
@@ -321,7 +324,10 @@ subroutine microp_aero_init(phys_state,pbuf2d)
321324

322325
call ndrop_bam_init(masterproc, iulog, &
323326
mwh2o=mwh2o, r_universal=r_universal, tmelt=tmelt, rhoh2o=rhoh2o, &
324-
naer_all_out=naer_all)
327+
naer_all_out=naer_all, errmsg=errmsg, errflg=errflg)
328+
if (errflg /= 0) then
329+
call endrun(routine//': ndrop_bam_init: '//trim(errmsg))
330+
end if
325331

326332
! Set module-level props object for BAM (used by nucleate_ice_cam)
327333
aero_props_obj => aero_props_bulk
@@ -537,6 +543,8 @@ subroutine microp_aero_run ( &
537543
real(r8), allocatable :: ccn_bam(:,:,:) ! CCN at 6 supersaturations (#/cm3)
538544
real(r8), allocatable :: naer2_bam(:,:,:) ! aerosol number conc for diagnostics
539545

546+
real(r8) :: wp2_full(pcols,pverp) ! CLUBB wp2 expanded onto the full interface grid (m2/s2)
547+
540548
real(r8) :: wsub(pcols,pver) ! diagnosed sub-grid vertical velocity st. dev. (m/s)
541549
real(r8) :: wsubi(pcols,pver) ! diagnosed sub-grid vertical velocity ice (m/s)
542550

@@ -642,12 +650,19 @@ subroutine microp_aero_run ( &
642650
case ('CLUBB_SGS')
643651
itim_old = pbuf_old_tim_idx()
644652
call pbuf_get_field(pbuf, wp2_idx, wp2)
653+
654+
! The WP2_nadv pbuf field is dimensioned on the CLUBB momentum subgrid
655+
! (nzm_clubb = pverp + 1 - top_lev), whose index 1 is CAM interface top_lev.
656+
! The scheme expects wp2 on the full interface grid, so expand it here.
657+
wp2_full(:ncol, :top_lev-1) = 0._r8
658+
wp2_full(:ncol, top_lev:pverp) = wp2(:ncol, 1:pverp-top_lev+1)
659+
645660
call compute_subgrid_vertical_velocity_clubb_run( &
646661
ncol = ncol, &
647662
pver = pver, &
648663
pverp = pverp, &
649664
top_lev = top_lev, &
650-
wp2 = wp2(:ncol,:), &
665+
wp2 = wp2_full(:ncol,:), &
651666
wsub = wsub(:ncol,:pver), &
652667
errmsg = errmsg, &
653668
errflg = errflg)

0 commit comments

Comments
 (0)