Skip to content

Commit

Permalink
Merge initial linkages to below ground bgc, commit 'c23cf02e', into a…
Browse files Browse the repository at this point in the history
…ndre-ed-clm-16x

Manual resolved sciences conflicts. needs further science
review. Areas of concern: use of century decomp when ed is on but
bgc_mode is sp (see FIXME comment in CLMBuildNamelist)? How should
EDBGCDynMod.F90 be integrated with CNVegetationFacade.F90, especially
the use of cnveg_state_inst and friends.

Test suite: ed - yellowstone gnu, intel, pgi
Test baseline: none
Test status: all tests pass
  • Loading branch information
bandre-ucar committed Jun 24, 2016
2 parents c081d90 + c23cf02 commit eebdf4d
Show file tree
Hide file tree
Showing 27 changed files with 1,965 additions and 316 deletions.
13 changes: 9 additions & 4 deletions components/clm/bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1105,9 +1105,9 @@ sub setup_cmdl_bgc_spinup {
my @valid_values = $definition->get_valid_values( $var );
fatal_error("$var has an invalid value ($val). Valid values are: @valid_values\n");
}
if ( $nl_flags->{'bgc_spinup'} eq "on" && $nl_flags->{'use_cn'} ne ".true.") {
fatal_error("$var can not be '$nl_flags->{'bgc_spinup'}' if CN is turned off (use_cn=$nl_flags->{'use_cn'}).");
}
# if ( $nl_flags->{'bgc_spinup'} eq "on" && $nl_flags->{'use_cn'} ne ".true.") {
# fatal_error("$var can not be '$nl_flags->{'bgc_spinup'}' if CN is turned off (use_cn=$nl_flags->{'use_cn'}).");
# }
if ( $nl->get_value("spinup_state") eq 0 && $nl_flags->{'bgc_spinup'} eq "on" ) {
fatal_error("Namelist spinup_state contradicts the command line option bgc_spinup" );
}
Expand Down Expand Up @@ -2399,9 +2399,14 @@ sub setup_logic_bgc_shared {

if ( $physv->as_long() >= $physv->as_long("clm4_5")) {
if ( $nl_flags->{'bgc_mode'} ne "sp" ) {
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'decomp_depth_efolding', 'phys'=>$physv->as_string() );
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'constrain_stress_deciduous_onset', 'phys'=>$physv->as_string() );
}
# FIXME(bja, 201606) the logic around ed / bgc_mode /
# use_century_decomp is confusing and messed up. This is a hack
# workaround.
if ($nl_flags->{'use_century_decomp'} == '.true.') {
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'decomp_depth_efolding', 'phys'=>$physv->as_string() );
}

}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use_cn = .false.
use_century_decomp = .false.
use_vertsoilc = .false.
use_century_decomp = .true.
use_vertsoilc = .true.
finidat = ''
hist_mfilt = 365
hist_nhtfrq = -24
hist_empty_htapes = .true.
hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT',
'STORVEGC','FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef',
'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef',
'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass',
'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT'
'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT',
'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','TOTECOSYSC'
2 changes: 1 addition & 1 deletion components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ subroutine fuse_cohorts(patchptr)
nextc%n*nextc%year_net_uptake(i))/newn
endif
enddo

currentCohort%n = newn
!remove fused cohort from the list
nextc%taller%shorter => nextnextc
Expand Down
15 changes: 13 additions & 2 deletions components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ subroutine spawn_patches( currentSite )

! calculate area of disturbed land, in this timestep, by summing contributions from each existing patch.
currentPatch => currentSite%youngest_patch

! zero site-level fire fluxes
currentSite%cwd_ag_burned = 0.0_r8
currentSite%leaf_litter_burned = 0.0_r8
currentSite%total_burn_flux_to_atm = 0.0_r8

site_areadis = 0.0_r8
do while(associated(currentPatch))
Expand Down Expand Up @@ -548,12 +551,14 @@ subroutine fire_litter_fluxes(cp_target, new_patch_target, patch_site_areadis)
burned_litter = new_patch%cwd_ag(c) * patch_site_areadis/new_patch%area * currentPatch%burnt_frac_litter(c+1) !kG/m2/day
new_patch%cwd_ag(c) = new_patch%cwd_ag(c) - burned_litter
currentSite%flux_out = currentSite%flux_out + burned_litter * new_patch%area !kG/site/day
currentSite%total_burn_flux_to_atm = currentSite%total_burn_flux_to_atm + burned_litter * new_patch%area !kG/site/day
enddo

do p = 1,numpft_ed
burned_litter = new_patch%leaf_litter(p) * patch_site_areadis/new_patch%area * currentPatch%burnt_frac_litter(dg_sf)
new_patch%leaf_litter(p) = new_patch%leaf_litter(p) - burned_litter
currentSite%flux_out = currentSite%flux_out + burned_litter * new_patch%area !kG/site/dat
currentSite%flux_out = currentSite%flux_out + burned_litter * new_patch%area !kG/site/day
currentSite%total_burn_flux_to_atm = currentSite%total_burn_flux_to_atm + burned_litter * new_patch%area !kG/site/day
enddo

!************************************/
Expand Down Expand Up @@ -615,6 +620,8 @@ subroutine fire_litter_fluxes(cp_target, new_patch_target, patch_site_areadis)
SF_val_CWD_frac(c) * bstem * currentCohort%cfa
currentSite%flux_out = currentSite%flux_out + dead_tree_density * &
AREA * SF_val_CWD_frac(c) * bstem * currentCohort%cfa
currentSite%total_burn_flux_to_atm = currentSite%total_burn_flux_to_atm + dead_tree_density * &
AREA * SF_val_CWD_frac(c) * bstem * currentCohort%cfa

enddo

Expand All @@ -625,6 +632,8 @@ subroutine fire_litter_fluxes(cp_target, new_patch_target, patch_site_areadis)
dead_tree_density * currentCohort%bl * currentCohort%cfa
currentSite%flux_out = currentSite%flux_out + &
dead_tree_density * AREA * currentCohort%bl * currentCohort%cfa
currentSite%total_burn_flux_to_atm = currentSite%total_burn_flux_to_atm + &
dead_tree_density * AREA * currentCohort%bl * currentCohort%cfa

enddo

Expand Down Expand Up @@ -655,6 +664,8 @@ subroutine fire_litter_fluxes(cp_target, new_patch_target, patch_site_areadis)
!KgC/gridcell/day
currentSite%flux_out = currentSite%flux_out + burned_leaves * currentCohort%n * &
patch_site_areadis/currentPatch%area * AREA
currentSite%total_burn_flux_to_atm = currentSite%total_burn_flux_to_atm+ burned_leaves * currentCohort%n * &
patch_site_areadis/currentPatch%area * AREA

endif
currentCohort%cfa = 0.0_r8
Expand Down Expand Up @@ -1113,7 +1124,7 @@ subroutine fuse_patches( csite )
if(nopatches > maxpatch)then
iterate = 1
profiletol = profiletol * 1.1_r8
write(iulog,*) 'maxpatch exceeded, triggering patch fusion iteration.',profiletol,nopatches

!---------------------------------------------------------------------!
! Making profile tolerance larger means that more fusion will happen !
!---------------------------------------------------------------------!
Expand Down
22 changes: 13 additions & 9 deletions components/clm/src/ED/biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,14 @@ subroutine non_canopy_derivs( currentPatch, temperature_inst, soilstate_inst, wa
currentPatch%droot_litter_dt(p) = currentPatch%root_litter_in(p) - currentPatch%root_litter_out(p)
enddo

currentPatch%leaf_litter_in(:) = 0.0_r8
currentPatch%root_litter_in(:) = 0.0_r8
currentPatch%leaf_litter_out(:) = 0.0_r8
currentPatch%root_litter_out(:) = 0.0_r8

currentPatch%CWD_AG_in(:) = 0.0_r8
currentPatch%cwd_bg_in(:) = 0.0_r8
currentPatch%CWD_AG_out(:) = 0.0_r8
currentPatch%cwd_bg_out(:) = 0.0_r8
! currentPatch%leaf_litter_in(:) = 0.0_r8
! currentPatch%root_litter_in(:) = 0.0_r8
! currentPatch%leaf_litter_out(:) = 0.0_r8
! currentPatch%root_litter_out(:) = 0.0_r8
! currentPatch%CWD_AG_in(:) = 0.0_r8
! currentPatch%cwd_bg_in(:) = 0.0_r8
! currentPatch%CWD_AG_out(:) = 0.0_r8
! currentPatch%cwd_bg_out(:) = 0.0_r8

end subroutine non_canopy_derivs

Expand Down Expand Up @@ -636,6 +635,8 @@ subroutine seeds_in( cp_pnt )
currentSite => currentPatch%siteptr

currentPatch%seeds_in(:) = 0.0_r8
currentPatch%seed_rain_flux(:) = 0.0_r8

currentCohort => currentPatch%tallest
do while (associated(currentCohort))
p = currentCohort%pft
Expand All @@ -649,6 +650,7 @@ subroutine seeds_in( cp_pnt )
if (EXTERNAL_RECRUITMENT == 1) then !external seed rain - needed to prevent extinction
do p = 1,numpft_ed
currentPatch%seeds_in(p) = currentPatch%seeds_in(p) + EDecophyscon%seed_rain(p) !KgC/m2/year
currentPatch%seed_rain_flux(p) = currentPatch%seed_rain_flux(p) + EDecophyscon%seed_rain(p) !KgC/m2/year
enddo
endif
currentPatch => currentPatch%younger
Expand Down Expand Up @@ -1251,4 +1253,6 @@ subroutine cwd_out( currentPatch, temperature_inst, soilstate_inst, waterstate_i

end subroutine cwd_out



end module EDPhysiologyMod
4 changes: 2 additions & 2 deletions components/clm/src/ED/biogeophys/EDSurfaceAlbedoMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -857,10 +857,10 @@ subroutine ED_Norman_Radiation (bounds, &
enddo
enddo
if (lai_change(1,2,1).gt.0.0.and.lai_change(1,2,2).gt.0.0)then
write(iulog,*) 'lai_change(1,2,12)',lai_change(1,2,1:4)
! write(iulog,*) 'lai_change(1,2,12)',lai_change(1,2,1:4)
endif
if (lai_change(1,2,2).gt.0.0.and.lai_change(1,2,3).gt.0.0)then
write(iulog,*) ' lai_change (1,2,23)',lai_change(1,2,1:4)
! write(iulog,*) ' lai_change (1,2,23)',lai_change(1,2,1:4)
endif
if (lai_change(1,1,3).gt.0.0.and.lai_change(1,1,2).gt.0.0)then
! NO-OP
Expand Down
Loading

0 comments on commit eebdf4d

Please sign in to comment.