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

cam6_4_028: Dust emissions #1104

Merged
merged 23 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
610e7a9
implement soil erod switch
fvitt Jan 27, 2023
5311341
implement soil erod switch for bulk model
fvitt Jan 31, 2023
0322253
Merge remote-tracking branch 'origin/soil_erod_switch' into dust_emis…
fvitt Jul 24, 2024
92b6bac
use Erik's CTSM branch
fvitt Jul 24, 2024
bfb1886
use shr_dust_emis_mod inquiry functions
fvitt Jul 25, 2024
9cb0551
add checking for consistent settings; old atm/zender method b4b
fvitt Jul 25, 2024
f7b9e5d
define and set default namelist variables
fvitt Jul 25, 2024
b01294f
fix issue with aqua-planet
fvitt Jul 26, 2024
37fae81
use new ctsm tag
fvitt Aug 5, 2024
e393c66
use Leung_2023 for cam7 phys
fvitt Aug 12, 2024
712dead
Use Erik's CTSM hash; fix issues in build-namelist
fvitt Aug 22, 2024
ba285ec
fix issue in build-namelist
fvitt Aug 23, 2024
e6d302c
fix bug in emis scaling when Leung is used
fvitt Aug 23, 2024
eb6518a
Default Zender for all configs; use tag ctsm5.2.027
fvitt Aug 29, 2024
62b248c
Merge remote-tracking branch 'ESCOMP/cam_development' into dust_emiss…
fvitt Aug 29, 2024
95c159b
regression test Leung dust emis scheme
fvitt Aug 29, 2024
caa1bd3
correct typo in testlist_cam
fvitt Aug 29, 2024
01c9a7a
Merge remote-tracking branch 'ESCOMP/cam_development' into dust_emiss…
fvitt Sep 3, 2024
28e02f1
Increase time for HEMCO test
fvitt Sep 3, 2024
1ea1baa
Remove soil_erod setting when Leung is used in buld dust; ChangeLog d…
fvitt Sep 3, 2024
a950fae
change megan setting appease the atm lnd drv_flds_in compare
fvitt Sep 3, 2024
c424825
Override LND_SETS_DUST_EMIS_DRV_FLDS only for cam7/clm6
fvitt Sep 4, 2024
e7627ac
update ChangeLog
fvitt Sep 4, 2024
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
5 changes: 2 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ fxDONOTUSEurl = https://github.com/NCAR/ParallelIO

[submodule "clm"]
path = components/clm
url = https://github.com/ESCOMP/CTSM
fxtag = ctsm5.2.009
url = https://github.com/ekluzek/CTSM.git
fxtag = 8478b73
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CTSM

Expand All @@ -189,4 +189,3 @@ url = https://github.com/ESCOMP/FMS_interface
fxtag = fi_240516
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/FMS_interface

2 changes: 1 addition & 1 deletion components/clm
Submodule clm updated 36 files
+2 −2 .gitmodules
+71 −75 bld/CLMBuildNamelist.pm
+15 −8 bld/namelist_files/namelist_defaults_ctsm.xml
+21 −0 bld/namelist_files/namelist_defaults_dust_emis.xml
+5 −19 bld/namelist_files/namelist_definition_ctsm.xml
+13 −0 bld/namelist_files/namelist_definition_drv_flds.xml
+27 −160 bld/unit_testers/build-namelist_test.pl
+1 −1 ccs_config
+14 −0 cime_config/config_component.xml
+1 −20 cime_config/testdefs/ExpectedTestFails.xml
+1 −18 cime_config/testdefs/testlist_clm.xml
+0 −1 cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods
+0 −2 cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm
+1 −1 components/cmeps
+151 −0 doc/ChangeLog
+3 −1 doc/ChangeSum
+1 −1 py_env_create
+9 −3 src/CMakeLists.txt
+1 −16 src/biogeochem/CNDriverMod.F90
+0 −271 src/biogeochem/CNRootDynMod.F90
+0 −1 src/biogeochem/DustEmisBase.F90
+16 −8 src/biogeochem/DustEmisFactory.F90
+2 −0 src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf
+2 −3 src/biogeophys/IrrigationMod.F90
+2 −24 src/biogeophys/SoilStateType.F90
+16 −4 src/biogeophys/UrbBuildTempOleson2015Mod.F90
+4 −1 src/biogeophys/UrbanParamsType.F90
+5 −0 src/cpl/nuopc/lnd_import_export.F90
+60 −15 src/cpl/share_esmf/UrbanTimeVarType.F90
+6 −12 src/cpl/share_esmf/ZenderSoilErodStreamType.F90
+3 −0 src/drv_test/CMakeLists.txt
+3 −0 src/drv_test/shr_dust_emis_test/CMakeLists.txt
+112 −0 src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf
+0 −11 src/main/clm_varctl.F90
+0 −16 src/main/controlMod.F90
+2 −12 src/main/pftconMod.F90
65 changes: 48 additions & 17 deletions src/chemistry/bulk_aero/dust_model.F90
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
!===============================================================================
! 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
use shr_dust_emis_mod,only: is_dust_emis_zender, is_zender_soil_erod_from_atm
use cam_control_mod, only: aqua_planet

implicit none
private
Expand Down Expand Up @@ -36,6 +39,7 @@ 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

contains

!=============================================================================
Expand All @@ -44,8 +48,8 @@ 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_real8, mpi_success
use shr_dust_emis_mod, only: shr_dust_emis_readnl

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

Expand All @@ -56,11 +60,11 @@ subroutine dust_readnl(nlfile)
namelist /dust_nl/ dust_emis_fact, soil_erod_file

!-----------------------------------------------------------------------------
if (aqua_planet) return

! 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 +73,26 @@ 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)
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
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 shr_dust_emis_readnl(mpicom, 'drv_flds_in')

if (masterproc) then
write(iulog,*) subname,': soil_erod_file = ',trim(soil_erod_file)
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
write(iulog,*) subname,': dust_emis_fact = ',dust_emis_fact
write(iulog,*) subname,': is_dust_emis_zender : ',is_dust_emis_zender()
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
write(iulog,*) subname,': is_zender_soil_erod_from_atm : ',is_zender_soil_erod_from_atm()
end if

end subroutine dust_readnl

Expand All @@ -89,13 +105,17 @@ subroutine dust_init()

integer :: n

if (aqua_planet) return

do n = 1, dust_nbin
call cnst_get_ind(dust_names(n), dust_indices(n),abort=.false.)
end do
dust_active = any(dust_indices(:) > 0)
if (.not.dust_active) return

call soil_erod_init( dust_emis_fact, soil_erod_file )
if (is_zender_soil_erod_from_atm()) 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 @@ -115,25 +135,36 @@ subroutine dust_emis( ncol, lchnk, dust_flux_in, cflx, soil_erod )

! local vars
integer :: i, m, idst
real(r8) :: erodfctr(ncol)
real(r8), parameter :: dust_emis_sclfctr(dust_nbin) &
= (/ 0.011_r8/0.032456_r8, 0.087_r8/0.174216_r8, 0.277_r8/0.4085517_r8, 0.625_r8/0.384811_r8 /)

if (.not.dust_active) return

! set dust emissions

col_loop: do i =1,ncol
if (is_zender_soil_erod_from_atm()) then
do i =1,ncol
! adjust emissions based on soil erosion
soil_erod(i) = soil_erodibility( i, lchnk )
erodfctr(i) = soil_erod(i)/soil_erod_fact*1.15_r8
end do
else
erodfctr(:) = 1._r8
end if

! rebin dust emissons

soil_erod(i) = soil_erodibility( i, lchnk )
do i =1,ncol

! 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
cflx(i,idst) = -dust_flux_in(i,m) * dust_emis_sclfctr(m) * erodfctr(i)

enddo

end do col_loop
end do

end subroutine dust_emis

Expand Down
76 changes: 47 additions & 29 deletions src/chemistry/modal_aero/dust_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ 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
use shr_dust_emis_mod,only: is_dust_emis_zender, is_zender_soil_erod_from_atm
use cam_control_mod, only: aqua_planet

implicit none
private
Expand All @@ -30,8 +33,8 @@ 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 = -huge(1._r8) ! tuning parameter for dust emissions
character(len=cl) :: soil_erod_file = 'soil_erod_file' ! full pathname for soil erodibility dataset

logical :: dust_active = .false.

Expand All @@ -43,8 +46,8 @@ 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_real8, mpi_success
use shr_dust_emis_mod, only: shr_dust_emis_readnl

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

Expand All @@ -55,11 +58,11 @@ subroutine dust_readnl(nlfile)
namelist /dust_nl/ dust_emis_fact, soil_erod_file

!-----------------------------------------------------------------------------
if (aqua_planet) return

! 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 +71,26 @@ 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)
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
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 shr_dust_emis_readnl(mpicom, 'drv_flds_in')

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

end subroutine dust_readnl

Expand All @@ -91,6 +106,8 @@ subroutine dust_init()
character(len=32) :: spec_name
integer, parameter :: mymodes(7) = (/ 2, 1, 3, 4, 5, 6, 7 /) ! tricky order ...

if (aqua_planet) return

dust_nbin = ndst
dust_nnum = ndst

Expand Down Expand Up @@ -131,7 +148,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 (is_zender_soil_erod_from_atm()) 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 @@ -155,32 +174,31 @@ subroutine dust_emis( ncol, lchnk, dust_flux_in, cflx, soil_erod )
integer :: i, m, idst, inum
real(r8) :: x_mton
real(r8),parameter :: soil_erod_threshold = 0.1_r8
real(r8) :: erodfctr(ncol)

! set dust emissions

col_loop: do i =1,ncol

soil_erod(i) = soil_erodibility( i, lchnk )
if (is_zender_soil_erod_from_atm()) then
col_loop: do i =1,ncol
soil_erod(i) = soil_erodibility( i, lchnk )
if( soil_erod(i) .lt. soil_erod_threshold ) soil_erod(i) = 0._r8
erodfctr(i) = soil_erod(i)/soil_erod_fact*1.15_r8
end do col_loop
else
erodfctr(:) = 1._r8
end if

if( soil_erod(i) .lt. soil_erod_threshold ) soil_erod(i) = 0._r8
! rebin dust emissons

! rebin and adjust 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)*soil_erod(i)/soil_erod_fact*1.15_r8

cflx(i,idst) = sum( -dust_flux_in(i,:) ) * dust_emis_sclfctr(m) * erodfctr(i) ! 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

enddo

end do col_loop
cflx(i,inum) = cflx(i,idst)*x_mton ! number mixing ratio
end do
end do

end subroutine dust_emis

Expand Down