1 |
# $Header: $ |
2 |
# $Name: $ |
3 |
#*********************************************************************** |
4 |
# Makefile for the off-line large scale optimization with m1qn3 |
5 |
# in reverse communication mode. |
6 |
# |
7 |
# started: Martin Losch Martin.Losch@awi.de 24-Apr-2012 |
8 |
# |
9 |
# changed: |
10 |
# |
11 |
#*********************************************************************** |
12 |
|
13 |
MAKEFILE=Makefile |
14 |
# The optimization routines. |
15 |
SRC = optim_main.F \ |
16 |
optim_sub.F \ |
17 |
optim_readparms.F \ |
18 |
optim_readdata.F \ |
19 |
optim_writedata.F \ |
20 |
optim_store_m1qn3.F \ |
21 |
m1qn3_offline.F \ |
22 |
ddot.F |
23 |
|
24 |
EXEDIR = . |
25 |
|
26 |
# default suffix for pre-processed fortran files is f |
27 |
SUFF=f |
28 |
# for case-insensitive file systems you may need this |
29 |
# SUFF=for |
30 |
# Location of cpp preprocessor |
31 |
# default is (Linux) |
32 |
CPP = cat $< | /lib/cpp -P -traditional |
33 |
# Mac OS X |
34 |
# CPP = cat $< | /usr/bin/cpp -P -traditional |
35 |
# on SUNOS |
36 |
# CPP = cat $< | /usr/ccs/lib/cpp |
37 |
|
38 |
INCLUDEDIRS = -I. \ |
39 |
-I/uv/home1/mlosch/MITgcm/pig1km/buildad |
40 |
# -I../verification/natl_box_adjoint/build |
41 |
|
42 |
LIBDIRS = |
43 |
LIBS = |
44 |
|
45 |
EXECUTABLE = $(EXEDIR)/optim.x |
46 |
|
47 |
# The cpp flags. |
48 |
CPPFLAGS = -DREAL_BYTE=4 \ |
49 |
-DMAX_INDEPEND=1000000 \ |
50 |
-D_RL='double precision' \ |
51 |
-D_RS='double precision' |
52 |
|
53 |
# -DMAX_INDEPEND=293570968 \ |
54 |
# FORTRAN compiler and its flags. |
55 |
# default is gfortran |
56 |
FC = gfortran |
57 |
FFLAGS = -fconvert=big-endian |
58 |
|
59 |
# ifort compilers |
60 |
#FC = ifort |
61 |
#FFLAGS = -mieee-fp -132 -r8 -i4 -W0 -WB -CB -fpe0 -traceback -convert big_endian -assume byterecl |
62 |
|
63 |
# SGI o3k IRIX64 |
64 |
#FC = f77 |
65 |
#FFLAGS = -extend_source -bytereclen -mips4 -r8 -static |
66 |
|
67 |
# AER cluster |
68 |
#FC = /opt/mpich/bin/mpif77 |
69 |
#FFLAGS = -byteswapio -r8 -Mnodclchk -Mextend |
70 |
|
71 |
SMALLF = $(SRC:.F=.$(SUFF)) |
72 |
OBJECTS = $(SRC:.F=.o) |
73 |
|
74 |
.SUFFIXES: .o .$(SUFF) .F |
75 |
|
76 |
all: small_f $(EXECUTABLE) |
77 |
$(EXECUTABLE): $(OBJECTS) |
78 |
$(FC) -o $@ $(FFLAGS) $(OBJECTS) $(LIBDIRS) $(LIBS) |
79 |
|
80 |
small_f: $(SMALLF) |
81 |
|
82 |
depend: |
83 |
makedepend -o .f $(INCLUDEDIRS) $(SRC) |
84 |
|
85 |
# The normal chain of rules is ( .F - .f - .o ) |
86 |
.F.f: |
87 |
$(CPP) $(CPPFLAGS) $(INCLUDEDIRS) > $@ |
88 |
.F.for: |
89 |
$(CPP) $(CPPFLAGS) $(INCLUDEDIRS) > $@ |
90 |
.f.o: |
91 |
$(FC) $(FFLAGS) -c $< |
92 |
.for.o: |
93 |
$(FC) $(FFLAGS) -c $< |
94 |
|
95 |
# Cleaning options. |
96 |
clean: |
97 |
-rm -f *.o *.f *.for |
98 |
|
99 |
Clean: |
100 |
@make -f $(MAKEFILE) clean |
101 |
-rm -f OPWARM.* |
102 |
|
103 |
CLEAN: |
104 |
@make -f $(MAKEFILE) Clean |
105 |
-rm -f $(EXECUTABLE) |
106 |
|
107 |
# DO NOT DELETE |