NCAR / icar

The Intermediate Complexity Atmospheric Research model (ICAR)
MIT License
72 stars 53 forks source link

bugfix: unititialized todays_date_time variable used #161

Closed scrasmussen closed 1 year ago

scrasmussen commented 1 year ago

TYPE: bugfix

KEYWORDS: NetCDF, Valgrind

SOURCE: Soren Rasmussen, NCAR

DESCRIPTION OF CHANGES: Valgrind was producing warnings of an uninitialized variable being used. The executable was outputting correct behavior because it would output todays_date_time with a bad value, then rewrite it later in the subroutine. Presumably this was originally done so that todays_date_time variable showed up in the NetCDF output in a specific order. Moving the todays_date_time initialization before the nf90_put_att call fixes the init issue and allows for removal of the repeat nf90_put_att call.

TESTS CONDUCTED: Builds and runs with correct looking output

Checklist