CTSM icon indicating copy to clipboard operation
CTSM copied to clipboard

Should be able to use lai streams with FATES-SP mode

Open ekluzek opened this issue 3 years ago • 2 comments

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.

ekluzek avatar Apr 26 '22 03:04 ekluzek

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.

ekluzek avatar Apr 26 '22 19:04 ekluzek

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 avatar May 08 '22 18:05 ekluzek

@ekluzek is this still in testing?

jkshuman avatar Feb 01 '23 20:02 jkshuman

@jkshuman I have not worked on this. Is this something that should bubble up with a higher priority?

ekluzek avatar Feb 01 '23 20:02 ekluzek

@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 avatar Jun 26 '23 20:06 glemieux

@glemieux yes! thank you! @ekluzek how difficult is this? I can take this on, perhaps we could meet to discuss?

adrifoster avatar Jun 26 '23 20:06 adrifoster

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.

ekluzek avatar Jun 26 '23 20:06 ekluzek

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.

adrifoster avatar Jul 12 '23 19:07 adrifoster