-
Notifications
You must be signed in to change notification settings - Fork 1
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 CMakeLists.txt of NCEP_bufr for gnu compiler #26
Merged
mathomp4
merged 2 commits into
GEOS-ESM:main
from
gmao-cda:bugfix/cda/bufr_v1_2_0_cmakelists_gnu
Nov 17, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmao-cda Why do we not want both compilers to do the same thing?
The differences you reported elsewhere suggest that there was a change in the library that requires an update to DYNAMIC, but then it should be for all compilers. E..g, the logic above is problematic for say the NAG compiler. (Granted we only use NAG for MAPL at the moment, but ... we have ambitions.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tclune The main issue is that Intel at the moment uses
STATIC_ALLOCATION
. I did ask about this in #17 but I am wary of touching code that is only really tested in the ADAS. I think we should move toDYNAMIC_ALLOCATION
for all compilers, but I don't know how to test this stuff.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have Intel compilers installed on my old macbook air. When I return home after work, I can test if switching to "DYNAMIC_ALLOCATION" for Intel will generate workable bufr libs when decoding my benchmark observations stored in BUFR format.
At least we can get some clues from this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we cannot test with ADAS, then maybe we should instead introduce a CMAKE "option", with the default being STATIC. One could then specify DYNAMIC on the command line.
The utility of this suggestion depends on how many non-DAS people need this library, and on whether we can come up with a good name for the option.
Just thinking out loud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mathomp4 To have more thorough tests on BUFRLIB, essentially those subs
read_*.f90
under GSI will decode bufr and prepbufr files and write out their decoded datasets in binary. We can compare if those decoded binary datasets have same results using the original and modified bufrlibs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recompiled bufr libs with intel compilers (
comp/intel/2021.2.0
) on Discover,with
DYNAMIC_ALLOCATION
applied tor bothifort
andicc
.Results:
There is no obvious error using
DYNAMIC_ALLOCATION
for Intel compiler (comp/intel/2021.2.0
):combfr.x
can still link correctly toNCEP_bufr_r4i4
,There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to ping @gmao-msienkie and see if she thinks this looks good. If so, we might do a two-step process here. One, take in the code in this PR where it's still static on Intel and make a release. Then maybe make another release where we go full DYNAMIC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was checking on this issue. It looks like there are a number of the "read_*" routines where the code has "call closbf" prior to any "call openbf" - which is what had caused a crash before with the version of BUFRLIB we are currently using when compiled with dynamic allocation. I had started a branch to fix this problem in 'read_iasi.f90' but killed my branch when I realized the extent of this "feature" in our code.
You noted in #17 that the newer version of the BUFRLIB would just print a warning message instead of exiting. That could work but I don't think that Ricardo would care to have numerous warning messages (one for each processor executing a problematic "read" routine) in the analysis log file. It looks like that we are still on 11.3.0 (see bvers.f), are there any plans to update the library.
I happened to get a question today regarding a newer version of 'read_cris.f90' someone copied from NCEP. When comparing with our current code I noticed the "call closbf" prior to the "call openbf" had been removed. Perhaps there has been some code cleaning as well as updates for data changes and science changes.
I think that NCEP is currently using a newer version of the BUFR library (11.4.0) in their operations. It looks like from the release notes that a number of features have been added to the library in the latest versions, as well as switching to compiling only with dynamic allocation. I am kind of thinking that when we bring in newer code for the GSI from NCEP we will want to also update the BUFR library at least to the version corresponding to what they are using with their code. At that point the people responsible for components that use the BUFRlib can carry out zero-diff tests to satisfy themselves that the code is working and not changing results.