Fix handling of bare land fluxes in lnd2glcMod
- Dominant language
- Fortran
- Stars
- 352
- Forks
- 361
- Avg merge
- 6d 6h
- Merged PRs (30d)
- 8
Description
_From @billsacks on May 8, 2017 18:37_
I think the handling of bare land fluxes in lnd2glcMod: update_lnd2glc _may_ be wrong in cases where there are landunits other than the vegetated landunit in the grid cell.
I'm specifically thinking about this code:
```Fortran
! Set vertical index and a flux normalization, based on whether the column in question is glacier or vegetated.
if (lun%itype(l) == istice_mec) then
n = col_itype_to_icemec_class(col%itype(c))
flux_normalization = 1.0_r8
else if (lun%itype(l) == istsoil) then
n = 0 !0-level index (bareland information)
flux_normalization = bareland_normalization(c)
else
! Other landunit types do not pass information in the lnd2glc fields.
! Note: for this to be acceptable, we need virtual vegetated columns in any grid
! cell that is made up solely of glacier plus some other special landunit (e.g.,
! glacier + lake) -- otherwise CISM wouldn't have any information for the non-
! glaciated portion of the grid cell.
cycle
end if
```
I see two possible issues:
(1) The comment in the `else` clause seems wrong with the current code. Specifically, the note starting with "for this to be acceptable" seems wrong now: with the flux_normalization, it seems like we're passing 0 values for bare land smb anywhere where the grid cell has 0% natural veg but < 100% glacier. Is this a problem?
(2) In the `else` clause, I'm thinking that we may want to abort rather than just silently cycling. At one point, I added this note in the `else` clause on a branch - but I never brought this to the trunk:
```Fortran
! NOTE(wjs, 2016-11-18) We abort if any such landunit is found in the do_smb
! filter: The code in this routine only passes SMB from the vegetated column to
! CISM, so if other code is handling other landunits within the do_smb filter,
! there will likely be conservation problems due to this inconsistency.
! (Although I haven't checked carefully to see if there would truly be
! conservation problems.)
```
and then I had changed the `cycle` to:
```Fortran
write(iulog,*) subname//' ERROR: column that is neither ice_mec nor soil'
write(iulog,*) 'encountered in the do_smc_c filter.'
call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__))
```
I want to think a little more about what the right thing is to do here.
cc @whlipscomb
_Copied from original issue: NCAR/CLM#6_
Contributor guide
Assessment
This issue has not been assessed yet.