6 ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) \
11 CONFIGURE_NETCDF_FLAG \
12 CONFIGURE_NETCDFPAR_FLAG \
13 CONFIGURE_PNETCDF_FLAG \
14 CONFIGURE_ADIOS2_FLAG \
16 CONFIGURE_GRIB2_FLAG \
17 CONFIGURE_RTTOV_FLAG \
20 CONFIGURE_CLOUDCV_FLAG \
21 CONFIGURE_4DVAR_FLAG \
22 CONFIGURE_TERRAIN_AND_LANDUSE \
23 CONFIGURE_WAVELET_FLAG \
31 -DBUILD_RRTMG_FAST=0 \
34 -DSHOW_ALL_VARS_USED=0 \
35 -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) \
36 -DMAX_DOMAINS_F=$(MAX_DOMAINS) \
37 -DMAX_HISTORY=$(MAX_HISTORY) \
38 -DNMM_NEST=$(WRF_NMM_NEST)
39 CFLAGS = $(CFLAGS_LOCAL) CONFIGURE_DMPARALLEL CONFIGURE_STUBMPI \
40 CONFIGURE_TERRAIN_AND_LANDUSE \
41 -DMAX_HISTORY=$(MAX_HISTORY) CONFIGURE_NMM_CORE
42 FCFLAGS = $(FCOPTIM) $(FCBASEOPTS)
43 ESMF_LIB_FLAGS = ESMFLIBFLAG
44 # ESMF 5 -- these are defined in esmf.mk, included above
45 #NOWIN ESMF_IO_LIB = ESMFIOLIB
46 ESMF_IO_LIB_EXT = ESMFIOEXTLIB
47 INCLUDE_MODULES = $(MODULE_SRCH_FLAG) \
48 $(ESMF_MOD_INC) $(ESMF_LIB_FLAGS) \
49 -I$(WRF_SRC_ROOT_DIR)/main \
50 -I$(WRF_SRC_ROOT_DIR)/external/io_netcdf \
51 -I$(WRF_SRC_ROOT_DIR)/external/io_int \
52 -I$(WRF_SRC_ROOT_DIR)/frame \
53 -I$(WRF_SRC_ROOT_DIR)/share \
54 -I$(WRF_SRC_ROOT_DIR)/phys \
55 -I$(WRF_SRC_ROOT_DIR)/wrftladj \
56 -I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \
57 -I$(NETCDFPATH)/include \
58 CONFIGURE_RTTOV_INC CONFIGURE_CTSM_INC
60 CC_TOOLS_CFLAGS = CONFIGURE_NMM_CORE
62 LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL) $(LIB_WRF_HYDRO) CONFIGURE_CTSM_LIB
63 LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL) CONFIGURE_LDFLAGS
64 ENVCOMPDEFS = CONFIGURE_COMPILEFLAGS
65 CPPFLAGS = $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG) CONFIGURE_COMMS_INCLUDE
66 NETCDFPATH = CONFIGURE_NETCDF_PATH
67 HDF5PATH = CONFIGURE_HDF5_PATH
68 WRFPLUSPATH = CONFIGURE_WRFPLUS_PATH
69 RTTOVPATH = CONFIGURE_RTTOV_PATH
70 PNETCDFPATH = CONFIGURE_PNETCDF_PATH
71 ADIOS2PATH = CONFIGURE_ADIOS2_PATH
73 bundled: io_only CONFIGURE_ATMOCN
74 external: io_only CONFIGURE_COMMS_EXTERNAL $(ESMF_TARGET)
75 io_only: esmf_time CONFIGURE_WRFIO_NF CONFIGURE_WRFIO_NFPAR CONFIGURE_WRFIO_PNF CONFIGURE_WRFIO_ADIOS2 CONFIGURE_WRFIO_GRIB2 \
76 wrf_ioapi_includes wrfio_grib_share wrfio_grib1 wrfio_int fftpack
79 ######################
80 externals: io_only bundled external
83 ( /bin/rm -f $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c )
86 ( if [ ! -e module_dm.F ] ; then /bin/cp module_dm_warning module_dm.F ; cat module_dm_stubs.F >> module_dm.F ; fi )
89 ( if [ ! -e $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ] ; then \
90 /bin/cp $(WRF_SRC_ROOT_DIR)/tools/gen_comms_warning $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ; \
91 cat $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/gen_comms.c >> $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ; fi )
94 ( if [ ! -e module_dm.F ] ; then /bin/cp module_dm_warning module_dm.F ; \
95 cat $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/module_dm.F >> module_dm.F ; fi )
98 ( cd $(WRF_SRC_ROOT_DIR)/external/io_netcdf ; \
99 make $(J) NETCDFPATH="$(NETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
100 CC="$(SCC)" CFLAGS="$(CFLAGS)" NETCDF4_DEP_LIB="$(NETCDF4_DEP_LIB)" \
101 FC="$(SFC) $(PROMOTION) $(OMP) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
104 ( cd $(WRF_SRC_ROOT_DIR)/external/io_netcdfpar ; \
105 make $(J) NETCDFPARPATH="$(NETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP) $(ARCHFLAGS)" \
106 NETCDF4_DEP_LIB="$(NETCDF4_DEP_LIB)" \
107 FC="$(FC) $(PROMOTION) $(OMP) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
110 ( cd $(WRF_SRC_ROOT_DIR)/external/io_pnetcdf ; \
111 make $(J) NETCDFPATH="$(PNETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP) $(ARCHFLAGS)" \
112 FC="$(FC) $(PROMOTION) $(OMP) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
115 ( cd $(WRF_SRC_ROOT_DIR)/external/io_adios2 ; \
116 make $(J) ADIOS2="$(ADIOS2PATH)" RANLIB="$(RANLIB)" CPP="$(CPP) $(ARCHFLAGS)" \
117 FC="$(FC) $(PROMOTION) $(OMP) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
120 ( cd $(WRF_SRC_ROOT_DIR)/external/io_grib_share ; \
121 make $(J) CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
122 FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" archive)
125 ( cd $(WRF_SRC_ROOT_DIR)/external/io_grib1 ; \
126 make $(J) CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
127 FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" archive)
130 ( cd $(WRF_SRC_ROOT_DIR)/external/io_grib2 ; \
131 make $(J) CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" \
133 FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="-traditional" AR="$(AR)" ARFLAGS="$(ARFLAGS)" \
134 FIXED="$(FORMAT_FIXED)" archive)
137 ( cd $(WRF_SRC_ROOT_DIR)/external/io_int ; \
138 make $(J) CC="$(CC)" CFLAGS_LOCAL="$(CFLAGS_LOCAL)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
139 FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) $(OMP)" FGREP="$(FGREP)" \
140 TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ARCHFLAGS="$(ARCHFLAGS)" all )
143 ( cd $(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 ; \
144 make $(J) FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" \
145 CPP="$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc -I. $(ARCHFLAGS) $(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
148 ( cd $(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5 ; \
149 make $(J) FC="$(SFC)" FFLAGS="$(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" AR="$(AR)" \
150 ARFLAGS="$(ARFLAGS)" CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" RM="$(RM)" )
153 ( cd $(WRF_SRC_ROOT_DIR)/external/atm_ocn ; \
154 make $(J) CC="$(SCC)" CFLAGS="$(CFLAGS) " RM="$(RM)" RANLIB="$(RANLIB)" \
155 CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" \
156 FC="$(DM_FC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="-traditional" AR="$(AR)" ARFLAGS="$(ARFLAGS)" \
157 FIXED="$(FORMAT_FIXED)" )
159 $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a :
160 ( cd $(WRF_SRC_ROOT_DIR)/external/RSL_LITE ; make $(J) CC="$(CC) $(CFLAGS)" \
161 FC="$(FC) $(FCFLAGS) $(OMP) $(PROMOTION) $(BYTESWAPIO)" \
162 CPP="$(CPP) -I. $(ARCHFLAGS) $(OMPCPP) $(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ;\
163 $(RANLIB) $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a )
165 ######################
166 # Macros, these should be generic for all machines
173 # These sub-directory builds are identical across all architectures
176 ( cd $(WRF_SRC_ROOT_DIR)/external/ioapi_share ; \
177 $(MAKE) NATIVE_RWORDSIZE="$(NATIVE_RWORDSIZE)" RWORDSIZE="$(RWORDSIZE)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
180 ( cd $(WRF_SRC_ROOT_DIR)/external/io_esmf ; \
181 make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) $(ESMF_MOD_INC)" \
182 RANLIB="$(RANLIB)" CPP="$(CPP) $(POUND_DEF) " AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
184 # There is probably no reason to modify these rules
188 sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F > $*.G
189 $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.G > $*.i
190 mv $*.i $(DEVTOP)/pick/$*.f90
191 cp $*.F $(DEVTOP)/pick
195 sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F > $*.G
196 $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $*.G > $*.bb
197 $(SED_FTN) $*.bb | $(CPP) $(TRADFLAG) > $*.f90
199 @ if echo $(ARCHFLAGS) | $(FGREP) 'DVAR4D'; then \
200 echo COMPILING $*.F for 4DVAR ; \
201 $(WRF_SRC_ROOT_DIR)/var/build/da_name_space.pl $*.f90 > $*.f90.tmp ; \
202 mv $*.f90.tmp $*.f90 ; \
204 $(FC) -o $@ -c $(FCFLAGS) $(OMP) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90
208 sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F90 > $*.G
209 $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $*.G > $*.bb
210 $(SED_FTN) $*.bb | $(CPP) $(TRADFLAG) > $*.tmp.f90
212 $(FC) -o $@ -c $(FCFLAGS) $(OMP) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.tmp.f90
216 sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F > $*.G
217 $(SED_FTN) $*.G > $*.H
218 $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.H > $@
223 $(FC) -o $@ -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90
225 setfeenv.o : setfeenv.c
227 $(CCOMP) -o $@ -c $(CFLAGS) $(OMPCC) $*.c
231 $(CC) -o $@ -c $(CFLAGS) $*.c