Skip to content

Commit

Permalink
Fix prescribed BAM
Browse files Browse the repository at this point in the history
	modified:   src/physics/cam/microp_aero.F90
	modified:   src/physics/cam/ndrop_bam.F90
  • Loading branch information
fvitt committed Mar 2, 2025
1 parent 77e70a3 commit 81a3ddb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/physics/cam/microp_aero.F90
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ subroutine microp_aero_init(phys_state,pbuf2d)
call endrun(routine//': ERROR required mode-species type not found')
end if

else
else if (.not.clim_carma_aero) then

! Props needed for BAM number concentration calcs.

Expand Down Expand Up @@ -865,7 +865,7 @@ subroutine microp_aero_run ( &
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!bulk aerosol ccn concentration (modal does it in ndrop, from dropmixnuc)

if (.not. clim_modal_aero) then
if ((.not. clim_modal_aero) .and. (.not.clim_carma_aero)) then

! ccn concentration as diagnostic
call ndrop_bam_ccn(lchnk, ncol, maerosol, naer2)
Expand Down
26 changes: 10 additions & 16 deletions src/physics/cam/ndrop_bam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ subroutine ndrop_bam_init

use phys_control, only: phys_getopts

!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
!
! Initialize constants for droplet activation by bulk aerosols
!
!
!-----------------------------------------------------------------------

integer :: l, m, iaer
Expand All @@ -91,8 +91,6 @@ subroutine ndrop_bam_init
! by using routines from the rad_constituents module.

call rad_cnst_get_info(0, naero=naer_all)
if (.not. naer_all>0) return

allocate( &
aername(naer_all), &
dryrad_aer(naer_all), &
Expand Down Expand Up @@ -174,7 +172,7 @@ subroutine ndrop_bam_init

! Skip aerosols that don't have a dispersion defined.
if (dispersion_aer(m) == 0._r8) cycle

alogsig(m) = log(dispersion_aer(m))
exp45logsig(m) = exp(4.5_r8*alogsig(m)*alogsig(m))
argfactor(m) = 2._r8/(3._r8*sqrt(2._r8)*alogsig(m))
Expand Down Expand Up @@ -268,11 +266,7 @@ subroutine ndrop_bam_run( &
integer :: m
!-------------------------------------------------------------------------------

nact = 0._r8

if (.not. naer_all>0) return
maxmodes = naer_all

allocate( &
volc(maxmodes), &
eta(maxmodes), &
Expand All @@ -286,6 +280,8 @@ subroutine ndrop_bam_run( &
call endrun('ndrop_bam_run')
endif

nact = 0._r8

if (nmode .eq. 1 .and. na(1) .lt. 1.e-20_r8) return

if (wbar .le. 0._r8) return
Expand Down Expand Up @@ -320,7 +316,7 @@ subroutine ndrop_bam_run( &
smc(m) = smcrit(m) ! only for prescribed size dist

if (hygro_aer(m) > 1.e-10_r8) then ! loop only if variable size dist
smc(m) = 2._r8*aten*sqrt(aten/(27._r8*hygro_aer(m)*amcubeloc(m)))
smc(m) = 2._r8*aten*sqrt(aten/(27._r8*hygro_aer(m)*amcubeloc(m)))
else
smc(m) = 100._r8
endif
Expand Down Expand Up @@ -392,8 +388,6 @@ subroutine ndrop_bam_ccn(lchnk, ncol, maerosol, naer2)
real(r8) :: ccn(pcols,pver,psat) ! number conc of aerosols activated at supersat
!-------------------------------------------------------------------------------

if (.not. naer_all>0) return

ccn(:ncol,:,:) = 0._r8

do k = top_lev, pver
Expand All @@ -403,7 +397,7 @@ subroutine ndrop_bam_ccn(lchnk, ncol, maerosol, naer2)
if (m == idxsul) then
! Lohmann treatment for sulfate has variable size distribution
do i = 1, ncol
if (naer2(i,k,m) > 0._r8) then
if (naer2(i,k,m) > 0._r8) then
amcubesulfate(i) = amcubefactor(m)*maerosol(i,k,m)/(naer2(i,k,m))
smcritsulfate(i) = smcritfactor(m)/sqrt(amcubesulfate(i))
else
Expand Down Expand Up @@ -495,9 +489,9 @@ subroutine maxsat(zeta, eta, nmode, smc, smax)
sum=1.e20_r8
endif
enddo

smax=1._r8/sqrt(sum)

end subroutine maxsat

!===============================================================================
Expand Down

0 comments on commit 81a3ddb

Please sign in to comment.