From f2fdf4558c41436ed1885ace7268763b2d0e7bd9 Mon Sep 17 00:00:00 2001 From: pesei <petra seibert @usedots@ boku ac at> Date: Tue, 18 Jun 2019 13:16:19 +0200 Subject: [PATCH] fortran makefiles debug and fast, grib_api --- source/fortran/makefile_debug | 62 +++++++++++++++++++++++++++++++++++ source/fortran/makefile_fast | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 source/fortran/makefile_debug create mode 100644 source/fortran/makefile_fast diff --git a/source/fortran/makefile_debug b/source/fortran/makefile_debug new file mode 100644 index 0000000..187234e --- /dev/null +++ b/source/fortran/makefile_debug @@ -0,0 +1,62 @@ +############################################################################### +# +# Makefile for flex_extract, Fortran code to calculate etadot +# +# Copyright: Leopold Haimberger, Petra Seibert +# SPDX-License-Identifier: GPL-2.0 +# +# Version for a machine with grib_api installed on standard paths +# full debugging +# +############################################################################### + + +GRIB_API_INCLUDE_DIR=/usr/include +GRIB_API_LIB= -Bstatic -lgrib_api_f77 -lgrib_api_f90 -lgrib_api -Bdynamic -lm -ljasper +EMOSLIB=-lemosR64 + +LIB = $(GRIB_API_LIB) $(EMOSLIB) + +F90 = gfortran -m64 -fdefault-real-8 -fcray-pointer -fno-second-underscore -ffixed-line-length-132 -fopenmp -fconvert=big-endian + +F90FLAGS = -I. -I$(GRIB_API_INCLUDE_DIR) + +OPT = -g -fbacktrace -fbounds-check + +BINDIR = . +EXE = calc_etadot_debug.out + +.f.o: + $(F90) -c $(F90FLAGS) $(OPT) $*.f +.f90.o: + $(F90) -c $(F90FLAGS) $(OPT) $*.f90 + +all: ${EXE} + +clean: + rm *.o *.mod #${EXE} + +preconvert.o: preconvert.f90 + $(F90) -c $(OPT) $(F90FLAGS) preconvert.f90 + +phgrreal.o: phgrreal.f + $(F90) -c $(OPT) phgrreal.f + +rwGRIB2.o: rwGRIB2.f90 + $(F90) -c $(OPT) $(F90FLAGS) rwGRIB2.f90 + +grphreal.o: grphreal.f + $(F90) -c $(OPT) grphreal.f + +ftrafo.o: ftrafo.f + $(F90) -c $(OPT) ftrafo.f + +$(BINDIR)/${EXE}: phgrreal.o grphreal.o ftrafo.o rwGRIB2.o posnam.o preconvert.o + $(F90) $(OPT) -o $(BINDIR)/${EXE} ftrafo.o phgrreal.o grphreal.o rwGRIB2.o posnam.o preconvert.o ${LIB} + + +############################################################################### +# +# End of the Makefile +# +############################################################################### diff --git a/source/fortran/makefile_fast b/source/fortran/makefile_fast new file mode 100644 index 0000000..c5a4d75 --- /dev/null +++ b/source/fortran/makefile_fast @@ -0,0 +1,62 @@ +############################################################################### +# +# Makefile for flex_extract, Fortran code to calculate etadot +# +# Copyright: Leopold Haimberger, Petra Seibert +# SPDX-License-Identifier: GPL-2.0 +# +# Version for a machine with grib_api installed on standard paths +# compiled for fast runs +# +############################################################################### + + +GRIB_API_INCLUDE_DIR=/usr/include +GRIB_API_LIB= -Bstatic -lgrib_api_f77 -lgrib_api_f90 -lgrib_api -Bdynamic -lm -ljasper +EMOSLIB=-lemosR64 + +LIB = $(GRIB_API_LIB) $(EMOSLIB) + +F90 = gfortran -m64 -fdefault-real-8 -fcray-pointer -fno-second-underscore -ffixed-line-length-132 -fopenmp -fconvert=big-endian + +F90FLAGS = -I. -I$(GRIB_API_INCLUDE_DIR) + +OPT = -O3 + +BINDIR = . +EXE = calc_etadot_fast.out + +.f.o: + $(F90) -c $(F90FLAGS) $(OPT) $*.f +.f90.o: + $(F90) -c $(F90FLAGS) $(OPT) $*.f90 + +all: ${EXE} + +clean: + rm *.o *.mod #${EXE} + +preconvert.o: preconvert.f90 + $(F90) -c $(OPT) $(F90FLAGS) preconvert.f90 + +phgrreal.o: phgrreal.f + $(F90) -c $(OPT) phgrreal.f + +rwGRIB2.o: rwGRIB2.f90 + $(F90) -c $(OPT) $(F90FLAGS) rwGRIB2.f90 + +grphreal.o: grphreal.f + $(F90) -c $(OPT) grphreal.f + +ftrafo.o: ftrafo.f + $(F90) -c $(OPT) ftrafo.f + +$(BINDIR)/${EXE}: phgrreal.o grphreal.o ftrafo.o rwGRIB2.o posnam.o preconvert.o + $(F90) $(OPT) -o $(BINDIR)/${EXE} ftrafo.o phgrreal.o grphreal.o rwGRIB2.o posnam.o preconvert.o ${LIB} + + +############################################################################### +# +# End of the Makefile +# +############################################################################### -- GitLab