Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the plant hydro codes to accomodate dynamic forest #440

Merged

Conversation

xuchongang
Copy link
Contributor

@xuchongang xuchongang commented Nov 6, 2018

Improve the plant hydro codes to accomodate dynamic forest

Description:

This pull request updates the hydro codes to accomplish the following key copmonents:

  1. Track the water in newly recruited plants
  2. Track the water in tree mortality
  3. Update the water potential with new growth of tissues and turnover of tissues

Collaborators:

@bchristo , @ckoven , @rosiealice , @rgknox

Expectation of Answer Changes:

This should make the HYDRO code works for the dynamics mode.

Checklist:

  • [X ] My change requires a change to the documentation.
  • [X ] I have updated the in-code documentation .AND. (the technical note .OR. the wiki) accordingly.
  • [ X] I have read the CONTRIBUTING document.
  • FATES PASS/FAIL regression tests were run
  • If answers were expected to change, evaluation was performed and provided

Test Results:

CTSM (or) E3SM (specify which) test hash-tag:

CTSM (or) E3SM (specify which) baseline hash-tag:

FATES baseline hash-tag:

Test Output:

Bradley O'Donnell Christoffersen and others added 29 commits July 20, 2018 11:26
… check for the hydraulics switch to be true, so will prob cause crash when hydraulics turned off
… ease of matching additions made to CopyCohortHydraulics
…pft-specifc parameters; added back in original code for innermost rhiz shell kmax for testing purposes
… Hijacked the scagpft dimension (temporary measure)
… but left commented out due to circular dependency issues with EDPftvarcon
…nt of water in new recruits. Subtract this from bc_out%plant_stored_h2o_si in UpdateH2OVeg call only.
…cohorts and fixes a bug elsewhere in a call to this subroutine
…com:xuchongang/fates-1 into xuchongang/fates_hydro_improve_ready_to_merge
for the dump_cohort for hydro to avoid cycirlar module references
…xuchongang/fates into xuchongang/fates_hydro_improve_ready_to_merge
@xuchongang xuchongang closed this Nov 21, 2018
@xuchongang xuchongang reopened this Nov 21, 2018
@rgknox
Copy link
Contributor

rgknox commented Nov 25, 2018

Thanks for providing the hydro default parameter file @xuchongang. Can we now consider this PR "ready" for testing and peer review?

@xuchongang
Copy link
Contributor Author

@rgknox , I think it is ready for testing and peer review. I have also added the hydraulic failure mortality based on hydro.

@@ -86,6 +86,7 @@ module EDPftvarcon
real(r8), allocatable :: mort_scalar_cstarvation(:)
real(r8), allocatable :: mort_scalar_hydrfailure(:)
real(r8), allocatable :: hf_sm_threshold(:)
real(r8), allocatable :: hf_flc_threshold(:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have the best precedent on this, but it would be awesome if we could have a comment after this definition that describes the parameter and its units. See, #437

@@ -77,12 +84,28 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )

! Proxy for hydraulic failure induced mortality.
hf_sm_threshold = EDPftvarcon_inst%hf_sm_threshold(cohort_in%pft)

if(cohort_in%patchptr%btran_ft(cohort_in%pft) <= hf_sm_threshold)then
hf_flc_threshold = EDPftvarcon_inst%hf_flc_threshold(cohort_in%pft)
Copy link
Contributor

@rgknox rgknox Nov 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I thought maybe we should consider having just one parameter here, generically defined as "hydraulic failure threshold". But it does appear that the units of hf_sm_threshold and hf_flc_threshold are completely different. One is soil moisture and the other is conductivity. I think I like them separated into two different values. Maybe we should add a note in the parameter file meta-data and the parameter definitions "in-code" as to where they are relevant though.

@@ -1511,7 +1518,12 @@ subroutine update_history_dyn(this,nc,nsites,sites)
hio_ddbh_canopy_si_scag => this%hvars(ih_ddbh_canopy_si_scag)%r82d, &
hio_ddbh_understory_si_scag => this%hvars(ih_ddbh_understory_si_scag)%r82d, &
hio_mortality_canopy_si_scag => this%hvars(ih_mortality_canopy_si_scag)%r82d, &
hio_mortality_understory_si_scag => this%hvars(ih_mortality_understory_si_scag)%r82d)
hio_mortality_understory_si_scag => this%hvars(ih_mortality_understory_si_scag)%r82d, &
hio_h2oveg_dead_si => this%hvars(ih_h2oveg_dead_si)%r81d, &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xuchongang, I'm running tests on cheyenne and running into problems at this line.
The problem is that these diagnostics are only allocated if hydraulics is turned on, yet this routine wants to associate a pointer to them even when hydraulics is off, and it is returning errors.
However, I'm wondering, do we even want these diagnostics calculated in this subroutine? This is only called once per day, but my impression was that these water contents are updated sub-daily right? Shouldn't we move these calculations to update_history_hydraulics anyway?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking at this again, it looks like these should be updated sub-daily:

ih_h2oveg_si
ih_h2oveg_hydro_err_si

And these should be updated daily:
ih_h2oveg_dead_si
ih_h2oveg_recruit_si
ih_h2oveg_growturn_err_si
ih_h2oveg_pheno_err_si

Seem right to you @xuchongang @bchristo ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rgknox yes this is correct. thanks!

@rgknox
Copy link
Contributor

rgknox commented Jan 14, 2019

Tests run on Cheyenne:
All existing tests pass:
/gpfs/fs1/scratch/rgknox/clmed-tests/fates.cheyenne.intel.dynamic-hydro-0114-v1-C295cef7-F4f0310d
Also tested b4b with master, all but nlcomp pass (expected):
/gpfs/fs1/scratch/rgknox/clmed-tests/fates.cheyenne.intel.master-C2342ece-Ffb4086b

A new exact restart test was added to CTSM for dynamic hydro. While the "compare" phase does not pass, I think nailing down restart capabilities is more of a medium term goal. My objective in getting the restart machinery into the current PR was more about staging, and not completing the task. Will create an issue.

@rgknox rgknox merged commit 4ae2e78 into NGEET:master Jan 14, 2019
Comment on lines +3889 to +3890
write(fates_log(),*)'Error: psi_note become positive,&
psi_node=',psi_node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that IBM compiler issues a build error on a string split into multiple lines without a continuation character on the next line: i.e. need to to update this to either

      write(fates_log(),*)'Error: psi_note become positive,&
                           & psi_node=',psi_node

or just

      write(fates_log(),*)'Error: psi_note become positive, psi_node=',psi_node

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amametjanov this is something we can do and will try to enforce, thanks for bringing this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants