-
Notifications
You must be signed in to change notification settings - Fork 714
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
Improve NetCDF detection and linking #1923
Improve NetCDF detection and linking #1923
Conversation
The results of regression tests:
|
Moved minor variable initialization in Should I add the notes about Hopefully splitting these PRs as requested multiple times will finally get these necessary changes into WRF and help broaden the environments WRF can be compiled under. |
@rjdave Thanks for adding the two line change here. Yes, please add relevant info to this PR. |
@islas Can you review this PR and recommend if it should be included in 4.5.2 release. Thanks! |
configure
Outdated
@@ -918,7 +882,7 @@ EOF | |||
echo " Fortran compiler is $SFC_arch" | |||
echo " It will build in $netcdf_arch" | |||
echo " " | |||
if [ -e $NETCDF/bin/nc-config ] ; then | |||
if [ -e $NETCDF_C/bin/nc-config ] ; then | |||
echo "NetCDF version: ${ncversion}" | |||
echo "Enabled NetCDF-4/HDF-5: `nc-config --has-nc4`" |
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 believe this will output the results from the wrong nc-config
if $NETCDF_C
differs from default in PATH
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.
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.
You're right, I missed that one. I will push the appropriate change in a few minutes.
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.
Most of these changes resolve #1742 and having consistent usage of
nf-config
andnc-config
fall under the aim of this PRPinging @wkliao to be aware that this should be the PR that resolves issues noted in #1742
If this PR #1923 resolved issues raised by PR #1742 and beyond, then #1742 can be closed. Given #1742 was created 1 and 1/2 years ago, I wonder if there is anything it missed, so it could not be merged.
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 think the primary thing #1742 did not have was the ability to use both nf-config
and nc-config
for different library link info. This probably wasn't a high priority then, but netCDF's shift to split the two programs even further as of v4.9.2 will soon be problematic for WRF's current make builds. (see Unidata/netcdf-c#2619 and Unidata/netcdf-c v4.9.2 release notes)
Definitely something to include with 4.5.2 as the latest releases of netCDF further separate |
@rjdave Can you add weiwangncar as your collaborator? We need to resolve a code conflict when merging your code into the repository. Thanks. |
I will have to see if we have any spare slots since this is in an organization and not my personal GitHub. |
There should be an option on the pull request to "Allow edits by maintainers", if not resolving the merge conflict within your repo should be doable as well. The option should be on the righthand column of the PR below all the reviewers, assignees, labels, and notifications. |
I see that adding |
@rjdave When you use the 'Resolve Conflicts' button to make a change, the change will be committed to your feature branch. |
The latest regression test results:
|
@islas Since this PR has been updated, it requires your review again. Specifically it removed quotes from the next line. Thanks. |
@islas Are you ok with this PR? Thanks! |
TYPE: enhancement KEYWORDS: NetCDF4, Spack-Stack, gfortran SOURCE: David Robertson, Rutgers University DESCRIPTION OF CHANGES: Problem: - NetCDF4 detection and linking is unreliable and impossible if NetCDF-C and NetCDF-Fortran reside in different directories - gfortran is intolerant of non-initialized variables in **`mediation_integrate.F`**. Solution: - Refactor the detection and configuration of NetCDF dependencies and add the capability to use NetCDF-C and NetCDF-Fortran libraries that don't reside in the same directory by introducing a new variable for the NetCDF-C path. - The **fname** and **n2** `intent(out)` variables are not assigned under certain circumstances so we should initialize them to empty strings. ``` ierr = 0 fname = "" n2 = "" ! Note that computation of fname and n2 are outside of the oid IF statement ``` LIST OF MODIFIED FILES: list of changed files (used `git diff --name-status release-v4.5.2` to get formatted list) ``` M Makefile M arch/Config.pl M arch/postamble M arch/preamble M configure M share/mediation_integrate.F ``` TESTS CONDUCTED: 1. Compiled and ran with several different configurations of NetCDF, including both shared and static versions of both split (NetCDF-C and NetCDF-Fortran in separate directories) and unified library locations. The shared library versions were from Spack-Stack; the static libraries were custom-built for my systems. 2. Ran the coupled WRF-ROMS standard test case for Hurricane Irene. 3. The Jenkins tests are all passing. RELEASE NOTE: This PR improve the detection and linking with shared and static configurations of the NetCDF-4 libraries (split or unified) inside and outside Spack-Stack.
TYPE: enhancement
KEYWORDS: NetCDF4, Spack-Stack, gfortran
SOURCE: David Robertson, Rutgers University
DESCRIPTION OF CHANGES:
Problem:
mediation_integrate.F
.Solution:
intent(out)
variables are not assigned under certain circumstances so we should initialize them to empty strings.LIST OF MODIFIED FILES: list of changed files (used
git diff --name-status release-v4.5.2
to get formatted list)TESTS CONDUCTED:
RELEASE NOTE: This PR improve the detection and linking with shared and static configurations of the NetCDF-4 libraries (split or unified) inside and outside Spack-Stack.