-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.ww3data.nuopc
executable file
·117 lines (86 loc) · 3.75 KB
/
makefile.ww3data.nuopc
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
################################################################################
##!! @author Saeed Moghimi ([email protected])
##!! @date 15/1/17 Original documentation
##! LOG !
##!
################################################################################
ifneq ($(origin ESMFMKFILE), environment)
$(warning Environment variable ESMFMKFILE was not set.)
export ESMFMKFILE=/scratch1/NCEPDEV/nems/emc.nemspara/soft/esmf/8.0.0bs48g-intel18.0.5.274-impi2018.0.4-netcdf4.6.1/lib/esmf.mk
$(info Setting to $(ESMFMKFILE))
endif
include $(ESMFMKFILE)
INCDIRS := -I.
LIBDIRS := -L.
LIBSS := -lnetcdf -lnetcdff -lhdf5 -lhdf5_fortran
INCDIRS += -I${NETCDFHOME}/include/
LIBDIRS += -L${NETCDFHOME}/lib/
INCDIRS += -I${HDF5HOME}/include/
LIBDIRS += -L${HDF5HOME}/lib/
# unremark this line to define petlists
LIBDIRS += -DWITHPETLISTS_on
# debug for gfortran
# LIBDIRS += -g -O0 -fbacktrace
################################################################################ $(INCDIRS) $(LIBDIRS)
################################################################################
.SUFFIXES: .f90 .F90 .c .C
%.o : %.F90
@echo ""
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $(INCDIRS) $(LIBDIRS) -DESMF_VERSION_MAJOR=$(ESMF_VERSION_MAJOR) $<
@echo ""
%.o : %.F
@echo ""
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $(INCDIRS) $(LIBDIRS) -DESMF_VERSION_MAJOR=$(ESMF_VERSION_MAJOR) $<
@echo ""
.PRECIOUS: %.o
# -----------------------------------------------------------------------------
vars:
@echo " >>>>>>>>>>>>>>>> vars >>>>>>>>>>>>>>"
@echo "INCDIRS $(INCDIRS)"
@echo "LIBDIRS $(LIBDIRS)"
@echo "ESMF_F90COMPILER $(ESMF_F90COMPILER)"
@echo "ESMF_F90LINKER $(ESMF_F90LINKER)"
@echo "ESMF_F90LINKOPTS $(ESMF_F90LINKOPTS)"
@echo "ESMF_F90LINKPATHS $(ESMF_F90LINKPATHS)"
@echo "ESMF_F90LINKRPATHS $(ESMF_F90LINKRPATHS)"
@echo "ESMF_F90ESMFLINKLIBS $(ESMF_F90ESMFLINKLIBS)"
# -----------------------------------------------------------------------------
PWDDIR := $(shell pwd)
INSTALLDIR := $(INSTDIR) # coming from NEMS/src/incmake/component_WW3DATA.mk
MAKEFILE = ww3data.mk
LIBRARY = libww3data_cap.a
MODULES = wav.o wav_mod.o
nuopc: $(LIBRARY)
$(LIBRARY): $(MODULES)
$(AR) $(ARFLAGS) $@ $?
nuopcinstall: $(LIBRARY)
@echo ""
mkdir -p $(INSTALLDIR)
@echo "# ESMF self-describing build dependency makefile fragment" > $(strip $(INSTALLDIR))/$(MAKEFILE)
@echo >> $(strip $(INSTALLDIR))/$(MAKEFILE)
@echo "ESMF_DEP_FRONT = wav " >> $(strip $(INSTALLDIR))/$(MAKEFILE)
@echo "ESMF_DEP_INCPATH = $(PWDDIR) $(strip $(INSTALLDIR)) " >> $(strip $(INSTALLDIR))/$(MAKEFILE)
@echo "ESMF_DEP_CMPL_OBJS = " >> $(strip $(INSTALLDIR))/$(MAKEFILE)
@echo "ESMF_DEP_LINK_OBJS = -L$(strip $(INSTALLDIR)) $(strip $(INSTALLDIR))/$(LIBRARY) " >> $(strip $(INSTALLDIR))/$(MAKEFILE)
cp -f *.a *.mod $(INSTALLDIR)
@echo ""
# module dependencies:
wav.o: wav_mod.o
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
.PHONY: dust nuopcclean nuopcdistclean info edit
nuopcclean:
@echo ""
rm -f wav.o wav_mod.o wav.mod wav_mod.mod $(LIBRARY)
@echo ""
nuopcdistclean: nuopcclean
@echo ""
@echo "Cleaning Model build..."
@echo ""
#make -C $(ADCDIR) -f $(MODEL_MK) clean PET*.ESMF_LogFile *.nc
dust:
@echo ""
clean PET*.ESMF_LogFile *.nc
@echo ""
edit:
gedit Makefile esmApp.F90 esm.F90 wav.F90 adc_cap.F90 adc_mod.F90 couple2swan_modif.F hwrf_mod.F90 hwrf_cap.F90 wav_mod.F90 &