Skip to content

Commit

Permalink
Revert "Merge remote-tracking branch 'adrifoster/interpMonthlyVeg_hel…
Browse files Browse the repository at this point in the history
…per_function' into bfb_merge_tag_2315_et_al"

This reverts commit d327ec5, reversing
changes made to 8189178.
  • Loading branch information
slevis-lmwg committed Jan 24, 2024
1 parent 0295098 commit 8b262bd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 52 deletions.
50 changes: 0 additions & 50 deletions src/biogeochem/SatellitePhenologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module SatellitePhenologyMod
public :: SatellitePhenologyInit ! Dynamically allocate memory
public :: interpMonthlyVeg ! interpolate monthly vegetation data
public :: readAnnualVegetation ! Read in annual vegetation (needed for Dry-deposition)
public :: do_interpMonthlyVeg ! whether or not to call interpMonthlyVeg
!
! !PRIVATE MEMBER FUNCTIONS:
private :: readMonthlyVegetation ! read monthly vegetation data for two months
Expand Down Expand Up @@ -258,55 +257,6 @@ subroutine interpMonthlyVeg (bounds, canopystate_inst)
end subroutine interpMonthlyVeg

!==============================================================================

logical function do_interpMonthlyVeg(use_cn, use_fates, use_fates_sp, doalb, n_drydep)
!
! !DESCRIPTION:
! returns whether or not to conduct interpMonthlyVeg subroutine
!
! !ARGUMENTS:
logical, intent(in) :: use_cn ! are we using the big-leaf, BGC version of model?
logical, intent(in) :: use_fates ! are we running FATES?
logical, intent(in) :: use_fates_sp ! are we running FATES-SP?
logical, intent(in) :: doalb ! true if time for surface albedo calc
integer, intent(in) :: n_drydep ! number in drypdep list

if (use_cn .and. n_drydep > 0) then

! For dry-deposition need to call CLMSP so that mlaidiff is obtained
! NOTE: This is also true of FATES below
do_interpMonthlyVeg = .true.

else if (use_fates .and. use_fates_sp) then

! For FATES-Specified phenology mode interpolate the weights for
! time-interpolation of monthly vegetation data (as in SP mode below)
! Also for FATES with dry-deposition as above need to call CLMSP so that mlaidiff is obtained
!if ( use_fates_sp .or. (n_drydep > 0 ) ) then ! Replace with this when we have dry-deposition working
! For now don't allow for dry-deposition because of issues in #1044 EBK Jun/17/2022
do_interpMonthlyVeg = .true.

else if (doalb .or. n_drydep > 0) then

! Determine weights for time interpolation of monthly vegetation data.
! This also determines whether it is time to read new monthly vegetation and
! obtain updated leaf area index [mlai1,mlai2], stem area index [msai1,msai2],
! vegetation top [mhvt1,mhvt2] and vegetation bottom [mhvb1,mhvb2]. The
! weights obtained here are used in subroutine SatellitePhenology to obtain time
! interpolated values.
! This is also done for FATES-SP mode above
do_interpMonthlyVeg = .true.

else

do_interpMonthlyVeg = .false.

end if

end function do_interpMonthlyVeg

!==============================================================================

subroutine readAnnualVegetation (bounds, canopystate_inst)
!
! !DESCRIPTION:
Expand Down
37 changes: 35 additions & 2 deletions src/main/clm_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module clm_driver
use UrbanRadiationMod , only : UrbanRadiation
!
use SoilBiogeochemVerticalProfileMod , only : SoilBiogeochemVerticalProfile
use SatellitePhenologyMod , only : SatellitePhenology, interpMonthlyVeg, do_interpMonthlyVeg
use SatellitePhenologyMod , only : SatellitePhenology, interpMonthlyVeg
use ndepStreamMod , only : ndep_interp
use cropcalStreamMod , only : cropcal_advance, cropcal_interp
use ch4Mod , only : ch4, ch4_init_gridcell_balance_check, ch4_init_column_balance_check
Expand Down Expand Up @@ -227,11 +227,44 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
! Specified phenology
! Done in SP mode, FATES-SP mode and also when dry-deposition is active
! ============================================================================

if (use_cn) then
! For dry-deposition need to call CLMSP so that mlaidiff is obtained
! NOTE: This is also true of FATES below
if ( n_drydep > 0 ) then
call t_startf('interpMonthlyVeg')
call interpMonthlyVeg(bounds_proc, canopystate_inst)
call t_stopf('interpMonthlyVeg')
endif

if (do_interpMonthlyVeg(use_cn, use_fates, use_fates_sp, doalb, n_drydep)) then
elseif(use_fates) then

! For FATES-Specified phenology mode interpolate the weights for
! time-interpolation of monthly vegetation data (as in SP mode below)
! Also for FATES with dry-deposition as above need to call CLMSP so that mlaidiff is obtained
!if ( use_fates_sp .or. (n_drydep > 0 ) ) then ! Replace with this when we have dry-deposition working
! For now don't allow for dry-deposition because of issues in #1044 EBK Jun/17/2022
if ( use_fates_sp ) then
call t_startf('interpMonthlyVeg')
call interpMonthlyVeg(bounds_proc, canopystate_inst)
call t_stopf('interpMonthlyVeg')
end if

else

! Determine weights for time interpolation of monthly vegetation data.
! This also determines whether it is time to read new monthly vegetation and
! obtain updated leaf area index [mlai1,mlai2], stem area index [msai1,msai2],
! vegetation top [mhvt1,mhvt2] and vegetation bottom [mhvb1,mhvb2]. The
! weights obtained here are used in subroutine SatellitePhenology to obtain time
! interpolated values.
! This is also done for FATES-SP mode above
if ( doalb .or. ( n_drydep > 0 ) )then
call t_startf('interpMonthlyVeg')
call interpMonthlyVeg(bounds_proc, canopystate_inst)
call t_stopf('interpMonthlyVeg')
end if

end if

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

0 comments on commit 8b262bd

Please sign in to comment.