Skip to content

Commit

Permalink
Merge pull request #1 from rgknox/andre-issue24-fix
Browse files Browse the repository at this point in the history
re-introduced EDBGC summary call and merged with master
  • Loading branch information
bandre-ucar committed Apr 1, 2016
2 parents 45cf097 + ce3a7d8 commit 41a2a3c
Show file tree
Hide file tree
Showing 33 changed files with 2,059 additions and 332 deletions.
10 changes: 10 additions & 0 deletions cime/machines/config_batch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
<directive name=""></directive>
</directives>
</batch_system>

<batch_system type="eddi" version="x.y">
<batch_query args=""></batch_query>
<batch_submit></batch_submit>
<batch_redirect></batch_redirect>
<batch_directive></batch_directive>
<directives>
<directive name=""></directive>
</directives>
</batch_system>

<batch_system MACH="wolf" version="x.y">
<batch_directive>#MSUB</batch_directive>
Expand Down
9 changes: 9 additions & 0 deletions cime/machines/config_compilers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,15 @@ for mct, etc.
<GPTL_CPPDEFS> -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY </GPTL_CPPDEFS>
</compiler>

<compiler COMPILER="gnu" MACH="eddi">
<NETCDF_PATH>$(NETCDF_HOME)</NETCDF_PATH>
<ADD_CPPDEFS> -DLinux -DCPRGNU </ADD_CPPDEFS>
<ADD_SLIBS> -L${NETCDF_PATH}/lib/ -lnetcdff -lnetcdf -lcurl -llapack -lblas</ADD_SLIBS>
<GPTL_CPPDEFS> -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY </GPTL_CPPDEFS>
<ESMF_LIBDIR></ESMF_LIBDIR>
</compiler>


<compiler COMPILER="gnu" MACH="yellowstone">
<LAPACK_LIBDIR> /glade/apps/opt/lib </LAPACK_LIBDIR>
<PIO_TYPENAME>netcdf</PIO_TYPENAME>
Expand Down
31 changes: 31 additions & 0 deletions cime/machines/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,37 @@
<MAX_TASKS_PER_NODE>USERDEFINED_required_build</MAX_TASKS_PER_NODE>
</machine>

<machine MACH="eddi">
<DESC>eddi linux PC</DESC>
<OS>LINUX</OS>
<COMPILERS>gnu</COMPILERS>
<MPILIBS>mpi-serial</MPILIBS>
<CESMSCRATCHROOT>/home/lbleco/clmed</CESMSCRATCHROOT>
<RUNDIR>$CESMSCRATCHROOT/$CASE/run</RUNDIR>
<EXEROOT>$CESMSCRATCHROOT/$CASE/bld</EXEROOT>
<DIN_LOC_ROOT>$CESMSCRATCHROOT/cesm_input_datasets/</DIN_LOC_ROOT>
<DIN_LOC_ROOT_CLMFORC>$DIN_LOC_ROOT/atm/datm7</DIN_LOC_ROOT_CLMFORC>
<DOUT_S_ROOT>$CESMSCRATCHROOT/cesm_archive/$CASE</DOUT_S_ROOT>
<DOUT_L_MSROOT>csm/$CASE</DOUT_L_MSROOT>
<CCSM_BASELINE>$CESMSCRATCHROOT/cesm_baselines</CCSM_BASELINE>
<CCSM_CPRNC>$CESMSCRATCHROOT/cesm_tools/cprnc/cprnc</CCSM_CPRNC>
<BATCHQUERY>USERDEFINED_optional_run</BATCHQUERY>
<BATCHSUBMIT>USERDEFINED_optional_run</BATCHSUBMIT>
<BATCHREDIRECT></BATCHREDIRECT>
<SUPPORTED_BY>rgknox-that-weird-a-with-circle-dot-lbl-dot-guvment</SUPPORTED_BY>
<GMAKE_J>1</GMAKE_J>
<MAX_TASKS_PER_NODE>4</MAX_TASKS_PER_NODE>
<batch_system type="none" version="x.y"></batch_system>
<mpirun mpilib="mpi-serial">
<executable>mpirun</executable>
<arguments>
<arg name="num_tasks">-np {{ num_tasks }}</arg>
<arg name="tasks_per_node"> -npernode {{ tasks_per_node }}</arg>
</arguments>
</mpirun>
</machine>


<machine MACH="wolf">
<DESC>LANL Linux Cluster, 16 pes/node, batch system Moab</DESC>
<NODENAME_REGEX>wolf</NODENAME_REGEX>
Expand Down
2 changes: 1 addition & 1 deletion cime/machines/env_mach_specific.conejo
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ endif
module load netcdf/4.4.0
module load parallel-netcdf/1.5.0
module load cmake/3.0.0
module load mkl/11.2.4
module load mkl/11.2.3
module load totalview

if ( $COMPILER == "gnu" && $MPILIB == "openmpi" ) then
Expand Down
29 changes: 29 additions & 0 deletions cime/machines/env_mach_specific.eddi
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/csh -f

# -------------------------------------------------------------------------
# eddi.lbl.gov
# eddi is a linux PC workstation that does not use module environments
# -------------------------------------------------------------------------

set CESM_REPO = `./xmlquery CCSM_REPOTAG -value`

if($status == 0) then
set COMPILER = `./xmlquery COMPILER -value`
set MPILIB = `./xmlquery MPILIB -value`
set DEBUG = `./xmlquery DEBUG -value`
set OS = `./xmlquery OS -value`
set PROJECT = `./xmlquery PROJECT -value`
else
echo $0 using settings from environment:
endif

echo "COMPILER=$COMPILER"
echo "MPILIB=$MPILIB"
echo "DEBUG=$DEBUG"
echo "OS=$OS"
echo "PROJECT=$PROJECT"

#limit coredumpsize unlimited
if ( $?PERL ) then
printenv
endif
4 changes: 3 additions & 1 deletion cime/machines/env_mach_specific.wolf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ endif
module load netcdf/4.4.0
module load parallel-netcdf/1.5.0
module load cmake/3.0.0
module load mkl/11.2.3
module load totalview

if ( $COMPILER == "gnu" && $MPILIB == "openmpi" ) then
module load trilinos
Expand All @@ -41,4 +43,4 @@ endif

if ( $?PERL ) then
printenv
endif
endif
6 changes: 3 additions & 3 deletions components/clm/bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1092,9 +1092,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
9 changes: 5 additions & 4 deletions components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm
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'
5 changes: 2 additions & 3 deletions components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,7 @@ subroutine fuse_cohorts(patchptr)
! to fuse with other new cohorts to keep the total number of cohorts
! down.

if( (.not.(currentCohort%isnew) .and. .not.(nextc%isnew) ) .or. &
( currentCohort%isnew .and. nextc%isnew ) ) then
if( .not.(currentCohort%isnew) .and. .not.(nextc%isnew) ) then

newn = currentCohort%n + nextc%n
fusion_took_place = 1
Expand Down Expand Up @@ -733,7 +732,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 41a2a3c

Please sign in to comment.