Package: oasis3 / 3.mct+dfsg.121022-13

make-debian.patch Patch series | download
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
Index: oasis3-3.mct+dfsg.121022/util/make_dir/make.debian
===================================================================
--- /dev/null
+++ oasis3-3.mct+dfsg.121022/util/make_dir/make.debian
@@ -0,0 +1,69 @@
+#
+# Include file for OASIS3 Makefile for a Linux system using 
+# Portland Group Fortran Compiler and MPICH
+#
+###############################################################################
+#
+# CHAN	: communication technique used in OASIS3 (MPI1/MPI2/NONE)
+CHAN            = MPI1
+#
+# Paths for libraries, object files and binaries
+#
+# COUPLE	: path for oasis3-mct main directory
+COUPLE          = $(TOP)
+#
+# ARCHDIR       : directory created when compiling
+ARCHDIR         = $(COUPLE)/build
+#
+# MPI library
+MPIDIR      = /usr
+MPIBIN      = $(MPIDIR)/bin
+MPI_INCLUDE = $(MPIDIR)/include
+MPILIB      = -L$(MPIDIR)/lib 
+#
+# NETCDF library
+NETCDF_INCLUDE  = /usr/include
+NETCDF_LIBRARY  = -L/usr/lib -lnetcdff
+#
+# Compiling and other commands
+MAKE        = make
+F90         = $(MPIBIN)/mpif90 -Wall -I$(MPI_INCLUDE)
+F           = $(F90)
+f90         = $(F90)
+f           = $(F90)
+CC          = gcc -I$(MPI_INCLUDE)
+LD          = $(MPIBIN)/mpif90 $(MPILIB)
+AR          = ar
+ARFLAGS     = -ruv
+#
+# CPP keys and compiler options
+# 
+CPPDEF    = -Duse_netCDF -Duse_comm_$(CHAN) -D__VERBOSE -DTREAT_OVERLAY
+#
+# 
+F90FLAGS_1  = $(FCFLAGS)
+f90FLAGS_1  = $(F90FLAGS_1)
+FFLAGS_1    = $(F90FLAGS_1)
+fFLAGS_1    = $(F90FLAGS_1)
+CCFLAGS_1   = 
+LDFLAGS     = 
+#
+###################
+#
+# Additional definitions that should not be changed
+#
+FLIBS		= $(NETCDF_LIBRARY)
+# BINDIR        : directory for executables
+BINDIR          = $(ARCHDIR)/bin
+# LIBBUILD      : contains a directory for each library
+LIBBUILD        = $(ARCHDIR)/build/lib
+# INCPSMILE     : includes all *o and *mod for each library
+INCPSMILE       = -I$(LIBBUILD)/psmile.$(CHAN) -I$(LIBBUILD)/pio  -I$(LIBBUILD)/mct 
+
+F90FLAGS  = $(F90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
+f90FLAGS  = $(f90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
+FFLAGS    = $(FFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
+fFLAGS    = $(fFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
+CCFLAGS   = $(CCFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
+#
+#############################################################################
Index: oasis3-3.mct+dfsg.121022/util/make_dir/TopMakefileOasis3
===================================================================
--- oasis3-3.mct+dfsg.121022.orig/util/make_dir/TopMakefileOasis3
+++ oasis3-3.mct+dfsg.121022/util/make_dir/TopMakefileOasis3
@@ -23,14 +23,12 @@ ERR = $(COUPLE)/util/make_dir/COMP.err
 #
 #######
 default: 
-	 rm -f $(LOG) $(ERR)
 	 $(MAKEf) makedirs
 	 $(MAKEf) makemct
 	 $(MAKEf) makelibs
 	 $(MAKEf) makepsmile
 #
 oasis3_psmile:
-	rm -f $(LOG) $(ERR)
 	$(MAKEf) makedirs
 	$(MAKEf) makemct
 	$(MAKEf) makelibs
@@ -53,9 +51,8 @@ makedirs:
 makemct:
 	@echo "=> Compiling library mpeu and mct"
 	(cd $(ARCHDIR)/build/lib/mctdir; cp -f -r -p $(LIBSRC)/mct/* .;\
-         ./configure MPIFC="$(F90)" FC="$(F90)" CC="$(CC)" \
-         1>> $(LOG) 2>> $(ERR) ;\
-         $(MAKE) 1>> $(LOG) 2>> $(ERR) ; \
+         ./configure MPIFC="$(F90)" FC="$(F90)" CC="$(CC)" ; \
+         $(MAKE)  ; \
          cp -f ./*/lib*.a   $(ARCHDIR)/lib/; \
          cp -f ./*/*.o    $(ARCHDIR)/build/lib/mct/; \
          cp -f ./*/*.mod  $(ARCHDIR)/build/lib/mct/;)
@@ -65,13 +62,13 @@ makemct:
 makelibs:
 	@echo "=> Compiling library scrip"
 	(cd $(ARCHDIR)/build/lib/scrip; cp -f $(LIBSRC)/scrip/src/Makefile .;\
-         $(modifmakefile) ; $(MAKE) all 1>> $(LOG) 2>> $(ERR) )
+         $(modifmakefile) ; $(MAKE) all )
 
 makepsmile:
 	@echo "=> Compiling library psmile"
 	(cd $(ARCHDIR)/build/lib/psmile.$(CHAN) ; \
          cp -f $(LIBSRC)/psmile/src/Makefile . ; $(modifmakefile) ; \
-         $(MAKE) all 1>> $(LOG) 2>> $(ERR) )
+         $(MAKE) all )
 #
 # Rules for cleaning
 #
Index: oasis3-3.mct+dfsg.121022/util/make_dir/make.inc
===================================================================
--- oasis3-3.mct+dfsg.121022.orig/util/make_dir/make.inc
+++ oasis3-3.mct+dfsg.121022/util/make_dir/make.inc
@@ -10,6 +10,6 @@
 # Note: Choose one of these includes files and modify it according to your
 #       local settings. Replace the currently active file with your own.
 #
-include  $(HOME)/oasis3-mct/util/make_dir/make.intel_corail
+include  $(TOP)/util/make_dir/make.$(ARCH)
 #
 ### End User configurable options ###
Index: oasis3-3.mct+dfsg.121022/lib/psmile/src/Makefile
===================================================================
--- oasis3-3.mct+dfsg.121022.orig/lib/psmile/src/Makefile
+++ oasis3-3.mct+dfsg.121022/lib/psmile/src/Makefile
@@ -1,29 +1,40 @@
 
 SRCS1	= $(shell ls $(COUPLE)/lib/psmile/src/*.F90)
 OBJS1	= $(patsubst $(COUPLE)/lib/psmile/src/%.F90, %.o, $(SRCS1))
+PIC_OBJS1	= $(patsubst $(COUPLE)/lib/psmile/src/%.F90, %.o.pic, $(SRCS1))
 
 VPATH 	= .:$(COUPLE)/lib/psmile/src:\
 	     $(COUPLE)/lib/psmile/include:\
 	     $(NETCDF_INCLUDE):$(MPI_INCLUDE)
 
 LIBRARY = $(ARCHDIR)/lib/libpsmile.${CHAN}.a
+SHLIB   = $(ARCHDIR)/lib/libpsmile.${CHAN}.so
+SONAME  = libpsmile.so.0d
+LDSHARED = ld -shared $(LDFLAGS)
 
 clean:
-	rm -f i.* *.o *.mod
+	rm -f i.* *.o *.mod *.o.pic
 
-all:	$(LIBRARY)
+all: $(LIBRARY) $(SHLIB)
 
 $(LIBRARY): $(OBJS1) 
 	$(AR) $(ARFLAGS) $(LIBRARY) $(OBJS1) 
 
+$(SHLIB): $(PIC_OBJS1)
+	$(LDSHARED) -o $(SHLIB)  $(PIC_OBJS1) --soname $(SONAME) -lc
+
 INCLS = -I$(COUPLE)/lib/psmile/include \
         -I$(ARCHDIR)/build/lib/mct \
         -I$(ARCHDIR)/build/lib/scrip \
         -I$(ARCHDIR)/build/lib/pio
 
 INCLSC = -I$(COUPLE)/lib/psmile/include
+
 .SUFFIXES:
-.SUFFIXES: .o .F90 .c
+.SUFFIXES: .o .F90 .c .o.pic
+
+%.o.pic:  %.F90
+	$(F90) $(F90FLAGS) $(INCLS) -fPIC -o $@ -c $<
 
 %.o: %.F90
 	$(F90) $(F90FLAGS) $(INCLS)  -c   $<
@@ -31,9 +42,15 @@ INCLSC = -I$(COUPLE)/lib/psmile/include
 %.o: %.c
 	$(CC) $(CCFLAGS) $(INCLSC) -c   $<
 
+%.o.pic: %.c
+	$(CC) $(CCFLAGS) $(INCLSC) -c  -o $@ -fPIC  $<
+
 mod_psmile_io.o: mod_psmile_io.F90
 	$(F90) $(F90FLAGS) $(INCLS)  -c   $<
 
+mod_psmile_io.o.pic: mod_psmile_io.F90
+	$(F90) $(F90FLAGS) -fPIC $(INCLS) -o $@ -c   $<
+
 #
 # ALL dependencies ...
 #
@@ -81,4 +98,49 @@ mod_oasis.o: mod_oasis_kinds.o mod_oasis
 	mod_oasis_getput_interface.o mod_oasis_parameters.o \
 	mod_oasis_grid.o mod_oasis_method.o mod_oasis_var.o \
 	mod_oasis_namcouple.o mod_oasis_auxiliary_routines.o
+#
+mod_oasis_kinds.o.pic: 
+mod_oasis_parameters.o.pic: mod_oasis_kinds.o.pic
+mod_oasis_data.o.pic: mod_oasis_kinds.o.pic 
+mod_oasis_sys.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic
+mod_oasis_mpi.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic
+mod_oasis_timer.o.pic: mod_oasis_kinds.o.pic mod_oasis_sys.o.pic mod_oasis_mpi.o.pic mod_oasis_data.o.pic
+mod_oasis_string.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic
+mod_oasis_namcouple.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_mpi.o.pic mod_oasis_string.o.pic
+mod_oasis_var.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic
+mod_oasis_part.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_timer.o.pic
+mod_oasis_ioshr.o.pic:  mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_mpi.o.pic mod_oasis_string.o.pic
+mod_oasis_io.o.pic:  mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_ioshr.o.pic mod_oasis_mpi.o.pic
+mod_oasis_grid.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_io.o.pic
+mod_oasis_coupler.o.pic: mod_oasis_kinds.o.pic  mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_mpi.o.pic mod_oasis_var.o.pic mod_oasis_part.o.pic  \
+        mod_oasis_string.o.pic mod_oasis_namcouple.o.pic mod_oasis_timer.o.pic mod_oasis_io.o.pic
+mod_oasis_advance.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_var.o.pic mod_oasis_part.o.pic mod_oasis_mpi.o.pic \
+        mod_oasis_coupler.o.pic mod_oasis_timer.o.pic mod_oasis_io.o.pic
+mod_oasis_method.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_coupler.o.pic mod_oasis_namcouple.o.pic \
+        mod_oasis_timer.o.pic mod_oasis_ioshr.o.pic mod_oasis_advance.o.pic mod_oasis_grid.o.pic \
+        mod_oasis_mpi.o.pic
+mod_oasis_getput_interface.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_var.o.pic mod_oasis_advance.o.pic 
+mod_oasis_auxiliary_routines.o.pic: mod_oasis_kinds.o.pic mod_oasis_data.o.pic mod_oasis_sys.o.pic \
+        mod_oasis_parameters.o.pic mod_oasis_var.o.pic mod_oasis_mpi.o.pic \
+        mod_oasis_coupler.o.pic mod_oasis_timer.o.pic mod_oasis_io.o.pic
+mod_prism.o.pic: mod_oasis_kinds.o.pic mod_oasis_part.o.pic mod_oasis_sys.o.pic \
+	mod_oasis_getput_interface.o.pic mod_oasis_parameters.o.pic \
+	mod_oasis_grid.o.pic mod_oasis_method.o.pic mod_oasis_var.o.pic \
+	mod_oasis_namcouple.o.pic mod_oasis_auxiliary_routines.o.pic
+mod_oasis.o.pic: mod_oasis_kinds.o.pic mod_oasis_part.o.pic mod_oasis_sys.o.pic \
+	mod_oasis_getput_interface.o.pic mod_oasis_parameters.o.pic \
+	mod_oasis_grid.o.pic mod_oasis_method.o.pic mod_oasis_var.o.pic \
+	mod_oasis_namcouple.o.pic mod_oasis_auxiliary_routines.o.pic
 
+#
Index: oasis3-3.mct+dfsg.121022/lib/scrip/src/Makefile
===================================================================
--- oasis3-3.mct+dfsg.121022.orig/lib/scrip/src/Makefile
+++ oasis3-3.mct+dfsg.121022/lib/scrip/src/Makefile
@@ -1,25 +1,35 @@
 
 SRCS1 =  $(shell ls $(COUPLE)/lib/scrip/src/*.F90)
 OBJS1 =  $(patsubst $(COUPLE)/lib/scrip/src/%.F90, %.o, $(SRCS1))
+POBJS1 =  $(patsubst $(COUPLE)/lib/scrip/src/%.F90, %.o.pic, $(SRCS1))
 
 SRCS3   = $(shell ls $(COUPLE)/lib/scrip/src/*.F)
 OBJS3   = $(patsubst $(COUPLE)/lib/scrip/src/%.F, %.o, $(SRCS3))
+POBJS3   = $(patsubst $(COUPLE)/lib/scrip/src/%.F, %.o.pic, $(SRCS3))
 
 SRCS4 =  $(shell ls $(COUPLE)/lib/scrip/src/*.f)
 OBJS4 =  $(patsubst $(COUPLE)/lib/scrip/src/%.f, %.o, $(SRCS4))
+POBJS4 =  $(patsubst $(COUPLE)/lib/scrip/src/%.f, %.o.pic, $(SRCS4))
 
 VPATH =	.:$(COUPLE)/lib/scrip/src:$(COUPLE)/src
 
 LIBRARY	= $(ARCHDIR)/lib/libscrip.a
+SHLIB	= $(ARCHDIR)/lib/libscrip.so
+SONAME  = libscrip.so.0d
+
+LDSHARED = ld -shared $(LDFLAGS)
 
 clean:
-	rm -f i.* *.o *.mod
+	rm -f i.* *.o *.mod *.o.pic
 
-all:	$(LIBRARY)
+all:	$(LIBRARY) $(SHLIB)
 
 $(LIBRARY): $(OBJS1)  $(OBJS3) $(OBJS4)
 	$(AR) $(ARFLAGS) $(LIBRARY) $(OBJS1) $(OBJS3) $(OBJS4)
 
+$(SHLIB): $(POBJS1) $(POBJS3) $(POBJS4)
+	$(LDSHARED) -o $(SHLIB) $(POBJS1) $(POBJS3) $(POBJS4) --soname $(SONAME) -lnetcdff -lnetcdf -lc
+
 .SUFFIXES:
 .SUFFIXES: .o .f .F .f90 .F90 .c
 
@@ -38,9 +48,23 @@ $(LIBRARY): $(OBJS1)  $(OBJS3) $(OBJS4)
 %.o: %.c
 	$(CC) $(CCFLAGS) -c   $<
 
+%.o.pic: %.F90
+	$(F90) $(F90FLAGS)  -o $@ -c  -fPIC $<
+
+%.o.pic: %.f90
+	$(f90) $(f90FLAGS) -o $@ -c -fPIC  $<
+
+%.o.pic: %.F
+	$(F) $(FFLAGS)  -o $@ -c -fPIC  $<
+
+%.o.pic: %.f
+	$(f) $(fFLAGS)  -o $@ -c  -fPIC $<
+
+%.o.pic: %.c
+	$(CC) $(CCFLAGS) -o $@ -c  -fPIC $<
+
 #
 # ALL dependencies ...
-#
 mod_oasis_flush.o : kinds_mod.o
 remap_bicubic_reduced.o: constants.o grids.o remap_vars.o
 netcdf.o: constants.o kinds_mod.o 
@@ -64,3 +88,27 @@ remap_bilinear_reduced.o: constants.o gr
 remap_gauswgt.o: constants.o grids.o kinds_mod.o remap_vars.o
 remap_write.o: constants.o grids.o kinds_mod.o netcdf.o remap_vars.o 
 timers.o: kinds_mod.o
+#
+mod_oasis_flush.o : kinds_mod.o
+remap_bicubic_reduced.o: constants.o grids.o remap_vars.o
+netcdf.o: constants.o kinds_mod.o 
+remap_conserv.o: constants.o grids.o kinds_mod.o remap_vars.o timers.o
+remap_distwgt.o: constants.o grids.o kinds_mod.o remap_vars.o
+remap_vars.o: constants.o grids.o kinds_mod.o
+scrip.o: constants.o grids.o iounits.o kinds_mod.o remap_bicubic.o \
+	remap_bicubic_reduced.o remap_bilinear.o remap_bilinear_reduced.o \
+	remap_conserv.o remap_distwgt.o remap_gauswgt.o remap_vars.o \
+	remap_write.o timers.o
+constants.o: kinds_mod.o
+distance.o: constants.o kinds_mod.o
+fracnnei.o: constants.o grids.o kinds_mod.o remap_vars.o 
+gradient_bicubic.o: constants.o kinds_mod.o 
+grids.o: constants.o iounits.o kinds_mod.o 
+iounits.o: kinds_mod.o 
+kinds_mod.o: 
+remap_bicubic.o: constants.o grids.o kinds_mod.o remap_vars.o
+remap_bilinear.o: constants.o grids.o kinds_mod.o remap_vars.o
+remap_bilinear_reduced.o: constants.o grids.o kinds_mod.o remap_vars.o
+remap_gauswgt.o: constants.o grids.o kinds_mod.o remap_vars.o
+remap_write.o: constants.o grids.o kinds_mod.o netcdf.o remap_vars.o 
+timers.o.pic: kinds_mod.o.pic