Skip to content

Fix bug in ESMF_CFIOUtils.F90#64

Merged
amolod merged 3 commits into
mainfrom
hotfix/bmauer/fix_get_times_cfio
Apr 13, 2026
Merged

Fix bug in ESMF_CFIOUtils.F90#64
amolod merged 3 commits into
mainfrom
hotfix/bmauer/fix_get_times_cfio

Conversation

@bena-nasa
Copy link
Copy Markdown
Contributor

@bena-nasa bena-nasa commented Mar 16, 2026

Mike Mehari found that ExtData was not correctly reading the JRA55 files that have data every 3 hours. It was only updating the fields once per day.

I ultimately traced this down to a bug in the ESMF_CFIOUtils.F90 file. That had a routine that returns the time information from the file as a start date, a start time, and a 64 bit integer vector of the deltas from the that time. However, depending on type (real32, real64 etc...) this was not being done correctly as it was not converting the time variable to int64 seconds correctly due to using INT on a real number and losing information. For example it would return 1.2 days, 1.4 days etc all as 86400 seconds.

This fixes that routine. Note that the helper procedures I needed to fix this properly were generated with chatGSFC for expediency.

In addition I am getting frustrated with not having an easy way to run ExtData by itself. Modern MAPL has a utility to do this that is not back portable to this codebase. I have created a very simple grid comp and driver I can use to run ExtData should any more problems be found that I would need to debug. I have put that in a folder in the Apps directory.

If any code was relying on the wrong results that the routine in ESMF_CFIOUtils.F90 this would be non-zero diff but that was flat out bug in that routine.

@bena-nasa bena-nasa requested a review from a team as a code owner March 16, 2026 20:25
@bena-nasa bena-nasa added the bug Something isn't working label Mar 16, 2026
@mfmehari
Copy link
Copy Markdown
Contributor

Thank you @bena-nasa for resolving it!

@mathomp4
Copy link
Copy Markdown
Member

@bena-nasa I think you can delete src/Applications/MAPL_Apps/hold_GNUmakefile

@amolod amolod added the Skip Changelog Skips the Changelog Enforcer label Apr 13, 2026
@amolod amolod merged commit d0a8489 into main Apr 13, 2026
1 check passed
@amolod amolod deleted the hotfix/bmauer/fix_get_times_cfio branch April 13, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Skip Changelog Skips the Changelog Enforcer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants