ESCOMP / ESCOMP/CTSM

vert_dist_top veg check mishandles some PFT types

Open Beginner friendly
#4,119 4 comments 0 reactions 0 assignees View on GitHub
bug non-b4b science
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
6d 6h
Merged PRs (30d)
8

Description

As of ctsm5.4.047, this block does not explicitly handle `nbrdlf_dcd_tmp_shrub` or `nc4_grass`: https://github.com/ESCOMP/CTSM/blob/7409d3218513e1d95dbc2828de9a11a8972b1386/src/biogeochem/CNFireEmissionsMod.F90#L356-L383

The result is that they both fall into `else if (veg_type == nc3crop .or. veg_type <= nc3irrig)` and thus get `ztop` set to 1000.

This is messy but has no impact for `nc4_grass`, as the other grasses do get 1000. However, that's _not_ the value for the explicitly-handled shrubs (2000), so this is probably buggy behavior for `nbrdlf_dcd_tmp_shrub`.

Note: After #4112 merges to master, those WILL be handled explicitly, including the presumably buggy behavior for `nbrdlf_dcd_tmp_shrub`.

Worth noting: This kind of bug will not be possible once we resolve #3388!

Contributor guide

Open the contributing guide

Research direction

Start in src/biogeochem/CNFireEmissionsMod.F90 at lines 356-383 and compare the fall-through branch with the explicitly handled PFT types, especially nbrdlf_dcd_tmp_shrub and nc4_grass. After considering the interaction with #4112, verify that each type receives the intended ztop value and that the change does not reintroduce the issue described in #3388.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
hpc
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.