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

Annual biomass not included in previous year's biomass passed to SOILWAT2 each year #364

Closed
kpalmqui opened this issue Jul 25, 2019 · 4 comments
Assignees
Labels

Comments

@kpalmqui
Copy link
Member

In ST_main.c, annual species biomass is accumulated via stat_Collect before annuals are killed each year, such that annual species biomass is non-zero in the bmass output files. Thereafter, annual species are killed via _kill_annuals.

THE PROBLEM: the biomass values that are passed to SOILWAT2 for annuals are the end of year values after annuals are killed (i.e. 0) and reduce biomass in SOILWAT2 compared to what was present that year in STEPPE.

Essentially, we need to modify the code such that the biomass values for annual species going into SOILWAT2 each year (i.e Env_Generate) represent establishment this year (already in place) and last year’s biomass. The good news is that we do save annual species relsize to calculate last year’s biomass via save_annual_species_relsize for use in annual establishment, so it shouldn’t be too hard to implement.

I will post a more formal solution shortly.

@kpalmqui kpalmqui added the bug label Jul 25, 2019
@kpalmqui kpalmqui self-assigned this Jul 25, 2019
@kpalmqui
Copy link
Member Author

kpalmqui commented Jul 25, 2019

Solution:

In sxw.c (SXW_Run_SOILWAT) include last year's biomass in sizes[g] by replacing:

#this correctly reflects perennial biomass and represents annual biomass due to this year's establishment only
ForEachGroup(g) {
        sizes[g] = RGroup_GetBiomass(g);
}

with:

#for annuals, get this year's biomass due to establishment
ForEachGroup(g) {
        sizes[g] = RGroup_GetBiomass(g);

#if the species is an annual, augment sizes[g] with last year's biomass        
        ForEachEstSpp(sp, g, j) {
            
            if (Species[sp]->max_age == 1) {

                sizes[g] += Species[sp]->lastyear_relsize * Species[sp]->mature_biomass;
            }
        }
    }

Using print statements I am seeing increments in ~1g per annual species per year (~4g) with the default inputs.

@dschlaep let me know if you see problems with this implementation.

@kpalmqui kpalmqui added this to the bugfix_366_annualbiomass milestone Jul 25, 2019
kpalmqui added a commit that referenced this issue Jul 25, 2019
- biomass for annual species now reflects biomass due to establishment this year and last year's biomass
@dschlaep
Copy link
Member

@kpalmqui - I agree that your solution and commit 21ac106 makes that annuals and perennials are finally treated equivalently in terms of biomass passed to SOILWAT2.

Biomass passed to SOILWAT2, as your code comments in the commit explain, represent now last year's biomass plus biomass due to current year's establishment -- that is because Env_Generate() is called at the beginning of a year, but after rgroup_Establish().

If most biomass is perennial, i.e., current year's establishment adds little biomass relatively, then this is ok; however, if current year's establishment adds biomass that is a substantial fraction of last year's biomass (let's say x% >> 0), as is the case for annuals, then we now pass on average about (100 + x)% biomass to SOILWAT2. As long as we simulate sites where annuals represent a smallish proportion of the vegetation, then this overestimation should be unproblematic. However, I don't currently see a better way than how you fixed it.

@kpalmqui
Copy link
Member Author

@dschlaep thanks for taking a look and for the comment! The only other possibility would be to move Env_Generate() to before rgroup_Establish(), which would cause new and more significant problems I think.

I'll open a pull request and tag you as a reviewer. Then I will merge into master and then feature_space etc.

@kpalmqui
Copy link
Member Author

closed by 21ac106

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

No branches or pull requests

2 participants