Skip to content

Commit

Permalink
Modified zeroing range during the clmed linking to only affect the so…
Browse files Browse the repository at this point in the history
…il patch and non-crop patches. FATES/ED only appears to operate on these patches, we should not be affecting the other patches, that is up to either another module, or should have a switch in a clearly defined space.
  • Loading branch information
rgknox committed May 16, 2016
1 parent 3b0d436 commit 224e662
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions main/EDCLMLinkMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,8 @@ subroutine ed_clm_link( this, bounds, ed_allsites_inst, ed_phenology_inst, &
real(r8) :: canopy_leaf_area ! total amount of leaf area in the vegetated area. m2.
integer :: sitecolumn(bounds%begg:bounds%endg)
logical :: istheresoil(bounds%begg:bounds%endg)
integer :: begp_fp, endp_fp ! Valid range of patch indices that are associated with
! FATES (F) for each parent (P) iteration (grid/column)
!----------------------------------------------------------------------

if ( DEBUG ) then
Expand Down Expand Up @@ -1034,29 +1036,32 @@ subroutine ed_clm_link( this, bounds, ed_allsites_inst, ed_phenology_inst, &
endif
enddo

! ============================================================================
! Zero the whole variable so we dont have ghost values when patch number declines.
! ============================================================================

clmpatch%is_veg(begp:endp) = .false.
clmpatch%is_bareground(begp:endp) = .false.

tlai(begp:endp) = 0.0_r8
htop(begp:endp) = 0.0_r8
hbot(begp:endp) = 0.0_r8
elai(begp:endp) = 0.0_r8
tsai(begp:endp) = 0.0_r8
esai(begp:endp) = 0.0_r8

do g = begg,endg

if(firstsoilpatch(g) >= 0.and.ed_allsites_inst(g)%istheresoil)then
ed_allsites_inst(g)%clmcolumn = sitecolumn(g)

! ============================================================================
! Zero the bare ground tile BGC variables.
! Valid Range for zero'ing here is the soil_patch and non crop patches
! If the crops are not turned on, don't worry, they were zero'd once and should
! not change again (RGK).
! firstsoilpatch(g) + numpft - numcft
! ============================================================================

begp_fp = firstsoilpatch(g)
endp_fp = firstsoilpatch(g) + numpft - numcft

clmpatch%is_veg(begp_fp:endp_fp) = .false.
clmpatch%is_bareground(begp_fp:endp_fp) = .false.
tlai(begp_fp:endp_fp) = 0.0_r8
htop(begp_fp:endp_fp) = 0.0_r8
hbot(begp_fp:endp_fp) = 0.0_r8
elai(begp_fp:endp_fp) = 0.0_r8
tsai(begp_fp:endp_fp) = 0.0_r8
esai(begp_fp:endp_fp) = 0.0_r8


patchn = 0
total_bare_ground = 0.0_r8
total_patch_area = 0._r8
Expand Down

0 comments on commit 224e662

Please sign in to comment.