1 | # svn $Id: Linux-g95.mk 47 2007-05-08 19:35:07Z arango $
|
---|
2 | #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
---|
3 | # Copyright (c) 2002-2007 The ROMS/TOMS Group :::
|
---|
4 | # Licensed under a MIT/X style license :::
|
---|
5 | # See License_ROMS.txt :::
|
---|
6 | #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
---|
7 | #
|
---|
8 | # Include file for GNU G95 compiler on Linux
|
---|
9 | # -------------------------------------------------------------------------
|
---|
10 | #
|
---|
11 | # ARPACK_LIBDIR ARPACK libary directory
|
---|
12 | # FC Name of the fortran compiler to use
|
---|
13 | # FFLAGS Flags to the fortran compiler
|
---|
14 | # CPP Name of the C-preprocessor
|
---|
15 | # CPPFLAGS Flags to the C-preprocessor
|
---|
16 | # CLEAN Name of cleaning executable after C-preprocessing
|
---|
17 | # NETCDF_INCDIR NetCDF include directory
|
---|
18 | # NETCDF_LIBDIR NetCDF libary directory
|
---|
19 | # LD Program to load the objects into an executable
|
---|
20 | # LDFLAGS Flags to the loader
|
---|
21 | # RANLIB Name of ranlib command
|
---|
22 | # MDEPFLAGS Flags for sfmakedepend (-s if you keep .f files)
|
---|
23 | #
|
---|
24 | # First the defaults
|
---|
25 | #
|
---|
26 | FC := g95
|
---|
27 | FFLAGS := -fno-second-underscore
|
---|
28 | CPP := /usr/bin/cpp
|
---|
29 | CPPFLAGS := -P -traditional
|
---|
30 | LD := $(FC)
|
---|
31 | LDFLAGS :=
|
---|
32 | AR := ar
|
---|
33 | ARFLAGS := -r
|
---|
34 | MKDIR := mkdir -p
|
---|
35 | RM := rm -f
|
---|
36 | RANLIB := ranlib
|
---|
37 | PERL := perl
|
---|
38 | TEST := test
|
---|
39 |
|
---|
40 | MDEPFLAGS := --cpp --fext=f90 --file=- --objdir=$(SCRATCH_DIR)
|
---|
41 |
|
---|
42 | #
|
---|
43 | # Library locations, can be overridden by environment variables.
|
---|
44 | #
|
---|
45 |
|
---|
46 | MCT_LIBDIR ?= /usr/local/mct/lib
|
---|
47 | # NETCDF_INCDIR ?= /opt/gnusoft/netcdf/include
|
---|
48 | NETCDF_INCDIR ?= /opt/g95soft/netcdf/include
|
---|
49 | # NETCDF_LIBDIR ?= /opt/gnusoft/netcdf/lib
|
---|
50 | NETCDF_LIBDIR ?= /opt/g95soft/netcdf/lib
|
---|
51 |
|
---|
52 | CPPFLAGS += -I$(NETCDF_INCDIR)
|
---|
53 | LIBS := -L$(NETCDF_LIBDIR) -lnetcdf
|
---|
54 |
|
---|
55 | ifdef USE_ARPACK
|
---|
56 | ifdef USE_MPI
|
---|
57 | PARPACK_LIBDIR ?= /usr/local/lib
|
---|
58 | LIBS += -L$(PARPACK_LIBDIR) -lparpack
|
---|
59 | endif
|
---|
60 | ARPACK_LIBDIR ?= /usr/local/lib
|
---|
61 | LIBS += -L$(ARPACK_LIBDIR) -larpack
|
---|
62 | endif
|
---|
63 |
|
---|
64 | ifdef USE_MPI
|
---|
65 | CPPFLAGS += -DMPI
|
---|
66 | ifdef USE_MPIF90
|
---|
67 | # FC := /opt/gnusoft/mpich/bin/mpif90
|
---|
68 | FC := /opt/g95soft/mpich2/bin/mpif90
|
---|
69 | LD := $(FC)
|
---|
70 | else
|
---|
71 | LIBS += -lfmpi-pgi -lmpi-pgi
|
---|
72 | endif
|
---|
73 | endif
|
---|
74 |
|
---|
75 | ifdef USE_OpenMP
|
---|
76 | CPPFLAGS += -D_OPENMP
|
---|
77 | endif
|
---|
78 |
|
---|
79 | ifdef USE_DEBUG
|
---|
80 | FFLAGS += -g -fbounds-check -ftrace=full
|
---|
81 | else
|
---|
82 | FFLAGS += -O3 -ffast-math
|
---|
83 | endif
|
---|
84 |
|
---|
85 | ifdef SWAN_COUPLE
|
---|
86 | FFLAGS += -I/usr/local/mct/include
|
---|
87 | LIBS += -L$(MCT_LIBDIR) -lmct -lmpeu
|
---|
88 | endif
|
---|
89 |
|
---|
90 | #
|
---|
91 | # Set free form format in source files to allow long string for
|
---|
92 | # local directory and compilation flags inside the code.
|
---|
93 | #
|
---|
94 |
|
---|
95 | $(SCRATCH_DIR)/mod_ncparam.o: FFLAGS += -ffree-form
|
---|
96 | $(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form
|
---|
97 |
|
---|
98 | #
|
---|
99 | # Supress free format in SWAN source files since there are comments
|
---|
100 | # beyond column 72.
|
---|
101 | #
|
---|
102 |
|
---|
103 | ifdef SWAN_COUPLE
|
---|
104 |
|
---|
105 | $(SCRATCH_DIR)/ocpcre.o: FFLAGS += -ffixed-form
|
---|
106 | $(SCRATCH_DIR)/ocpids.o: FFLAGS += -ffixed-form
|
---|
107 | $(SCRATCH_DIR)/ocpmix.o: FFLAGS += -ffixed-form
|
---|
108 | $(SCRATCH_DIR)/swancom1.o: FFLAGS += -ffixed-form
|
---|
109 | $(SCRATCH_DIR)/swancom2.o: FFLAGS += -ffixed-form
|
---|
110 | $(SCRATCH_DIR)/swancom3.o: FFLAGS += -ffixed-form
|
---|
111 | $(SCRATCH_DIR)/swancom4.o: FFLAGS += -ffixed-form
|
---|
112 | $(SCRATCH_DIR)/swancom5.o: FFLAGS += -ffixed-form
|
---|
113 | $(SCRATCH_DIR)/swanmain.o: FFLAGS += -ffixed-form
|
---|
114 | $(SCRATCH_DIR)/swanout1.o: FFLAGS += -ffixed-form
|
---|
115 | $(SCRATCH_DIR)/swanout2.o: FFLAGS += -ffixed-form
|
---|
116 | $(SCRATCH_DIR)/swanparll.o: FFLAGS += -ffixed-form
|
---|
117 | $(SCRATCH_DIR)/swanpre1.o: FFLAGS += -ffixed-form
|
---|
118 | $(SCRATCH_DIR)/swanpre2.o: FFLAGS += -ffixed-form
|
---|
119 | $(SCRATCH_DIR)/swanser.o: FFLAGS += -ffixed-form
|
---|
120 | $(SCRATCH_DIR)/swmod1.o: FFLAGS += -ffixed-form
|
---|
121 | $(SCRATCH_DIR)/swmod2.o: FFLAGS += -ffixed-form
|
---|
122 | $(SCRATCH_DIR)/swmod3.o: FFLAGS += -ffixed-form
|
---|
123 |
|
---|
124 | endif
|
---|