Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for RUC LSM imprecision issue #6

Conversation

SamuelTrahanNOAA
Copy link
Collaborator

@SamuelTrahanNOAA SamuelTrahanNOAA commented Sep 22, 2022

The module_sf_ruclsm.F90 has comparisons to zero, which break the code when numbers are very close to 0, such as 1e-322. This happens with the gfortran compiler when compled with -DDEBUG=ON since the option to truncate subnormal numbers is turned off. It might also happen if the ruc lsm was run in double precision, but I have not seen that yet. My fix is truncate subnormal numbers manually, for the two variables that cause trouble. This new code is in the "sanity checks" regions of lsm_ruc.F90, as requested by @tanyasmirnova.

Fixes #5

The module_sf_ruclsm has comparisons to zero, which break the code
when numbers are very close to 0, such as 1e-322. This happens with
the gfortran compiler when compled -DDEBUG=ON since the option to
truncate subnormal numbers is turned off.

The workaround is to truncate subnormal numbers manually, for the
two variables that cause trouble.
@SamuelTrahanNOAA
Copy link
Collaborator Author

Codeowner @tanyasmirnova has requested that:

  1. The sanity checks should be moved to lsm_ruc.F90's sanity check block where they belong.
  2. Two "snow on ice" variables should have the same sanity check. (By luck alone, the gfortran debug test did not encounter subnormal snow on ice numbers.)

I'm testing this in the fork (NOAA-GSL#163) and I'll apply the fix to this PR as soon as those tests pass.

@SamuelTrahanNOAA SamuelTrahanNOAA changed the title fix for module_sf_ruclsm imprecision issue fix for RUC LSM imprecision issue Sep 26, 2022
@grantfirl
Copy link
Collaborator

@SamuelTrahanNOAA Since #13 was merged, I think that this one is the next in the UFS merge queue. Please pull in the latest ufs/dev branch to get ready for testing when you get a chance.

@SamuelTrahanNOAA
Copy link
Collaborator Author

@grantfirl The ccpp-physics seems to be ahead of the higher-level repositories. Are you sure #13 was supposed to be merged?

@grantfirl
Copy link
Collaborator

Super-repos are still in the process of merging their respective PRs.

@SamuelTrahanNOAA
Copy link
Collaborator Author

It looks like the only changes are in ccpp/physics, so I can start testing despite the out-of-sync repositories.

@jkbk2004
Copy link

@ChunxiZhang-NOAA @SamuelTrahanNOAA cubed sphere pr 219 was merged in. We can move on to merge this pr.

@grantfirl
Copy link
Collaborator

@jkbk2004 I can merge this if necessary. I think that ordinarily, @ChunxiZhang-NOAA should have that responsibility for this fork/branch, but @dustinswales and I have the capability if there is ever time pressure.

@jkbk2004
Copy link

@grantfirl sure! please, go ahead. so that @SamuelTrahanNOAA can move to downstream.

@grantfirl grantfirl merged commit ab220bf into ufs-community:ufs/dev Oct 17, 2022
@ChunxiZhang-NOAA
Copy link

@jkbk2004 I can merge this if necessary. I think that ordinarily, @ChunxiZhang-NOAA should have that responsibility for this fork/branch, but @dustinswales and I have the capability if there is ever time pressure.

@grantfirl Thanks for merging the PR into this fork timely. I was in a meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

module_sf_ruclsm imprecision breaks gfortran in debug mode for RRFS tests
5 participants