Skip to content

Commit

Permalink
bugfix: Diversions Makefiles for configure build (#811)
Browse files Browse the repository at this point in the history
* Adding Makefiles and updating build system to handle new C compiler dependency and Diversions and fortglob builds

* Quick update on old configure build system
  • Loading branch information
scrasmussen authored Feb 14, 2025
1 parent 08b0888 commit d6fb60e
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 856 deletions.
27 changes: 27 additions & 0 deletions src/Routing/Diversions/Makefile
Original file line number Diff line number Diff line change
@@ -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 *~
7 changes: 5 additions & 2 deletions src/Routing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/arc/Makefile.mpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 0 additions & 36 deletions src/arc/Makefile.seq

This file was deleted.

11 changes: 6 additions & 5 deletions src/arc/macros.mpp.cray_fortran
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ifeq ($(SPATIAL_SOIL),1)
SPATIAL_SOIL = -DSPATIAL_SOIL
else
SPATIAL_SOIL =
SPATIAL_SOIL =
endif

ifeq ($(HYDRO_REALTIME),1)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
3 changes: 2 additions & 1 deletion src/arc/macros.mpp.gfort
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/arc/macros.mpp.ifort
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
107 changes: 0 additions & 107 deletions src/arc/macros.mpp.ifort.luna

This file was deleted.

79 changes: 0 additions & 79 deletions src/arc/macros.mpp.ifort.summit_has

This file was deleted.

Loading

0 comments on commit d6fb60e

Please sign in to comment.