1 | ###################### |
---|
2 | |
---|
3 | ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 \ |
---|
4 | $(ARCH_LOCAL) \ |
---|
5 | $(DA_ARCHFLAGS) \ |
---|
6 | CONFIGURE_DMPARALLEL \ |
---|
7 | CONFIGURE_STUBMPI \ |
---|
8 | CONFIGURE_NETCDF_FLAG \ |
---|
9 | CONFIGURE_PNETCDF_FLAG \ |
---|
10 | CONFIGURE_ESMF_FLAG \ |
---|
11 | CONFIGURE_GRIB2_FLAG \ |
---|
12 | CONFIGURE_RTTOV_FLAG \ |
---|
13 | CONFIGURE_CRTM_FLAG \ |
---|
14 | CONFIGURE_NESTOPT \ |
---|
15 | -DGRIB1 \ |
---|
16 | -DINTIO \ |
---|
17 | -DLIMIT_ARGS \ |
---|
18 | -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) \ |
---|
19 | -DMAX_DOMAINS_F=$(MAX_DOMAINS) \ |
---|
20 | -DNMM_NEST=$(WRF_NMM_NEST) |
---|
21 | CFLAGS = $(CFLAGS_LOCAL) CONFIGURE_DMPARALLEL CONFIGURE_STUBMPI |
---|
22 | FCFLAGS = $(FCOPTIM) $(FCBASEOPTS) $(OMP) |
---|
23 | ESMF_LIB_FLAGS = ESMFLIBFLAG |
---|
24 | ESMF_IO_LIB = ESMFIOLIB |
---|
25 | ESMF_IO_LIB_EXT = ESMFIOEXTLIB |
---|
26 | INCLUDE_MODULES = $(MODULE_SRCH_FLAG) \ |
---|
27 | $(ESMF_MOD_INC) $(ESMF_LIB_FLAGS) \ |
---|
28 | -I$(WRF_SRC_ROOT_DIR)/main \ |
---|
29 | -I$(WRF_SRC_ROOT_DIR)/external/io_netcdf \ |
---|
30 | -I$(WRF_SRC_ROOT_DIR)/external/io_int \ |
---|
31 | -I$(WRF_SRC_ROOT_DIR)/frame \ |
---|
32 | -I$(WRF_SRC_ROOT_DIR)/share \ |
---|
33 | -I$(WRF_SRC_ROOT_DIR)/phys \ |
---|
34 | -I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \ |
---|
35 | -I$(WRF_SRC_ROOT_DIR)/libo_links/.config/inc \ |
---|
36 | -ICONFIGURE_NETCDF_PATH/include \ |
---|
37 | CONFIGURE_CRTM_INC \ |
---|
38 | CONFIGURE_RTTOV_INC |
---|
39 | REGISTRY = Registry |
---|
40 | |
---|
41 | LIB_BUNDLED = \ |
---|
42 | -L$(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5 -lfftpack \ |
---|
43 | -L$(WRF_SRC_ROOT_DIR)/external/io_grib1 -lio_grib1 \ |
---|
44 | -L$(WRF_SRC_ROOT_DIR)/external/io_grib_share -lio_grib_share \ |
---|
45 | -L$(WRF_SRC_ROOT_DIR)/external/io_int -lwrfio_int \ |
---|
46 | $(ESMF_IO_LIB) \ |
---|
47 | $(ESMF_IO_LIB) \ |
---|
48 | CONFIGURE_COMMS_LIB \ |
---|
49 | $(WRF_SRC_ROOT_DIR)/frame/module_internal_header_util.o \ |
---|
50 | $(WRF_SRC_ROOT_DIR)/frame/pack_utils.o |
---|
51 | |
---|
52 | LIB_EXTERNAL = \ |
---|
53 | CONFIGURE_NETCDF_LIB_PATH CONFIGURE_PNETCDF_LIB_PATH CONFIGURE_GRIB2_LIB \ |
---|
54 | -L$(WRF_SRC_ROOT_DIR)/libo_links/.config/lib -llmdz \ |
---|
55 | -lnetcdf |
---|
56 | |
---|
57 | LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL) |
---|
58 | LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL) CONFIGURE_LDFLAGS |
---|
59 | ENVCOMPDEFS = CONFIGURE_COMPILEFLAGS |
---|
60 | CPPFLAGS = $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG) CONFIGURE_COMMS_INCLUDE |
---|
61 | NETCDFPATH = CONFIGURE_NETCDF_PATH |
---|
62 | PNETCDFPATH = CONFIGURE_PNETCDF_PATH |
---|
63 | |
---|
64 | bundled: wrf_ioapi_includes wrfio_grib_share wrfio_grib1 wrfio_int esmf_time fftpack |
---|
65 | external: CONFIGURE_WRFIO_NF CONFIGURE_WRFIO_PNF CONFIGURE_WRFIO_GRIB2 CONFIGURE_COMMS_EXTERNAL $(ESMF_TARGET) |
---|
66 | |
---|
67 | ###################### |
---|
68 | externals: bundled external |
---|
69 | |
---|
70 | gen_comms_serial : |
---|
71 | ( /bin/rm -f $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ) |
---|
72 | |
---|
73 | module_dm_serial : |
---|
74 | ( if [ ! -e module_dm.F ] ; then /bin/cp module_dm_warning module_dm.F ; cat module_dm_stubs.F >> module_dm.F ; fi ) |
---|
75 | |
---|
76 | gen_comms_rsllite : |
---|
77 | ( if [ ! -e $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ] ; then \ |
---|
78 | /bin/cp $(WRF_SRC_ROOT_DIR)/tools/gen_comms_warning $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ; \ |
---|
79 | cat $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/gen_comms.c >> $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ; fi ) |
---|
80 | |
---|
81 | module_dm_rsllite : |
---|
82 | ( if [ ! -e module_dm.F ] ; then /bin/cp module_dm_warning module_dm.F ; \ |
---|
83 | cat $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/module_dm.F >> module_dm.F ; fi ) |
---|
84 | |
---|
85 | wrfio_nf : |
---|
86 | ( cd $(WRF_SRC_ROOT_DIR)/external/io_netcdf ; \ |
---|
87 | make NETCDFPATH="$(NETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP)" \ |
---|
88 | CC="$(SCC)" CFLAGS="$(CFLAGS)" \ |
---|
89 | FC="$(SFC) $(PROMOTION) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ) |
---|
90 | |
---|
91 | wrfio_pnf : |
---|
92 | ( cd $(WRF_SRC_ROOT_DIR)/external/io_pnetcdf ; \ |
---|
93 | make NETCDFPATH="$(PNETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP)" \ |
---|
94 | FC="$(FC) $(PROMOTION) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ) |
---|
95 | |
---|
96 | wrfio_grib_share : |
---|
97 | ( cd $(WRF_SRC_ROOT_DIR)/external/io_grib_share ; \ |
---|
98 | make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" \ |
---|
99 | FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" archive) |
---|
100 | |
---|
101 | wrfio_grib1 : |
---|
102 | ( cd $(WRF_SRC_ROOT_DIR)/external/io_grib1 ; \ |
---|
103 | make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" \ |
---|
104 | FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" archive) |
---|
105 | |
---|
106 | wrfio_grib2 : |
---|
107 | ( cd $(WRF_SRC_ROOT_DIR)/external/io_grib2 ; \ |
---|
108 | make CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" \ |
---|
109 | CPP="$(CPP)" \ |
---|
110 | FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="-traditional" AR="$(AR)" ARFLAGS="$(ARFLAGS)" \ |
---|
111 | FIXED="$(FORMAT_FIXED)" archive) |
---|
112 | |
---|
113 | wrfio_int : |
---|
114 | ( cd $(WRF_SRC_ROOT_DIR)/external/io_int ; \ |
---|
115 | make CC="$(CC)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" \ |
---|
116 | FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" \ |
---|
117 | TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" all ) |
---|
118 | |
---|
119 | esmf_time : |
---|
120 | ( cd $(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 ; \ |
---|
121 | make FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" \ |
---|
122 | CPP="$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc -I. $(ARCHFLAGS) $(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ) |
---|
123 | |
---|
124 | fftpack : |
---|
125 | ( cd $(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5 ; \ |
---|
126 | make FC="$(SFC)" FFLAGS="$(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ) |
---|
127 | |
---|
128 | $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a : |
---|
129 | ( cd $(WRF_SRC_ROOT_DIR)/external/RSL_LITE ; make CC="$(CC) $(CFLAGS)" \ |
---|
130 | FC="$(FC) $(FCFLAGS) $(PROMOTION) $(BYTESWAPIO)" \ |
---|
131 | CPP="$(CPP) -I. $(ARCHFLAGS) $(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ;\ |
---|
132 | $(RANLIB) $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a ) |
---|
133 | |
---|
134 | ###################### |
---|
135 | # Macros, these should be generic for all machines |
---|
136 | |
---|
137 | LN = ln -sf |
---|
138 | MAKE = make -i -r |
---|
139 | RM = rm -f |
---|
140 | |
---|
141 | |
---|
142 | # These sub-directory builds are identical across all architectures |
---|
143 | |
---|
144 | wrf_ioapi_includes : |
---|
145 | ( cd $(WRF_SRC_ROOT_DIR)/external/ioapi_share ; \ |
---|
146 | $(MAKE) NATIVE_RWORDSIZE="$(NATIVE_RWORDSIZE)" RWORDSIZE="$(RWORDSIZE)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ) |
---|
147 | |
---|
148 | wrfio_esmf : |
---|
149 | ( cd $(WRF_SRC_ROOT_DIR)/external/io_esmf ; \ |
---|
150 | make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) $(ESMF_MOD_INC)" \ |
---|
151 | RANLIB="$(RANLIB)" CPP="$(CPP) $(POUND_DEF) " AR="$(AR)" ARFLAGS="$(ARFLAGS)" ) |
---|
152 | |
---|
153 | # There is probably no reason to modify these rules |
---|
154 | |
---|
155 | .F.i: |
---|
156 | $(RM) $@ |
---|
157 | $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.F > $@ |
---|
158 | mv $*.i $(DEVTOP)/pick/$*.f90 |
---|
159 | cp $*.F $(DEVTOP)/pick |
---|
160 | |
---|
161 | .F.o: |
---|
162 | $(RM) $@ |
---|
163 | $(SED_FTN) $*.F > $*.b |
---|
164 | $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.b > $*.f90 |
---|
165 | $(RM) $*.b |
---|
166 | $(FC) -o $@ -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90 |
---|
167 | |
---|
168 | .F.f90: |
---|
169 | $(RM) $@ |
---|
170 | $(SED_FTN) $*.F > $*.b |
---|
171 | $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.b > $@ |
---|
172 | $(RM) $*.b |
---|
173 | |
---|
174 | .f90.o: |
---|
175 | $(RM) $@ |
---|
176 | $(FC) -o $@ -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90 |
---|
177 | |
---|
178 | .c.o: |
---|
179 | $(RM) $@ |
---|
180 | $(CC) -o $@ -c $(CFLAGS) $*.c |
---|
181 | |
---|