@@ -34,12 +34,12 @@ module BeTRSimulationALM
3434 procedure , public :: StepWithDrainage = > ALMStepWithDrainage
3535 procedure , public :: SetBiophysForcing = > ALMSetBiophysForcing
3636 ! unique subroutines
37- procedure , public :: DiagnoseDtracerFreezeThaw = > ALMDiagnoseDtracerFreezeThaw
3837 procedure , public :: CalcDewSubFlux = > ALMCalcDewSubFlux
3938 procedure , public :: SoilFluxStateRecv = > ALMBetrSoilFluxStateRecv
4039 procedure , public :: CalcSmpL = > ALMCalcSmpL
4140 procedure , public :: PlantSoilBGCSend = > ALMBetrPlantSoilBGCSend
4241 procedure , public :: PlantSoilBGCRecv = > ALMBetrPlantSoilBGCRecv
42+ procedure , public :: set_active = > ALMset_active
4343 end type betr_simulation_alm_type
4444
4545 public :: create_betr_simulation_alm
@@ -207,6 +207,24 @@ subroutine ALMStepWithoutDrainage(this, bounds, col, pft)
207207 call endrun(msg= this% bsimstatus% print_msg())
208208 end subroutine ALMStepWithoutDrainage
209209
210+ !- --------------------------------------------------------------------------------
211+ subroutine ALMset_active (this ,bounds ,col )
212+
213+ !
214+ ! DESCRIPTION
215+ ! activate columuns that are active in alm
216+ use ColumnType , only : column_type
217+ implicit none
218+ ! !ARGUMENTS:
219+ class(betr_simulation_alm_type) , intent (inout ) :: this
220+ type (bounds_type) , intent (in ) :: bounds
221+ type (column_type) , intent (in ) :: col ! column type
222+
223+ integer :: c
224+ do c = bounds% begc, bounds% endc
225+ this% active_col(c) = (this% active_col(c) .and. col% active(c))
226+ enddo
227+ end subroutine ALMset_active
210228 !- --------------------------------------------------------------------------------
211229 subroutine ALMStepWithDrainage (this , bounds , col )
212230 ! DESCRIPTION
@@ -523,43 +541,6 @@ subroutine ALMBetrPlantSoilBGCRecv(this, bounds, num_soilc, filter_soilc,&
523541 end subroutine ALMBetrPlantSoilBGCRecv
524542 !- -----------------------------------------------------------------------
525543
526- subroutine ALMDiagnoseDtracerFreezeThaw (this , bounds , num_nolakec , filter_nolakec , col , lun )
527- !
528- ! DESCRIPTION
529- ! aqueous tracer partition based on freeze-thaw
530- !
531- ! USES
532- use ColumnType , only : column_type
533- use LandunitType , only : landunit_type
534- use WaterStateType , only : waterstate_type
535- implicit none
536- !
537- ! Arguments
538- class(betr_simulation_alm_type), intent (inout ) :: this
539- type (bounds_type) , intent (in ) :: bounds
540- integer , intent (in ) :: num_nolakec ! number of column non-lake points in column filter
541- integer , intent (in ) :: filter_nolakec(:) ! column filter for non-lake points
542- type (landunit_type) , intent (in ) :: lun
543- ! type(waterstate_type), intent(in) :: waterstate_vars
544- type (column_type) , intent (in ) :: col ! column type
545-
546- ! temporary variables
547- type (betr_bounds_type) :: betr_bounds
548- integer :: fc, c
549-
550- call this% BeTRSetBounds(betr_bounds)
551-
552- call this% BeTRSetcps(bounds, col)
553-
554- do fc = 1 , num_nolakec
555- c = filter_nolakec(fc)
556- if (.not. this% active_col(c))cycle
557- call this% betr(c)% diagnose_dtracer_freeze_thaw(betr_bounds, this% num_soilc, this% filter_soilc, &
558- this% biophys_forc(c))
559- enddo
560- end subroutine ALMDiagnoseDtracerFreezeThaw
561-
562- !- -----------------------------------------------------------------------
563544 subroutine ALMCalcDewSubFlux (this , &
564545 bounds , col , num_hydrologyc , filter_soilc_hydrologyc )
565546 ! DESCRIPTION
@@ -716,6 +697,7 @@ subroutine ALMSetBiophysForcing(this, bounds, col, pft, carbonflux_vars, waterst
716697 type (soilstate_type) , optional , intent (in ) :: soilstate_vars
717698
718699 integer :: p, pi, c
700+ integer :: npft_loc
719701
720702 call this% BeTRSetBiophysForcing(bounds, col, pft, 1 , nlevsoi, carbonflux_vars, waterstate_vars, &
721703 waterflux_vars, temperature_vars, soilhydrology_vars, atm2lnd_vars, canopystate_vars, &
@@ -724,15 +706,23 @@ subroutine ALMSetBiophysForcing(this, bounds, col, pft, carbonflux_vars, waterst
724706
725707 ! the following will be ALM specific
726708 ! big leaf model
709+ ! set profiles autotrohpic respiration
727710 do c = bounds% begc, bounds% endc
728- do pi = 1 , betr_maxpatch_pft
729- if (pi <= col% npfts(c)) then
730- p = col% pfti(c) + pi - 1
731- if (pft% active(p)) then
732- this% biophys_forc(c)% rr_patch(pi,1 :nlevsoi) = carbonflux_vars% rr_patch(p) ! * root_prof(p,1:nlevsoi)
711+ npft_loc = ubound (carbonflux_vars% rr_patch,1 )- lbound (carbonflux_vars% rr_patch,1 )+ 1
712+ if (npft_loc /= col% npfts(c) .and. col% pfti(c) /= lbound (carbonflux_vars% rr_patch,1 )) then
713+ do pi = 1 , betr_maxpatch_pft
714+ this% biophys_forc(c)% rr_patch(pi,1 :nlevsoi) = 0._r8
715+ enddo
716+ else
717+ do pi = 1 , betr_maxpatch_pft
718+ if (pi <= col% npfts(c)) then
719+ p = col% pfti(c) + pi - 1
720+ if (pft% active(p)) then
721+ this% biophys_forc(c)% rr_patch(pi,1 :nlevsoi) = carbonflux_vars% rr_patch(p) ! * root_prof(p,1:nlevsoi)
722+ endif
733723 endif
734- endif
735- enddo
724+ enddo
725+ endif
736726 enddo
737727 ! dvgm
738728 !
0 commit comments