Skip to content
Snippets Groups Projects
Commit 4415fa36 authored by pesei's avatar pesei Committed by anphi
Browse files

Update makefiles to use eccodes instead of grib_api

Adapt makefile_ecgate so that the lib and inc paths are taken from env variables
Make linke from exe file to standard exe calc_etadot
Adapt makefile_cray, but this needs still to be tested

Correct comments in some makefiles

Corrected and tested Cray makefile
parent 7e595101
No related branches found
No related tags found
No related merge requests found
############################################################################### ###############################################################################
# #
# Top level Makefile for ECMWFDATA7.0 software # Makefile for flex_extract, Fortran code to calculate etadot
# Makefile created using by mkmf 19.3.0
# #
# Last modified: December 1, 2015 # Copyright: Leopold Haimberger, Petra Seibert
# SPDX-License-Identifier: GPL-2.0
#
# Version for a machine with eccodes and emoslib installed on standard paths
# with optimisation
# #
############################################################################### ###############################################################################
.SUFFIXES: .o .c .c~ .f .f~ .F90 .f90 .f90~ .f95 .f95~ .F .F~ .y .y~ .l .l~ \ EXE = calc_etadot
.s .s~ .sh .sh~ .h .h~ .C .C~ .a
OPT =
DEBUG = -g
LIB = $(GRIB_API_LIBS) $(EMOSLIB)
FC=ftn $(F90FLAGS)
F90C=ftn $(F90FLAGS)
FFLAGS = $(OPT) -I. -r8 -I$(GRIB_API_INCLUDE_DIR)
F90FLAGS = $(OPT) -I. -r8 -I$(GRIB_API_INCLUDE_DIR)
LDFLAGS = $(OPT) LIB = $(ECCODES_LIB) $(EMOSLIB)
INC = -I. -I$(ECCODES_INCLUDE_DIR)
BINDIR = . FC = ftn
OPT = -O3
FFLAGS = -s real64 $(OPT) $(LIB) $(INC)
LDFLAGS = $(OPT) -fopenmp
EXE = calc_etadot EXE = calc_etadot
.f.o: .f.o:
$(F90C) -c $(F90FLAGS) $(DEBUG) $*.f SRC = ./rwgrib2.f90 ./calc_etadot.f90 ./ftrafo.f90 ./grphreal.f90 ./posnam.f90 ./phgrreal.f90
.f90.o: OBJ = rwgrib2.o calc_etadot.o ftrafo.o grphreal.o posnam.o phgrreal.o
$(F90C) -c $(F90FLAGS) $(DEBUG) $*.f90 MOD = ftrafo.mod grtoph.mod phtogr.mod rwgrib2.mod
all: ${EXE} all: ${EXE}
clean: ftrafo.o: ./ftrafo.f90 phgrreal.o
rm *.o *.mod ${EXE} $(FC) $(FFLAGS) -c ./ftrafo.f90
grphreal.o: ./grphreal.f90 phgrreal.o
phgrreal.o: phgrreal.f $(FC) $(FFLAGS) -c ./grphreal.f90
$(F90C) -c -g -O3 phgrreal.f phgrreal.o: ./phgrreal.f90
$(FC) $(FFLAGS) -c ./phgrreal.f90
grphreal.o: grphreal.f posnam.o: ./posnam.f90
$(F90C) -c -g -O3 grphreal.f $(FC) $(FFLAGS) -c ./posnam.f90
calc_etadot.o: ./calc_etadot.f90 phgrreal.o grphreal.o ftrafo.o rwgrib2.o
ftrafo.o: ftrafo.f $(FC) $(FFLAGS) -c ./calc_etadot.f90
$(F90C) -c -g -O3 ftrafo.f rwgrib2.o: ./rwgrib2.f90
$(FC) $(FFLAGS) -c ./rwgrib2.f90
$(BINDIR)/${EXE}: phgrreal.o grphreal.o ftrafo.o rwgrib2.o posnam.o calc_etadot.o
$(F90C) $(DEBUG) $(OPT) -o $(BINDIR)/${EXE} ftrafo.o phgrreal.o grphreal.o rwgrib2.o posnam.o calc_etadot.o ${LIB}
clean:
-rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
############################################################################### ${EXE}: $(OBJ)
# $(FC) $(OBJ) -o ${EXE} $(LDFLAGS)
# End of the Makefile
#
###############################################################################
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# Copyright: Leopold Haimberger, Petra Seibert # Copyright: Leopold Haimberger, Petra Seibert
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# #
# Version for a machine with grib_api and emoslib installed on standard paths # Version for a machine with eccodes and emoslib installed on standard paths
# full debugging # full debugging
# #
############################################################################### ###############################################################################
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
EXE = calc_etadot_debug.out EXE = calc_etadot_debug.out
GRIB_API_LIB= -Bstatic -lgrib_api_f90 -lgrib_api -Bdynamic -lm -ljasper GRIB_API_LIB= -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper
EMOSLIB=-lemosR64 EMOSLIB=-lemosR64
LIB = $(GRIB_API_LIB) $(EMOSLIB) LIB = $(GRIB_API_LIB) $(EMOSLIB)
GRIB_API_INCLUDE_DIR=/usr/include ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15
INC = -I. -I$(GRIB_API_INCLUDE_DIR) INC = -I. -I$(ECCODES_INCLUDE_DIR)
FC = gfortran FC = gfortran
OPT = -g -Og -fbacktrace -fcheck=all OPT = -g -Og -fbacktrace -fcheck=all
...@@ -46,7 +46,9 @@ calc_etadot.o: ./calc_etadot.f90 phgrreal.o grphreal.o ftrafo.o rwgrib2.o ...@@ -46,7 +46,9 @@ calc_etadot.o: ./calc_etadot.f90 phgrreal.o grphreal.o ftrafo.o rwgrib2.o
rwgrib2.o: ./rwgrib2.f90 rwgrib2.o: ./rwgrib2.f90
$(FC) $(FFLAGS) -c ./rwgrib2.f90 $(FC) $(FFLAGS) -c ./rwgrib2.f90
clean: -rm -f $(OBJ) ${EXE} $(MOD) clean:
-rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
${EXE}: $(OBJ) ${EXE}: $(OBJ)
$(FC) $(OBJ) -o ${EXE} $(LDFLAGS) $(FC) $(OBJ) -o ${EXE} $(LDFLAGS)
ln -sf ${EXE} calc_etadot
############################################################################### ###############################################################################
# #
# Top level Makefile for ECMWFDATA7.0 software # Makefile for flex_extract, Fortran code to calculate etadot
# Makefile created using by mkmf 19.3.0
# #
# Last modified: December 1, 2015 # Copyright: Leopold Haimberger, Petra Seibert
# SPDX-License-Identifier: GPL-2.0
#
# Version for a machine with eccodes and emoslib installed on standard paths
# with optimisation
# #
############################################################################### ###############################################################################
.SUFFIXES: .o .c .c~ .f .f~ .F90 .f90 .f90~ .f95 .f95~ .F .F~ .y .y~ .l .l~ \ EXE = calc_etadot_fast.out
.s .s~ .sh .sh~ .h .h~ .C .C~ .a
OPT = -O3
DEBUG = -g
LIB = $(ECCODES_LIB) $(EMOSLIB) LIB = $(ECCODES_LIB) $(EMOSLIB)
INC = -I. -I$(ECCODES_INCLUDE_DIR)
FC=gfortran -m64 -fdefault-real-8 -fcray-pointer -fno-second-underscore -ffixed-line-length-132 -fopenmp -fconvert=big-endian FC=gfortran
F90C=gfortran -m64 -fdefault-real-8 -fcray-pointer -fno-second-underscore -ffixed-line-length-132 -fopenmp -fconvert=big-endian
FFLAGS = $(OPT) -I. -I$(ECCODES_INCLUDE_DIR)
F90FLAGS = $(OPT) -I. -I$(ECCODES_INCLUDE_DIR)
LDFLAGS = $(OPT)
BINDIR = . OPT = -O3 -march=native
FFLAGS = $(OPT) $(LIB) $(INC) -fdefault-real-8 -fopenmp -fconvert=big-endian
EXE = calc_etadot LDFLAGS = $(OPT) $(LIB) -fopenmp
SRC = ./rwgrib2.f90 ./calc_etadot.f90 ./ftrafo.f90 ./grphreal.f90 ./posnam.f90 ./phgrreal.f90
OBJ = rwgrib2.o calc_etadot.o ftrafo.o grphreal.o posnam.o phgrreal.o
.f.o: MOD = ftrafo.mod grtoph.mod phtogr.mod rwgrib2.mod
$(F90C) -c $(F90FLAGS) $(DEBUG) $*.f
.f90.o:
$(F90C) -c $(F90FLAGS) $(DEBUG) $*.f90
all: ${EXE} all: ${EXE}
ftrafo.o: ./ftrafo.f90 phgrreal.o
$(FC) $(FFLAGS) -c ./ftrafo.f90
grphreal.o: ./grphreal.f90 phgrreal.o
$(FC) $(FFLAGS) -c ./grphreal.f90
phgrreal.o: ./phgrreal.f90
$(FC) $(FFLAGS) -c ./phgrreal.f90
posnam.o: ./posnam.f90
$(FC) $(FFLAGS) -c ./posnam.f90
calc_etadot.o: ./calc_etadot.f90 phgrreal.o grphreal.o ftrafo.o rwgrib2.o
$(FC) $(FFLAGS) -c ./calc_etadot.f90
rwgrib2.o: ./rwgrib2.f90
$(FC) $(FFLAGS) -c ./rwgrib2.f90
clean: clean:
rm *.o *.mod ${EXE} -rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
phgrreal.o: phgrreal.f
$(F90C) -c -g -O3 -fopenmp phgrreal.f
grphreal.o: grphreal.f ${EXE}: $(OBJ)
$(F90C) -c -g -O3 -fopenmp grphreal.f $(FC) $(OBJ) -o ${EXE} $(LDFLAGS)
ln -sf ${EXE} calc_etadot
ftrafo.o: ftrafo.f
$(F90C) -c -g -O3 -fopenmp ftrafo.f
$(BINDIR)/${EXE}: phgrreal.o grphreal.o ftrafo.o rwgrib2.o posnam.o calc_etadot.o
$(F90C) $(DEBUG) $(OPT) -o $(BINDIR)/${EXE} ftrafo.o phgrreal.o grphreal.o rwgrib2.o posnam.o calc_etadot.o ${LIB}
###############################################################################
#
# End of the Makefile
#
###############################################################################
...@@ -6,20 +6,20 @@ ...@@ -6,20 +6,20 @@
# Copyright: Leopold Haimberger, Petra Seibert # Copyright: Leopold Haimberger, Petra Seibert
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# #
# Version for a machine with grib_api and emoslib installed on standard paths # Version for a machine with eccodes and emoslib installed on standard paths
# full debugging # with optimisation
# #
############################################################################### ###############################################################################
EXE = calc_etadot_fast.out EXE = calc_etadot_fast.out
GRIB_API_LIB= -Bstatic -lgrib_api_f90 -lgrib_api -Bdynamic -lm -ljasper GRIB_API_LIB= -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper
EMOSLIB=-lemosR64 EMOSLIB=-lemosR64
LIB = $(GRIB_API_LIB) $(EMOSLIB) LIB = $(GRIB_API_LIB) $(EMOSLIB)
GRIB_API_INCLUDE_DIR=/usr/include ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15
INC = -I. -I$(GRIB_API_INCLUDE_DIR) INC = -I. -I$(ECCODES_INCLUDE_DIR)
FC = gfortran FC = gfortran
OPT = -O3 -march=native OPT = -O3 -march=native
...@@ -47,7 +47,8 @@ rwgrib2.o: ./rwgrib2.f90 ...@@ -47,7 +47,8 @@ rwgrib2.o: ./rwgrib2.f90
$(FC) $(FFLAGS) -c ./rwgrib2.f90 $(FC) $(FFLAGS) -c ./rwgrib2.f90
clean: clean:
-rm -f $(OBJ) ${EXE} $(MOD) -rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
${EXE}: $(OBJ) ${EXE}: $(OBJ)
$(FC) $(OBJ) -o ${EXE} $(LDFLAGS) $(FC) $(OBJ) -o ${EXE} $(LDFLAGS)
ln -sf ${EXE} calc_etadot
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment