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

mom5: should we explicitly add netcdf-c's include directory in the SPD? #17

Open
harshula opened this issue May 14, 2023 · 2 comments
Open
Assignees

Comments

@harshula
Copy link
Collaborator

GCC compiles contain the Makefile snippet:

CFLAGS += $(shell nc-config --cflags)

that results in the following being added:

-I$SPACK/opt/spack/linux-debian12-x86_64/gcc-12.2.0/netcdf-c-4.7.4-jzburrwbsqhi6cjth7nm4zdnunhcyhaq/include -I$SPACK/opt/spack/linux-debian12-x86_64/gcc-12.2.0/hdf5-1.12.2-igvxfglba4p6pcufko2mbprzeampoljh/include

Instead, should we explicitly add netcdf-c's include directory? e.g. (spec["netcdf-c"].headers).cpp_flags

@harshula harshula self-assigned this May 14, 2023
@harshula
Copy link
Collaborator Author

  1. mpicc appears to compile the C files without explicitly needing netcdf-c's include directory.

  2. pio.h contains:

#include <netcdf.h>

@aidanheerdegen
Copy link
Member

Turns out there is very limited use of the netCDF C interface in MOM5 itself (or FMS as that is where this comes from):

https://github.com/mom-ocean/MOM5/blob/master/src/shared/mosaic/read_mosaic.c#L27

There is widespread use in the tools subdirectory, but none of that is used directly by MOM5. The only use of read_mosaic in the code is also in the tools subdirectory

https://github.com/search?q=repo%3Amom-ocean%2FMOM5%20read_mosaic&type=code

apart from compiling EBM (mom5_ebm_compile.csh) which is not relevant.

From the limited searching I've done above it seems to me that read_mosaic.c is not required for MOM5, but it is included in the generic build of FMS because that is used for a number of builds.

@harshula harshula moved this to In Progress in ACCESS-OM2 Spack May 15, 2023
@harshula harshula moved this from In Progress to Todo in ACCESS-OM2 Spack Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants