Skip to content

Commit

Permalink
BF: NETCDFPAR "Error" in build log when option not used (#1651)
Browse files Browse the repository at this point in the history
TYPE: bug fix

KEYWORDS: netcdfpar, Error

SOURCE: internal

DESCRIPTION OF CHANGES:
IMPORTANT: Without these mods, every commit since the parallel netcdf4 IO mods will fail the DA
build test in the regression test. For example, at least these commits:
```
fed10f4 Adding the WRF-Solar EPS model (#1547)
0bda5e0 Fix 4dvar build failure after commit 8b5bfe5 (#1652)
8b5bfe5 Thompson AA enhancements: BC aerosol, biomass burning emissions, and … (#1616)
9dc68ca After testing with UFS/GFS/FV-3, some tuning knob changes to Thompson-MP and icloud3 (cloud fraction) scheme (#1626)
96fd889 Update HONO, TERP, and CO2 emissions (#1644)
64fb190 SFCLAY=1, add shallow water roughness calculation (#1543)
609c2fc New module firebrand_spotting for WRF-Fire (#1540)
75bfe6d MYNN PBL clouds in photolysis option 4 (TUV) (#1622)
f8c4b13 Fix runtime error when using sf_surface_mosaic = 1 with use_wudapt_lcz = 0 (#1638)
b511c70 Run-time option for climate GHG for radiation (#1625)
8194c66 Bug fix for configuration option INTEL:HSW/BDW (#1645)
16c9287  bug fixes for radar_rf_opt=2 (#1642)
a82ce24 Sync with NoahMP Github version with all NoahMP updates since v4.3 (#1641)
7b642cc Bug fix for TAMDAR T VarBC (#1632)
92fd706 fix WRFDA build for Parallel netcdf-4 IO (#1634)
```
Problem:
With PR #1552 "Parallel netcdf-4 IO option" (SHA1 3cd4713), when then code was built without
the new parallel NetCDF4 compression, the build log had an `Error`. 
```
> grep Error compile.log
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [diffwrf] Error 1 (ignored)
make[2]: [diffwrf] Error 1 (ignored)
wrf_io.f:117: Error: Can't open included file 'mpif.h'
make[2]: [wrf_io.o] Error 1 (ignored)
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [field_routines.o] Error 1 (ignored)
make[2]: [libwrfio_nfpar.a] Error 127 (ignored)
make[2]: [libwrfio_nfpar.a] Error 1 (ignored)
```
The problem was related to constructing the object files in the io_netcdfpar directory. When the 
option is not selected at compile time, then we do not care about errors in the directory that will 
never be used.

Solution:
If the NETCDFPAR option is not selected at compile time, then SKIP going into the io_netcdfpar
directory all together.

LIST OF MODIFIED FILES:
m Makefile
m arch/Config.pl
m arch/configure.defaults
m configure

TESTS CONDUCTED:
1. Without the NETCDFPAR parameter set, the build for the io_netcdfpar directory is bypassed:
```
          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \
```

2. When the NETCDFPAR env variable is set, the build includes the io_netcdfpar directory:
          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \
```

3. Jenkins tests are all PASS.
  • Loading branch information
davegill authored Jan 24, 2022
1 parent fed10f4 commit a2ad00c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -923,13 +923,13 @@ framework :
LIB_LOCAL="$(LIB_LOCAL)" \
ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR"; \
cd ../io_netcdfpar ; \
$(MAKE) NETCDFPARPATH="$(NETCDFPATH)" \
$(NETCDFPAR_BUILD) $(MAKE) NETCDFPARPATH="$(NETCDFPATH)" \
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_netcdfpar ; \
$(MAKE) NETCDFPARPATH="$(NETCDFPATH)" \
$(NETCDFPAR_BUILD) $(MAKE) NETCDFPARPATH="$(NETCDFPATH)" \
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
2 changes: 2 additions & 0 deletions arch/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
if ( $sw_netcdfpar_path )
{ $_ =~ s/CONFIGURE_WRFIO_NFPAR/wrfio_nfpar/g ;
$_ =~ s:CONFIGURE_NETCDFPAR_FLAG:-DNETCDFPAR: ;
$_ =~ s:CONFIGURE_NETCDFPAR_BUILD:: ;
if ( $ENV{NETCDFPAR_LDFLAGS} ) {
$_ =~ s:CONFIGURE_NETCDFPAR_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdfpar/libwrfio_nfpar.a $ENV{NETCDFPAR_LDFLAGS} : ;
} elsif ( $sw_os eq "Interix" ) {
Expand All @@ -518,6 +519,7 @@
else
{ $_ =~ s/CONFIGURE_WRFIO_NFPAR//g ;
$_ =~ s:CONFIGURE_NETCDFPAR_FLAG::g ;
$_ =~ s:CONFIGURE_NETCDFPAR_BUILD:echo SKIPPING: ;
$_ =~ s:CONFIGURE_NETCDFPAR_LIB_PATH::g ;
}

Expand Down
44 changes: 44 additions & 0 deletions arch/configure.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RANLIB = ls
RLFLAGS =
#ranlib
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux i486 i586 i686 armv7l aarch64, gfortran compiler with gcc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -86,6 +87,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux i486 i586 i686, g95 compiler with gcc #serial dmpar
Expand Down Expand Up @@ -129,6 +131,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, PGI compiler with gcc # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -172,6 +175,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le, PGI compiler with pgcc, SGI MPT # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -215,6 +219,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le, PGI accelerator compiler with gcc # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -257,6 +262,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, ifort compiler with icc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -334,6 +340,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, Xeon Phi (MIC architecture) ifort compiler with icc # dm+sm
Expand Down Expand Up @@ -381,6 +388,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = gcc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, Xeon (SNB with AVX mods) ifort compiler with icc # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -428,6 +436,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = gcc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, ifort compiler with icc, SGI MPT #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -499,6 +508,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, ifort compiler with icc, IBM POE #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -548,6 +558,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH ia64 Linux ifort compiler with icc 9.x,10.x #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -629,6 +640,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux SGI Altix, ifort compiler with icc 9.x,10.x #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -712,6 +724,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux i486 i586 i686 x86_64 ppc64le, PathScale compiler with pathcc #serial dmpar
Expand Down Expand Up @@ -755,6 +768,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le, gfortran compiler with gcc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -799,6 +813,7 @@ M4 = m4 -G
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) PGI compiler with pgcc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -842,6 +857,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) intel compiler with icc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -888,6 +904,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) intel compiler with clang EDIT FOR OPENMPI #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -933,6 +950,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) g95 with gcc #serial dmpar
Expand Down Expand Up @@ -977,6 +995,7 @@ M4 = m4 -B 14000
RANLIB = ranlib -c
RLFLAGS = -c
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) gfortran with gcc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1021,6 +1040,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) gfortran with clang #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1065,6 +1085,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = clang
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) xlf #serial dmpar
Expand Down Expand Up @@ -1110,6 +1131,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH AIX xlf compiler with xlc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1158,6 +1180,7 @@ M4 = m4 -B 20000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, xlf compiler with xlc # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1209,6 +1232,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Cray XC CLE/Linux x86_64, PGI compiler with gcc # serial dmpar smpar dm+sm
Expand Down Expand Up @@ -1271,6 +1295,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Cray XE and XC CLE/Linux x86_64, Cray CCE compiler # serial dmpar smpar dm+sm
Expand Down Expand Up @@ -1321,6 +1346,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = gcc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Cray XC CLE/Linux x86_64, Xeon ifort compiler # serial dmpar smpar dm+sm
Expand Down Expand Up @@ -1370,6 +1396,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = gcc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD


###########################################################
Expand Down Expand Up @@ -1422,6 +1449,8 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux ppc64 BG /P xlf compiler with xlc # smpar dmpar dm+sm
# developed on surveyor.alcf.anl.gov (thanks to ANL/ALCF)
Expand Down Expand Up @@ -1469,6 +1498,8 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux ppc64 IBM Blade Server xlf compiler with xlc # dmpar
# provided by Luis C. Cana Cascallar for IBM JS21 blade server, May 2009
Expand Down Expand Up @@ -1513,6 +1544,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = xlc -q64
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, PGI compiler with pgcc # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1556,6 +1588,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH CYGWIN_NT i686, PGI compiler on Windows # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1599,6 +1632,7 @@ M4 = NA
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

LIB_EXTERNAL = \
../external/io_netcdf/libwrfio_nf.a CONFIGURE_NETCDF_PATH/lib/libnetcdf.lib \
Expand Down Expand Up @@ -1656,6 +1690,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) PGI compiler with pgcc -f90= #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1699,6 +1734,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) intel compiler with icc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1745,6 +1781,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = cc
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Darwin (MACOS) gfortran with gcc openmpi #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1789,6 +1826,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS = -c
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, PGI compiler with pgcc -f90= # serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1832,6 +1870,7 @@ M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux HSW/BDW x86_64 ppc64le i486 i586 i686, ifort compiler with icc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1876,6 +1915,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux KNL x86_64 ppc64le i486 i586 i686, ifort compiler with icc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1920,6 +1960,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH CYGWIN_NT i686 x86_64 Cygwin, gfortran compiler with gcc #serial smpar dmpar dm+sm
Expand Down Expand Up @@ -1964,6 +2005,7 @@ M4 = m4 -G
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

LIB_EXTERNAL = \
$(WRF_SRC_ROOT_DIR)/external/io_netcdf/libwrfio_nf.a CONFIGURE_NETCDF_PATH/lib/libnetcdf.dll.a \
Expand Down Expand Up @@ -2022,6 +2064,7 @@ M4 = m4 -G
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

#insert new stanza here

Expand Down Expand Up @@ -2067,6 +2110,7 @@ M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = /usr/bin/gcc -Wall
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

#insert new stanza before the Fujitsu block, keep Fujitsu at the end of the list
###########################################################
Expand Down
6 changes: 6 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ if test -n "$PERL" ; then

fi

if [ -e $NETCDF/bin/nc-config ] ; then
ncversion=`nc-config --version | awk '{print $2}'`
else
ncversion=OLD
fi

PROBS=FALSE
if [ -n "$NETCDFPAR" ] ; then
NETCDF="$NETCDFPAR"
Expand Down

0 comments on commit a2ad00c

Please sign in to comment.