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 4 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

6 changes: 6 additions & 0 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7153,6 +7153,12 @@ 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
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
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)
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 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)
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
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)
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 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