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

Mass balance error in TRS #1246

Open
ongalicia opened this issue Sep 12, 2024 · 6 comments
Open

Mass balance error in TRS #1246

ongalicia opened this issue Sep 12, 2024 · 6 comments

Comments

@ongalicia
Copy link

@adamhb I tried to run FATES by editing the default parameter file for 3 PFTs (default values from "Broadleaf evergreen tropical tree" and edited selected values). I followed the parameter values in Handbury-Brown et al. (2022) (https://doi.org/10.1111/nph.18059) for LD-DI, ST-DI and ST-DT (edited parameter values as below). The fates_regeneration_model was set to be = 2 to be the "Tree Recruitment Scheme (Hanbury-Brown et al., 2022)".

 fates_trs_repro_alloc_a = 0.0058, 0.0042, 0.0049 ;
 fates_trs_repro_alloc_b = -3.1380, -2.6518, -2.6171 ;
 fates_trs_seedling_b_emerg = 1.6, 1.2, 1.2 ;
 fates_trs_seedling_background_mort = 0.17, 0.19, 0.1085371 ;
 fates_trs_seedling_h2o_mort_a = 1.04e-16, 1.04e-19, 4.070565e-17 ;
 fates_trs_seedling_h2o_mort_b = -5.5e-10, -5.5e-10, -6.390757e-11 ;
 fates_trs_seedling_h2o_mort_c = 3.5e-04, 3.5e-04, 1.268992e-05 ;
 fates_trs_seedling_light_mort_a = -0.033, -0.009897694, -0.009897694 ;
 fates_trs_seedling_light_mort_b = -3.84, -7.154063, -7.154063 ;
 fates_trs_seedling_light_rec_a = 0.01, 0.007, 0.007 ;
 fates_trs_seedling_light_rec_b = 1.0653, 0.8615, 0.8615 ;
 fates_trs_seedling_mdd_crit = 4600000, 4600000, 1400000 ;
 fates_trs_seedling_par_crit_germ = 0.656, 0.656, 0.656 ;
 fates_trs_seedling_psi_crit = -176000, -176000, -251995.7 ;
 fates_trs_seedling_psi_emerg = -15744.65, -15744.65, -15744.65 ;

fates_regeneration_model = 2 ;
 dtime_sync=         1800  dtime_elm=         1800  mod =            0
 Beginning timestep   : 1900-01-01_00:00:00
 --WARNING-- skipping CN balance check for first timestep
 --WARNING-- skipping CN balance check for first timestep
    Completed timestep: 1900-01-01_00:00:00
 Beginning timestep   : 1900-01-01_00:30:00
 --WARNING-- skipping CN balance check for first timestep
 FATES dynamics start
 mass balance error detected
 element type (see PRTGenericMod.F90):            1
 error fraction relative to biomass stock:    3.6487420125529045E-002
 absolut error (flux in - change):   -7813.5935558158171     
 call index:            1
 Element index (PARTEH global):           1
 net:   -7.8089716983745827     
 dstock:    7805.7845841174421     
 seed_in:    0.0000000000000000     
 net_root_uptake:    0.0000000000000000     
 gpp_acc:    0.0000000000000000     
 flux_generic_in:    0.0000000000000000     
 wood_product:    0.0000000000000000     
 error from patch resizing:    0.0000000000000000     
 burn_flux_to_atm:    0.0000000000000000     
 seed_out:    0.0000000000000000     
 flux_generic_out:    0.0000000000000000     
 frag_out:    7.1113576625637656     
 aresp_acc:   0.69761403581081682     
 error=net_flux-dstock:   7813.5935558158171     
 biomass   3.4263376831712215E+019
 litter   25728.862227431189     
 seeds  -3.4263376831712027E+019
 total stock   214144.86222743118     
 previous total   206339.07764331374     
 lat lon  0.94736842105254904        105.00000000000000     
 ---------------------------------------

@adamhb
Copy link
Contributor

adamhb commented Sep 13, 2024

Hi! The TRS parameters look good to me. The mass balance error is likely related to something else. It appears this happens in the first time step? Did you initialize the model with observed stand structure? I recommend you try running the exact same simulation with the TRS turned off to confirm if this is a TRS problem or something else.

@ongalicia
Copy link
Author

Hello! I've tried again by re-creating 3 parameter files; the only changes made to each file from the default is the following,

 fates_trs_repro_alloc_a = 0.0058, 0.0042, 0.0049 ;
 fates_trs_repro_alloc_b = -3.1380, -2.6518, -2.6171 ;
 fates_trs_seedling_b_emerg = 1.6, 1.2, 1.2 ;
 fates_trs_seedling_background_mort = 0.17, 0.19, 0.1085371 ;
 fates_trs_seedling_h2o_mort_a = 1.04e-16, 1.04e-19, 4.070565e-17 ;
 fates_trs_seedling_h2o_mort_b = -5.5e-10, -5.5e-10, -6.390757e-11 ;
 fates_trs_seedling_h2o_mort_c = 3.5e-04, 3.5e-04, 1.268992e-05 ;
 fates_trs_seedling_light_mort_a = -0.033, -0.009897694, -0.009897694 ;
 fates_trs_seedling_light_mort_b = -3.84, -7.154063, -7.154063 ;
 fates_trs_seedling_light_rec_a = 0.01, 0.007, 0.007 ;
 fates_trs_seedling_light_rec_b = 1.0653, 0.8615, 0.8615 ;
 fates_trs_seedling_mdd_crit = 4600000, 4600000, 1400000 ;
 fates_trs_seedling_psi_crit = -176000, -176000, -251995.7 ;

and

fates_regeneration_model = 1 ;
fates_regeneration_model = 2 ;
fates_regeneration_model = 3 ;

for the first, second and third file respectively. I then ran the model 3 times, each time changing the parameter file the script directs to. The first (fates_regeneration_model = 1 ) and third (fates_regeneration_model = 3 ) managed to run the simulations successfully, however I still encountered the same issue with the second (fates_regeneration_model = 2 ) with the mass balance error.

For the initialization inventory, I used data from one census of the 4 ha ForestGEO plot in Singapore (Bukit Timah), with pft = 0 for all the trees in the .css file.

Thank you!

@adamhb
Copy link
Contributor

adamhb commented Sep 13, 2024

Ok, @ongalicia. Which version of the FATES code are you using (which api tag number?)? @glemieux, I see you linked this issue to another issue. Is this something you're familiar with? I haven't used the TRS for a while, but perhaps this is either a newer bug that has something to do with TRS compatibility with a newer api or an old bug that is only just now being discovered?

@ongalicia
Copy link
Author

I am using the sci.1.76.4_ap.35.1.0 version. Thank you!

@glemieux
Copy link
Contributor

glemieux commented Sep 16, 2024

@glemieux, I see you linked this issue to another issue. Is this something you're familiar with?

Apologies @adamhb, the linked issue is one I was creating as part of a github demonstration. You can ignore it. This was discovered during our FATES tutorial that we held last week. Your question about it being a newer bug is a good one. Upon reflection, we don't have a test routine in our standard regression suite to exercise the TRS modes. This is something I'll address in a different issue.

UPDATE: created issue #1251

@adamhb
Copy link
Contributor

adamhb commented Sep 16, 2024

@glemieux, thanks for starting #1251. @ongalicia, the problem could be that a bug was introduced in a more recent version of FATES that conflicts with the TRS. Hopefully, work on the new issue #1251 that @glemieux started will help solve this.

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

No branches or pull requests

3 participants