Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to turn off soil erosion in CAM for dust emissions #748

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 13 additions & 6 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3545,7 +3545,7 @@ Include effects of precip evaporation on turbulent moments
<entry id="clubb_do_adv" type="logical" category="pblrad"
group="clubbpbl_diff_nl" valid_values="" >
Switch for CLUBB_ADV parameter that turns on advection of CLUBB pdf moments by
the dynamics core. Very experimental.
the dynamics core. Very experimental.
</entry>

<!-- Clubb timestep -->
Expand Down Expand Up @@ -3894,7 +3894,7 @@ xpyp only.

<entry id="clubb_l_intr_sfc_flux_smooth" type="logical" category="pblrad"
group="clubb_params_nl" valid_values="" >
Flag to apply a locally calculated ustar to momentum surface fluxes in the
Flag to apply a locally calculated ustar to momentum surface fluxes in the
clubb interface.
</entry>

Expand Down Expand Up @@ -3960,8 +3960,8 @@ Flag to turn on the clubb monotonic flux limiter for vm (meridional momemtum).

<entry id="clubb_l_partial_upwind_wp3" type="logical" category="pblrad"
group="clubb_params_nl" valid_values="" >
Flag to use an "upwind" discretization rather than a centered discretization
for the portion of the wp3 turbulent advection term for ADG1 that is linearized
Flag to use an "upwind" discretization rather than a centered discretization
for the portion of the wp3 turbulent advection term for ADG1 that is linearized
in terms of wp3(t+1). (Requires ADG1 PDF and l_standard_term_ta=true).
</entry>

Expand All @@ -3988,7 +3988,7 @@ Flag to use smooth Heaviside 'Peskin' in computation of invrs_tau.

<entry id="clubb_l_standard_term_ta" type="logical" category="pblrad"
group="clubb_params_nl" valid_values="" >
Use the standard discretization for the turbulent advection terms. Setting to
Use the standard discretization for the turbulent advection terms. Setting to
.false. means that a_1 and a_3 are pulled outside of the derivative in
advance_wp2_wp3_module.F90 and in advance_xp2_xpyp_module.F90.
</entry>
Expand Down Expand Up @@ -4070,7 +4070,7 @@ production) term.

<entry id="clubb_l_vary_convect_depth" type="logical" category="pblrad"
group="clubb_params_nl" valid_values="" >
Flag used to calculate convective velocity using a variable estimate of layer
Flag used to calculate convective velocity using a variable estimate of layer
depth based on the depth over which wpthlp is positive near the ground when true
</entry>

Expand Down Expand Up @@ -6742,6 +6742,13 @@ Full pathname of boundary dataset for soil erodibility factors.
Default: set by build-namelist.
</entry>

<entry id="soil_erod_active" type="logical" category="cam_chem"
group="dust_nl" valid_values="" >
Switch to turn on/off soil erodibility for dust emissions in CAM.
Default: TRUE
</entry>


<entry id="srf_emis_specifier" type="char*256(1000)" category="cam_chem"
group="chem_inparm" valid_values="" >
List of full pathnames of surface emission datasets.
Expand Down
69 changes: 48 additions & 21 deletions src/chemistry/bulk_aero/dust_model.F90
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
!===============================================================================
! Dust for Bulk Aerosol Model
!===============================================================================
module dust_model
module dust_model
use shr_kind_mod, only: r8 => shr_kind_r8, cl => shr_kind_cl
use spmd_utils, only: masterproc
use cam_abortutils, only: endrun
use cam_logfile, only: iulog

implicit none
private
Expand Down Expand Up @@ -36,6 +37,9 @@ module dust_model

real(r8) :: dust_emis_fact = -1.e36_r8 ! tuning parameter for dust emissions
character(len=cl) :: soil_erod_file = 'soil_erod_file' ! full pathname for soil erodibility dataset

logical :: soil_erod_active = .true.

contains

!=============================================================================
Expand All @@ -44,23 +48,21 @@ module dust_model
subroutine dust_readnl(nlfile)

use namelist_utils, only: find_group_name
use units, only: getunit, freeunit
use mpishorthand
use spmd_utils, only: mpicom, masterprocid, mpi_character, mpi_logical, mpi_real8, mpi_success

character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input

! Local variables
integer :: unitn, ierr
character(len=*), parameter :: subname = 'dust_readnl'

namelist /dust_nl/ dust_emis_fact, soil_erod_file
namelist /dust_nl/ dust_emis_fact, soil_erod_file, soil_erod_active

!-----------------------------------------------------------------------------

! Read namelist
if (masterproc) then
unitn = getunit()
open( unitn, file=trim(nlfile), status='old' )
open( newunit=unitn, file=trim(nlfile), status='old' )
call find_group_name(unitn, 'dust_nl', status=ierr)
if (ierr == 0) then
read(unitn, dust_nl, iostat=ierr)
Expand All @@ -69,14 +71,27 @@ subroutine dust_readnl(nlfile)
end if
end if
close(unitn)
call freeunit(unitn)
end if

#ifdef SPMD
! Broadcast namelist variables
call mpibcast(dust_emis_fact, 1, mpir8, 0, mpicom)
call mpibcast(soil_erod_file, len(soil_erod_file), mpichar, 0, mpicom)
#endif
call mpi_bcast(soil_erod_file, len(soil_erod_file), mpi_character, masterprocid, mpicom, ierr)
if (ierr/=mpi_success) then
call endrun(subname//' MPI_BCAST ERROR: soil_erod_file')
end if
call mpi_bcast(dust_emis_fact, 1, mpi_real8, masterprocid, mpicom, ierr)
if (ierr/=mpi_success) then
call endrun(subname//' MPI_BCAST ERROR: dust_emis_fact')
end if
call mpi_bcast(soil_erod_active, 1, mpi_logical, masterprocid, mpicom, ierr)
if (ierr/=mpi_success) then
call endrun(subname//' MPI_BCAST ERROR: soil_erod_active')
end if

if (masterproc) then
write(iulog,*) subname,': soil_erod_active = ',soil_erod_active
write(iulog,*) subname,': soil_erod_file = ',trim(soil_erod_file)
write(iulog,*) subname,': dust_emis_fact = ',dust_emis_fact
end if

end subroutine dust_readnl

Expand All @@ -95,7 +110,9 @@ subroutine dust_init()
dust_active = any(dust_indices(:) > 0)
if (.not.dust_active) return

call soil_erod_init( dust_emis_fact, soil_erod_file )
if (soil_erod_active) then
call soil_erod_init( dust_emis_fact, soil_erod_file )
endif

call dust_set_params( dust_nbin, dust_dmt_grd, dust_dmt_vwr, dust_stk_crc )

Expand All @@ -120,20 +137,30 @@ subroutine dust_emis( ncol, lchnk, dust_flux_in, cflx, soil_erod )

! set dust emissions

col_loop: do i =1,ncol
if (soil_erod_active) then
col_loop: do i =1,ncol

soil_erod(i) = soil_erodibility( i, lchnk )
soil_erod(i) = soil_erodibility( i, lchnk )

! adjust emissions based on soil erosion
do m = 1,dust_nbin
! adjust emissions based on soil erosion
do m = 1,dust_nbin

idst = dust_indices(m)
cflx(i,idst) = -dust_flux_in(i,m) &
* dust_emis_sclfctr(m)*soil_erod(i)/soil_erod_fact*1.15_r8
idst = dust_indices(m)
cflx(i,idst) = -dust_flux_in(i,m) &
* dust_emis_sclfctr(m)*soil_erod(i)/soil_erod_fact*1.15_r8

enddo
enddo

end do col_loop
end do col_loop
else
! rebin dust emissons
do i = 1,ncol
do m = 1,dust_nbin
idst = dust_indices(m)
cflx(i,idst) = -dust_flux_in(i,m) * dust_emis_sclfctr(m)
end do
end do
end if

end subroutine dust_emis

Expand Down
82 changes: 56 additions & 26 deletions src/chemistry/modal_aero/dust_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module dust_model
use spmd_utils, only: masterproc
use cam_abortutils, only: endrun
use modal_aero_data, only: ntot_amode, ndst=>nDust
use cam_logfile, only: iulog

implicit none
private
Expand All @@ -30,8 +31,10 @@ module dust_model
real(r8), allocatable :: dust_dmt_vwr(:)
real(r8), allocatable :: dust_stk_crc(:)

real(r8) :: dust_emis_fact = -1.e36_r8 ! tuning parameter for dust emissions
character(len=cl) :: soil_erod_file = 'soil_erod_file' ! full pathname for soil erodibility dataset
real(r8) :: dust_emis_fact = -1.e36_r8 ! tuning parameter for dust emissions
character(len=cl) :: soil_erod_file = 'soil_erod_file' ! full pathname for soil erodibility dataset

logical :: soil_erod_active = .true.

logical :: dust_active = .false.

Expand All @@ -43,23 +46,21 @@ module dust_model
subroutine dust_readnl(nlfile)

use namelist_utils, only: find_group_name
use units, only: getunit, freeunit
use mpishorthand
use spmd_utils, only: mpicom, masterprocid, mpi_character, mpi_logical, mpi_real8, mpi_success

character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input

! Local variables
integer :: unitn, ierr
character(len=*), parameter :: subname = 'dust_readnl'

namelist /dust_nl/ dust_emis_fact, soil_erod_file
namelist /dust_nl/ dust_emis_fact, soil_erod_file, soil_erod_active

!-----------------------------------------------------------------------------

! Read namelist
if (masterproc) then
unitn = getunit()
open( unitn, file=trim(nlfile), status='old' )
open( newunit=unitn, file=trim(nlfile), status='old' )
call find_group_name(unitn, 'dust_nl', status=ierr)
if (ierr == 0) then
read(unitn, dust_nl, iostat=ierr)
Expand All @@ -68,14 +69,27 @@ subroutine dust_readnl(nlfile)
end if
end if
close(unitn)
call freeunit(unitn)
end if

#ifdef SPMD
! Broadcast namelist variables
call mpibcast(dust_emis_fact, 1, mpir8, 0, mpicom)
call mpibcast(soil_erod_file, len(soil_erod_file), mpichar, 0, mpicom)
#endif
call mpi_bcast(soil_erod_file, len(soil_erod_file), mpi_character, masterprocid, mpicom, ierr)
if (ierr/=mpi_success) then
call endrun(subname//' MPI_BCAST ERROR: soil_erod_file')
end if
call mpi_bcast(dust_emis_fact, 1, mpi_real8, masterprocid, mpicom, ierr)
if (ierr/=mpi_success) then
call endrun(subname//' MPI_BCAST ERROR: dust_emis_fact')
end if
call mpi_bcast(soil_erod_active, 1, mpi_logical, masterprocid, mpicom, ierr)
if (ierr/=mpi_success) then
call endrun(subname//' MPI_BCAST ERROR: soil_erod_active')
end if

if (masterproc) then
write(iulog,*) subname,': soil_erod_active = ',soil_erod_active
write(iulog,*) subname,': soil_erod_file = ',trim(soil_erod_file)
write(iulog,*) subname,': dust_emis_fact = ',dust_emis_fact
end if

end subroutine dust_readnl

Expand Down Expand Up @@ -131,7 +145,9 @@ subroutine dust_init()
dust_active = any(dust_indices(:) > 0)
if (.not.dust_active) return

call soil_erod_init( dust_emis_fact, soil_erod_file )
if (soil_erod_active) then
call soil_erod_init( dust_emis_fact, soil_erod_file )
end if

call dust_set_params( dust_nbin, dust_dmt_grd, dust_dmt_vwr, dust_stk_crc )

Expand All @@ -158,29 +174,43 @@ subroutine dust_emis( ncol, lchnk, dust_flux_in, cflx, soil_erod )

! set dust emissions

col_loop: do i =1,ncol
if (soil_erod_active) then
col_loop: do i =1,ncol

soil_erod(i) = soil_erodibility( i, lchnk )
soil_erod(i) = soil_erodibility( i, lchnk )

if( soil_erod(i) .lt. soil_erod_threshold ) soil_erod(i) = 0._r8
if( soil_erod(i) .lt. soil_erod_threshold ) soil_erod(i) = 0._r8

! rebin and adjust dust emissons..
do m = 1,dust_nbin
! rebin and adjust dust emissons
do m = 1,dust_nbin

idst = dust_indices(m)
idst = dust_indices(m)

cflx(i,idst) = sum( -dust_flux_in(i,:) ) &
* dust_emis_sclfctr(m)*soil_erod(i)/soil_erod_fact*1.15_r8
cflx(i,idst) = sum( -dust_flux_in(i,:) ) &
* dust_emis_sclfctr(m)*soil_erod(i)/soil_erod_fact*1.15_r8

x_mton = 6._r8 / (pi * dust_density * (dust_dmt_vwr(m)**3._r8))
x_mton = 6._r8 / (pi * dust_density * (dust_dmt_vwr(m)**3._r8))

inum = dust_indices(m+dust_nbin)
inum = dust_indices(m+dust_nbin)

cflx(i,inum) = cflx(i,idst)*x_mton
cflx(i,inum) = cflx(i,idst)*x_mton

enddo
enddo

end do col_loop
else
! rebin dust emissons
do i = 1,ncol
do m = 1,dust_nbin
idst = dust_indices(m)
cflx(i,idst) = sum( -dust_flux_in(i,:) ) * dust_emis_sclfctr(m) ! mass mixing ratio
x_mton = 6._r8 / (pi * dust_density * (dust_dmt_vwr(m)**3._r8))
inum = dust_indices(m+dust_nbin)
cflx(i,inum) = cflx(i,idst)*x_mton ! number mixing ratio
end do
end do
end if

end do col_loop

end subroutine dust_emis

Expand Down