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

FDS Source: Issue #12019. Fix bug related to double precision reals #12022

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

mcgratta
Copy link
Contributor

@mcgratta mcgratta commented Aug 3, 2023

No description provided.

@mcgratta mcgratta merged commit 3f7b04a into firemodels:master Aug 3, 2023
3 checks passed
@mcgratta
Copy link
Contributor Author

mcgratta commented Aug 3, 2023

This PR does the following:

  1. Change the name ALMOST_ONE to ONE_M_EPS
  2. Add ONE_P_EPS=1+EPSILON
  3. Fix bug in read.f90 related to finding bounds for spatial integration.

There are a few places in the code where we want a number to be a little bigger or smaller to avoid computer round-off. Previously, we would typically write Y - TWO_EPSILON_EB to be a number just less than Y if it were 12.00000000 and we wanted to round down to 11.999999. Like when converting XB on the DEVC line to find the proper cells over which to integrate a spatial stat. Anyway, EPSILON(X) is the smallest number for which 1-EPSILON(X)<1 . But if we add or subtract one or two epsilons from a larger number, the result may not be larger or smaller than the number. Instead, it is better to multiply our number by 1-EPS or 1+EPS to ensure that the result will be significant.

Note, this does not affect the vast majority of uses for TWO_EPSILON_EB where we just want to know if a number is close to zero.

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.

1 participant