Skip to content

Commit

Permalink
Per Erik Kluzek's request, dmleung commented out all lines relevant t…
Browse files Browse the repository at this point in the history
…o the alternative clay fraction dataset from SoilGrids. CLM will use its own clay dataset. (dmleung edited 11 Jul 2022)
  • Loading branch information
dmleung committed Jul 11, 2022
1 parent e388d42 commit 51a5382
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
9 changes: 5 additions & 4 deletions bld/namelist_files/namelist_definition_clm4_5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2574,10 +2574,11 @@ use case.)

<!-- added by dmleung to CLM5, 14 Dec 2021 -->
<!-- manually input clay fraction -dmleung, 2 Mar 2021 -->
<entry id="clay_frc" type="char*256" input_pathname="abs" category="datasets"
group="clm_inparm" valid_values="" >
Full pathname of time-invariant clay fraction dataset for calculating dust emission.
</entry>
<!-- eliminated per Erik Kluzek's request, dmleung 11 Jul 2022 -->
<!-- <entry id="clay_frc" type="char*256" input_pathname="abs" category="datasets"
group="clm_inparm" valid_values="" > -->
<!-- Full pathname of time-invariant clay fraction dataset for calculating dust emission. -->
<!-- </entry> -->

<!-- added by dmleung to CLM5, 17 Dec 2021 -->
<!-- roughness factor f_eff -dmleung, 22 Apr 2020 -->
Expand Down
27 changes: 14 additions & 13 deletions src/biogeophys/SoilStateInitTimeConstMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
use clm_varcon , only : secspday, pc, mu, denh2o, denice, grlnd
use clm_varctl , only : use_cn, use_lch4, use_fates
use clm_varctl , only : iulog, fsurdat, paramfile, soil_layerstruct, &
clay_frc, & ! -dmleung added clay_frc to CESM2/CLM5 14 Dec 2021
!clay_frc, & ! -dmleung added clay_frc to CESM2/CLM5 14 Dec 2021; commented out per Erik Kluzek's request 11 Jul 2022
rough_fct, lulc_frc ! -dmleung added to CESM2/CLM5 17 Dec 2021
use landunit_varcon , only : istdlak, istwet, istsoil, istcrop, istice_mec
use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv
Expand Down Expand Up @@ -153,7 +153,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
real(r8) ,pointer :: sand3d (:,:) ! read in - soil texture: percent sand (needs to be a pointer for use in ncdio)
real(r8) ,pointer :: clay3d (:,:) ! read in - soil texture: percent clay (needs to be a pointer for use in ncdio)
real(r8) ,pointer :: organic3d (:,:) ! read in - organic matter: kg/m3 (needs to be a pointer for use in ncdio)
real(r8) ,pointer :: clayfrc2d(:) ! read in - clay percentage (called fraction here) from SoilGrids, dmleung added 14 Dec 2021
!real(r8) ,pointer :: clayfrc2d(:) ! read in - clay percentage (called fraction here) from SoilGrids, dmleung added 14 Dec 2021; commented out per Erik Kluzek's request; 11 Jul 2022
real(r8) ,pointer :: roughfct2d(:) ! read in - time-invariant roughness factor, dmleung added 17 Dec 2021
real(r8) ,pointer :: rockfrc2d(:) ! read in - rock area fraction from GLCNMO, dmleung added 17 Dec 2021
real(r8) ,pointer :: vegefrc2d(:) ! read in - shrub/crop area fraction from GLCNMO, dmleung added 17 Dec 2021
Expand Down Expand Up @@ -306,19 +306,20 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)

!############ subsection for input data for new dust emission scheme ##############
! dmleung added to CESM2/CLM5 14 Dec 2021
allocate(clayfrc2d(begg:endg)) ! 2 Mar 2021
! commented out per Erik Kluzek's request; not incorpating into CLM. 11 Jul 2022
!allocate(clayfrc2d(begg:endg)) ! 2 Mar 2021
! read SoilGrids clay fraction, 2 Mar 2021
write(iulog,*) 'Attempting to read alternative (e.g., SoilGrids) clay fraction data, by dmleung .....'
call getfil (clay_frc, locfn, 0)
call ncd_pio_openfile (ncid, locfn, 0)
call ncd_io(ncid=ncid, varname='f_clay', flag='read', data=clayfrc2d, dim1name=grlnd, readvar=readvar)
!write(iulog,*) 'Attempting to read alternative (e.g., SoilGrids) clay fraction data, by dmleung .....'
!call getfil (clay_frc, locfn, 0)
!call ncd_pio_openfile (ncid, locfn, 0)
!call ncd_io(ncid=ncid, varname='f_clay', flag='read', data=clayfrc2d, dim1name=grlnd, readvar=readvar)

do p = begp,endp
g = patch%gridcell(p)
soilstate_inst%clayfrc_patch(p) = clayfrc2d(g)/100_r8
end do
!do p = begp,endp
! g = patch%gridcell(p)
! soilstate_inst%clayfrc_patch(p) = clayfrc2d(g)/100_r8
!end do

call ncd_pio_closefile(ncid)
!call ncd_pio_closefile(ncid)

! dmleung added to CESM2/CLM5 17 Dec 2021
allocate(roughfct2d(begg:endg)) ! dmleung, 16 Jul 2020
Expand Down Expand Up @@ -672,7 +673,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
g = col%gridcell(c)

soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) !Fecan et al. (1999) -jfk, dmleung coded 27 Nov 2021 for CLM clay fraction
!soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clayfrc2d(g) + 0.0014_r8*clayfrc2d(g)*clayfrc2d(g)) !Fecan et al. (1999) -jfk, dmleung coded 14 Dec 2021 for SoilGrids clay fraction
!soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clayfrc2d(g) + 0.0014_r8*clayfrc2d(g)*clayfrc2d(g)) !Fecan et al. (1999) -jfk, dmleung coded 14 Dec 2021 for SoilGrids clay fraction; commented out per Erik Kluzek's request 11 Jul 2022
!soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 -dmleung commented 27 Nov 2021
soilstate_inst%mss_frc_cly_vld_col(c) = min(clay3d(g,1) * 0.01_r8, 0.20_r8)
end do
Expand Down
6 changes: 3 additions & 3 deletions src/biogeophys/SoilStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ module SoilStateType

! sand/ clay/ organic matter
real(r8), pointer :: sandfrac_patch (:) ! patch sand fraction
real(r8), pointer :: clayfrac_patch (:) ! patch clay fraction
real(r8), pointer :: clayfrac_patch (:) ! patch clay fraction
real(r8), pointer :: mss_frc_cly_vld_col (:) ! col mass fraction clay limited to 0.20
real(r8), pointer :: cellorg_col (:,:) ! col organic matter for gridcell containing column (1:nlevsoi)
real(r8), pointer :: cellsand_col (:,:) ! sand value for gridcell containing column (1:nlevsoi)
real(r8), pointer :: cellclay_col (:,:) ! clay value for gridcell containing column (1:nlevsoi)
real(r8), pointer :: bd_col (:,:) ! col bulk density of dry soil material [kg/m^3] (CN)
!####################### for new dust emission scheme -dmleung ############################
real(r8), pointer :: clayfrc_patch (:) ! alternative clay fraction, 14 dec 2021
!real(r8), pointer :: clayfrc_patch (:) ! alternative clay fraction, 14 dec 2021; eliminated per Erik Kluzek's request, 11 Jul 2022
real(r8), pointer :: roughfct_patch (:) ! roughness factor, 17 dec 2021
real(r8), pointer :: rockfrc_patch (:) ! GLCNMO rock/bare area fraction, 17 dec 2021
real(r8), pointer :: vegefrc_patch (:) ! GLCNMO shrub/crop area fraction, 17 dec 2021
Expand Down Expand Up @@ -139,7 +139,7 @@ subroutine InitAllocate(this, bounds)
allocate(this%bd_col (begc:endc,nlevgrnd)) ; this%bd_col (:,:) = nan

!################ dmleung added 14 Dec 2021 ########################
allocate(this%clayfrc_patch (begp:endp)) ; this%clayfrc_patch (:) = nan
!allocate(this%clayfrc_patch (begp:endp)) ; this%clayfrc_patch (:) = nan !eliminated per Erik Kluzek's request, dmelung 11 Jul 2022
allocate(this%roughfct_patch (begp:endp)) ; this%roughfct_patch (:) = nan
allocate(this%rockfrc_patch (begp:endp)) ; this%rockfrc_patch (:) = nan
allocate(this%vegefrc_patch (begp:endp)) ; this%vegefrc_patch (:) = nan
Expand Down
2 changes: 1 addition & 1 deletion src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module clm_varctl
character(len=fname_len), public :: nrevsn = ' ' ! restart data file name for branch run
character(len=fname_len), public :: fsnowoptics = ' ' ! snow optical properties file name
character(len=fname_len), public :: fsnowaging = ' ' ! snow aging parameters file name
character(len=fname_len), public :: clay_frc = ' ' ! alternative clay fraction, dmleung, added 14 Dec 2021
!character(len=fname_len), public :: clay_frc = ' ' ! alternative clay fraction, dmleung, added 14 Dec 2021; eliminate the use of alternative clay fraction per Erik Kluzek's request 11 Jul 2022
character(len=fname_len), public :: rough_fct = ' ' ! roughness factor, dmleung, added 17 Dec 2021
character(len=fname_len), public :: lulc_frc = ' ' ! LULC area fraction, dmleung, added 17 Dec 2021

Expand Down
15 changes: 8 additions & 7 deletions src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ subroutine control_init( )

! dust emission, dmleung 14 Dec 2021
namelist /clm_inparm/ &
clay_frc, & !-dmleung 14 Dec 2021
!clay_frc, & !-dmleung 14 Dec 2021; eliminated per Erik Kluzek's request, dmleung 11 Jul 2022
rough_fct, lulc_frc !-dmleung 17 Dec 2021

! ----------------------------------------------------------------------
Expand Down Expand Up @@ -611,7 +611,7 @@ subroutine control_spmd()
call mpi_bcast (fsnowaging, len(fsnowaging), MPI_CHARACTER, 0, mpicom, ier)

! initialize input data for new dust emission module dmleung 14 Dec 2021
call mpi_bcast (clay_frc, len(clay_frc), MPI_CHARACTER, 0, mpicom, ier) ! added by dmleung, 14 Dec 2021
!call mpi_bcast (clay_frc, len(clay_frc), MPI_CHARACTER, 0, mpicom, ier) ! added by dmleung, 14 Dec 2021; eliminated per Erk Kluzek's request, dmleung 11 Jul 2022
call mpi_bcast (rough_fct, len(rough_fct), MPI_CHARACTER, 0, mpicom, ier)! added by dmleung, 17 Dec 2021
call mpi_bcast (lulc_frc, len(lulc_frc), MPI_CHARACTER, 0, mpicom, ier) ! added by dmleung, 17 Dec 2021

Expand Down Expand Up @@ -833,11 +833,12 @@ subroutine control_print ()
write(iulog,*) ' land frac data = ',trim(fatmlndfrc)
end if
!##### for dmleung's input data for new dust emission module #####
if (clay_frc == ' ') then ! -dml, 2 Mar 2021, added 14 Dec 2021
write(iulog,*) ' clay_frc surface dataset not set'
else
write(iulog,*) ' surface data = ',trim(clay_frc)
end if
! eliminate the use of alternative clay fraction per Erik Kluzek's request, dmleung 11 Jul 2022
!if (clay_frc == ' ') then ! -dml, 2 Mar 2021, added 14 Dec 2021
! write(iulog,*) ' clay_frc surface dataset not set'
!else
! write(iulog,*) ' surface data = ',trim(clay_frc)
!end if
if (rough_fct == ' ') then ! -dmleung, 17 Dec 2020
write(iulog,*) ' rough_fct surface dataset not set'
else
Expand Down

2 comments on commit 51a5382

@ekluzek
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmleung go ahead and completely remove the lines that you commented out. With version control there is no need to just comment lines out, so you still see them. Part of what we want to do is to make it easier to bring in the new code that's active, keeping the comment out code will make that harder.

@dmleung
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay! will do it now.

Please sign in to comment.