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

fixed pnetcdf usage in CIME #251

Merged
merged 1 commit into from
May 2, 2023
Merged

Conversation

mvertens
Copy link
Contributor

The -DPNETCDF flag was not getting set as part of the build using CIME.
This PR fixes that problem.

@mvertens mvertens requested a review from matsbn April 28, 2023 13:03
@mvertens
Copy link
Contributor Author

@matsbn - I'd like to have this fix as part of the sandbox that I'm putting together for you, Thomas, Ana and Jens for Making Waves.

@mvertens mvertens removed the request for review from matsbn May 1, 2023 07:33
@matsbn
Copy link
Contributor

matsbn commented May 2, 2023

Since BLOM master is currently supporting NorESM based on CESM2.1 to CESM2.3 frameworks, I wanted to test this PR with NorESM2 (based on CESM2.1). The modified buildcpp works well in NorESM2, although the fix is redundant in this configuration (-DPNETCDF flag is duplicated when pnetcdf module is loaded).

If I remember correctly, I got the -DPNETCDF flag set correctly with cesm2.3.alpha08a code base by modifying cime/scripts/Tools/Makefile to include something like:

ifdef LIB_PNETCDF
CPPDEFS += -D_PNETCDF
SLIBS += -L$(LIB_PNETCDF) -lpnetcdf
ifeq ($(COMP_NAME), blom)
CPPDEFS += -DPNETCDF
endif
endif

Also setting the cmake specific netcdf/pnetcdf settings for Betzy was important. Would you think that is a better place to set CPP flags for external libraries?

@mvertens
Copy link
Contributor Author

mvertens commented May 2, 2023 via email

@matsbn
Copy link
Contributor

matsbn commented May 2, 2023

Thanks for the clarification. I agree we should approach a consistent procedure on how to set library specific settings across components, and I guess it is a bit of a moving target right now. Until we agree on how to go about this, this fix should work for now so I'll merge it.

@matsbn matsbn merged commit 81cd404 into NorESMhub:master May 2, 2023
@mvertens mvertens deleted the feature/fix_pnetcdf branch July 17, 2023 08:23
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.

2 participants