New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Makefile in NEMO/branches/UKMO/BPC_miniapp/Master – NEMO

source: NEMO/branches/UKMO/BPC_miniapp/Master/Makefile @ 10837

Last change on this file since 10837 was 10837, checked in by wayne_gaudin, 6 years ago

Ticket #2197 - added version extraction to the Makefile

File size: 3.5 KB
Line 
1# usage
2# Make several versions, plus extract individual versions
3# make clean; make
4# Make and scalar CPU version
5# make clean; make CPU=1
6# ./bpc.exe
7#
8# Make and run mananged memory version for GPU
9# make clean MANAGED=1 ; make MANAGED=1
10# ./bpc_gpu_managed.exe
11#
12# Make and run OpenACC CPU version
13# make clean MULTI=1 ; make MULTI=1
14# ACC_NUM_CORES=20 ./bpc_multi.exe
15#
16# Make and run CPU/OpenMP version
17# make clean CPU=1 ; make CPU=1
18# OMP_NUM_THREADS=20 ./bpc_cpu.exe
19
20FC=pgf90
21
22# Default flags are the GPU with managed memory
23MANAGED=1
24TARGET=gpu
25FMACPU=
26ifdef MANAGED
27  MANAGE=,managed -DMANAGED
28endif
29
30ifdef ALL
31TARGET=*
32endif
33
34
35FLAGS = -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=tesla,cc70$(MANAGE)
36LFLAGS= -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=tesla,cc70$(MANAGE)
37
38ifdef CPU
39  FLAGS = -gopt -Mpreprocess -fast -mp=nonuma -Minfo=mp $(FMACPU)
40  LFLAGS= -gopt -Mpreprocess -fast -mp=nonuma -Minfo=mp $(FMACPU)
41  TARGET=cpu
42endif
43
44ifdef MULTI
45  FLAGS= -gopt -O2 -Mpreprocess -fast -acc -Minfo=acc -ta=multicore
46  FLAGS= -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=multicore
47  TARGET=multi
48endif
49
50ifdef DEBUG
51  FLAGS = -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk -Mchkptr
52  LFLAGS= -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk -Mchkptr
53endif
54
55# These flags will be system dependent
56NETCDF=-I$(NETCDF_INC) -L$(NETCDF_LIB) -lnetcdff -lnetcdf
57
58bpc_$(TARGET).exe: par_kind.o phycst.o len_oce.o in_out_man_cut.o eos_insitu.o zpshde.o dynhpgs.o zdfmxl.o ldfslp.o traldf_iso.o main_bpc_hpg.o
59   $(FC) par_kind.o phycst.o len_oce.o in_out_man_cut.o eos_insitu.o zpshde.o dynhpgs.o zdfmxl.o ldfslp.o traldf_iso.o tiletype.o traldf_iso_tile.o main_bpc_hpg.o $(LFLAGS) $(NETCDF) -o bpc_$(TARGET).exe
60
61par_kind.o: par_kind.F90
62   $(FC) -c $(FLAGS) $(NETCDF) par_kind.F90
63
64phycst.o: phycst.F90 par_kind.o
65   $(FC) -c $(FLAGS) $(NETCDF) phycst.F90
66
67len_oce.o: len_oce.F90
68   $(FC) -c $(FLAGS) $(NETCDF) len_oce.F90
69
70in_out_man_cut.o: in_out_man_cut.F90 par_kind.o
71   $(FC) -c $(FLAGS) $(NETCDF) in_out_man_cut.F90
72
73eos_insitu.o: eos_insitu.F90 phycst.o in_out_man_cut.o len_oce.o vectopt_loop_substitute.h90
74   $(FC) -c $(FLAGS) $(NETCDF) eos_insitu.F90
75
76zpshde.o: zpshde.F90 len_oce.o phycst.o in_out_man_cut.o eos_insitu.o
77   $(FC) -c $(FLAGS) $(NETCDF) zpshde.F90
78
79dynhpgs.o: dynhpgs.F90 par_kind.o len_oce.o in_out_man_cut.o vectopt_loop_substitute.h90
80   $(FC) -c $(FLAGS) $(NETCDF) dynhpgs.F90
81
82zdfmxl.o: zdfmxl.F90 in_out_man_cut.o phycst.o len_oce.o
83   $(FC) -c $(FLAGS) $(NETCDF) zdfmxl.F90
84
85ldfslp.o: ldfslp.F90 len_oce.o phycst.o in_out_man_cut.o
86   $(FC) -c $(FLAGS) $(NETCDF) ldfslp.F90
87
88tiletype.o: tiletype.F90
89   $(FC) -c $(FLAGS) $(NETCDF) tiletype.F90
90
91traldf_iso.o: traldf_iso.F90  len_oce.o phycst.o in_out_man_cut.o
92   $(FC) -c $(FLAGS) $(NETCDF) traldf_iso.F90
93
94traldf_iso_tile.o: traldf_iso_tile.F90  len_oce.o phycst.o in_out_man_cut.o tiletype.o
95   $(FC) -c $(FLAGS) $(NETCDF) traldf_iso_tile.F90
96
97main_bpc_hpg.o: main_bpc_hpg.F90 par_kind.o len_oce.o phycst.o in_out_man_cut.o eos_insitu.o zpshde.o dynhpgs.o zdfmxl.o ldfslp.o traldf_iso.o traldf_iso_tile.o tiletype.o
98   $(FC) -c $(FLAGS) $(NETCDF) main_bpc_hpg.F90
99
100clean:
101   rm -f *.o *.mod bpc_$(TARGET).exe
102
103bpc_all: bpc_OpenMP bpc_OpenACC_managed bpc_OpenACC
104
105bpc_OpenMP:
106   mkdir -p ../OpenMP
107   for i in *90; do  grep -v ACC $$i > ../OpenMP/$$i ; done
108   cp Makefile ../OpenMP
109bpc_OpenACC_managed:
110   mkdir -p ../OpenACC_managed
111   for i in *90; do  grep -v OMP $$i > ../OpenACC_managed/$$i ; done
112   cp Makefile ../OpenACC_managed
113bpc_OpenACC:
114   mkdir -p ../OpenACC
115   for i in *90; do  grep -v OMP $$i > ../OpenACC/$$i ; done
116   cp Makefile ../OpenACC
117
Note: See TracBrowser for help on using the repository browser.