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

Support parallel Make in Legacy build system #686

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Clean up phys/ Makefile calls to SURFEX build
  • Loading branch information
rcabell authored and scrasmussen committed Mar 17, 2023
commit e44df6359cad68069580a512b688e1a173737c33
17 changes: 4 additions & 13 deletions src/Land_models/NoahMP/phys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,34 @@ include ../user_build_options

SRCS := $(wildcard *.F)
OBJS := $(SRCS:%.F=%.o)
SUR_SRCS := $(wildcard surfex/*.F)
SUR_OBJS := $(SUR_SRCS:%.F=%.o)
CPPHRLDAS = -D_HRLDAS_OFFLINE_

# Check whether or not to build Crocus
ifndef BUILD_CROCUS
BUILD_CROCUS:=1
endif
ifeq ($(BUILD_CROCUS), 1)
SUR_OBJS := $(filter-out ../surfex/module_snowcro_intercept.o, $(SUR_OBJS))
SUR_OBJS := surfex/module_snowcro.o surfex/ini_csts.o
else
SUR_OBJS := $(filter-out ../surfex/module_snowcro.o, $(SUR_OBJS))
SUR_OBJS := surfex/module_snowcro_intercept.o
endif

all: $(OBJS)

%.o:%.F
@echo ""
$(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c -I../Utility_routines -Isurfex $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $(*).F
$(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c -I../Utility_routines -Isurfex $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $<
@echo ""

surfex/%.o:
$(MAKE) --directory=surfex/
$(MAKE) --directory=surfex/ $(@F)

#
# Dependencies:
#
module_sf_noahmpdrv.o: module_sf_noahmplsm.o module_sf_noahmp_glacier.o module_sf_noahmp_groundwater.o $(SUR_OBJS)
module_sf_noahmp_groundwater.o: module_sf_noahmplsm.o

surfex/ini_csts.o: surfex/modd_csts.o
surfex/mode_thermos.o: surfex/modd_snow_par.o
surfex/mode_surf_coefs.o: surfex/mode_thermos.o
surfex/mode_snow3l.o: surfex/modd_snow_par.o
surfex/module_snowcro.o: surfex/mode_surf_coefs.o surfex/tridiag_ground_snowcro.o


#
# This command cleans up object (etc) files:
#
Expand Down