-
Notifications
You must be signed in to change notification settings - Fork 92
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
SP mode: failed with grass allometry when check tree_lai (time for grass allometry to be separated from trees?) #785
Comments
Hmm. I wonder if there is something up with the conversion from bleaf to treelai using those allometry options? |
I don't know if this has something to do with using tiller diameter instead of using stem(or trunk) diameter for grass here. @ckoven might know? |
update: I'm now not sure if this has something to do with the allometry parameters. I ran the simulation again with exact same settings(default allom params that I did run successefully last time), and this time it failed with the same error. I think under SP mode there's something going on with this chunk of code here: fates/biogeochem/FatesAllometryMod.F90 Lines 800 to 812 in 70a3e13
Is this specific to grass PFT or to all simulations with one PFT? need to figure out. |
Did it fail with one of those errors in particular? (And if so, did it write the outputs??) |
It did fail with the line 807-811, that cl >1. the error message: I also noticed that in the successed simulation, there's no understory at all so I assume cl = 1. What is this about SP mode? CL must be one? There are some huge numbers of CL in my previous failed runs. |
Yes. In principle, all being well, SP mode should create a cohort that exactly fills one canopy layer. The trees will be the height dictated by the surface dataset, and a dbh and canopy area consistent with that. The idea is that this routine calculates, for those trees, the leaf carbon that is conistant with the input TLAI. If CL>1, then something has gone wrong in the calculation of canopy area. |
Did you try an 'out of the box' run with SP mode? At what point does it start to fail? |
Yes, I'm running a single point simulation with only C3 grass. I also substitude MONETHLY_LAI in the surface data with MODIS observation for the site. This error occurs after case.submit |
Does it work with the default PFT file? (to rule out other gremlins) |
Great. Let me know if you manage to isolate the cause of the failure in shifting to the grasses. |
Hi Rosie, I'm sorry. I took back what I said. I accidently ran it 4 times with the fates_params_default.cdl, so those 4 runs do not count (guess at least we know it won't fail with default param file with 12 PFTs then). It failed with both single tree and grass PFT (no params changed). So it is a single PFT issue. Same error BTW. |
Righto. What was the fail message? The >1 CL ? |
yes, CL >1. I want to ask if my fates_hlm_pft_map is [0,0,0,0,0,0,1,1,0,0,0,0,0,0] but in surface data PCT_NAT_PFT is |
update: I changed hlm_pft_map all values to 1 for single grass PFT trying to run SP mode as suggested by Rosie, it failed at the first try. Then I changed DEBUG to TRUE and it ran successfully. In case it was just that one time it did work(as it did before!) I changed DEBUG to FALSE and then TRUE again to run it, model failed when DEBUG off and did work when DEBUG on(and I did try DEBUG on for several times and each time it did run). I'm getting the same canopy layer >1 error message whenever model crashed. I don't understand why DEBUG on can make it run? I haven't looked at the output though. |
OK I think I made some progress. What seems to be happening is an order of operations problem in init_patches. Specifically, there is a check that makes sure that the patch areas add up to one exactly. This is occasionally not the case owing to (I think) precision errors in the reading in of the surface dataset. At the moment there is a check for this that happens after the patches have all been created. The code then adjusts the area of the oldest patch, if there is sufficient area, (and the youngest patch if not) to account for the difference between the total area of the patches and of the column ("AREA" which is perhaps a variable that now deserves a more verbose name...) Line 583 in 5d449e4
The problem with this, as far as I can see, is that the init_cohorts command, which sets the c_area of the single SP cohort, is called BEFORE the change to the patch area in the line linked above. The routine that sets c_area (assign_sp_cohort_properties) is also called in run time, and thus the error is ultimately corrected, but I think we have to go through the checks that are currently failing at the end of initialisation too. To fix this, I made another instance of the code that adjusts the patches areas for precision errors, but this time it acts on the incoming PFT area vector (sites(s)%area_pft(nocomp_pft)), and not on the area of the resulting patches. The patch adjusted is arbitrarily the first one, which I guess introduces weighting in favour of earlier PFTs/bare ground, but we are talking 10^-12 order errors here so I'm not too worried about that. The code is on a branch here: https://github.com/rosiealice/fates/commits/SP_onepft_bugfix This code runs OK with a single PFT in my 4x5 global test when all of the hlm_pft_map values are set to 1.0, and using a single PFT file that Xiulin provided (thanks @XiulinGao!) I haven't tested it with the original values of hlm_pft_map. Could you have a go with this @XiulinGao and see if it triggers the errors you were seeing? Noting that
Cross fingers! |
@rosiealice Thanks Rosie! and sure, I'll test it! Currently I'm running SP mode with no problem at all as long as I run with debug on ;), and I have no clue why this. I'll run w/o debug on the new branch and will keep you all posted! |
update: so I ran on Rosie's onpft_bugfix branch with all values of hlm_pft set to 1 and w/o that setting. Apprently for single grid simulation, I still had to set all values to 1 otherwise it will fail with area does not sum to 1 error. Also, model crashed with the CL>1 error again after I fixed hlm_pft, and the solution to it is to turn on debug, which is super strange to me. |
@XiulinGao is this still an issue, or did you fix it? |
So I did what @huitang-earth suggested (https://github.com/huitang-earth/fates/blob/367c8fa29b99a35e1f467c4f87ead30f1b96aff7/main/EDPftvarcon.F90#L1717) to temporarily pass the pft mapping check in order get the run continue. Then it crashed again with error messages as below:
in sub-canopy layer in leafc_from_treelai
this is not set up to work for lower canopy layers.
problem in leafc_from_treelai 79518032 1
ENDRUN:ERROR in /home/xiulingao/var-test-runs/CTSM/src/fates/biogeochem/FatesAllometryMod.F90 at line 811 $
ERROR: Unknown error submitted to shr_abort_abort.
The grass allomtery parameters I used are from @xuchongang , which are as below:
"fates_allom_agb1 1 0.000964"
"fates_allom_agb2 1 1.9492"
"fates_allom_agb3 1 0"
"fates_allom_agb4 1 0"
"fates_allom_agb_frac 1 1"
"fates_allom_d2bl1 1 0.000964"
"fates_allom_d2bl2 1 1.9492"
"fates_allom_d2bl3 1 0"
"fates_allom_d2ca_coefficient_max 1 0.03"
"fates_allom_d2ca_coefficient_min 1 0.01"
"fates_allom_d2h1 1 1"
"fates_allom_d2h2 1 1"
"fates_allom_dbh_maxheight 1 1"
"fates_allom_hmode 1 3"
"fates_allom_la_per_sa_int 1 1000"
"fates_allom_sai_scaler 1 0.0012"
According to Chonggang's explanation these are based off tillers of grasses not the whole bunch, which works for his grass species with runners(so it's hard to define individuals as one single parent plant can grow into a large clone). This allometry setting apparently caused problem in tree_lai checking as I ran the model by taking the allometry parameters out (so ran with default allometry parameters) and it works.
The text was updated successfully, but these errors were encountered: