1 | # |
---|
2 | include ../../util/make_dir/make.inc |
---|
3 | LIBPSMILE = $(ARCHDIR)/lib/libpsmile.${CHAN}.a $(ARCHDIR)/lib/libmct.a $(ARCHDIR)/lib/libmpeu.a $(ARCHDIR)/lib/libscrip.a |
---|
4 | # |
---|
5 | ##### User configurable options ##### |
---|
6 | # |
---|
7 | # CPP keys for type of decomposition for ocean (_M1) and for atmos (_M2) |
---|
8 | # DECOMP_APPLE for 1D decomposition, DECOMP_BOX for 2D decomposition |
---|
9 | CPPKEYDECOMP_M1=DECOMP_APPLE |
---|
10 | CPPKEYDECOMP_M2=DECOMP_APPLE |
---|
11 | # |
---|
12 | ### End User configurable options ### |
---|
13 | # |
---|
14 | CPPLOCAL_M1 = -D${CPPKEYDECOMP_M1} |
---|
15 | CPPLOCAL_M2 = -D${CPPKEYDECOMP_M2} |
---|
16 | # |
---|
17 | OBJ_M1 = read_grid.o def_parallel_decomposition.o |
---|
18 | OBJ_M2 = read_grid.o def_parallel_decomposition_m2.o |
---|
19 | #------------------------------------------------------------------------------- |
---|
20 | # General rules |
---|
21 | #------------------------------------------------------------------------------- |
---|
22 | # |
---|
23 | default: all |
---|
24 | # |
---|
25 | all: oasis3_psmile ocean atmos |
---|
26 | # |
---|
27 | # Compile and link libaries |
---|
28 | oasis3_psmile: |
---|
29 | (cd ../../util/make_dir ; $(MAKE) oasis3_psmile -f TopMakefileOasis3) |
---|
30 | # |
---|
31 | # |
---|
32 | #------------------------------------------------------------------------------- |
---|
33 | # Rules for executables |
---|
34 | #------------------------------------------------------------------------------- |
---|
35 | # |
---|
36 | ocean: $(OBJ_M1) ocean.o $(LIBPSMILE) Makefile |
---|
37 | $(LD) $(LDFLAGS) -o $@ $(OBJ_M1) ocean.o $(LIBPSMILE) $(FLIBS) $(NETCDF_LIBRARY) |
---|
38 | atmos: $(OBJ_M2) atmos.o $(LIBPSMILE) Makefile |
---|
39 | $(LD) $(LDFLAGS) -o $@ $(OBJ_M2) atmos.o $(LIBPSMILE) $(FLIBS) $(NETCDF_LIBRARY) |
---|
40 | # |
---|
41 | #------------------------------------------------------------------------------- |
---|
42 | # Rules for compilation |
---|
43 | #------------------------------------------------------------------------------- |
---|
44 | # |
---|
45 | read_grid.o : read_grid.F90 |
---|
46 | $(F90) $(F90FLAGS) -c read_grid.F90 |
---|
47 | def_parallel_decomposition.o : def_parallel_decomposition.F90 |
---|
48 | $(F90) $(F90FLAGS) $(CPPLOCAL_M1) -c def_parallel_decomposition.F90 |
---|
49 | def_parallel_decomposition_m2.o : def_parallel_decomposition.F90 |
---|
50 | $(F90) $(F90FLAGS) $(CPPLOCAL_M2) -o def_parallel_decomposition_m2.o -c def_parallel_decomposition.F90 |
---|
51 | ocean.o : ocean.F90 Makefile |
---|
52 | $(F90) $(F90FLAGS) $(CPPLOCAL_M1) -c ocean.F90 |
---|
53 | atmos.o : atmos.F90 Makefile |
---|
54 | $(F90) $(F90FLAGS) $(CPPLOCAL_M2) -c atmos.F90 |
---|
55 | # |
---|
56 | #------------------------------------------------------------------------------- |
---|
57 | # Utilities |
---|
58 | #------------------------------------------------------------------------------- |
---|
59 | # |
---|
60 | help: |
---|
61 | more Make.help |
---|
62 | # |
---|
63 | # Clean directory |
---|
64 | # |
---|
65 | clean: |
---|
66 | -rm -f *.o *.mod *.MOD ocean atmos |
---|
67 | -rm -f i.*.F90 *.L |
---|
68 | -rm -f core core.* |
---|
69 | # |
---|
70 | # Make sure to recompile everything |
---|
71 | # |
---|
72 | realclean: clean remove |
---|
73 | remove: |
---|
74 | (cd ../../util/make_dir ; $(MAKE) realclean -f TopMakefileOasis3) |
---|