runoff-mapper.makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. executable = ../bin/runoff-mapper.exe
  2. FC = mpif90
  3. FFLAGS = -r8 -O3 -march=core-avx2
  4. LD = mpif90
  5. LDFLAGS =
  6. OASIS_BASE_DIR = ${HOME}/models/ecearth_3.3.3.2/sources/oasis3-mct/ecconf
  7. OASIS_MOD_DIR = $(OASIS_BASE_DIR)/build/lib/psmile.MPI1
  8. OASIS_INC_DIR = $(OASIS_BASE_DIR)/lib/psmile/include
  9. OASIS_LIB_DIR = $(OASIS_BASE_DIR)/lib
  10. OASIS_LIBS = -lpsmile.MPI1 -lmct -lmpeu -lscrip
  11. MPI_BASE_DIR :=
  12. ifneq ($(strip $(MPI_BASE_DIR)),)
  13. MPI_INC_DIR := $(MPI_BASE_DIR)$(addprefix /,)
  14. MPI_LIB_DIR := $(MPI_BASE_DIR)$(addprefix /,)
  15. endif
  16. MPI_LIBS :=
  17. ifneq ($(strip /),)
  18. NETCDF_LIB_DIR := $(EBROOTNETCDF)/lib64 $(EBROOTNETCDFMINFORTRAN)/lib
  19. NETCDF_INC_DIR := $(EBROOTNETCDF)/include $(EBROOTNETCDFMINFORTRAN)/include
  20. endif
  21. NETCDF_LIBS := netcdff netcdf
  22. VPATH = cplng
  23. cplng_srcs = \
  24. cplng_data_mod.F90 \
  25. cplng_init_mod.F90 \
  26. cplng_config_mod.F90 \
  27. cplng_exchange_mod.F90 \
  28. cplng_finalize_mod.F90 \
  29. cplng_mod.F90
  30. rnfmap_srcs = runoff_mapper_mod.F90 runoff_mapper.F90
  31. $(executable): config_mod.o $(cplng_srcs:.F90=.o) $(rnfmap_srcs:.F90=.o)
  32. $(LD) $(LDFLAGS) -o $@ $^ -L$(OASIS_LIB_DIR) $(OASIS_LIBS) \
  33. $(addprefix -L,$(NETCDF_LIB_DIR)) $(addprefix -l,$(NETCDF_LIBS)) \
  34. $(addprefix -L,$(MPI_LIB_DIR)) $(addprefix -l,$(MPI_LIBS))
  35. %.o: %.F90
  36. $(FC) $(FFLAGS) -c -I$(OASIS_MOD_DIR) $(addprefix -I,$(NETCDF_INC_DIR)) $(addprefix -I,$(MPI_INC_DIR)) $<
  37. .PHONY: clean
  38. clean:
  39. @rm -f *.o *.mod