Skip to content

Commit

Permalink
Import ed_v0.1.0 changes into a branch from r120.
Browse files Browse the repository at this point in the history
Created patch file between clm4_5_1_r097 and
ed_v010_21_clm4_5_1_r097 tags with the command:

  svn diff \
    https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_5_1_r097/ \
    https://svn-ccsm-models.cgd.ucar.edu/clm2/branch_tags/ed_v0.1.0_tags/ed_v010_21_clm4_5_1_r097 > \
    ed_v0.1.0-21_r097.patch

Manually edit patch file to remove property changes. Manually
edit patch file to change 'models/lnd' to 'components' in patch
file paths.

There are some failed hunks in SVN_EXTERNAL_DIRECTORIES that
failed to apply and were ignored. It looks like most of these are
irrelevent because of cime changes, but one may need to be
revisited:

  https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/refKovenMuszala_tags/rkm_01_scripts4_141023

Testing: Branch has not been compiled or tested.
  • Loading branch information
bandre-ucar committed Dec 15, 2015
1 parent dab09e8 commit 308312f
Show file tree
Hide file tree
Showing 26 changed files with 1,176 additions and 279 deletions.
735 changes: 735 additions & 0 deletions .ChangeLogED

Large diffs are not rendered by default.

28 changes: 5 additions & 23 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4266,27 +4266,12 @@ Changes answers relative to baseline: YES (but only because of bug 1998)
===============================================================
Tag name: clm4_5_1_r089
Originator(s): erik (Erik)
Date: Mon Oct 13 13:46:43 MDT 2014
Date: Fri Oct 10 13:52:12 MDT 2014
One-line Summary: Bring new urban building temperature to trunk as a clm5.0 feature
as well as human-stress index calculations

Purpose of changes:

New prognostic internal building air temperature methodology for CLM5.0. Retain the older simpler method
for CLM4.5. The namelist toggle to switch between them is: building_temp_method. By default for clm4_5 physics
the older method is used and for clm5_0 the newer one is used. Also add in a package of human-stress index
calculations. Again this is by default on for clm5_0 and off for clm4_5.

The new building air temperature methodology, solves the system of equations for internal: air, roof, floor,
and wall (shade and sunlit) Temperatures. It uses the LAPACK subroutine DGESV to solve the system. It also
figures out the energy flux needed to either cool the building air temperature to a maximum allowed temperature
or to heat it to the minimum allowed temperature.

Add in the new load balancing tool and the PyReshaper tool (changes multi-variable
monthly history files into single-variable time-series files).

Remove the now unneeded clm4_5 interpinic as well as the mkmapgrids FORTRAN program.

Requirements for tag: Bring in new clm5_0 building temperature as option, Fix scripts bugs, bug 2053/2032

Test level of tag: regular
Expand Down Expand Up @@ -4320,13 +4305,12 @@ Describe any changes made to the namelist: new namelists and namelist items
List any changes to the defaults for the boundary datasets: None

Describe any substantial timing or memory changes:
clm5_0 memory use is greater than clm4_5 due to human_stress_indices calculations
and output on history (I've seen it make up to a 20% difference)
clm5_0 memory use is about 20% greater than clm4_5 due to human_stress_indices calculations
and output on history

Code reviewed by: self, oleson, sacks, mvertens, andre

List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, rtm, cism, csm_share
Update to cesm1_3_alpha13c externals.
Also add in load_balancing_tool and pyReshaper

scripts to scripts4_141009
Expand All @@ -4339,7 +4323,7 @@ List any svn externals directories updated (csm_share, mct, etc.): scripts, Mach

List all files eliminated:

--------- Remove clm4_5 interpinic, online interpinic supersedes it
--------- Remove clm4_5 interpinic, online interpinic superseeds it
D models/lnd/clm/tools/clm4_5/interpinic
D models/lnd/clm/tools/clm4_5/interpinic/*
D models/lnd/clm/tools/clm4_5/interpinic/src/*
Expand Down Expand Up @@ -4492,9 +4476,7 @@ CLM testing:

CLM tag used for the baseline comparisons: clm4_5_1_r088

Changes answers relative to baseline: No for CLM40 and CLM45
But, answers DO change for CLM50
(except scripts tag update changes history files for IG and irrigation compsets/tests)
Changes answers relative to baseline: No (except scripts tag update changes history files for IG compsets)


===============================================================
Expand Down
28 changes: 5 additions & 23 deletions components/clm/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4266,27 +4266,12 @@ Changes answers relative to baseline: YES (but only because of bug 1998)
===============================================================
Tag name: clm4_5_1_r089
Originator(s): erik (Erik)
Date: Mon Oct 13 13:46:43 MDT 2014
Date: Fri Oct 10 13:52:12 MDT 2014
One-line Summary: Bring new urban building temperature to trunk as a clm5.0 feature
as well as human-stress index calculations

Purpose of changes:

New prognostic internal building air temperature methodology for CLM5.0. Retain the older simpler method
for CLM4.5. The namelist toggle to switch between them is: building_temp_method. By default for clm4_5 physics
the older method is used and for clm5_0 the newer one is used. Also add in a package of human-stress index
calculations. Again this is by default on for clm5_0 and off for clm4_5.

The new building air temperature methodology, solves the system of equations for internal: air, roof, floor,
and wall (shade and sunlit) Temperatures. It uses the LAPACK subroutine DGESV to solve the system. It also
figures out the energy flux needed to either cool the building air temperature to a maximum allowed temperature
or to heat it to the minimum allowed temperature.

Add in the new load balancing tool and the PyReshaper tool (changes multi-variable
monthly history files into single-variable time-series files).

Remove the now unneeded clm4_5 interpinic as well as the mkmapgrids FORTRAN program.

Requirements for tag: Bring in new clm5_0 building temperature as option, Fix scripts bugs, bug 2053/2032

Test level of tag: regular
Expand Down Expand Up @@ -4320,13 +4305,12 @@ Describe any changes made to the namelist: new namelists and namelist items
List any changes to the defaults for the boundary datasets: None

Describe any substantial timing or memory changes:
clm5_0 memory use is greater than clm4_5 due to human_stress_indices calculations
and output on history (I've seen it make up to a 20% difference)
clm5_0 memory use is about 20% greater than clm4_5 due to human_stress_indices calculations
and output on history

Code reviewed by: self, oleson, sacks, mvertens, andre

List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, rtm, cism, csm_share
Update to cesm1_3_alpha13c externals.
Also add in load_balancing_tool and pyReshaper

scripts to scripts4_141009
Expand All @@ -4339,7 +4323,7 @@ List any svn externals directories updated (csm_share, mct, etc.): scripts, Mach

List all files eliminated:

--------- Remove clm4_5 interpinic, online interpinic supersedes it
--------- Remove clm4_5 interpinic, online interpinic superseeds it
D models/lnd/clm/tools/clm4_5/interpinic
D models/lnd/clm/tools/clm4_5/interpinic/*
D models/lnd/clm/tools/clm4_5/interpinic/src/*
Expand Down Expand Up @@ -4492,9 +4476,7 @@ CLM testing:

CLM tag used for the baseline comparisons: clm4_5_1_r088

Changes answers relative to baseline: No for CLM40 and CLM45
But, answers DO change for CLM50
(except scripts tag update changes history files for IG and irrigation compsets/tests)
Changes answers relative to baseline: No (except scripts tag update changes history files for IG compsets)


===============================================================
Expand Down
1 change: 1 addition & 0 deletions components/clm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ add_subdirectory(${CLM_ROOT}/src/biogeophys clm_biogeophys)
add_subdirectory(${CLM_ROOT}/src/dyn_subgrid clm_dyn_subgrid)
add_subdirectory(${CLM_ROOT}/src/main clm_main)
add_subdirectory(${CLM_ROOT}/src/ED/main ed_main)
add_subdirectory(${CLM_ROOT}/src/ED/biogeophys ed_biogeophys)

# Add general unit test directories (stubbed out files, etc.)
add_subdirectory(unit_test_stubs)
Expand Down
1 change: 1 addition & 0 deletions components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ subroutine allocate_live_biomass(cc_p)
currentcohort%balive -currentcohort%bl- currentcohort%br - currentcohort%bsw, currentcohort%status_coh,currentcohort%balive
write(iulog,*) 'actual vs predicted balive',ideal_balive,currentcohort%balive ,ratio_balive,leaf_frac
write(iulog,*) 'leaf,root,stem',currentcohort%bl,currentcohort%br,currentcohort%bsw
write(iulog,*) 'pft',ft,pftcon%evergreen(ft),pftcon%season_decid(ft),leaves_off_switch
endif
currentCohort%b = currentCohort%bdead + currentCohort%balive

Expand Down
14 changes: 10 additions & 4 deletions components/clm/src/ED/biogeochem/EDGrowthFunctionsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ real(r8) function Bleaf( cohort_in )
! ============================================================================

type(ed_cohort_type), intent(in) :: cohort_in
real(r8) :: slascaler ! changes the target biomass according to the SLA

if(cohort_in%dbh < 0._r8.or.cohort_in%pft == 0.or.cohort_in%dbh > 1000.0_r8)then
write(iulog,*) 'problems in bleaf',cohort_in%dbh,cohort_in%pft
Expand All @@ -111,12 +112,17 @@ real(r8) function Bleaf( cohort_in )
if(cohort_in%dbh <= EDecophyscon%max_dbh(cohort_in%pft))then
bleaf = 0.0419_r8 * (cohort_in%dbh**1.56) * EDecophyscon%wood_density(cohort_in%pft)**0.55_r8
else
bleaf = 0.0419_r8 * (EDecophyscon%max_dbh(cohort_in%pft)**1.56) * EDecophyscon%wood_density(cohort_in%pft)**0.55_r8
endif

bleaf = 0.0419_r8 * (EDecophyscon%max_dbh(cohort_in%pft)**1.56) * EDecophyscon%wood_density(cohort_in%pft)**0.55_r8
endif
slascaler = 0.03_r8/pftcon%slatop(cohort_in%pft)
bleaf = bleaf * slascaler

!write(*,*) 'bleaf',bleaf, slascaler,cohort_in%pft

!Adjust for canopies that have become so deep that their bottom layer is not producing any carbon...
!nb this will change the allometry and the effects of this remain untested. RF. April 2014
bleaf = bleaf*cohort_in%canopy_trim

bleaf = bleaf * cohort_in%canopy_trim

return
end function Bleaf
Expand Down
6 changes: 5 additions & 1 deletion components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,11 @@ subroutine fuse_2_patches(dp, rp)
rp%frac_burnt = (dp%frac_burnt*dp%area + rp%frac_burnt*rp%area)/(dp%area + rp%area)
rp%burnt_frac_litter(:) = (dp%burnt_frac_litter(:)*dp%area + rp%burnt_frac_litter(:)*rp%area)/(dp%area + rp%area)
rp%btran_ft(:) = (dp%btran_ft(:)*dp%area + rp%btran_ft(:)*rp%area)/(dp%area + rp%area)

rp%dleaf_litter_dt(:) = (dp%dleaf_litter_dt(:)*dp%area + rp%dleaf_litter_dt(:)*rp%area)/(dp%area+rp%area)
rp%leaf_litter_in(:) = (dp%leaf_litter_in(:)*dp%area + rp%leaf_litter_in(:)*rp%area)/(dp%area+rp%area)
rp%leaf_litter_out(:) = (dp%leaf_litter_out(:)*dp%area + rp%leaf_litter_out(:)*rp%area)/(dp%area+rp%area)


rp%area = rp%area + dp%area !THIS MUST COME AT THE END!

!insert donor cohorts into recipient patch
Expand Down
41 changes: 38 additions & 3 deletions components/clm/src/ED/biogeochem/EDPhenologyType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module EDPhenologyType
! Public procedures
procedure, public :: accumulateAndExtract
procedure, public :: init
procedure, public :: restart
procedure, public :: initAccVars
procedure, public :: initAccBuffer
procedure, public :: clean
Expand All @@ -51,6 +52,40 @@ module EDPhenologyType
contains

!------------------------------------------------------------------------------

!------------------------------------------------------------------------
subroutine Restart(this, bounds, ncid, flag)
!
! !DESCRIPTION:
! Read/Write module information to/from restart file.
!
! !USES:
use shr_log_mod , only : errMsg => shr_log_errMsg
use spmdMod , only : masterproc
use abortutils , only : endrun
use ncdio_pio , only : file_desc_t, ncd_double
use restUtilMod
!
! !ARGUMENTS:
class(ed_phenology_type) :: this
type(bounds_type), intent(in) :: bounds
type(file_desc_t), intent(inout) :: ncid
character(len=*) , intent(in) :: flag

!
! !LOCAL VARIABLES:
integer :: j,c ! indices
logical :: readvar ! determine if variable is on initial file
!-----------------------------------------------------------------------

call restartvar(ncid=ncid, flag=flag, varname='ED_GDD', xtype=ncd_double, &
dim1name='pft', &
long_name='growing degree days for ED', units='ddays', &
interpinic_flag='interp', readvar=readvar, data=this%ED_GDD_patch)


end subroutine restart

subroutine accumulateAndExtract( this, bounds, &
t_ref2m_patch, &
gridcell, latdeg, &
Expand Down Expand Up @@ -78,6 +113,7 @@ subroutine accumulateAndExtract( this, bounds, &
! local variables
!
! update_accum_field expects a pointer, can't make this an allocatable
!
real(r8), pointer :: rbufslp(:) ! temporary single level - pft level
integer :: g, p ! local index for gridcell and pft
integer :: ier ! error code
Expand All @@ -91,7 +127,7 @@ subroutine accumulateAndExtract( this, bounds, &

! Accumulate and extract GDD0 for ED
do p = bounds%begp,bounds%endp

g = gridcell(p)

if (latdeg(g) >= 0._r8) then
Expand Down Expand Up @@ -120,11 +156,10 @@ subroutine accumulateAndExtract( this, bounds, &
if( latdeg(g) < 0._r8 .and. month < calParams%june ) then !do not accumulate in earlier half of year.
rbufslp(p) = accumResetVal
endif

end do

call update_accum_field ( trim(this%accString), rbufslp, get_nstep() )
call extract_accum_field ( trim(this%accstring), this%ED_GDD_patch, get_nstep() )
call extract_accum_field ( trim(this%accString), this%ED_GDD_patch, get_nstep() )

deallocate(rbufslp)

Expand Down
Loading

0 comments on commit 308312f

Please sign in to comment.