12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #adapted from runoff-mapper Makefile template
- FC = [[[PLT:ACTIVE:FC]]]
- FFLAGS = [[[PLT:ACTIVE:FFLAGS]]]
- LD = [[[PLT:ACTIVE:LD]]]
- LDFLAGS = [[[PLT:ACTIVE:LDFLAGS]]]
- FPP = [[[PLT:ACTIVE:FPP]]]
- FFLAGS_FPP_PREFIX = [[[PLT:ACTIVE:FFLAGS_FPP_PREFIX]]]
- OASIS_BASE_DIR = [[[PLT:ACTIVE:ECEARTH_SRC_DIR]]]/oasis3-mct/ecconf
- OASIS_MOD_DIR = $(OASIS_BASE_DIR)/build/lib/psmile.MPI1
- OASIS_INC_DIR = $(OASIS_BASE_DIR)/lib/psmile/include
- OASIS_LIB_DIR = $(OASIS_BASE_DIR)/lib
- OASIS_LIBS = -lpsmile.MPI1 -lmct -lmpeu -lscrip
- MPI_BASE_DIR := [[[PLT:ACTIVE:MPI_BASE_DIR]]]
- ifneq ($(strip $(MPI_BASE_DIR)),)
- MPI_INC_DIR := $(MPI_BASE_DIR)$(addprefix /,[[[PLT:ACTIVE:MPI_INC_SUBDIR]]])
- MPI_LIB_DIR := $(MPI_BASE_DIR)$(addprefix /,[[[PLT:ACTIVE:MPI_LIB_SUBDIR]]])
- endif
- MPI_LIBS := [[[PLT:ACTIVE:MPI_LIBS_WITHOUT_L]]]
- ifneq ($(strip [[[PLT:ACTIVE:NETCDF_BASE_DIR]]]),)
- NETCDF_LIB_DIR := [[[PLT:ACTIVE:NETCDF_BASE_DIR]]]/[[[PLT:ACTIVE:NETCDF_LIB_SUBDIR]]]
- NETCDF_INC_DIR := [[[PLT:ACTIVE:NETCDF_BASE_DIR]]]/[[[PLT:ACTIVE:NETCDF_INC_SUBDIR]]]
- endif
- NETCDF_LIBS := [[[PLT:ACTIVE:NETCDF_LIBS_WITHOUT_L]]]
- all: lpjg_forcing ccycle_coupling
- # add any new lpjg_forcing_xxx here, currently only IFS forcing implemented
- lpjg_forcing: lpjg_forcing_ifs_T159 lpjg_forcing_ifs_T255
- lpjg_forcing_ifs_T%: lpjg_forcing_ifs_T%.o
- $(LD) $(LDFLAGS) -o $@ $^ -L$(OASIS_LIB_DIR) $(OASIS_LIBS) \
- $(addprefix -L,$(NETCDF_LIB_DIR)) $(addprefix -l,$(NETCDF_LIBS)) \
- $(addprefix -L,$(MPI_LIB_DIR)) $(addprefix -l,$(MPI_LIBS))
- lpjg_forcing_ifs_T159.f90:
- $(FPP) $(FFLAGS_FPP_PREFIX)IFS_RES_T159 lpjg_forcing_ifs.F90 > $@
- lpjg_forcing_ifs_T255.f90:
- $(FPP) $(FFLAGS_FPP_PREFIX)IFS_RES_T255 lpjg_forcing_ifs.F90 > $@
- ccycle_coupling: ccycle_coupling.o
- $(LD) $(LDFLAGS) -o $@ $^ -L$(OASIS_LIB_DIR) $(OASIS_LIBS) \
- $(addprefix -L,$(NETCDF_LIB_DIR)) $(addprefix -l,$(NETCDF_LIBS)) \
- $(addprefix -L,$(MPI_LIB_DIR)) $(addprefix -l,$(MPI_LIBS))
- %.o: %.f90
- $(FC) $(FFLAGS) -c -I$(OASIS_MOD_DIR) $(addprefix -I,$(NETCDF_INC_DIR)) $(addprefix -I,$(MPI_INC_DIR)) $<
- .PHONY: clean
- clean:
- @rm -f *.o *.mod lpjg_forcing_ifs_T*.f90 lpjg_forcing_ifs_T159 lpjg_forcing_ifs_T255 ccycle_coupling
|