source: trunk/WRF.COMMON/WRFV3/arch/postamble_new @ 3553

Last change on this file since 3553 was 2775, checked in by aslmd, 2 years ago

modified the default configuration in WRFV3 arch so that executing configure creates a configure.wrf that is compliant with planetary applications directly without the need to patch. a by-product is that there no longer a weird mix of NETCDF env variable and harcoded stuff when patching, from now on setting the NETCDF environment variable is enough (as usually in WRF). the link to compiled LMDZ physics library is done through the libo_links folder that contains only ciclad right now but can be populated with configurations. for the moment the changes to default is only applicable to ifort cases but it is easy to broaden this to other cases by working on arch/configure_new.defaults.

File size: 7.6 KB
Line 
1######################
2
3ARCHFLAGS       =    $(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)
21CFLAGS          =    $(CFLAGS_LOCAL) CONFIGURE_DMPARALLEL CONFIGURE_STUBMPI
22FCFLAGS         =    $(FCOPTIM) $(FCBASEOPTS) $(OMP)
23ESMF_LIB_FLAGS  =    ESMFLIBFLAG
24ESMF_IO_LIB     =    ESMFIOLIB
25ESMF_IO_LIB_EXT =    ESMFIOEXTLIB
26INCLUDE_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
39REGISTRY        =    Registry
40
41LIB_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
52LIB_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
57LIB             =    $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL)
58LDFLAGS         =    $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL) CONFIGURE_LDFLAGS
59ENVCOMPDEFS     =    CONFIGURE_COMPILEFLAGS
60CPPFLAGS        =    $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG) CONFIGURE_COMMS_INCLUDE
61NETCDFPATH      =    CONFIGURE_NETCDF_PATH
62PNETCDFPATH     =    CONFIGURE_PNETCDF_PATH
63
64bundled:  wrf_ioapi_includes wrfio_grib_share wrfio_grib1 wrfio_int esmf_time fftpack
65external:  CONFIGURE_WRFIO_NF CONFIGURE_WRFIO_PNF CONFIGURE_WRFIO_GRIB2 CONFIGURE_COMMS_EXTERNAL $(ESMF_TARGET)
66
67######################
68externals: bundled external
69
70gen_comms_serial :
71        ( /bin/rm -f $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c )
72
73module_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
76gen_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
81module_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
85wrfio_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
91wrfio_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
96wrfio_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
101wrfio_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
106wrfio_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
113wrfio_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
119esmf_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
124fftpack :
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
137LN      =       ln -sf
138MAKE    =       make -i -r
139RM      =       rm -f
140
141
142# These sub-directory builds are identical across all architectures
143
144wrf_ioapi_includes :
145        ( cd $(WRF_SRC_ROOT_DIR)/external/ioapi_share ; \
146          $(MAKE) NATIVE_RWORDSIZE="$(NATIVE_RWORDSIZE)" RWORDSIZE="$(RWORDSIZE)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
147
148wrfio_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
Note: See TracBrowser for help on using the repository browser.