-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
73 lines (61 loc) · 3.7 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# GNU Makefile template for user ESMF application
################################################################################
################################################################################
## This Makefile must be able to find the "esmf.mk" Makefile fragment in the ##
## 'include' line below. Following the ESMF User's Guide, a complete ESMF ##
## installation should ensure that a single environment variable "ESMFMKFILE" ##
## is made available on the system. This variable should point to the ##
## "esmf.mk" file. ##
## ##
## This example Makefile uses the "ESMFMKFILE" environment variable. ##
## ##
## If you notice that this Makefile cannot find variable ESMFMKFILE then ##
## please contact the person responsible for the ESMF installation on your ##
## system. ##
## As a work-around you can simply hardcode the path to "esmf.mk" in the ##
## include line below. However, doing so will render this Makefile a lot less ##
## flexible and non-portable. ##
################################################################################
#ifneq ($(origin ESMFMKFILE), environment)
#$(error Environment variable ESMFMKFILE was not set.)
#endif
include $(ESMFMKFILE)
UTILINCS = -I$(CICE_LIB) -L$(CICE_LIB) -l$(CICE_FILE) -I$(HYCOM_LIB) -L$(HYCOM_LIB) -l$(HC_FILE)
################################################################################
################################################################################
.SUFFIXES: .f90 .F90 .c .C
%.o : %.f90
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(UTILINCS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREENOCPP) $<
%.o : %.F90
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(UTILINCS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $(CPPFLAGS) $<
%.o : %.c
$(ESMF_CXXCOMPILER) -c $(ESMF_CXXCOMPILEOPTS) $(ESMF_CXXCOMPILEPATHSLOCAL) $(ESMF_CXXCOMPILEPATHS) $(ESMF_CXXCOMPILECPPFLAGS) $<
%.o : %.C
$(ESMF_CXXCOMPILER) -c $(ESMF_CXXCOMPILEOPTS) $(ESMF_CXXCOMPILEPATHSLOCAL) $(ESMF_CXXCOMPILEPATHS) $(ESMF_CXXCOMPILECPPFLAGS) $<
# -----------------------------------------------------------------------------
hycom_cice_nuopc: hycom_cice_nuopc.o esm.o cice_cap.o hycom_cap.o conn.o mod_cb_arrays_nuopc_glue.o mod_hycom_nuopc_glue.o mod_nuopc_options.o
$(ESMF_F90LINKER) $(ESMF_F90LINKOPTS) $(UTILINCS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $^ $(ESMF_F90ESMFLINKLIBS) -l${CICE_FILE} -l${HC_FILE}
# module dependencies:
esmApp.o: esm.o
esm.o: cice_cap.o hycom_cap.o conn.o mod_nuopc_options.o
hycom_cap.o: mod_cb_arrays_nuopc_glue.o mod_hycom_nuopc_glue.o mod_nuopc_options.o
mod_hycom_nuopc_glue.o: mod_cb_arrays_nuopc_glue.o
hycom_cice_nuopc.o: esm.o
mod_nuopc_options.o: mod_nuopc_options.F90
cice_cap.o: mod_nuopc_options.o
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
.PHONY: dust clean distclean info edit
dust:
rm -f PET*.ESMF_LogFile
clean:
rm -f esmApp hycom_cice_nuopc *.o *.mod
distclean: dust clean
info:
@echo ==================================================================
@echo ESMFMKFILE=$(ESMFMKFILE)
@echo ==================================================================
@cat $(ESMFMKFILE)
@echo ==================================================================
edit:
nedit esmApp.F90 esm.F90 atm.F90 ocn.F90 conn.F90 &