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

WIP: Initial work to support new style NETCDF environment variables #1269

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -976,13 +976,13 @@ framework :
@ echo '--------------------------------------'
( cd frame ; $(MAKE) $(J) LLIST="$(LINKLIST)" framework ; \
cd ../external/io_netcdf ; \
$(MAKE) NETCDFPATH="$(NETCDFPATH)" \
$(MAKE) NETCDF_INC="$(NETCDF_INC)" NETCDF_LIB="$(NETCDF_LIB)" NETCDF_FORTRAN_INC="$(NETCDF_FORTRAN_INC)" NETCDF_FORTRAN_LIB="$(NETCDF_FORTRAN_LIB)" \
FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR" diffwrf; \
cd ../io_netcdf ; \
$(MAKE) NETCDFPATH="$(NETCDFPATH)" \
$(MAKE) NETCDF_INC="$(NETCDF_INC)" NETCDF_LIB="$(NETCDF_LIB)" NETCDF_FORTRAN_INC="$(NETCDF_FORTRAN_INC)" NETCDF_FORTRAN_LIB="$(NETCDF_FORTRAN_LIB)" \
FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
Expand All @@ -1005,13 +1005,13 @@ framework_plus :
@ echo '--------------------------------------'
( cd frame ; $(MAKE) $(J) LLIST="$(MODLL)" framework ; \
cd ../external/io_netcdf ; \
$(MAKE) NETCDFPATH="$(NETCDFPATH)" \
$(MAKE) NETCDF_INC="$(NETCDF_INC)" NETCDF_LIB="$(NETCDF_LIB)" NETCDF_FORTRAN_INC="$(NETCDF_FORTRAN_INC)" NETCDF_FORTRAN_LIB="$(NETCDF_FORTRAN_LIB)" \
FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR" diffwrf; \
cd ../io_netcdf ; \
$(MAKE) NETCDFPATH="$(NETCDFPATH)" \
$(MAKE) NETCDF_INC="$(NETCDF_INC)" NETCDF_LIB="$(NETCDF_LIB)" NETCDF_FORTRAN_INC="$(NETCDF_FORTRAN_INC)" NETCDF_FORTRAN_LIB="$(NETCDF_FORTRAN_LIB)" \
FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
Expand Down Expand Up @@ -1106,7 +1106,7 @@ fseek_test :

# rule used by configure to test if this will compile with netcdf4
nc4_test:
@cd tools ; /bin/rm -f nc4_test.{exe,nc,o} ; $(SCC) -o nc4_test.exe nc4_test.c -I$(NETCDF)/include -L$(NETCDF)/lib $(USENETCDF) ; cd ..
@cd tools ; /bin/rm -f nc4_test.{exe,nc,o} ; $(SCC) -o nc4_test.exe nc4_test.c -I$(NETCDF_INC) -L$(NETCDF_LIB) $(USENETCDF) ; cd ..

# rule used by configure to test if Fortran 2003 IEEE signaling is available
fortran_2003_ieee_test:
Expand Down
42 changes: 32 additions & 10 deletions arch/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

select((select(STDOUT), $|=1)[0]);
$sw_perl_path = perl ;
$sw_netcdf_path = "" ;
$sw_netcdf_inc = "" ;
$sw_netcdf_lib = "" ;
$sw_netcdff_inc = "" ;
$sw_netcdff_lib = "" ;
$sw_pnetcdf_path = "" ;
$sw_hdf5_path="";
$sw_phdf5_path="";
Expand Down Expand Up @@ -59,9 +62,21 @@
{
$sw_perl_path = substr( $ARGV[0], 6 ) ;
}
if ( substr( $ARGV[0], 1, 7 ) eq "netcdf=" )
if ( substr( $ARGV[0], 1, 11 ) eq "netcdf_inc=" )
{
$sw_netcdf_path = substr( $ARGV[0], 8 ) ;
$sw_netcdf_inc = substr( $ARGV[0], 12 ) ;
}
if ( substr( $ARGV[0], 1, 11 ) eq "netcdf_lib=" )
{
$sw_netcdf_lib = substr( $ARGV[0], 12 ) ;
}
if ( substr( $ARGV[0], 1, 12 ) eq "netcdff_inc=" )
{
$sw_netcdff_inc = substr( $ARGV[0], 13 ) ;
}
if ( substr( $ARGV[0], 1, 12 ) eq "netcdff_lib=" )
{
$sw_netcdff_lib = substr( $ARGV[0], 13 ) ;
}
if ( substr( $ARGV[0], 1, 13 ) eq "dep_lib_path=" )
{
Expand Down Expand Up @@ -442,7 +457,10 @@
if ( $latchon == 1 )
{
$_ =~ s/CONFIGURE_PERL_PATH/$sw_perl_path/g ;
$_ =~ s/CONFIGURE_NETCDF_PATH/$sw_netcdf_path/g ;
$_ =~ s/CONFIGURE_NETCDF_INC/$sw_netcdf_inc/g ;
$_ =~ s/CONFIGURE_NETCDF_LIB/$sw_netcdf_lib/g ;
$_ =~ s/CONFIGURE_NETCDF_FORTRAN_INC/$sw_netcdff_inc/g ;
$_ =~ s/CONFIGURE_NETCDF_FORTRAN_LIB/$sw_netcdff_lib/g ;
$_ =~ s/CONFIGURE_PNETCDF_PATH/$sw_pnetcdf_path/g ;
$_ =~ s/CONFIGURE_HDF5_PATH/$sw_hdf5_path/g ;
$_ =~ s/CONFIGURE_PHDF5_PATH/$sw_phdf5_path/g ;
Expand Down Expand Up @@ -481,15 +499,17 @@
$_ =~ s/#// ;
$_ =~ s/#// ;
}
if ( $sw_netcdf_path )
if ( $sw_netcdf_lib )
{ $_ =~ s/CONFIGURE_WRFIO_NF/wrfio_nf/g ;
$_ =~ s:CONFIGURE_NETCDF_FLAG:-DNETCDF: ;
if ( $ENV{NETCDF_LDFLAGS} ) {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a $ENV{NETCDF_LDFLAGS} : ;
} elsif ( $sw_os eq "Interix" ) {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a -L$sw_netcdf_path/lib $sw_usenetcdff $sw_usenetcdf : ;
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a -L$sw_netcdf_lib $sw_usenetcdff $sw_usenetcdf : ;
} elsif ( $sw_netcdff_lib ) {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdff_lib $sw_usenetcdff -L$sw_netcdf_lib $sw_usenetcdf : ;
} else {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdf_path/lib $sw_usenetcdff $sw_usenetcdf : ;
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdf_lib $sw_usenetcdff $sw_usenetcdf : ;
}
}
else
Expand Down Expand Up @@ -803,15 +823,17 @@
if ( $sw_os ne "CYGWIN_NT" ) {
$_ =~ s/#NOWIN// ;
}
if ( $sw_netcdf_path )
if ( $sw_netcdf_lib )
{ $_ =~ s/CONFIGURE_WRFIO_NF/wrfio_nf/g ;
$_ =~ s:CONFIGURE_NETCDF_FLAG:-DNETCDF: ;
if ( $ENV{NETCDF_LDFLAGS} ) {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a $ENV{NETCDF_LDFLAGS} : ;
} elsif ( $sw_os eq "Interix" ) {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a -L$sw_netcdf_path/lib $sw_usenetcdff $sw_usenetcdf : ;
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a -L$sw_netcdf_lib $sw_usenetcdff $sw_usenetcdf : ;
} elsif ( $sw_netcdff_lib ) {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdff_lib $sw_usenetcdff -L$sw_netcdf_lib $sw_usenetcdf : ;
} else {
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdf_path/lib $sw_usenetcdff $sw_usenetcdf : ;
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdf_lib $sw_usenetcdff $sw_usenetcdf : ;
}
}
else
Expand Down
6 changes: 4 additions & 2 deletions arch/conf_tokens
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
CONFIGURE_RWORDSIZE
CONFIGURE_NETCDF_FLAG
CONFIGURE_GRIB2_FLAG
CONFIGURE_NETCDF_LIB_PATH
CONFIGURE_NETCDF_LIB
CONFIGURE_NETCDF_INC
CONFIGURE_NETCDF_FORTRAN_LIB
CONFIGURE_NETCDF_FORTRAN_INC
CONFIGURE_GRIB2_LIB
CONFIGURE_LDFLAGS
CONFIGURE_COMPILEFLAGS
CONFIGURE_WRFIO_NF
CONFIGURE_WRFIO_GRIB2
CONFIGURE_NETCDF_PATH
CONFIGURE_GRIB2_INC
6 changes: 3 additions & 3 deletions arch/configure.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ RLFLAGS =
CC_TOOLS = $(SCC)

LIB_EXTERNAL = \
../external/io_netcdf/libwrfio_nf.a CONFIGURE_NETCDF_PATH/lib/libnetcdf.lib \
../external/io_netcdf/libwrfio_nf.a CONFIGURE_NETCDF_LIB/libnetcdf.lib \
../external/wavelet/libWavelet.a ../external/wavelet/lib_wavelet.a
ESMF_IO_LIB = ../external/esmf_time_f90/libesmf_time.a
LIB_BUNDLED = \
Expand Down Expand Up @@ -1960,8 +1960,8 @@ RLFLAGS =
CC_TOOLS = $(SCC)

LIB_EXTERNAL = \
$(WRF_SRC_ROOT_DIR)/external/io_netcdf/libwrfio_nf.a CONFIGURE_NETCDF_PATH/lib/libnetcdf.dll.a \
-L CONFIGURE_NETCDF_PATH -lnetcdff -lnetcdf -lnetcdf -ltirpc -lhdf5_hl -lhdf5 -lm -lz \
$(WRF_SRC_ROOT_DIR)/external/io_netcdf/libwrfio_nf.a CONFIGURE_NETCDF_LIB/libnetcdf.dll.a \
-L CONFIGURE_NETCDF_LIB -lnetcdff -lnetcdf -lnetcdf -ltirpc -lhdf5_hl -lhdf5 -lm -lz \
CONFIGURE_GRIB2_LIB
ESMF_IO_LIB = $(WRF_SRC_ROOT_DIR)/external/esmf_time_f90/libesmf_time.a
LIB_BUNDLED = \
Expand Down
17 changes: 10 additions & 7 deletions arch/postamble
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ ESMF_LIB_FLAGS = ESMFLIBFLAG
# ESMF 5 -- these are defined in esmf.mk, included above
#NOWIN ESMF_IO_LIB = ESMFIOLIB
ESMF_IO_LIB_EXT = ESMFIOEXTLIB
NETCDF_INC = CONFIGURE_NETCDF_INC
NETCDF_LIB = CONFIGURE_NETCDF_LIB
NETCDF_FORTRAN_INC = CONFIGURE_NETCDF_FORTRAN_INC
NETCDF_FORTRAN_LIB = CONFIGURE_NETCDF_FORTRAN_LIB
HDF5PATH = CONFIGURE_HDF5_PATH
WRFPLUSPATH = CONFIGURE_WRFPLUS_PATH
RTTOVPATH = CONFIGURE_RTTOV_PATH
PNETCDFPATH = CONFIGURE_PNETCDF_PATH
INCLUDE_MODULES = $(MODULE_SRCH_FLAG) \
$(ESMF_MOD_INC) $(ESMF_LIB_FLAGS) \
-I$(WRF_SRC_ROOT_DIR)/main \
Expand All @@ -52,7 +60,7 @@ INCLUDE_MODULES = $(MODULE_SRCH_FLAG) \
-I$(WRF_SRC_ROOT_DIR)/phys \
-I$(WRF_SRC_ROOT_DIR)/wrftladj \
-I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \
-I$(NETCDFPATH)/include \
-I$(NETCDF_INC) -I$(NETCDF_FORTRAN_INC) \
CONFIGURE_RTTOV_INC
REGISTRY = Registry
CC_TOOLS_CFLAGS = CONFIGURE_NMM_CORE
Expand All @@ -61,11 +69,6 @@ LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL) $(LIB_WRF_HYDRO
LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL) CONFIGURE_LDFLAGS
ENVCOMPDEFS = CONFIGURE_COMPILEFLAGS
CPPFLAGS = $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG) CONFIGURE_COMMS_INCLUDE
NETCDFPATH = CONFIGURE_NETCDF_PATH
HDF5PATH = CONFIGURE_HDF5_PATH
WRFPLUSPATH = CONFIGURE_WRFPLUS_PATH
RTTOVPATH = CONFIGURE_RTTOV_PATH
PNETCDFPATH = CONFIGURE_PNETCDF_PATH

bundled: io_only CONFIGURE_ATMOCN
external: io_only CONFIGURE_COMMS_EXTERNAL $(ESMF_TARGET)
Expand Down Expand Up @@ -93,7 +96,7 @@ module_dm_rsllite :

wrfio_nf :
( cd $(WRF_SRC_ROOT_DIR)/external/io_netcdf ; \
make $(J) NETCDFPATH="$(NETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
make $(J) NETCDF_INC="$(NETCDF_INC)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
CC="$(SCC)" CFLAGS="$(CFLAGS)" \
FC="$(SFC) $(PROMOTION) $(OMP) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )

Expand Down
86 changes: 50 additions & 36 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ if test -n "$PERL" ; then

fi

if test -z "$NETCDF" ; then
if test -z "$NETCDF" -a -z "$NETCDF_DIR" ; then
echo ' '
echo '*****************************************************************************'
echo 'No environment variable NETCDF set.'
echo 'No environment variable NETCDF_DIR or NETCDF set.'
echo 'Stopping'
echo '*****************************************************************************'
echo ' '
Expand All @@ -177,30 +177,43 @@ fi

USENETCDFF=""
USENETCDF=""
if [ -n "$NETCDF" ] ; then
echo "Will use NETCDF in dir: $NETCDF"
# Oh UNIDATA, why make it so hard ...
if [ -f "$NETCDF/lib/libnetcdff.a" -o -f "$NETCDF/lib/libnetcdff.so" -o -f "$NETCDF/lib/libnetcdff.dll.a" ] ; then
USENETCDFF="-lnetcdff"
else
USENETCDFF=" "
fi
if [ -f "$NETCDF/lib/libnetcdf.a" -o -f "$NETCDF/lib/libnetcdf.so" -o -f "$NETCDF/lib/libnetcdf.dll.a" ] ; then
USENETCDF="-lnetcdf"
else
USENETCDF=" "
fi
export USENETCDF=$USENETCDF
export USENETCDFF=$USENETCDFF
# Convert old NETCDF to updated variables
if [ -n "$NETCDF" -a -z "$NETCDF_DIR" ] ; then
export NETCDF_DIR=$NETCDF
fi
if [ -z "$NETCDF_BIN" ] ; then
export NETCDF_BIN=$NETCDF_DIR/bin
fi
if [ -z "$NETCDF_INC" ] ; then
export NETCDF_INC=$NETCDF_DIR/include
fi
if [ -z "$NETCDF_LIB" ] ; then
export NETCDF_LIB=$NETCDF_DIR/lib
fi
# Set NETCDF_FORTRAN vars if they are not already set
if [ -z "$NETCDF_FORTRAN_BIN" ] ; then
export NETCDF_FORTRAN_BIN=$NETCDF_BIN
fi
if [ -z "$NETCDF_FORTRAN_INC" ] ; then
export NETCDF_FORTRAN_INC=$NETCDF_INC
fi
if [ -z "$NETCDF_FORTRAN_LIB" ] ; then
export NETCDF_FORTRAN_LIB=$NETCDF_LIB
fi

echo "Will use NETCDF in dir: $NETCDF_DIR"
if [ -f "$NETCDF_FORTRAN_LIB/libnetcdff.a" -o -f "$NETCDF_FORTRAN_LIB/libnetcdff.so" -o -f "$NETCDF_FORTRAN_LIB/libnetcdff.dll.a" ] ; then
USENETCDFF="-lnetcdff"
else
echo ' '
echo '*****************************************************************************'
echo 'No environment variable NETCDF set.'
echo 'Stopping'
echo '*****************************************************************************'
echo ' '
exit 6
USENETCDFF=" "
fi
if [ -f "$NETCDF_LIB/libnetcdf.a" -o -f "$NETCDF_LIB/libnetcdf.so" -o -f "$NETCDF_LIB/libnetcdf.dll.a" ] ; then
USENETCDF="-lnetcdf"
else
USENETCDF=" "
fi
export USENETCDF=$USENETCDF
export USENETCDFF=$USENETCDFF

# If the user asked for classic netcdf, acquiesce to the request.

Expand Down Expand Up @@ -236,15 +249,15 @@ if [ -z "$CURL_PATH" ] ; then CURL_PATH=''; fi
if [ -n "$NETCDF4" ] ; then
if [ $NETCDF4 -eq 1 ] ; then
DEP_LIB_PATH=''
if [ -f $NETCDF/bin/nf-config ] ; then
nx_config="$NETCDF/bin/nf-config --flibs"
if [ -f $NETCDF_FORTRAN_BIN/nf-config ] ; then
nx_config="$NETCDF_FORTRAN_BIN/nf-config --flibs"
DEP_LIB_PATH="`$nx_config | awk '{for(i=1;i<=NF;i++){if(match($i, /-L.*/)) {print $i} } }'`"
CURL="`$nx_config | awk '{for(i=1;i<=NF;i++){if($i == "-lcurl") {print $i} } }'`"
GPFS="`$nx_config | awk '{for(i=1;i<=NF;i++){if($i == "-lgpfs") {print $i} } }'`"
fi
if [ "$DEP_LIB_PATH" = '' ] ; then
if [ -f $NETCDF/bin/nc-config ] ; then
nx_config="$NETCDF/bin/nc-config --libs"
if [ -f $NETCDF_BIN/nc-config ] ; then
nx_config="$NETCDF_BIN/nc-config --libs"
DEP_LIB_PATH="`$nx_config | awk '{for(i=1;i<=NF;i++){if(match($i, /-L.*/)) {print $i} } }'`"
CURL="`$nx_config | awk '{for(i=1;i<=NF;i++){if($i == "-lcurl") {print $i} } }'`"
GPFS="`$nx_config | awk '{for(i=1;i<=NF;i++){if($i == "-lgpfs") {print $i} } }'`"
Expand Down Expand Up @@ -552,7 +565,8 @@ if test -n "$PERL" ; then
srch=`grep -i "^#ARCH.*$os" arch/configure.defaults | grep -i "$mach"`
if [ -n "$srch" ] ; then
$PERL arch/Config.pl -dmparallel=$COMMLIB -ompparallel=$OMP -perl=$PERL \
-netcdf=$NETCDF -pnetcdf=$PNETCDF -hdf5=$HDF5 -phdf5=$PHDF5 -os=$os -mach=$mach -ldflags=$ldflags \
-netcdf_inc=$NETCDF_INC -netcdf_lib=$NETCDF_LIB -netcdff_inc=$NETCDF_FORTRAN_INC -netcdff_lib=$NETCDF_FORTRAN_LIB \
-pnetcdf=$PNETCDF -hdf5=$HDF5 -phdf5=$PHDF5 -os=$os -mach=$mach -ldflags=$ldflags \
-compileflags=$compileflags -opt_level=$opt_level -USENETCDFF=$USENETCDFF -USENETCDF=$USENETCDF \
-time=$FORTRAN_COMPILER_TIMER -tfl="$TFL" -cfl="$CFL" -config_line="$config_line" \
-wrf_core=$wrf_core -gpfs=$GPFS_PATH -curl=$CURL_PATH -dep_lib_path="$DEP_LIB_PATH"
Expand Down Expand Up @@ -634,14 +648,14 @@ echo "If you wish to change settings, please edit that file."
echo "If you wish to change the default options, edit the file:"
echo " arch/configure.defaults"

if test -n "$NETCDF" ; then
if [ ! -f $NETCDF/include/netcdf.inc ] ; then
if test -n "$NETCDF_FORTRAN_INC" ; then
if [ ! -f $NETCDF_FORTRAN_INC/netcdf.inc ] ; then
echo
echo "Error : Not found $NETCDF/include/netcdf.inc"
echo "Error : Not found $NETCDF_FORTRAN_INC/netcdf.inc"
echo " Please check this installation of NetCDF and re-run this configure script"
exit -1
fi
grep nf_format_64bit $NETCDF/include/netcdf.inc > /dev/null
grep nf_format_64bit $NETCDF_FORTRAN_INC/netcdf.inc > /dev/null
configure_aaaa=$? ; export configure_aaaa
if [ $configure_aaaa -a -z "$WRFIO_NCD_NO_LARGE_FILE_SUPPORT" ] ; then
echo "NetCDF users note:"
Expand Down Expand Up @@ -718,7 +732,7 @@ EOF
fi
fi

if [ -e $NETCDF/lib/libnetcdf.a -a "$SFC" != "" -a "$SCC" != "" -a "$CCOMP" != "" ]; then
if [ -e $NETCDF_LIB/libnetcdf.a -a "$SFC" != "" -a "$SCC" != "" -a "$CCOMP" != "" ]; then

SFC_MULTI_ABI=0
SCC_MULTI_ABI=0
Expand All @@ -729,7 +743,7 @@ EOF
echo Testing for NetCDF, C and Fortran compiler
echo

ar p $NETCDF/lib/libnetcdf.a `ar t $NETCDF/lib/libnetcdf.a | grep -E '\.o' | head -n 1 | sed 's/://'` > ${foo}.o
ar p $NETCDF_LIB/libnetcdf.a `ar t $NETCDF_LIB/libnetcdf.a | grep -E '\.o' | head -n 1 | sed 's/://'` > ${foo}.o
netcdf_arch="`file ${foo}.o | grep -o -E '[0-9]{2}-bit|i386'`"
rm ${foo}.o

Expand Down Expand Up @@ -1018,7 +1032,7 @@ if [ -n "$NETCDF4" ] ; then
if [ $retval -ne 0 ] ; then
echo "************************** W A R N I N G ************************************"
echo "NETCDF4 IO features are requested, but this installation of NetCDF "
echo " $NETCDF"
echo " $NETCDF_DIR"
echo "DOES NOT support these IO features. "
echo
echo "Please make sure NETCDF version is 4.1.3 or later and was built with "
Expand Down
Loading