1 | #makefile to build a wrf_io with netCDF |
---|
2 | |
---|
3 | OBJSL = wrf_io.o field_routines.o module_wrfsi_static.o |
---|
4 | OBJS = $(OBJSL) |
---|
5 | CODE = ext_ncd_get_dom_ti.code ext_ncd_get_var_td.code ext_ncd_get_var_ti.code ext_ncd_put_dom_ti.code ext_ncd_put_var_td.code ext_ncd_put_var_ti.code transpose.code |
---|
6 | FFLAGS = $(FCFLAGS) -I$(NETCDFPATH)/include -I../ioapi_share |
---|
7 | LIBS = -L$(NETCDFPATH)/lib -lnetcdf |
---|
8 | CPP1 = $(CPP) -P $(TRADFLAG) |
---|
9 | M4 = m4 -Uinclude -Uindex -Ulen |
---|
10 | AR = ar |
---|
11 | |
---|
12 | .SUFFIXES: .F90 .f .o .code |
---|
13 | |
---|
14 | all : libwrfio_nf.a |
---|
15 | |
---|
16 | libwrfio_nf.a: $(OBJS) $(CODE) |
---|
17 | /bin/rm -f libwrfio_nf.a |
---|
18 | $(AR) cr libwrfio_nf.a $(OBJSL) |
---|
19 | $(RANLIB) libwrfio_nf.a |
---|
20 | |
---|
21 | wrf_io.o: wrf_io.F90 $(CODE) |
---|
22 | $(CPP1) -I../ioapi_share wrf_io.F90 | $(M4) - > wrf_io.f |
---|
23 | $(FC) $(FFLAGS) -c wrf_io.f |
---|
24 | |
---|
25 | module_wrfsi_static.o: module_wrfsi_static.F90 |
---|
26 | $(CPP1) -I../ioapi_share module_wrfsi_static.F90 > module_wrfsi_static.f |
---|
27 | $(FC) $(FFLAGS) -c module_wrfsi_static.f |
---|
28 | |
---|
29 | diffwrf: diffwrf.F90 |
---|
30 | $(CPP1) -I$(NETCDFPATH)/include -I../ioapi_share diffwrf.F90 > diffwrf.f |
---|
31 | $(FC) -c $(FFLAGS) diffwrf.f |
---|
32 | @if [ \( -f ../../frame/wrf_debug.o \) -a \( -f ../../frame/module_wrf_error.o \) -a \( -f $(ESMF_MOD_DEPENDENCE) \) ] ; then \ |
---|
33 | echo "diffwrf io_netcdf is being built now. "; \ |
---|
34 | $(FC) $(FFLAGS) $(LDFLAGS) -o diffwrf diffwrf.o $(OBJSL) $(LIBS) ../../frame/wrf_debug.o ../../frame/module_wrf_error.o $(ESMF_IO_LIB_EXT) ;\ |
---|
35 | else \ |
---|
36 | echo "***************************************************************************** " ; \ |
---|
37 | echo "*** Rerun compile to make diffwrf in external/io_netcdf directory *** " ; \ |
---|
38 | echo "***************************************************************************** " ; \ |
---|
39 | fi |
---|
40 | |
---|
41 | field_routines.o: field_routines.F90 |
---|
42 | $(CPP1) -I../ioapi_share field_routines.F90 > field_routines.f |
---|
43 | $(FC) $(FFLAGS) -c field_routines.f |
---|
44 | |
---|
45 | superclean: |
---|
46 | /bin/rm -f *.f *.o testWRFWrite testWRFRead \ |
---|
47 | *.mod libwrfio_nf.a diffwrf |
---|