ESCOMP / ESCOMP/CTSM

g_to_ig arrays can be removed

Open
#3,603 0 comments 0 reactions 0 assignees View on GitHub
b4b code health
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
2d 21h
Merged PRs (30d)
7

Description

Most of the modules that handle streams data have g_to_ig arrays to convert the indexing. I think this was required at some point years ago, but now it isn't, as the array is actually the identity function. So there is no need to keep it around. It's a left over vestige that can be removed.

A better way to handle this when there is a question on the indexing is to use SHR_ASSERT or shr_assert calls to check that the indexing is the way it's expected. Also putting the base level streams handling into one module for CTSM can help here as well.

Here are some files with this construct:

cropcalStreamMod.F90:
laiStreamMod.F90:
SoilMoistureStreamMod.F90:

UrbanTimeVarType also has this conversion:

``` fortran
UrbanTimeVarType.F90: ig = lun%gridcell(l) - bounds%begg + 1
```

which should probably just have a SHR_ASSERT to show that bounds%begg is 1 for a bounds_proc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.