Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

configure: error: netcdf.mod not found in NETCDF_PATH/include

Hi,

I am using CESM version 1.1.2 to build the B20TRLENS compset. I have attached my config_machines.xml, config_compiler.xml and other machine-specific files.

I am using the intel13 compiler with the following specs:-

<compiler COMPILER="intel13">
<PNETCDF_PATH></PNETCDF_PATH>
<ADD_CPPDEFS> -DFORTRANUNDERSCORE -DNO_R16</ADD_CPPDEFS>
<MPI_PATH>/apps/openmpi/1.6.3</MPI_PATH>
<MPICC>mpicc</MPICC>
<MPIFC>mpif90</MPIFC>
<MPICXX>mpicxx</MPICXX>
<CONFIG_ARGS></CONFIG_ARGS>
<ESMF_LIBDIR></ESMF_LIBDIR>
<FFLAGS> -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs </FFLAGS>
<FREEFLAGS> -free </FREEFLAGS>
<FIXEDFLAGS> -fixed -132 </FIXEDFLAGS>
<CXX_LINKER>FORTRAN</CXX_LINKER>
<CXX_LDFLAGS> -cxxlib </CXX_LDFLAGS>
<ADD_CPPDEFS> -DCPRINTEL </ADD_CPPDEFS>
<SUPPORTS_CXX>TRUE</SUPPORTS_CXX>
<ADD_FFLAGS> -fPIC -g -O2 -I/apps/netcdf/4.7.1/include </ADD_FFLAGS>
<ADD_SLIBS> -L/apps/netcdf/4.7.1/lib/Intel -lnetcdff -L/apps/netcdf/4.7.1/lib -lnetcdf </ADD_SLIBS>
<SFC> ifort </SFC>
</compiler>

I can create the case and run ./cesm_setup successfully. However, on building the case, the buildlib.pio script fails with the following error:-

configure: error: netcdf.mod not found in NETCDF_PATH/include check the environment variable NETCDF_PATH

I checked the config.log file, it fails at the following lines of the /models/utils/pio/configure script:-

if test ! -f $NETCDF_PATH/include/netcdf.mod && \
test ! -f $NETCDF_PATH/include/NETCDF.mod
then { { $as_echo "$as_me:$LINENO: error: netcdf.mod not found in NETCDF_PATH/include \
check the environment variable NETCDF_PATH" >&5


The NETCDF_PATH in the env_mach_specific file is set to /apps/netcdf/4.7.1. It seems that the model is trying to find the netcdf.mod file at /apps/netcdf/4.7.1/include. However, the way the netcdf files are installed on my system (I do not have administrator privileges), the netcdf.mod file is located at /apps/netcdf/4.7.1/include/Intel.

How do I resolve this error? Is there a way I can make the model search for the file in a different path?

I have attached the pio build log files.

Thanks in advance...
 

Attachments

  • config_compilers.txt
    37.8 KB · Views: 5
  • config_machines.txt
    27.8 KB · Views: 3
  • pio.bldlog.200525-204022.txt
    4.8 KB · Views: 2
  • env_mach_specific.txt
    1.2 KB · Views: 3
  • config_log.txt
    44.6 KB · Views: 0
I replaced the code

if test ! -f $NETCDF_PATH/include/netcdf.mod && \
test ! -f $NETCDF_PATH/include/NETCDF.mod
then { { $as_echo "$as_me:$LINENO: error: netcdf.mod not found in NETCDF_PATH/include \
check the environment variable NETCDF_PATH" >&5


with

if test ! -f $NETCDF_PATH/include/netcdf.mod && \
test ! -f $NETCDF_PATH/include/NETCDF.mod && \
test ! -f $NETCDF_PATH/include/Intel/netcdf.mod && \

then { { $as_echo "$as_me:$LINENO: error: netcdf.mod not found in NETCDF_PATH/include \
check the environment variable NETCDF_PATH" >&5


and that fixed it.
 
Top