Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

If statements in DATM buildnml wrongly assume False if the value is 0.0

Open
#445 1 comment 0 reactions 1 assignee View on GitHub

@ekluzek is already working on this.

Since Sep 23, 2026.

Assessment

This issue has not been assessed yet.

Description

bug Responsibility: CTSM

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ESCOMP/CDEPS

All issues in ESCOMP/CDEPS

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.