Skip to content

vert_dist_top veg check mishandles (?) some PFT types #4119

Description

@samsrabin

As of ctsm5.4.047, this block does not explicitly handle nbrdlf_dcd_tmp_shrub or nc4_grass:

! Bare soil, won't be used
if ( veg_type == noveg ) then
ztop = nan
! temperate and boreal evergreen needleleaf trees
else if ( veg_type == ndllf_evr_tmp_tree .or. veg_type == ndllf_evr_brl_tree ) then
ztop = 4.e3_r8 ! m
! temperate and boreal trees
else if ( veg_type == ndllf_dcd_brl_tree .or. veg_type == nbrdlf_evr_tmp_tree .or. &
veg_type == nbrdlf_dcd_tmp_tree .or. veg_type == nbrdlf_dcd_brl_tree ) then
ztop = 3.e3_r8 ! m
! tropical broadleaf trees (evergreen and decidious)
else if ( veg_type == nbrdlf_evr_trp_tree .or. veg_type == nbrdlf_dcd_trp_tree ) then
ztop = 2.5e3_r8 ! m
! shrubs
else if ( veg_type >= nbrdlf_evr_shrub .and. veg_type <= nbrdlf_dcd_brl_shrub ) then
ztop = 2.e3_r8 ! m
! grasses
else if ( veg_type >= nc3_arctic_grass .and. veg_type <= nc3_nonarctic_grass ) then
ztop = 1.e3_r8 ! m
! generic unmanaged crops
else if ( veg_type == nc3crop .or. veg_type <= nc3irrig ) then
ztop = 1.e3_r8 ! m
! Prognostic crops
else if (is_prognostic_crop(veg_type)) then
ztop = 1.e3_r8 ! m
else
call endrun('ERROR:: undefined veg_type' )
end if

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

This is messy but has no impact for nc4_grass, as the other grasses do get 0.001. However, that's not the value for the explicitly-handled shrubs (0.002), 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething is working incorrectlynextthis should get some attention in the next week or two. Normally each Thursday SE meeting.non-b4bChanges answers (incl. adding tests)scienceEnhancement to or bug impacting science

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions