Skip to content

Commit

Permalink
Merge pull request #838 from glemieux/spmode-gnufix-master
Browse files Browse the repository at this point in the history
Satellite phenology mode fixes for the gnu compiler
  • Loading branch information
rgknox authored Mar 2, 2022
2 parents 7761d72 + 6056a62 commit 7edf030
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ subroutine UpdateCohortBioPhysRates(currentCohort)

ipft = currentCohort%pft

if(sum(frac_leaf_aclass(1:nleafage))>nearzero) then
if(sum(frac_leaf_aclass(1:nleafage))>nearzero .and. hlm_use_sp .eq. ifalse) then


frac_leaf_aclass(1:nleafage) = frac_leaf_aclass(1:nleafage) / &
Expand All @@ -2049,7 +2049,7 @@ subroutine UpdateCohortBioPhysRates(currentCohort)
currentCohort%kp25top = sum(param_derived%kp25top(ipft,1:nleafage) * &
frac_leaf_aclass(1:nleafage))

elseif (hlm_use_sp .eq. itrue .and. hlm_is_restart .eq. itrue) then
elseif (hlm_use_sp .eq. itrue) then

currentCohort%vcmax25top = EDPftvarcon_inst%vcmax25top(ipft,1)
currentCohort%jmax25top = param_derived%jmax25top(ipft,1)
Expand Down
8 changes: 8 additions & 0 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,12 @@ subroutine assign_cohort_SP_properties(currentCohort,htop,tlai,tsai,parea,init,l
! ------------------------------------------
currentCohort%treelai = tlai
canopylai(:) = 0._r8
if(init.eq.itrue)then
! If we are initializing, the canopy layer has not been set yet, so just set to 1
currentCohort%canopy_layer = 1
! We need to get the vcmax25top
currentCohort%vcmax25top = EDPftvarcon_inst%vcmax25top(currentCohort%pft,1)
endif
leaf_c = leafc_from_treelai( currentCohort%treelai, currentCohort%pft, currentCohort%c_area,&
currentCohort%n, currentCohort%canopy_layer, currentCohort%vcmax25top)

Expand All @@ -1532,6 +1538,8 @@ subroutine assign_cohort_SP_properties(currentCohort,htop,tlai,tsai,parea,init,l

if( abs(currentCohort%treelai-check_treelai).gt.1.0e-12)then !this is not as precise as nearzero
write(fates_log(),*) 'error in validate treelai',currentCohort%treelai,check_treelai,currentCohort%treelai-check_treelai
write(fates_log(),*) 'tree_lai inputs: ', currentCohort%pft, currentCohort%c_area, currentCohort%n, &
currentCohort%canopy_layer, currentCohort%vcmax25top
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

Expand Down
1 change: 1 addition & 0 deletions main/EDInitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ subroutine zero_site( site_in )

! FIRE
site_in%acc_ni = 0.0_r8 ! daily nesterov index accumulating over time. time unlimited theoretically.
site_in%FDI = 0.0_r8 ! daily fire danger index (0-1)
site_in%NF = 0.0_r8 ! daily lightning strikes per km2
site_in%NF_successful = 0.0_r8 ! daily successful iginitions per km2

Expand Down

0 comments on commit 7edf030

Please sign in to comment.