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 @ 10894

Last change on this file since 10894 was 10894, checked in by wayne_gaudin, 5 years ago

Improving autogeneration of various versions

File size: 3.8 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
57NETCDF=-I$(CPATH) -L/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/pgi-19.1/netcdf-4.6.1-snrb2ywx62gybndihod5cjn2cgqv6g5b/lib -L/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/pgi-19.1/netcdf-fortran-4.4.4-3pcdzmpp5luuvp72ddzuc24dldq45pfw/lib -lnetcdff -lnetcdf
58
59bpc_$(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
60   $(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
61
62par_kind.o: par_kind.F90
63   $(FC) -c $(FLAGS) $(NETCDF) par_kind.F90
64
65phycst.o: phycst.F90 par_kind.o
66   $(FC) -c $(FLAGS) $(NETCDF) phycst.F90
67
68len_oce.o: len_oce.F90
69   $(FC) -c $(FLAGS) $(NETCDF) len_oce.F90
70
71in_out_man_cut.o: in_out_man_cut.F90 par_kind.o
72   $(FC) -c $(FLAGS) $(NETCDF) in_out_man_cut.F90
73
74eos_insitu.o: eos_insitu.F90 phycst.o in_out_man_cut.o len_oce.o vectopt_loop_substitute.h90
75   $(FC) -c $(FLAGS) $(NETCDF) eos_insitu.F90
76
77zpshde.o: zpshde.F90 len_oce.o phycst.o in_out_man_cut.o eos_insitu.o
78   $(FC) -c $(FLAGS) $(NETCDF) zpshde.F90
79
80dynhpgs.o: dynhpgs.F90 par_kind.o len_oce.o in_out_man_cut.o vectopt_loop_substitute.h90
81   $(FC) -c $(FLAGS) $(NETCDF) dynhpgs.F90
82
83zdfmxl.o: zdfmxl.F90 in_out_man_cut.o phycst.o len_oce.o
84   $(FC) -c $(FLAGS) $(NETCDF) zdfmxl.F90
85
86ldfslp.o: ldfslp.F90 len_oce.o phycst.o in_out_man_cut.o
87   $(FC) -c $(FLAGS) $(NETCDF) ldfslp.F90
88
89tiletype.o: tiletype.F90
90   $(FC) -c $(FLAGS) $(NETCDF) tiletype.F90
91
92traldf_iso.o: traldf_iso.F90  len_oce.o phycst.o in_out_man_cut.o
93   $(FC) -c $(FLAGS) $(NETCDF) traldf_iso.F90
94
95traldf_iso_tile.o: traldf_iso_tile.F90  len_oce.o phycst.o in_out_man_cut.o tiletype.o
96   $(FC) -c $(FLAGS) $(NETCDF) traldf_iso_tile.F90
97
98main_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
99   $(FC) -c $(FLAGS) $(NETCDF) main_bpc_hpg.F90
100
101clean:
102   rm -f *.o *.mod bpc_$(TARGET).exe
103
104bpc_all: bpc_OpenMP bpc_OpenACC_managed bpc_OpenACC
105
106bpc_OpenMP:
107   mkdir -p ../OpenMP
108   for i in *90; do  grep -v ACC $$i > ../OpenMP/$$i ; done
109   cp Makefile ../OpenMP
110bpc_OpenACC_managed:
111   mkdir -p ../OpenACC_managed
112   for i in *90; do  grep -v OMP $$i > ../OpenACC_managed/$$i ; done
113   cp Makefile ../OpenACC_managed
114bpc_OpenACC:
115   mkdir -p ../OpenACC
116   for i in *90; do  grep -v OMP $$i > ../OpenACC/$$i ; done
117   cp Makefile ../OpenACC
118
Note: See TracBrowser for help on using the repository browser.