-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.solaris_sunstudio
85 lines (69 loc) · 3.06 KB
/
Makefile.solaris_sunstudio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Makefile for the 3D KPP boundary-layer ocean model
# Written by Nicholas P. Klingaman
# University of Reading, Department of Meteorology and NCAS-Climate
# Substantially revised on 03 Sept. 2009 to remove separate dot files for each target
# NOTE: You *must* run <make clean> if you wish to recompile the model for another target
# (e.g., if you have compiled for OASIS2 and wish to recompile for OASIS3, you must run <make clean> first,
# then run <make oasis3_coupled>.)
# Fortran compiler
F90=gfortran
# C Preprocessor
CPP=cpp
# Flags for the Fortran compiler
F90_FLAGS=-x f77-cpp-input -O3 -fdefault-real-8 -ffixed-line-length-72 -I.
# Extra flag required to pass CPP macros through the Fortran compiler - currently required for only XLF.
F90_CPP_FLAG=
# Oasis 2 static library
OASIS2_LIB=/opt/src/oasis_2.4.1_pathscale/lib/clim/src_MPI1/climmpi1.a
# Oasis 3 static library
OASIS3_LIB=/opt/src/oasis3_2-5/prism/macosx_gfortran/lib/libclim.MPI1.a
# NetCDF dynamic libraries
NCDF_LIB=-L/opt/lib/netcdf-gfortran/lib -L/opt/lib -lnetcdf -lnetcdff
# NetCDF include files
NCDF_INC=-I/opt/lib/netcdf-gfortran/include
# MPI (or OpenMPI) include files
MPI_INC=-I/opt/include
# MPI dynamic libraries
MPI_LIB=-L/opt/lib/openmpi -lmpi -lmpi_f77
# CFS dynamic libraries
CFS_LIB=
# Name of the KPP executable
EXECUTABLE=KPP_ocean
# -- No user modifications beyond this point --
FORCED_FILES = steves_3D_ocn.f steves_fluxes.f subs1D.f ncdf_in.f ncdf_out.f \
ocn.f 3D_netcdf.f init.f kpp.f vmix.f
OASIS2_COUPLED_FILES = $(FORCED_FILES) couple_io_oasis2.f init_oasis2.f
OASIS3_COUPLED_FILES = $(OASIS2_COUPLED_FILES)
CFS_COUPLED_FILES = $(FORCED_FILES) couple_io_cfs.f
FORCED_OBJS = $(FORCED_FILES:.f=.o)
OASIS2_COUPLED_OBJS = $(OASIS2_COUPLED_FILES:.f=.o)
OASIS3_COUPLED_OBJS = $(OASIS3_COUPLED_FILES:.f=.o)
CFS_COUPLED_OBJS = $(CFS_COUPLED_FILES:.f=.o)
GFS_FORCED_OBJS = $(FORCED_OBJS)
FORCED_LINK = $(F90) $(FORCED_OBJS) -o ${EXECUTABLE} ${NCDF_INC} ${NCDF_LIB}
OASIS2_COUPLED_LINK = $(F90) $(OASIS2_COUPLED_OBJS) ${OASIS2_LIB} -o ${EXECUTABLE} ${MPI_LIB} ${MPI_INC} ${NCDF_INC} ${NCDF_LIB}
OASIS3_COUPLED_LINK = $(F90) $(OASIS3_COUPLED_OBJS) ${OASIS3_LIB} -o ${EXECUTABLE} ${MPI_LIB} ${MPI_INC} ${NCDF_INC} ${NCDF_LIB}
CFS_COUPLED_LINK = $(F90) $(CFS_COUPLED_OBJS) -o $(EXECUTABLE) $(CFS_LIB) $(NCDF_INC) $(NCDF_LIB)
GFS_FORCED_LINK = $(F90) $(GFS_FORCED_OBJS) -o $(EXECUTABLE) $(CFS_LIB) $(NCDF_INC) $(NCDF_LIB)
.SUFFIXES:
.SUFFIXES: .f .o
.f.o :
$(F90) $(F90_FLAGS) $(CPP_FLAGS) $(NCDF_INC) $(MPI_INC) -c $< -o ${<:.f=.o}
forced : $(FORCED_OBJS)
$(FORCED_LINK)
cfs_coupled : CPP_FLAGS=$(F90_CPP_FLAG)-DCFS $(F90_CPP_FLAG)-DCOUPLE
cfs_coupled : $(CFS_COUPLED_OBJS)
$(CFS_COUPLED_LINK)
gfs_forced : CPP_FLAGS=$(F90_CPP_FLAG)-DCFS
gfs_forced : $(GFS_FORCED_OBJS)
$(GFS_FORCED_LINK)
oasis2_coupled : CPP_FLAGS=$(F90_CPP_FLAG)-DOASIS2 $(F90_CPP_FLAG)-DCOUPLE
oasis2_coupled : $(OASIS2_COUPLED_OBJS)
$(OASIS2_COUPLED_LINK)
oasis3_coupled : CPP_FLAGS=$(F90_CPP_FLAG)-DOASIS3 $(F90_CPP_FLAG)-DCOUPLE
oasis3_coupled : $(OASIS3_COUPLED_OBJS)
$(OASIS3_COUPLED_LINK)
clean :
rm -rf *.o $(EXECUTABLE)
obj_clean :
rm -rf *.o