Should be able to use lai streams with FATES-SP mode
Brief summary of bug
From code inspection I can see that you can't use lai streams with FATES-SP mode, but you should be able to.
General bug information
CTSM version you are using: ctsm5.1.dev090
Does this bug cause significantly incorrect results in the model's science? No
Configurations affected: FATES compsets with use_fates_sp=T and use_lai_streams=T
Details of bug
Here's the code in clm_driver that causes me to see this as a problem...
if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then
call lai_advance( bounds_proc )
endif
Probably a better way to do this is to have the checking of if use_lai_streams and use_cn or use_fates elsewhere. Here it should just check if use_lai_streams is on and do the lai_advance.
I tried running this way and it does die in initialization. It looks like the namelist isn't setup properly to give the LAI streams filename. So it dies trying to read the LAI streams file which isn't set.
In adding a testmod for this it dies at preview_namelist time with:
err=ERROR : CLM build-namelist::CLMBuildNamelist::setup_logic_lai_streams() : When bgc is NOT SP none of the following can be set: stream_year_first_lai, stream_year_last_lai, model_year_align_lai, lai_tintalgo nor stream_fldfilename_lai (eg. don't use this option with BGC,CN,CNDV nor BGDCV).
The build-namelist should be changed to go more along the lines with:
https://github.com/ESCOMP/CTSM/issues/942#issuecomment-825232435
The build-namelist currently includes the "-bgc" option to determine both the "veg-model" (Big-Leaf or FATES, or multilayer canopy) and "veg-method" (prognostic or prescribed (SP)). With refactoring to separate the two the namelist could more easily handle recognizing that lai_streams is an option for prescribed veg-method and any veg-model option.
@ekluzek is this still in testing?
@jkshuman I have not worked on this. Is this something that should bubble up with a higher priority?
@adrifoster I think maybe this is what was referenced in the "minimum shippable fates" document you shared during the fates software meeting call today?
@glemieux yes! thank you! @ekluzek how difficult is this? I can take this on, perhaps we could meet to discuss?
Meeting to discuss sounds great. I think this is pretty straightforward to do, just changing some if statements and testing everything, and also adding a FATES specific test for this.
I believe I have this working now, but I am getting a "too much canopy in summary" error - this is not related to the lai streams, but a known issue in SP mode with f09_g17 grid. I am going to treat this as a separate bug/PR but still try to track it down.