-
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: model crashed with only 1 PFT #782
Comments
OK. Looks like the logic of that check might need altering. I'll try and look into this tomorrow... Thanks! |
Thank you! I''m curious that if the check runs before fates_hlm_pft_map is readed or the reversed order? as during fates params reading process, there's no fates_hlm_pft_map, and after that I saw the pft map check failed. hlm_pft_map also show as 0 in the error message. So I'm wonder the error roots in param register and reading process or in param check process. |
I think I see the issue: since the loop is iterating through the That said, re-reading the code comment: Lines 1752 to 1753 in 70a3e13
I think the intent of the comment means that the calculation should look like:
since this check is nested in a UPDATE: I forgot that the import flips the dimensionality on purpose, so there isn't a larger issue like I thought at first glance, so ignore the strike throughs.
fates/parameter_files/fates_params_default.cdl Lines 545 to 547 in 70a3e13
Lines 638 to 644 in 70a3e13
size( EDPftvarcon_inst%hlm_pft_map,2) which returned 14, instead of the expected 12 (expected based on the parameter file definition).
fates/biogeochem/EDPhysiologyMod.F90 Lines 1389 to 1405 in 70a3e13
|
Thanks Greg! So it is still the param check code need to be modified? I guess that makes it easier. |
Yep, I just want to make sure to hear @rosiealice feedback since the way the check is written I might be misinterpreting the goal. |
@rosiealice @glemieux , just let you know that when I ran single PFT simulation (for moss and lichen test), I also have the same problem. So, I just commented out the "endrun" for a quick fix (https://github.com/huitang-earth/fates/blob/367c8fa29b99a35e1f467c4f87ead30f1b96aff7/main/EDPftvarcon.F90#L1717), which works. Current check will only work if you use all the FATES pfts to match all the host land model pfts. But if we use a subset of the FATES pfts, should we allow "sumarea" to be less than 1 (not larger than 1, of course)? Would using a "warning message" rather than a "endrun" be more proper here then? |
I was actually thinking that the check logic should be doing a match index between HLM and FATES pfts first and only loop through all the matched HLM pfts to check if all summed to 1 instead of looping through all HLM pfts (which I personally think is not efficient). |
So, I was coming slowly to the conclusion that the intention of this check is only appropriate for a certain set of use cases. But then I thought that perhaps the logic is OK. In fact, if we have only one FATES PFT, then we need to allocate all of every HLM PFT to that single FATES PFT to fill up all of the space (and every value in the hlm_pft_map vector should be 1.0). Otherwise, we'll be running with a mostly empty world? Maybe that's actually what you want to do (i.e. run for only places where this HLM PFT exists on the map) but to do that, we'd have to allow this check to fail, and then allocate all the remaining land as bare ground. Does that make sense? |
@rosiealice @XiulinGao is an alternative to put in a switch that says, if running SP or nocomp mode with some subset of PFTs, that we rescale the PFT coverage so that if any of the subsetted PFTs exist on a gridcell, we reweight the PFTs so that the subsetted ones fill up the available space? That way one can use SP mode to compare against site data with known composition that is different from the gridcell that it is in? |
Note this check should only be applied when we are using biogeographical constraints, this should not be triggering for fully dynamic runs, ie add the condition:
|
I ran into this yesterday after making a new parameter file and running in full-fates mode. hlm_pft_map was all messed up. We should indeed add that check... |
I just ran into this in a full-fates run too. will add a PR with a fix. |
@ckoven was there a PR merged that fixed this? |
@glemieux and I are reading through this, and it does not seem like the original issue is addressed by #798. It seems like we are still trying to figure out how to proceed vis-a-vis the points made by @ckoven and @rosiealice on Sept 29th 2021. |
Looks like #798 was indeed supposed to have fixed this... |
A variation on this issue came up again in conversation with @jenniferholm when running a FBG only case, but with 3 pfts. If I understand correctly, the current method of setting up the Is my understading here of the usage (for FBG only at least) correct? |
@sshu88 - came across this issue as well in a case where he modified the PCT_NAT_PFT in the surface data file. He did a manual fix to make sure that each row summed to 1, like you show in your "sum check", instead of having the row sum to zero. Anyway, just tagging @sshu3 here since also saw this problem and did a one time fix |
I was running FATES SP mode with single PFT. By using updated python scripts under tools folder to modify my paramter file, the fates_hlm_pft_map looks like this: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0](reversed in the dimension, so would be 14x1).
This then causes a problem in reading the fates_hlm_pft_map and leads to following error:
The distribution of this host land model PFT : 1
into FATES PFTs, does not add up to 1.0.
Error is: -1.0000000000000000
and the hlm_pft_map is: 0.0000000000000000
Aborting
ENDRUN:ERROR in /home/xiulingao/var-test-runs/CTSM/src/fates/main/EDPftvarcon.F90 at line 1762 $
ERROR: Unknown error submitted to shr_abort_abort.
fates/main/EDPftvarcon.F90
Lines 1752 to 1765 in 70a3e13
Apprarently, hlm_pft_map is not readed during the run. And then I tried to run SP mode with all 12 PFTs it then did work. So I think there's somehting wrong in either FatesInterfaceMod.F90 or EDPftvarcon.F90 which leads to failure in reading fates_hlm_pft_map when there is only one PFT or the output pft mapping matrix is wrong (so problem with FatesPFTIndexSwapper.py?)
The text was updated successfully, but these errors were encountered: