Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
123 changes: 120 additions & 3 deletions arch/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
$sw_usenetcdf = "" ;
$sw_time = "" ; # name of a timer to time fortran compiles, e.g. timex or time
$sw_ifort_r8 = 0 ;
$sw_hdf5 = "-lhdf5 -lhdf5_hl";
$sw_hdf5 = "-lhdf5_hl -lhdf5";
$sw_zlib = "-lz";
$sw_dep_lib_path = "";
$sw_gpfs_path = "";
Expand Down Expand Up @@ -604,8 +604,7 @@
$_ .= " \$\(NETCDF4_IO_OPTS\)\n" ;
}
if (/^LIB.*=/)
{ $_ =~ s/\r|\n//g ;
$_ .=" \$\(NETCDF4_DEP_LIB\)\n" ;
{ $_ =~ s/(\\?)[\r\n]/ \$\(NETCDF4_DEP_LIB\)\1\n/g ;
}
}
}
Expand Down Expand Up @@ -756,6 +755,9 @@
# apply substitutions to the preamble...
while ( <ARCH_PREAMBLE> )
{
if ( $sw_os ne "CYGWIN_NT" ) {
$_ =~ s/#NOWIN// ;
}
# ESMF substitutions in preamble
if ( $sw_esmflib_path && $sw_esmfinc_path )
{
Expand Down Expand Up @@ -797,6 +799,121 @@

$_ =~ s/CONFIGURE_DEP_LIB_PATH/$sw_dep_lib_path/g ;

$_ =~ s/CONFIGURE_PERL_PATH/$sw_perl_path/g ;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DWesl
Daniel,
Why do you replicate these 100+ lines of perl? This code already exist from about line 440 through 560.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Processing preamble. I didn't know what LIB_BUNDLED and LIB_EXTERNAL assumed to be defined, so I just moved everything there.
I'll try paring this down sometime tomorrow. It will likely be next week before I can test dmpar configurations, but I might be able to get to serial and smpar builds before then. I don't remember what I tested the first time through.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned to just the variables referenced in LIB_EXTERNAL and LIB_BUNDLED

$_ =~ s/CONFIGURE_NETCDF_PATH/$sw_netcdf_path/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 ;
$_ =~ s/CONFIGURE_LDFLAGS/$sw_ldflags/g ;
$_ =~ s/CONFIGURE_COMPILEFLAGS/$sw_compileflags/g ;
$_ =~ s/CONFIGURE_RWORDSIZE/$sw_rwordsize/g ;
$_ =~ s/CONFIGURE_FC/$sw_time $sw_fc/g ;
$_ =~ s/CONFIGURE_CC/$sw_cc/g ;
$_ =~ s/CONFIGURE_COMMS_LIB/$sw_comms_lib/g ;
$_ =~ s/CONFIGURE_COMMS_INCLUDE/$sw_comms_include/g ;
$_ =~ s/CONFIGURE_COMMS_EXTERNAL/$sw_comms_external/g ;
if ( $sw_os ne "CYGWIN_NT" ) {
$_ =~ s/#NOWIN// ;
}
$_ =~ s/CONFIGURE_DMPARALLEL/$sw_dmparallelflag/g ;
$_ =~ s/CONFIGURE_STUBMPI/$sw_stubmpi/g ;
$_ =~ s/CONFIGURE_NESTOPT/$sw_nest_opt/g ;
$_ =~ s/CONFIGURE_TRADFLAG/$sw_tfl/g ;
$_ =~ s/CONFIGURE_CPPFLAGS/$sw_cfl/g ;
$_ =~ s/CONFIGURE_4DVAR_FLAG/$sw_4dvar_flag/g ;
$_ =~ s/CONFIGURE_WRFPLUS_PATH/$sw_wrfplus_path/g ;
$_ =~ s/CONFIGURE_CRTM_FLAG/$sw_crtm_flag/g ;
$_ =~ s/CONFIGURE_RTTOV_FLAG/$sw_rttov_flag/g ;
$_ =~ s/CONFIGURE_RTTOV_INC/$sw_rttov_inc/g ;
$_ =~ s/CONFIGURE_RTTOV_PATH/$sw_rttov_path/g ;
$_ =~ s/CONFIGURE_CLOUDCV_FLAG/$sw_cloudcv_flag/g ;
$_ =~ s/CONFIGURE_WAVELET_FLAG/$sw_wavelet_flag/g ;
if ( $sw_ifort_r8 ) {
$_ =~ s/^PROMOTION.*=/PROMOTION = -r8 /g ;
}
if ( $sw_dmparallel ne "" && ($_ =~ /^DMPARALLEL[=\t ]/) ) {
$_ =~ s/#// ;
}
if ( $sw_ompparallel ne "" && ( $_ =~ /^OMPCPP[=\t ]/ || $_ =~ /^OMPCC[=\t ]/ || $_ =~ /^OMP[=\t ]/ ) ) {
$_ =~ s/#// ;
$_ =~ s/#// ;
$_ =~ s/#// ;
}
if ( $sw_netcdf_path )
{ $_ =~ 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 : ;
} 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 : ;
}
}
else
{ $_ =~ s/CONFIGURE_WRFIO_NF//g ;
$_ =~ s:CONFIGURE_NETCDF_FLAG::g ;
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH::g ;
}

if ( $sw_pnetcdf_path )
{ $_ =~ s/CONFIGURE_WRFIO_PNF/wrfio_pnf/g ;
$_ =~ s:CONFIGURE_PNETCDF_FLAG:-DPNETCDF: ;
if ( $sw_os eq "Interix" ) {
$_ =~ s:CONFIGURE_PNETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_pnetcdf/libwrfio_pnf.a -L$sw_pnetcdf_path/lib -lpnetcdf: ;
} else {
$_ =~ s:CONFIGURE_PNETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_pnetcdf -lwrfio_pnf -L$sw_pnetcdf_path/lib -lpnetcdf: ;
}
}
else
{ $_ =~ s/CONFIGURE_WRFIO_PNF//g ;
$_ =~ s:CONFIGURE_PNETCDF_FLAG::g ;
$_ =~ s:CONFIGURE_PNETCDF_LIB_PATH::g ;
}

if ( $sw_hdf5_path )
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
$_ =~ s:CONFIGURE_HDF5_FLAG:-DHDF5: ;
}
else
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH::g ;
$_ =~ s:CONFIGURE_HDF5_FLAG::g ;
}

if ( $sw_phdf5_path )

{ $_ =~ s/CONFIGURE_WRFIO_PHDF5/wrfio_phdf5/g ;
$_ =~ s:CONFIGURE_PHDF5_FLAG:-DPHDF5: ;
$_ =~ s:CONFIGURE_PHDF5_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_phdf5 -lwrfio_phdf5 -L$sw_phdf5_path/lib -lhdf5_fortran -lhdf5 -lm -lz -L$sw_phdf5_path/lib -lsz: ;
}
else
{ $_ =~ s/CONFIGURE_WRFIO_PHDF5//g ;
$_ =~ s:CONFIGURE_PHDF5_FLAG::g ;
$_ =~ s:CONFIGURE_PHDF5_LIB_PATH::g ;
}

if ( $sw_jasperlib_path && $sw_jasperinc_path )
{ $_ =~ s/CONFIGURE_WRFIO_GRIB2/wrfio_grib2/g ;
$_ =~ s:CONFIGURE_GRIB2_FLAG:-DGRIB2:g ;
$_ =~ s:CONFIGURE_GRIB2_INC:-I$sw_jasperinc_path:g ;
$_ =~ s:CONFIGURE_GRIB2_LIB:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_grib2 -lio_grib2 -L$sw_jasperlib_path -ljasper:g ;
}
else
{ $_ =~ s/CONFIGURE_WRFIO_GRIB2//g ;
$_ =~ s:CONFIGURE_GRIB2_FLAG::g ;
$_ =~ s:CONFIGURE_GRIB2_INC::g ;
$_ =~ s:CONFIGURE_GRIB2_LIB::g ;
}

if ( $sw_terrain_and_landuse )
{
$_ =~ s/CONFIGURE_TERRAIN_AND_LANDUSE/$sw_terrain_and_landuse/g;
}
else
{
$_ =~ s:CONFIGURE_TERRAIN_AND_LANDUSE:-DLANDREAD_STUB=1:g;
}

if ( $sw_gpfs_path ne "" )
{ if (/^GPFS.*=/)
{ $_ =~ s/\r|\n//g;
Expand Down
60 changes: 59 additions & 1 deletion arch/configure.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ CC_TOOLS = $(SCC)
###########################################################
#ARCH CYGWIN_NT i686, PGI compiler on Windows # serial smpar dmpar dm+sm
#
DESCRIPTION = PGI ($SFC/$SCC): Windows
DESCRIPTION = PGI ($SFC/$SCC): Windows POSIX native
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -mp -Minfo=mp
Expand Down Expand Up @@ -1916,6 +1916,64 @@ RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)

###########################################################
#ARCH CYGWIN_NT i686 x86_64, gfortran compiler with gcc #serial smpar dmpar dm+sm
#
DESCRIPTION = GNU ($SFC/$SCC)
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -fopenmp
OMPCC = # -fopenmp
SFC = gfortran
SCC = gcc
CCOMP = gcc
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
RWORDSIZE = CONFIGURE_RWORDSIZE
PROMOTION = #-fdefault-real-8
ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM
CFLAGS_LOCAL = -w -O3 -c
LDFLAGS_LOCAL =
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
FCOPTIM = -O2 -ftree-vectorize -funroll-loops
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0
FCDEBUG = # -g $(FCNOOPT) # -ggdb -fbacktrace
FORMAT_FIXED = -ffixed-form
FORMAT_FREE = -ffree-form -ffree-line-length-none
FCSUFFIX =
BYTESWAPIO = -fconvert=big-endian -frecord-marker=4
FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO)
FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG =
TRADFLAG = -traditional
CPP = /lib/cpp -P
AR = ar
ARFLAGS = ru
M4 = m4 -G
RANLIB = ranlib
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 \
CONFIGURE_GRIB2_LIB
ESMF_IO_LIB = $(WRF_SRC_ROOT_DIR)/external/esmf_time_f90/libesmf_time.a
LIB_BUNDLED = \
$(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5/libfftpack.a \
$(WRF_SRC_ROOT_DIR)/external/io_grib1/libio_grib1.a \
$(WRF_SRC_ROOT_DIR)/external/io_grib_share/libio_grib_share.a \
$(WRF_SRC_ROOT_DIR)/external/io_int/libwrfio_int.a \
$(ESMF_IO_LIB) \
CONFIGURE_COMMS_LIB \
$(WRF_SRC_ROOT_DIR)/frame/module_internal_header_util.o \
$(WRF_SRC_ROOT_DIR)/frame/pack_utils.o

#insert new stanza here

###########################################################
Expand Down
13 changes: 0 additions & 13 deletions arch/postamble
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,6 @@ INCLUDE_MODULES = $(MODULE_SRCH_FLAG) \
REGISTRY = Registry
CC_TOOLS_CFLAGS = CONFIGURE_NMM_CORE

#NOWIN LIB_BUNDLED = \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5/libfftpack.a \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/io_grib1/libio_grib1.a \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/io_grib_share/libio_grib_share.a \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/io_int/libwrfio_int.a \
#NOWIN $(ESMF_IO_LIB) \
#NOWIN CONFIGURE_COMMS_LIB \
#NOWIN $(WRF_SRC_ROOT_DIR)/frame/module_internal_header_util.o \
#NOWIN $(WRF_SRC_ROOT_DIR)/frame/pack_utils.o

#NOWIN LIB_EXTERNAL = \
#NOWIN CONFIGURE_NETCDF_LIB_PATH CONFIGURE_PNETCDF_LIB_PATH CONFIGURE_GRIB2_LIB CONFIGURE_ATMOCN_LIB CONFIGURE_HDF5_LIB_PATH

LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL) $(LIB_WRF_HYDRO)
LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL) CONFIGURE_LDFLAGS
ENVCOMPDEFS = CONFIGURE_COMPILEFLAGS
Expand Down
13 changes: 13 additions & 0 deletions arch/preamble
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ NETCDF4_DEP_LIB = $(DEP_LIB_PATH) $(HDF5) $(ZLIB) $(GPFS) $(CURL)

LIBWRFLIB = libwrflib.a

#NOWIN LIB_BUNDLED = \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5/libfftpack.a \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/io_grib1/libio_grib1.a \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/io_grib_share/libio_grib_share.a \
#NOWIN $(WRF_SRC_ROOT_DIR)/external/io_int/libwrfio_int.a \
#NOWIN $(ESMF_IO_LIB) \
#NOWIN CONFIGURE_COMMS_LIB \
#NOWIN $(WRF_SRC_ROOT_DIR)/frame/module_internal_header_util.o \
#NOWIN $(WRF_SRC_ROOT_DIR)/frame/pack_utils.o

#NOWIN LIB_EXTERNAL = \
#NOWIN CONFIGURE_NETCDF_LIB_PATH CONFIGURE_PNETCDF_LIB_PATH CONFIGURE_GRIB2_LIB CONFIGURE_ATMOCN_LIB CONFIGURE_HDF5_LIB_PATH


#### Architecture specific settings ####

6 changes: 3 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ 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" ] ; then
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" ] ; then
if [ -f "$NETCDF/lib/libnetcdf.a" -o -f "$NETCDF/lib/libnetcdf.so" -o -f "$NETCDF/lib/libnetcdf.dll.a" ] ; then
USENETCDF="-lnetcdf"
else
USENETCDF=" "
Expand All @@ -204,7 +204,7 @@ fi

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

if [ "`uname`" = "Linux" ] ; then
if [ "`uname`" = "Linux" -o "`uname -o`" = "Cygwin" ] ; then
ans="`whereis nf-config`"
elif [ "`uname`" = "Darwin" ] ; then
ans="`which nf-config`"
Expand Down
2 changes: 1 addition & 1 deletion external/io_netcdf/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ diffwrf: diffwrf.F90
$(FC) -c $(FFLAGS) diffwrf.f
@if [ \( -f ../../frame/wrf_debug.o \) -a \( -f ../../frame/module_wrf_error.o \) -a \( -f $(ESMF_MOD_DEPENDENCE) \) -a \( -f ../../frame/clog.o \) ] ; then \
echo "diffwrf io_netcdf is being built now. " ; \
if [ \( -f $(NETCDFPATH)/lib/libnetcdff.a -o -f $(NETCDFPATH)/lib/libnetcdff.so \) ] ; then \
if [ \( -f $(NETCDFPATH)/lib/libnetcdff.a -o -f $(NETCDFPATH)/lib/libnetcdff.so -o -f $(NETCDFPATH)/lib/libnetcdff.dll.a \) ] ; then \
$(FC) $(FFLAGS) $(LDFLAGS) -o diffwrf diffwrf.o $(OBJSL) ../../frame/wrf_debug.o ../../frame/module_wrf_error.o ../../frame/clog.o $(ESMF_IO_LIB_EXT) $(LIBFFS) ;\
else \
$(FC) $(FFLAGS) $(LDFLAGS) -o diffwrf diffwrf.o $(OBJSL) ../../frame/wrf_debug.o ../../frame/module_wrf_error.o ../../frame/clog.o $(ESMF_IO_LIB_EXT) $(LIBS) ;\
Expand Down
1 change: 1 addition & 0 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ OBJ = registry.o my_strtok.o reg_parse.o data.o type.o misc.o \

registry : $(OBJ) standard.exe
$(CC_TOOLS) -o registry $(DEBUG) $(LDFLAGS) $(OBJ)
if [ -x /usr/bin/peflags.exe ] ; then /usr/bin/peflags.exe --stack-reserve=33554432 registry; fi

standard.exe : standard.o
$(CC_TOOLS) -o standard.exe $(DEBUG) $(LDFLAGS) standard.o
Expand Down