Zero-pad years in datetime strings using i4.4

Open Beginner friendly
#50 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
fortran
Domain
backend

Research direction

Open share/datetime_mod.F90 and locate the datetime constructor and Update_datetime routines. Check how each formats the year, then exercise construction and time advancement with a year below 1000 and a four-digit year. Done means both produce zero-padded four-digit years without changing four-digit output.

Written by the indexing model from the issue text.

Description

bug

The datetime constructor and Update_datetime in share/datetime_mod.F90 format the year using i4. For years below 1000, this inserts
leading spaces instead of zeros.

For example, year 1 produces:

fire_output_ 1-01-01_00:00:00.nc

The expected filename is:

fire_output_0001-01-01_00:00:00.nc

Change the year format from i4 to i4.4 in both routines. This would allow idealized examples to use dates such as 0001-01-01 with
consistently formatted timestamps.

Verify that construction and time advancement preserve zero-padding, and that four-digit years remain unchanged.

Dominant language
Fortran
Stars
11
Forks
17
Avg merge
21h 12m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

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 NCAR/fire_behavior

All issues in NCAR/fire_behavior

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.