If statements in DATM buildnml wrongly assume False if the value is 0.0
@ekluzek is already working on this.
Since Sep 23, 2026.
Assessment
This issue has not been assessed yet.
Description
A few longstanding if statements in DATM. buildnml wrongly assume False for values of zero. This is because in python (and C and other languages) an if statement on zero assumes False:
if 0:
print( "this will never happen")
else
print( "this will return")
So only the else branch gets triggered.
This is seen in this bit of code:
if case.get_value("PTS_LON"):
scol_lon = float(case.get_value("PTS_LON"))
else:
scol_lon = missing
if case.get_value("PTS_LAT"):
scol_lat = float(case.get_value("PTS_LAT"))
else:
scol_lat = missing
- Dominant language
- Fortran
- Stars
- 32
- Forks
- 69
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ESCOMP/CDEPS
-
Bug in `datm_datamode_clmncep_mod` preventing using diffuse & direct SW streamsPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
CESM Only enhancement question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100