Skip to content

Commit

Permalink
Merge pull request #6 from NGEET/andre-ed_v0.1.0-r097
Browse files Browse the repository at this point in the history
Merge test of andre-ed-_v0.1.0-r097

Test suite: ed
Test baseline: none (science changing results)
Test namelist changes: none
Test status: All tests expected to pass on lawrencium passed.  Code was also reviewed.

Code reviewed by bandre and rgknox.

DONE SMS_D_Mmpi-serial_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
      --- Test Functionality: ---
    PASS SMS_D_Mmpi-serial_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest : successful coupler log 
    PASS SMS_D_Mmpi-serial_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 43 seconds ---

DONE SMS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
      --- Test Functionality: ---
    PASS SMS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest : successful coupler log 
    PASS SMS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 70 seconds ---

DONE SMS_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
      --- Test Functionality: ---
    PASS SMS_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest : successful coupler log 
    PASS SMS_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 38 seconds ---

DONE SMS_D_Ld3.f10_f10.ICLM45BGC.lawrencium-lr2_intel.clm-default : (test finished, successful coupler log) 
      --- Test Functionality: ---
    PASS SMS_D_Ld3.f10_f10.ICLM45BGC.lawrencium-lr2_intel.clm-default : successful coupler log 
    PASS SMS_D_Ld3.f10_f10.ICLM45BGC.lawrencium-lr2_intel.clm-default.memleak
    --- Test time is 73 seconds ---

DONE ERS_D_Mmpi-serial_Ld5.1x1_brazil.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
     --- Test Functionality  ---:
    PASS ERS_D_Mmpi-serial_Ld5.1x1_brazil.ICLM45ED.lawrencium-lr2_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) 
    PASS ERS_D_Mmpi-serial_Ld5.1x1_brazil.ICLM45ED.lawrencium-lr2_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files) 
    PASS ERS_D_Mmpi-serial_Ld5.1x1_brazil.ICLM45ED.lawrencium-lr2_intel.clm-edTest : test functionality summary (ERS_test) 
    PASS ERS_D_Mmpi-serial_Ld5.1x1_brazil.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 68 seconds ---

DONE SMS_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
      --- Test Functionality: ---
    PASS SMS_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest : successful coupler log 
    PASS SMS_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 50 seconds ---

DONE ERS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
     --- Test Functionality  ---:
    PASS ERS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) 
    PASS ERS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files) 
    PASS ERS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest : test functionality summary (ERS_test) 
    PASS ERS_D_Ld5.f10_f10.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 138 seconds ---

DONE ERS_D_Ld5.f45_g37.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
     --- Test Functionality  ---:
    PASS ERS_D_Ld5.f45_g37.ICLM45ED.lawrencium-lr2_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) 
    PASS ERS_D_Ld5.f45_g37.ICLM45ED.lawrencium-lr2_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files) 
    PASS ERS_D_Ld5.f45_g37.ICLM45ED.lawrencium-lr2_intel.clm-edTest : test functionality summary (ERS_test) 
    PASS ERS_D_Ld5.f45_g37.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 270 seconds ---

DONE ERS_D_Ld5.f09_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
     --- Test Functionality  ---:
    FAIL ERS_D_Ld5.f09_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) 
    FAIL ERS_D_Ld5.f09_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files) 
    FAIL ERS_D_Ld5.f09_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest : test functionality summary (ERS_test) 
    PASS ERS_D_Ld5.f09_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 644 seconds ---

DONE ERS_D_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
     --- Test Functionality  ---:
    FAIL ERS_D_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) 
    FAIL ERS_D_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files) 
    FAIL ERS_D_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest : test functionality summary (ERS_test) 
    PASS ERS_D_Ld5.f19_g16.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 188 seconds ---

DONE ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default : (test finished, successful coupler log) 
     --- Test Functionality  ---:
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default.clm2.h0.nc : test compare clm2.h0 (.base and .hybrid files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default.clm2.h1.nc : test compare clm2.h1 (.base and .hybrid files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default.cpl.hi.nc : test compare cpl.hi (.base and .hybrid files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default : test functionality summary (hybrid test  .base and .hybrid files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default.clm2.h1.nc : test compare clm2.h1 (.base and .rest files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default.cpl.hi.nc : test compare cpl.hi (.base and .rest files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default : test functionality summary (restart test .base and .rest   files) 
    PASS ERI_D_Ld9.f09_g16.ICLM45BGC.lawrencium-lr2_intel.clm-default.memleak
    --- Test time is 2219 seconds ---

DONE ERS_D_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest : (test finished, successful coupler log) 
     --- Test Functionality  ---:
    PASS ERS_D_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) 
    PASS ERS_D_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files) 
    PASS ERS_D_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest : test functionality summary (ERS_test) 
    PASS ERS_D_Ld5.5x5_amazon.ICLM45ED.lawrencium-lr2_intel.clm-edTest.memleak
    --- Test time is 59 seconds ---
  • Loading branch information
rgknox committed Jan 29, 2016
2 parents eb26be6 + 27f119e commit 69a361b
Show file tree
Hide file tree
Showing 24 changed files with 1,079 additions and 130 deletions.
735 changes: 735 additions & 0 deletions .ChangeLogED

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*.swp
*~

# patch temp files
*.orig
*.rej

# mac files
.DS_Store

Expand Down
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
13 changes: 13 additions & 0 deletions components/clm/cimetest/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,17 @@
<entry >FAIL ERI_D.ne30_g16.ICLM45BGC.edison_intel.clm-vrtlay</entry>
<entry bugz="1696" >FAIL ERS_Ld211_D_P144x1.f10_f10.ICNCP.edison_intel.clm-crop</entry>


<entry>FAIL ERS_D_Ld5.f19_g16.ICLM45ED.yellowstone_pgi.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f19_g16.ICLM45ED.yellowstone_pgi.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f09_g16.ICLM45ED.yellowstone_pgi.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f09_g16.ICLM45ED.yellowstone_pgi.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f19_g16.ICLM45ED.yellowstone_gnu.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f19_g16.ICLM45ED.yellowstone_gnu.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f09_g16.ICLM45ED.yellowstone_gnu.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f09_g16.ICLM45ED.yellowstone_gnu.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f19_g16.ICLM45ED.yellowstone_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f19_g16.ICLM45ED.yellowstone_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f09_g16.ICLM45ED.yellowstone_intel.clm-edTest.clm2.h0.nc : test compare clm2.h0 (.base and .rest files)</entry>
<entry>FAIL ERS_D_Ld5.f09_g16.ICLM45ED.yellowstone_intel.clm-edTest.cpl.hi.nc : test compare cpl.hi (.base and .rest files)</entry>
</expectedFails>
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 @@ -218,6 +218,7 @@ subroutine allocate_live_biomass(cc_p)
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 @@ -1105,7 +1105,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 @@ -41,6 +41,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 @@ -55,6 +56,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 @@ -82,6 +117,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 @@ -95,7 +131,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 @@ -124,11 +160,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() )

if (this%DEBUG) write(iulog,*) 'ED_GDD accumAndExtract ', this%ED_GDD_patch

Expand Down
Loading

0 comments on commit 69a361b

Please sign in to comment.