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 compiler error when fv_nphys=0 #3128

Merged
merged 1 commit into from
Aug 20, 2019
Merged

Conversation

whannah1
Copy link
Contributor

@whannah1 whannah1 commented Aug 14, 2019

When building with GNU in debug mode on certain machines it will complain
if fv_nphys=0 even though those blocks of code are never used. This
fixes the issue by using a dummy variable to hold the product of
fv_nphys*fv_nphys.

[BFB]

When GNU is used in debug mode on certain machines it will complain
if fv_nphys=0 even thought those blocks of code are never used. This
fixes the issue by using a dummy variable to hold the product of
fv_nphys*fv_nphys.

	modified:   components/cam/src/dynamics/se/dyn_grid.F90
Copy link
Contributor

@AaronDonahue AaronDonahue left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me. Are we relying on the fact that if nphys_sq doesn't divide (gcol-1) perfectly than the integer will be rounded down? I assume this is the correct behavior, but worth asking.

@rljacob
Copy link
Member

rljacob commented Aug 16, 2019

The comment in the code you replaced says "Note: the max() is to fool the compiler debug mode when fv_nphys=0". Did the max no longer work?

@whannah1
Copy link
Contributor Author

@AaronDonahue, that is the correct behavior. We're only interested in the block/element, which always has nphys_sq FV cells.

@rljacob, the max would still have worked, but I figure the new way was more sensible and made the code a bit cleaner.

@rljacob rljacob added the HOMME label Aug 16, 2019
rljacob added a commit that referenced this pull request Aug 16, 2019
When building with GNU in debug mode on certain machines it will complain
if fv_nphys=0 even though those blocks of code are never used. This
fixes the issue by using a dummy variable to hold the product of
fv_nphys*fv_nphys.

[BFB]

* whannah/atm/fix-pg-compiler-bug:
  Fix compiler error when fv_nphys=0
@rljacob rljacob merged commit 41f0e59 into master Aug 20, 2019
@whannah1 whannah1 deleted the whannah/atm/fix-pg-compiler-bug branch August 29, 2019 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants