diff --git a/src/Routing/Diversions/Makefile b/src/Routing/Diversions/Makefile new file mode 100644 index 000000000..c7200a472 --- /dev/null +++ b/src/Routing/Diversions/Makefile @@ -0,0 +1,27 @@ +# Makefile +# +include ../../macros + +OBJS = \ + module_diversions_timeslice.o \ + module_diversions.o + +all: $(OBJS) + +%.o: %.F90 + @echo "Routing Diversions Makefile:" + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(LDFLAGS) -I"../../mod" -I$(NETCDFINC) $(*).F90 + @echo "" + ar -r ../../lib/libHYDRO.a $(@) + cp *.mod ../../mod + + +fortglob_dir: + make -C ../../utils/fortglob + +module_diversions_timeslice.o: fortglob_dir + +module_diversions.o: module_diversions_timeslice.o + +clean: + rm -f *.o *.mod *.stb *~ diff --git a/src/Routing/Makefile b/src/Routing/Makefile index 65d6ca457..fbcb946cb 100644 --- a/src/Routing/Makefile +++ b/src/Routing/Makefile @@ -83,6 +83,7 @@ module_RT.o: module_GW_baseflow.o \ module_HYDRO_io.o \ module_noah_chan_param_init_rt.o \ module_UDMAP.o \ + module_channel_routing.o \ ../Data_Rec/module_namelist.o \ ../Data_Rec/module_RT_data.o \ ../Data_Rec/module_gw_gw2d_data.o @@ -102,9 +103,11 @@ endif module_UDMAP.o: ../Data_Rec/module_namelist.o ../Data_Rec/module_RT_data.o ifneq ($(WRF_HYDRO_NUDGING),-DWRF_HYDRO_NUDGING) -module_channel_routing.o: module_UDMAP.o +module_channel_routing.o: module_UDMAP.o \ + Diversions/module_diversions.o else -module_channel_routing.o: module_UDMAP.o\ +module_channel_routing.o: module_UDMAP.o \ + Diversions/module_diversions.o \ ../nudging/module_date_utils_nudging.o \ ../nudging/module_nudging_utils.o \ ../nudging/module_stream_nudging.o diff --git a/src/arc/Makefile.mpp b/src/arc/Makefile.mpp index 665961ede..19a09e98d 100644 --- a/src/arc/Makefile.mpp +++ b/src/arc/Makefile.mpp @@ -6,8 +6,10 @@ all: BASIC: make -C MPP make -C IO + make -C utils/fortglob make -C utils make -C OrchestratorLayer + make -C Routing/Diversions make -C Routing/Overland make -C Routing/Subsurface make -C Routing/Reservoirs diff --git a/src/arc/Makefile.seq b/src/arc/Makefile.seq deleted file mode 100644 index 386935ce9..000000000 --- a/src/arc/Makefile.seq +++ /dev/null @@ -1,36 +0,0 @@ -# Makefile - -all: - (make -f Makefile BASIC) - -BASIC: - (cd Data_Rec ; make -f Makefile) - (cd Routing; make -f Makefile) - ifeq ($(WRF_HYDRO_NUDGING),-DWRF_HYDRO_NUDGING) - (cd nudging; make -f Makefile) - endif - (cd HYDRO_drv; make -f Makefile) - -LIS: - (make -f Makefile BASIC) - (cd LIS_cpl ; make -f Makefile) - -CLM: - (make -f Makefile BASIC) - (cd CLM_cpl ; make -f Makefile) - -WRF: - (make -f Makefile BASIC) - (cd WRF_cpl ; make -f Makefile) - -HYDRO: - (make -f Makefile BASIC) - -clean: - (cd Data_Rec; make -f Makefile clean) - (cd HYDRO_drv; make -f Makefile clean) - ifeq ($(WRF_HYDRO_NUDGING),-DWRF_HYDRO_NUDGING) - (cd nudging; make -f Makefile clean) - endif - (cd Routing; make -f Makefile clean) - (rm -f lib/*.a */*.mod CPL/*/*.o CPL/*/*.mod) diff --git a/src/arc/macros.mpp.cray_fortran b/src/arc/macros.mpp.cray_fortran index a222ca8ca..315d3b897 100644 --- a/src/arc/macros.mpp.cray_fortran +++ b/src/arc/macros.mpp.cray_fortran @@ -3,7 +3,7 @@ ifeq ($(SPATIAL_SOIL),1) SPATIAL_SOIL = -DSPATIAL_SOIL else -SPATIAL_SOIL = +SPATIAL_SOIL = endif ifeq ($(HYDRO_REALTIME),1) @@ -32,19 +32,19 @@ endif ifeq ($(WRF_HYDRO_NUDGING),1) WRF_HYDRO_NUDGING = -DWRF_HYDRO_NUDGING else -WRF_HYDRO_NUDGING = +WRF_HYDRO_NUDGING = endif ifeq ($(OUTPUT_CHAN_CONN),1) OUTPUT_CHAN_CONN = -DOUTPUT_CHAN_CONN else -OUTPUT_CHAN_CONN = +OUTPUT_CHAN_CONN = endif ifeq ($(PRECIP_DOUBLE),1) PRECIP_DOUBLE = -DPRECIP_DOUBLE else -PRECIP_DOUBLE = +PRECIP_DOUBLE = endif ifeq ($(NWM_META),1) @@ -61,6 +61,7 @@ endif RMD = rm -f COMPILER90 = ftn +COMPILERCC = cc FORMAT_FREE = -f free BYTESWAPIO = -h byteswapio F90FLAGS = -O2 -c -ef -h alias=none -h fp1 $(FORMAT_FREE) $(BYTESWAPIO) @@ -69,6 +70,6 @@ MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod LDFLAGS = CPPINVOKE = -eT CPPFLAGS = -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(NWM_META) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS) -LIBS = +LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/src/arc/macros.mpp.gfort b/src/arc/macros.mpp.gfort index 5f22389e0..ac8c56ff8 100644 --- a/src/arc/macros.mpp.gfort +++ b/src/arc/macros.mpp.gfort @@ -55,7 +55,8 @@ endif RMD = rm -f -COMPILER90 = mpif90 +COMPILER90 = mpif90 +COMPILERCC = mpicc F90FLAGS = -w -c -O2 -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -std=legacy DEBUGFLAGS = -DHYDRO_D -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=invalid,zero,overflow,underflow -finit-real=nan MODFLAG = -I"./" -I"../../MPP" -I"../MPP" -I"../mod" diff --git a/src/arc/macros.mpp.ifort b/src/arc/macros.mpp.ifort index eb4c94b32..12e74cf49 100644 --- a/src/arc/macros.mpp.ifort +++ b/src/arc/macros.mpp.ifort @@ -61,6 +61,7 @@ endif RMD = rm -f COMPILER90 = mpif90 +COMPILERCC = mpicc FORMAT_FREE = -FR BYTESWAPIO = -convert big_endian F90FLAGS = -O2 -g -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) diff --git a/src/arc/macros.mpp.ifort.luna b/src/arc/macros.mpp.ifort.luna deleted file mode 100644 index 39ac0d636..000000000 --- a/src/arc/macros.mpp.ifort.luna +++ /dev/null @@ -1,107 +0,0 @@ -## If you have multiple mpi biulds on a single machine -## this example may be relevant to you. -## Ex: The hydro-c1 machine has mpi and netcdf built against portland -## fortran in the PATH. However mpi and netcd built against intel -## fortran is also available. Here's how I build WRF HYDRO against -## intel -## Below, in this file, I make the changes: -## COMPILER90 = $(ifortCompiler90) -## LDFLAGS = $(ifortLdFlags) -## NETCDFINC = $(ifortNetcdfInc) -## NETCDFLIB = -L$(ifortNetcdfLib) -lnetcdff -lnetcdf -## In my ~/.bashrc I have -## ## WRF HYDRO -## export NETCDF=/opt/netcdf -## export WRF_HYDRO=1 -## export HYDRO_D=1 -## ### manage ifort on hydro -## export ifortNetcdfLib="/opt/netcdf-4.3.0+ifort-12.1/lib/" -## export ifortNetcdfInc="/opt/netcdf-4.3.0+ifort-12.1/include/" -## # RPATH for ifort (pgi is already default so no need) -## ifortMpiLib="/opt/openmpi-1.10.0-intel/lib/" -## export ifortLdFlags="-Wl,-rpath,${ifortNetcdfLib}:${ifortMpiLib} -L${ifortNetcdfLib} -L${ifortMpiLib}" -## export ifortCompiler90='/opt/openmpi-1.10.0-intel/bin/mpif90' -## # Aliases for invoking ifort -## alias impirun='/opt/openmpi-1.10.0-intel/bin/mpirun' -## alias iman='man -M/opt/openmpi+intel/man' -## # Bonus: Check your wrf hydro environment - up you to maintain to your needs. -## alias henv='printenv | egrep -i "(HYDRO|NUDG|PRECIP|CHAN_CONN|^NETCDF|^LDFLAGS|^ifort)" | egrep -v PWD' - -.IGNORE: - -ifeq ($(SPATIAL_SOIL),1) -SPATIAL_SOIL = -DSPATIAL_SOIL -else -SPATIAL_SOIL = -endif - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - -ifeq ($(WRF_HYDRO_NUDGING),1) -WRF_HYDRO_NUDGING = -DWRF_HYDRO_NUDGING -else -WRF_HYDRO_NUDGING = -endif - -ifeq ($(OUTPUT_CHAN_CONN),1) -OUTPUT_CHAN_CONN = -DOUTPUT_CHAN_CONN -else -OUTPUT_CHAN_CONN = -endif - -ifeq ($(PRECIP_DOUBLE),1) -PRECIP_DOUBLE = -DPRECIP_DOUBLE -else -PRECIP_DOUBLE = -endif - -ifeq ($(NCEP_WCOSS),1) -NCEP_WCOSS = -DNCEP_WCOSS -else -NCEP_WCOSS = -endif - -ifeq ($(NWM_META),1) -NWM_META = -DNWM_META -else -NWM_META = -endif - -RMD = rm -f -COMPILER90 = ftn -FORMAT_FREE = -FR -BYTESWAPIO = -convert big_endian -F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) -DEBUGFLAGS = -DHYDRO_D -g -traceback -debug all -check all -MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod -# -# Used for DMAPP -# module load dmapp/7.0.1-1.0502.11080.8.76.ari -#LDFLAGS = $(HDF5_LDFLAGS) -Wl,--whole-archive,-ldmapp,--no-whole-archive -LDFLAGS = $(HDF5_LDFLAGS) -CPPINVOKE = -fpp -CPPFLAGS = -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(NWM_META) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS) -LIBS =$(Z_LIB) -NETCDFINC = $(NETCDF_INC) -NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/src/arc/macros.mpp.ifort.summit_has b/src/arc/macros.mpp.ifort.summit_has deleted file mode 100644 index f11747332..000000000 --- a/src/arc/macros.mpp.ifort.summit_has +++ /dev/null @@ -1,79 +0,0 @@ -.IGNORE: - -ifeq ($(SPATIAL_SOIL),1) -SPATIAL_SOIL = -DSPATIAL_SOIL -else -SPATIAL_SOIL = -endif - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - -ifeq ($(WRFIO_NCD_LARGE_FILE_SUPPORT),1) -WRFIO_NCD_LARGE_FILE_SUPPORT = -DWRFIO_NCD_LARGE_FILE_SUPPORT -else -WRFIO_NCD_LARGE_FILE_SUPPORT = -endif - -ifeq ($(WRF_HYDRO_NUDGING),1) -WRF_HYDRO_NUDGING = -DWRF_HYDRO_NUDGING -else -WRF_HYDRO_NUDGING = -endif - -ifeq ($(OUTPUT_CHAN_CONN),1) -OUTPUT_CHAN_CONN = -DOUTPUT_CHAN_CONN -else -OUTPUT_CHAN_CONN = -endif - -ifeq ($(PRECIP_DOUBLE),1) -PRECIP_DOUBLE = -DPRECIP_DOUBLE -else -PRECIP_DOUBLE = -endif - -ifeq ($(NCEP_WCOSS),1) -NCEP_WCOSS = -DNCEP_WCOSS -else -NCEP_WCOSS = -endif - -ifeq ($(NWM_META),1) -NWM_META = -DNWM_META -else -NWM_META = -endif - -RMD = rm -f -COMPILER90 = mpiifort -FORMAT_FREE = -FR -BYTESWAPIO = -convert big_endian -F90FLAGS = -O2 -g -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) -DEBUGFLAGS = -DHYDRO_D -g -traceback -debug all -check all -MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod -LDFLAGS = -CPPINVOKE = -fpp -CPPFLAGS = -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRFIO_NCD_LARGE_FILE_SUPPORT) $(NWM_META) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS) -LIBS = -NETCDFINC = $(NETCDF_INC) -NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/src/arc/macros.mpp.ifort.theia b/src/arc/macros.mpp.ifort.theia deleted file mode 100644 index 62e61dc17..000000000 --- a/src/arc/macros.mpp.ifort.theia +++ /dev/null @@ -1,92 +0,0 @@ -.IGNORE: - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - -ifneq ($(origin ESMFMKFILE), environment) -$(error Environment variable ESMFMKFILE was not set.) -endif -include $(ESMFMKFILE) - -RMD = rm -f -COMPILER90 = $(ESMF_F90COMPILER) -FORMAT_FREE = -FR -BYTESWAPIO = -convert big_endian -F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) -# -w Disables all warning messages -# -c Prevents linking. -# -g Produces symbolic debug information in the object -# file. -# -ftz Flushes denormal results to zero when the application -# is in the gradual underflow mode. -# -align all Tells the compiler to add padding bytes whenever -# possible to obtain the natural alignment of data -# items in common blocks, derived types, and record -# structures. -# -fno-alias Specifies that aliasing should not be assumed in -# the program. -# -fp-model precise Enables value-safe optimizations on floating- -# point data and rounds intermediate results to -# source-defined precision. -# -FR Specifies source files are in free format -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -u Sets the default type of a variable to undefined -# (IMPLICIT NONE) -# -traceback Tells the compiler to generate extra information in -# the object file to allow the display of source file -# traceback information at run time when a severe -# error occurs. -# -fpe0 Floating-point invalid, divide-by-zero, and -# overflow exceptions are enabled -# -nomixed_str_len_arg The hidden length passed for a character argument -# is to be placed in sequential order at the end of -# the argument list. [default] -# -names lowercase Causes the compiler to ignore case differences in -# identifiers and to convert external names to -# lowercase. [default] -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -assume byterecl Specifies that the units for the OPEN statement -# RECL specifier (record length) value are in bytes -# for unformatted data files, not longwords (four- -# byte units) -DEBUGFLAGS = -DHYDRO_D -g -traceback -debug all -check all -MODFLAG = -I./ -I../../MPP -I../MPP -I../mod -LDFLAGS = -CPPINVOKE = -fpp -CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) -# -C: Do not discard comments. -# -P: Inhibit generation of linemarkers in the output -# from the preprocessor. -# -traditional: Try to imitate the behavior of old-fashioned C -# preprocessors, as opposed to ISO C preprocessors. -LIBS = -NETCDFINC = $(NETCDF)/include -NETCDFLIB = -L$(NETCDF)/lib -lnetcdff -lnetcdf diff --git a/src/arc/macros.mpp.linux b/src/arc/macros.mpp.linux index 8bb08839a..ce3f13a7f 100644 --- a/src/arc/macros.mpp.linux +++ b/src/arc/macros.mpp.linux @@ -3,7 +3,7 @@ ifeq ($(SPATIAL_SOIL),1) SPATIAL_SOIL = -DSPATIAL_SOIL else -SPATIAL_SOIL = +SPATIAL_SOIL = endif ifeq ($(HYDRO_REALTIME),1) @@ -32,32 +32,33 @@ endif ifeq ($(WRF_HYDRO_NUDGING),1) WRF_HYDRO_NUDGING = -DWRF_HYDRO_NUDGING else -WRF_HYDRO_NUDGING = +WRF_HYDRO_NUDGING = endif ifeq ($(OUTPUT_CHAN_CONN),1) OUTPUT_CHAN_CONN = -DOUTPUT_CHAN_CONN else -OUTPUT_CHAN_CONN = +OUTPUT_CHAN_CONN = endif ifeq ($(PRECIP_DOUBLE),1) PRECIP_DOUBLE = -DPRECIP_DOUBLE else -PRECIP_DOUBLE = +PRECIP_DOUBLE = endif -RM = rm -f -RMD = rm -f +RM = rm -f +RMD = rm -f COMPILER90= mpif90 -F90FLAGS = -Mfree -c -byteswapio -O2 -Kieee -DEBUGFLAGS = -DHYDRO_D -g +COMPILERCC= mpicc +F90FLAGS = -Mfree -c -byteswapio -O2 -Kieee +DEBUGFLAGS = -DHYDRO_D -g LDFLAGS = $(F90FLAGS) MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod -I ../../mod -I ../../../mod -LDFLAGS = +LDFLAGS = CPPINVOKE = -Mpreprocess CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) -LIBS = -NETCDFINC = $(NETCDF_INC) +LIBS = +NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/src/arc/macros.seq.IBM.xlf90_r b/src/arc/macros.seq.IBM.xlf90_r deleted file mode 100644 index e5aebcc18..000000000 --- a/src/arc/macros.seq.IBM.xlf90_r +++ /dev/null @@ -1,39 +0,0 @@ -.IGNORE: - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - - - -RM = rm -f -RMD = rm -f -COMPILER90= xlf90_r -F90FLAGS = -c -O2 -qfree=f90 -qmaxmem=819200 -DEBUGFLAGS = -DHYDRO_D -g -MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod -LDFLAGS = -CPP = cpp -C -P -CPPFLAGS = -I../Data_Rec $(HYDRO_D) -LIBS = -NETCDFINC = $(NETCDF_INC) -NETCDFLIB = -L$(NETCDF_LIB) -lnetcdf diff --git a/src/arc/macros.seq.gfort b/src/arc/macros.seq.gfort deleted file mode 100644 index 22bdfb68b..000000000 --- a/src/arc/macros.seq.gfort +++ /dev/null @@ -1,43 +0,0 @@ -.IGNORE: - -ifeq ($(SPATIAL_SOIL),1) -SPATIAL_SOIL = -DSPATIAL_SOIL -else -SPATIAL_SOIL = -endif - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - - -RMD = rm -f -COMPILER90= gfortran -F90FLAGS = -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -DEBUGFLAGS = -DHYDRO_D -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=invalid,zero,overflow,underflow -finit-real=nan -MODFLAG = -I./ -I../mod -LDFLAGS = -CPPINVOKE = -cpp -CPPFLAGS = -I"../Data_Rec" $(HYDRO_D) $(SPATIAL_SOIL) -LIBS = -NETCDFINC = $(NETCDF_INC) -NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/src/arc/macros.seq.ifort b/src/arc/macros.seq.ifort deleted file mode 100644 index be68951c0..000000000 --- a/src/arc/macros.seq.ifort +++ /dev/null @@ -1,56 +0,0 @@ -.IGNORE: - -ifeq ($(SPATIAL_SOIL),1) -SPATIAL_SOIL = -DSPATIAL_SOIL -else -SPATIAL_SOIL = -endif - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - -ifeq ($(WRF_HYDRO_NUDGING),1) -WRF_HYDRO_NUDGING = -DWRF_HYDRO_NUDGING -else -WRF_HYDRO_NUDGING = -endif - -ifeq ($(OUTPUT_CHAN_CONN),1) -OUTPUT_CHAN_CONN = -DOUTPUT_CHAN_CONN -else -OUTPUT_CHAN_CONN = -endif - -RMD = rm -f -COMPILER90= ifort -##F90FLAGS = -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise -FR -convert big_endian -DEBUGFLAGS = -DHYDRO_D -g -traceback -debug all -check all - -MODFLAG = -I./ -I ../mod -LDFLAGS = -CPPINVOKE = -fpp -CPPFLAGS = -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) -LIBS = -NETCDFINC = $(NETCDF_INC) -NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/src/arc/macros.seq.linux b/src/arc/macros.seq.linux deleted file mode 100644 index 614a7e0b5..000000000 --- a/src/arc/macros.seq.linux +++ /dev/null @@ -1,57 +0,0 @@ -.IGNORE: - -ifeq ($(SPATIAL_SOIL),1) -SPATIAL_SOIL = -DSPATIAL_SOIL -else -SPATIAL_SOIL = -endif - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - -ifeq ($(WRF_HYDRO_NUDGING),1) -WRF_HYDRO_NUDGING = -DWRF_HYDRO_NUDGING -else -WRF_HYDRO_NUDGING = -endif - -ifeq ($(OUTPUT_CHAN_CONN),1) -OUTPUT_CHAN_CONN = -DOUTPUT_CHAN_CONN -else -OUTPUT_CHAN_CONN = -endif - - -RMD = ls -RM = rm -f -COMPILER90= pgf90 -F90FLAGS = -Mfree -Mfptrap -c -byteswapio -Ktrap=fp -O2 -Kieee -DEBUGFLAGS = -DHYDRO_D -g -LDFLAGS = $(F90FLAGS) -MODFLAG = -I./ -I ../mod -LDFLAGS = -CPPINVOKE = -CPPFLAGS = -I ../Data_Rec $(HYDRO_D) $(WRF_HYDRO) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) -LIBS = -NETCDFINC = $(NETCDF_INC) -NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/src/arc/macros.theia.debug b/src/arc/macros.theia.debug deleted file mode 100644 index 5b5b5799f..000000000 --- a/src/arc/macros.theia.debug +++ /dev/null @@ -1,92 +0,0 @@ -.IGNORE: - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - -ifneq ($(origin ESMFMKFILE), environment) -$(error Environment variable ESMFMKFILE was not set.) -endif -include $(ESMFMKFILE) - -RMD = rm -f -COMPILER90 = $(ESMF_F90COMPILER) -FORMAT_FREE = -FR -BYTESWAPIO = -convert big_endian -F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) -F90FLAGS += -g -traceback -# -w Disables all warning messages -# -c Prevents linking. -# -g Produces symbolic debug information in the object -# file. -# -ftz Flushes denormal results to zero when the application -# is in the gradual underflow mode. -# -align all Tells the compiler to add padding bytes whenever -# possible to obtain the natural alignment of data -# items in common blocks, derived types, and record -# structures. -# -fno-alias Specifies that aliasing should not be assumed in -# the program. -# -fp-model precise Enables value-safe optimizations on floating- -# point data and rounds intermediate results to -# source-defined precision. -# -FR Specifies source files are in free format -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -u Sets the default type of a variable to undefined -# (IMPLICIT NONE) -# -traceback Tells the compiler to generate extra information in -# the object file to allow the display of source file -# traceback information at run time when a severe -# error occurs. -# -fpe0 Floating-point invalid, divide-by-zero, and -# overflow exceptions are enabled -# -nomixed_str_len_arg The hidden length passed for a character argument -# is to be placed in sequential order at the end of -# the argument list. [default] -# -names lowercase Causes the compiler to ignore case differences in -# identifiers and to convert external names to -# lowercase. [default] -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -assume byterecl Specifies that the units for the OPEN statement -# RECL specifier (record length) value are in bytes -# for unformatted data files, not longwords (four- -# byte units) -MODFLAG = -I./ -I../../MPP -I../MPP -I../mod -LDFLAGS = -CPPINVOKE = -fpp -CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) -# -C: Do not discard comments. -# -P: Inhibit generation of linemarkers in the output -# from the preprocessor. -# -traditional: Try to imitate the behavior of old-fashioned C -# preprocessors, as opposed to ISO C preprocessors. -LIBS = -NETCDFINC = $(NETCDF)/include -NETCDFLIB = -L$(NETCDF)/lib -lnetcdff -lnetcdf diff --git a/src/arc/macros.yellowstone b/src/arc/macros.yellowstone deleted file mode 100644 index 8c5318c0f..000000000 --- a/src/arc/macros.yellowstone +++ /dev/null @@ -1,92 +0,0 @@ -.IGNORE: - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - -ifneq ($(origin ESMFMKFILE), environment) -$(error Environment variable ESMFMKFILE was not set.) -endif -include $(ESMFMKFILE) - -RMD = rm -f -COMPILER90 = $(ESMF_F90COMPILER) -FORMAT_FREE = -FR -BYTESWAPIO = -convert big_endian -F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) -# -w Disables all warning messages -# -c Prevents linking. -# -g Produces symbolic debug information in the object -# file. -# -ftz Flushes denormal results to zero when the application -# is in the gradual underflow mode. -# -align all Tells the compiler to add padding bytes whenever -# possible to obtain the natural alignment of data -# items in common blocks, derived types, and record -# structures. -# -fno-alias Specifies that aliasing should not be assumed in -# the program. -# -fp-model precise Enables value-safe optimizations on floating- -# point data and rounds intermediate results to -# source-defined precision. -# -FR Specifies source files are in free format -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -u Sets the default type of a variable to undefined -# (IMPLICIT NONE) -# -traceback Tells the compiler to generate extra information in -# the object file to allow the display of source file -# traceback information at run time when a severe -# error occurs. -# -fpe0 Floating-point invalid, divide-by-zero, and -# overflow exceptions are enabled -# -nomixed_str_len_arg The hidden length passed for a character argument -# is to be placed in sequential order at the end of -# the argument list. [default] -# -names lowercase Causes the compiler to ignore case differences in -# identifiers and to convert external names to -# lowercase. [default] -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -assume byterecl Specifies that the units for the OPEN statement -# RECL specifier (record length) value are in bytes -# for unformatted data files, not longwords (four- -# byte units) -DEBUGFLAGS = -DHYDRO_D -g -traceback -debug all -check all -MODFLAG = -I./ -I../../MPP -I../MPP -I../mod -LDFLAGS = -CPP = cpp -CPPFLAGS = -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) -# -C: Do not discard comments. -# -P: Inhibit generation of linemarkers in the output -# from the preprocessor. -# -traditional: Try to imitate the behavior of old-fashioned C -# preprocessors, as opposed to ISO C preprocessors. -LIBS = -NETCDFINC = $(NETCDF)/include -NETCDFLIB = -L$(NETCDF)/lib -lnetcdff -lnetcdf diff --git a/src/arc/macros.yellowstone.debug b/src/arc/macros.yellowstone.debug deleted file mode 100644 index 93e7aec44..000000000 --- a/src/arc/macros.yellowstone.debug +++ /dev/null @@ -1,92 +0,0 @@ -.IGNORE: - -ifeq ($(HYDRO_REALTIME),1) -HYDRO_REALTIME = -DHYDRO_REALTIME -else -HYDRO_REALTIME = -endif - -ifeq ($(WRF_HYDRO),1) -WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME) -else -WRF_HYDRO = -endif - -ifeq ($(WRF_HYDRO_RAPID),1) -WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME) -endif - -ifeq ($(HYDRO_D),1) -HYDRO_D = -DHYDRO_D $(WRF_HYDRO) -else -HYDRO_D = $(WRF_HYDRO) -endif - - -ifneq ($(origin ESMFMKFILE), environment) -$(error Environment variable ESMFMKFILE was not set.) -endif -include $(ESMFMKFILE) - -RMD = rm -f -COMPILER90 = $(ESMF_F90COMPILER) -FORMAT_FREE = -FR -BYTESWAPIO = -convert big_endian -F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) -F90FLAGS += -g -traceback -# -w Disables all warning messages -# -c Prevents linking. -# -g Produces symbolic debug information in the object -# file. -# -ftz Flushes denormal results to zero when the application -# is in the gradual underflow mode. -# -align all Tells the compiler to add padding bytes whenever -# possible to obtain the natural alignment of data -# items in common blocks, derived types, and record -# structures. -# -fno-alias Specifies that aliasing should not be assumed in -# the program. -# -fp-model precise Enables value-safe optimizations on floating- -# point data and rounds intermediate results to -# source-defined precision. -# -FR Specifies source files are in free format -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -u Sets the default type of a variable to undefined -# (IMPLICIT NONE) -# -traceback Tells the compiler to generate extra information in -# the object file to allow the display of source file -# traceback information at run time when a severe -# error occurs. -# -fpe0 Floating-point invalid, divide-by-zero, and -# overflow exceptions are enabled -# -nomixed_str_len_arg The hidden length passed for a character argument -# is to be placed in sequential order at the end of -# the argument list. [default] -# -names lowercase Causes the compiler to ignore case differences in -# identifiers and to convert external names to -# lowercase. [default] -# -convert big_endian Specifies that the format will be big endian for -# INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8, -# and big endian IEEE floating-point for REAL*4, -# REAL*8, REAL*16, COMPLEX*8, COMPLEX*16, or COM- -# PLEX*32. -# -assume byterecl Specifies that the units for the OPEN statement -# RECL specifier (record length) value are in bytes -# for unformatted data files, not longwords (four- -# byte units) -MODFLAG = -I./ -I../../MPP -I../MPP -I../mod -LDFLAGS = -CPP = cpp -CPPFLAGS = -C -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) -# -C: Do not discard comments. -# -P: Inhibit generation of linemarkers in the output -# from the preprocessor. -# -traditional: Try to imitate the behavior of old-fashioned C -# preprocessors, as opposed to ISO C preprocessors. -LIBS = -NETCDFINC = $(NETCDF)/include -NETCDFLIB = -L$(NETCDF)/lib -lnetcdff -lnetcdf diff --git a/src/configure b/src/configure index 33a546e95..7c3ff1ed5 100755 --- a/src/configure +++ b/src/configure @@ -4,6 +4,9 @@ theArgument=$1 ################################### ## Setup the HOSTNAME if not set +echo "---------------------------------------------------" +echo " WARNING" +echo "---------------------------------------------------" echo "WARNING: configure is being deprecated and removed in the future." echo " See docs/BUILD.md for more detail on building." echo " Please switch to using CMake from the top directory." @@ -80,13 +83,12 @@ if [[ -z $theArgument ]]; then echo echo "Number Key Description" echo "---------------------------------------------------" - echo " 1 pgi PGI parallel" + echo " 1 nvfort nvidia parallel" echo " 2 gfort gfortran parallel" - echo " 3 ifort intel parallel (incl. Theia, Gordon, Summit)" - echo " 4 luna intel parallel (WCOSS Luna)" + echo " 3 ifort intel parallel" + echo " 4 cray cray (ftn) parallel" echo " 5 ifort_omp intel openmp" echo " 6 intel.cray_xc intel parallel (cray_xc)" - echo " 7 cray_fortran Cray Fortran PE (ftn)" echo " 0 exit exit" echo read -p "Enter selection: " theArgument @@ -100,10 +102,10 @@ theArgument=`echo $theArgument | tr '[:upper:]' '[:lower:]'` ################################### ## What to do with the choice -if [[ "$theArgument" == "1" ]] || [[ "$theArgument" == "pgi" ]]; then +if [[ "$theArgument" == "1" ]] || [[ "$theArgument" == "nvfort" ]]; then cp arc/macros.mpp.linux macros cp arc/Makefile.mpp Makefile.comm - echo "Configured: PGI" + echo "Configured: nvfort" fi if [[ "$theArgument" == "2" ]] || [[ "$theArgument" == "gfort" ]]; then @@ -113,44 +115,21 @@ if [[ "$theArgument" == "2" ]] || [[ "$theArgument" == "gfort" ]]; then fi if [[ "$theArgument" == "3" ]] || [[ "$theArgument" == "ifort" ]]; then - - ## theia login machines self identify as "tfe" and have - ## their own intel macros. We handle luna more explicitly... - if [[ $HOSTNAME = *tfe* ]]; then - cp arc/macros.mpp.ifort.theia macros - echo "Configured: ifort on Theia" - - elif [[ $HOSTNAME = *gordon* ]]; then - cp arc/macros.mpp.intel.cray_xc macros - echo "Configured: ifort on Gordon" - - elif [[ $HOSTNAME = *shas* ]]; then - cp arc/macros.mpp.ifort.summit_has macros - echo "Configured: ifort on Summit haswell" - - else - cp arc/macros.mpp.ifort macros - echo "Configured: ifort" - fi + cp arc/macros.mpp.ifort macros + echo "Configured: ifort" cp arc/Makefile.mpp Makefile.comm fi -if [[ "$theArgument" == "4" ]] || [[ "$theArgument" == "luna" ]]; then - cp arc/macros.mpp.ifort.luna macros +if [[ "$theArgument" == "4" ]] || [[ "$theArgument" == "cray" ]]; then + cp arc/macros.mpp.cray_fortran macros cp arc/Makefile.mpp Makefile.comm - echo "Configured: ifort on Luna" + echo "Configured: Cray Fortran PrgEnv" fi + if [[ "$theArgument" == "5" ]] || [[ "$theArgument" == "ifort_omp" ]]; then - ## theia login machines self identify as "tfe" and have - ## their own intel macros. We handle luna more explicitly... - if [[ $HOSTNAME != *tfe* ]]; then - cp arc/macros.mpp.ifort.omp macros - echo "Configured: ifort with OpenMP" - else - cp arc/macros.mpp.ifort.theia macros - echo "Configured: ifort on Theia" - fi + cp arc/macros.mpp.ifort.omp macros + echo "Configured: ifort with OpenMP" cp arc/Makefile.mpp Makefile.comm fi @@ -160,11 +139,6 @@ if [[ "$theArgument" == "6" ]] || [[ "$theArgument" == "intel.cray_xc" ]]; then echo "Configured: ifort on cray_xc" fi -if [[ "$theArgument" == "7" ]] || [[ "$theArgument" == "cray_fortran" ]]; then - cp arc/macros.mpp.cray_fortran macros - cp arc/Makefile.mpp Makefile.comm - echo "Configured: Cray Fortran PrgEnv" -fi ## The above result in a new macros file which was @@ -177,16 +151,6 @@ if [[ ! -e macros ]]; then exit 1 fi -# PGI sequential -# cp arc/macros.seq.linux macros -# cp arc/Makefile.seq Makefile.comm -# gfortran sequential -#zystem "cp arc/macros.seq.gfort macros -#cp arc/Makefile.seq Makefile.comm -# ifort sequential -#cp arc/macros.seq.ifort macros -#cp arc/Makefile.seq Makefile.comm - if [[ -e macros.tmp ]]; then cat macros macros.tmp > macros.a rm -f macros.tmp diff --git a/src/utils/fortglob/Makefile b/src/utils/fortglob/Makefile new file mode 100644 index 000000000..716136704 --- /dev/null +++ b/src/utils/fortglob/Makefile @@ -0,0 +1,33 @@ +# Makefile + +.PHONY: cp *.f90 *.c + +include ../../macros + +OBJS = \ + fortglob.o \ + libfortglob.o + +all: $(OBJS) cp + +cp: + cp *.mod ../../mod + +%.o: %.f90 + @echo "Utils fortglob Makefile: %.f90" + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(LDFLAGS) -I../../ -I$(NETCDFINC) $(*).F90 + @echo "" + ar -r ../../lib/libHYDRO.a $(@) +%.o: %.c + @echo "Utils fortglob Makefile: %.c" + $(COMPILERCC) -o $(@) -c $(*).c + ar -r ../../lib/libHYDRO.a $(@) + @echo "" +# +# Dependencies: +# +fortglob.o: libfortglob.o + + +clean: + rm -f *.o *.mod *.stb *~