Skip to content

Conversation

@hkershaw-brown
Copy link
Member

Description:

Parse_variables_clamp in the default model_mod had format d16.8 in the read statement. This caused integers to be read as value * 10-8 following the fortran standard.
This pull request removes the format on the read for parse_variables_clamp and from the reads in the modules this routine was based off, wrf, mpas_atm, tiegcm

Fixes issue

fixes #1022

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Please describe any tests you ran to verify your changes.
Changed the test_parse_args to check integers in the namelist.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

@hkershaw-brown hkershaw-brown requested a review from mjs2369 January 6, 2026 21:30
Copy link
Contributor

@mjs2369 mjs2369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Helen. This is missing a fix for mpas_ocn:

bound = trim(bounds_table(2,n))
if ( bound /= 'NULL' .and. bound /= '' ) then
read(bound,'(d16.8)') lower_bound
else
lower_bound = missing_r8
endif
bound = trim(bounds_table(3,n))
if ( bound /= 'NULL' .and. bound /= '' ) then
read(bound,'(d16.8)') upper_bound
else
upper_bound = missing_r8
endif

@hkershaw-brown
Copy link
Member Author

Hi Helen. This is missing a fix for mpas_ocn:

bound = trim(bounds_table(2,n))
if ( bound /= 'NULL' .and. bound /= '' ) then
read(bound,'(d16.8)') lower_bound
else
lower_bound = missing_r8
endif
bound = trim(bounds_table(3,n))
if ( bound /= 'NULL' .and. bound /= '' ) then
read(bound,'(d16.8)') upper_bound
else
upper_bound = missing_r8
endif

Good catch, however I have left mpas_ocn alone as it does not compile (no quickbuild.sh).

Copy link
Contributor

@mjs2369 mjs2369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix

@hkershaw-brown hkershaw-brown added the release! bundle with next release label Jan 8, 2026
@hkershaw-brown hkershaw-brown merged commit 162eacb into main Jan 8, 2026
103 checks passed
@hkershaw-brown hkershaw-brown deleted the fix-readstr branch January 8, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release! bundle with next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: reading clamping values entered as integers gives incorrect values

3 participants