Changeset 7cd1586 in flex_extract.git


Ignore:
Timestamp:
Feb 29, 2020, 2:26:20 PM (4 years ago)
Author:
pesei <petra seibert -@…>
Branches:
master, ctbto, dev
Children:
1610f73
Parents:
7e59510
Message:

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

Location:
Source/Fortran
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Source/Fortran/makefile_cray

    rdfa7dbd r7cd1586  
    11###############################################################################
    22#
    3 # Top level Makefile for ECMWFDATA7.0 software
     3# Makefile for flex_extract, Fortran code to calculate etadot
     4# Makefile created using by mkmf 19.3.0
    45#
    5 # Last modified:  December 1, 2015
     6# Copyright: Leopold Haimberger, Petra Seibert
     7# SPDX-License-Identifier: GPL-2.0
     8#
     9# Version for a machine with eccodes and emoslib installed on standard paths
     10# full debugging
    611#
    712###############################################################################
    813
    914
    10 .SUFFIXES: .o .c .c~ .f .f~ .F90 .f90 .f90~ .f95 .f95~ .F .F~ .y .y~ .l .l~ \
    11            .s .s~ .sh .sh~ .h .h~ .C .C~ .a
     15EXE      =  calc_etadot
    1216
    13 OPT     =
    14 DEBUG   = -g
    15 LIB     =  $(GRIB_API_LIBS) $(EMOSLIB)
     17LIB     =  $(ECCODES_LIB) $(EMOSLIB)   
     18INC = -I. -I$(ECCODES_INCLUDE_DIR)
    1619
    17 FC=ftn  $(F90FLAGS)
    18 F90C=ftn    $(F90FLAGS)
     20FC = ftn
    1921
    20 FFLAGS =  $(OPT) -I. -r8 -I$(GRIB_API_INCLUDE_DIR)
    21 F90FLAGS =  $(OPT) -I. -r8 -I$(GRIB_API_INCLUDE_DIR)
    22 
    23 LDFLAGS =  $(OPT)
    24 
    25 BINDIR  =      .
    26 
     22OPT = -O3
     23FFLAGS =  -r8 $(OPT) $(LIB) $(INC)
     24LDFLAGS =  $(OPT) -fopenmp
    2725EXE     =      calc_etadot
    2826
     27.f.o:
     28SRC = ./rwgrib2.f90 ./calc_etadot.f90 ./ftrafo.f90 ./grphreal.f90 ./posnam.f90 ./phgrreal.f90
     29OBJ = rwgrib2.o calc_etadot.o ftrafo.o grphreal.o posnam.o phgrreal.o
     30MOD = ftrafo.mod  grtoph.mod    phtogr.mod  rwgrib2.mod
    2931
    30 .f.o:
    31         $(F90C) -c $(F90FLAGS) $(DEBUG) $*.f
    32 .f90.o:
    33         $(F90C) -c $(F90FLAGS) $(DEBUG) $*.f90
     32ftrafo.o: ./ftrafo.f90 phgrreal.o
     33        $(FC)  $(FFLAGS)  -c    ./ftrafo.f90
     34grphreal.o: ./grphreal.f90 phgrreal.o
     35        $(FC)  $(FFLAGS)  -c    ./grphreal.f90
     36phgrreal.o: ./phgrreal.f90
     37        $(FC)  $(FFLAGS)  -c    ./phgrreal.f90
     38posnam.o: ./posnam.f90
     39        $(FC)  $(FFLAGS)  -c    ./posnam.f90
     40calc_etadot.o: ./calc_etadot.f90 phgrreal.o grphreal.o ftrafo.o rwgrib2.o
     41        $(FC)  $(FFLAGS)  -c    ./calc_etadot.f90
     42rwgrib2.o: ./rwgrib2.f90
     43        $(FC)  $(FFLAGS)  -c    ./rwgrib2.f90
    3444
    35 all:    ${EXE}
     45clean:
     46        -rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
    3647
    37 clean:
    38         rm *.o *.mod ${EXE}
    39 
    40 phgrreal.o: phgrreal.f
    41         $(F90C) -c -g -O3 phgrreal.f
    42 
    43 grphreal.o: grphreal.f
    44         $(F90C) -c -g -O3 grphreal.f
    45 
    46 ftrafo.o: ftrafo.f
    47         $(F90C) -c -g -O3 ftrafo.f
    48 
    49 $(BINDIR)/${EXE}:       phgrreal.o grphreal.o ftrafo.o rwgrib2.o  posnam.o calc_etadot.o
    50         $(F90C) $(DEBUG) $(OPT) -o $(BINDIR)/${EXE} ftrafo.o phgrreal.o grphreal.o rwgrib2.o posnam.o calc_etadot.o ${LIB}
    51 
    52 
    53 ###############################################################################
    54 #
    55 # End of the Makefile
    56 #
    57 ###############################################################################
     48${EXE}: $(OBJ)
     49        $(FC) $(OBJ) -o ${EXE}  $(LDFLAGS)
  • Source/Fortran/makefile_debug

    rdfa7dbd r7cd1586  
    77# SPDX-License-Identifier: GPL-2.0
    88#
    9 # Version for a machine with grib_api and emoslib installed on standard paths
     9# Version for a machine with eccodes and emoslib installed on standard paths
    1010# full debugging
    1111#
     
    1515EXE      =  calc_etadot_debug.out
    1616
    17 GRIB_API_LIB=  -Bstatic -lgrib_api_f90 -lgrib_api -Bdynamic -lm -ljasper
     17GRIB_API_LIB=  -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper
    1818EMOSLIB=-lemosR64
    1919LIB =  $(GRIB_API_LIB) $(EMOSLIB)
    2020
    21 GRIB_API_INCLUDE_DIR=/usr/include
    22 INC = -I. -I$(GRIB_API_INCLUDE_DIR)
     21ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15
     22INC = -I. -I$(ECCODES_INCLUDE_DIR)
    2323
    2424FC = gfortran
     
    4747        $(FC)  $(FFLAGS)  -c    ./rwgrib2.f90
    4848
    49 clean: -rm -f $(OBJ) ${EXE} $(MOD)
     49clean:
     50        -rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
    5051
    5152${EXE}: $(OBJ)
    5253        $(FC) $(OBJ) -o ${EXE}  $(LDFLAGS)
     54        ln -sf ${EXE} calc_etadot
  • Source/Fortran/makefile_ecgate

    rdfa7dbd r7cd1586  
    11###############################################################################
    22#
    3 # Top level Makefile for ECMWFDATA7.0 software
     3# Makefile for flex_extract, Fortran code to calculate etadot
     4# Makefile created using by mkmf 19.3.0
    45#
    5 # Last modified:  December 1, 2015
     6# Copyright: Leopold Haimberger, Petra Seibert
     7# SPDX-License-Identifier: GPL-2.0
     8#
     9# Version for a machine with eccodes and emoslib installed on standard paths
     10# full debugging
    611#
    712###############################################################################
    813
    914
    10 .SUFFIXES: .o .c .c~ .f .f~ .F90 .f90 .f90~ .f95 .f95~ .F .F~ .y .y~ .l .l~ \
    11            .s .s~ .sh .sh~ .h .h~ .C .C~ .a
     15EXE      =  calc_etadot_fast.out
    1216
    13 OPT     = -O3
    14 DEBUG   = -g
    1517LIB     =  $(ECCODES_LIB) $(EMOSLIB)   
     18INC = -I. -I$(ECCODES_INCLUDE_DIR)
    1619
    17 FC=gfortran   -m64 -fdefault-real-8 -fcray-pointer -fno-second-underscore  -ffixed-line-length-132 -fopenmp  -fconvert=big-endian 
    18 F90C=gfortran   -m64 -fdefault-real-8 -fcray-pointer -fno-second-underscore  -ffixed-line-length-132 -fopenmp  -fconvert=big-endian
     20FC=gfortran 
    1921
    20 FFLAGS =  $(OPT) -I. -I$(ECCODES_INCLUDE_DIR)
     22OPT = -O3 -march=native
     23FFLAGS =   $(OPT) $(LIB) $(INC) -fdefault-real-8 -fopenmp -fconvert=big-endian
     24LDFLAGS =  $(OPT) $(LIB) -fopenmp
     25SRC = ./rwgrib2.f90 ./calc_etadot.f90 ./ftrafo.f90 ./grphreal.f90 ./posnam.f90 ./phgrreal.f90
     26OBJ = rwgrib2.o calc_etadot.o ftrafo.o grphreal.o posnam.o phgrreal.o
     27MOD = ftrafo.mod  grtoph.mod    phtogr.mod  rwgrib2.mod
    2128
    22 F90FLAGS =  $(OPT) -I. -I$(ECCODES_INCLUDE_DIR)
     29all: ${EXE}
     30ftrafo.o: ./ftrafo.f90 phgrreal.o
     31        $(FC)  $(FFLAGS)  -c    ./ftrafo.f90
     32grphreal.o: ./grphreal.f90 phgrreal.o
     33        $(FC)  $(FFLAGS)  -c    ./grphreal.f90
     34phgrreal.o: ./phgrreal.f90
     35        $(FC)  $(FFLAGS)  -c    ./phgrreal.f90
     36posnam.o: ./posnam.f90
     37        $(FC)  $(FFLAGS)  -c    ./posnam.f90
     38calc_etadot.o: ./calc_etadot.f90 phgrreal.o grphreal.o ftrafo.o rwgrib2.o
     39        $(FC)  $(FFLAGS)  -c    ./calc_etadot.f90
     40rwgrib2.o: ./rwgrib2.f90
     41        $(FC)  $(FFLAGS)  -c    ./rwgrib2.f90
    2342
    24 LDFLAGS =  $(OPT)
     43clean:
     44        -rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
    2545
    26 BINDIR  =      .
    27 
    28 EXE     =      calc_etadot
    29 
    30 
    31 .f.o:
    32         $(F90C) -c $(F90FLAGS) $(DEBUG) $*.f
    33 .f90.o:
    34         $(F90C) -c $(F90FLAGS) $(DEBUG) $*.f90
    35 
    36 all:    ${EXE}
    37 
    38 clean:
    39         rm *.o *.mod ${EXE}
    40 
    41 phgrreal.o: phgrreal.f
    42         $(F90C) -c -g -O3 -fopenmp phgrreal.f
    43 
    44 grphreal.o: grphreal.f
    45         $(F90C) -c -g -O3 -fopenmp grphreal.f
    46 
    47 ftrafo.o: ftrafo.f
    48         $(F90C) -c -g -O3 -fopenmp ftrafo.f
    49 
    50 $(BINDIR)/${EXE}:       phgrreal.o grphreal.o ftrafo.o rwgrib2.o  posnam.o calc_etadot.o
    51         $(F90C) $(DEBUG) $(OPT) -o $(BINDIR)/${EXE} ftrafo.o phgrreal.o grphreal.o rwgrib2.o posnam.o calc_etadot.o ${LIB}
    52 
    53 
    54 ###############################################################################
    55 #
    56 # End of the Makefile
    57 #
    58 ###############################################################################
     46${EXE}: $(OBJ)
     47        $(FC) $(OBJ) -o ${EXE}  $(LDFLAGS)
     48        ln -sf ${EXE} calc_etadot
  • Source/Fortran/makefile_fast

    rdfa7dbd r7cd1586  
    77# SPDX-License-Identifier: GPL-2.0
    88#
    9 # Version for a machine with grib_api and emoslib installed on standard paths
     9# Version for a machine with eccodes and emoslib installed on standard paths
    1010# full debugging
    1111#
     
    1515EXE      =  calc_etadot_fast.out
    1616
    17 GRIB_API_LIB=  -Bstatic -lgrib_api_f90 -lgrib_api -Bdynamic -lm -ljasper
     17GRIB_API_LIB=  -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper
    1818EMOSLIB=-lemosR64
    1919LIB =  $(GRIB_API_LIB) $(EMOSLIB)
    2020
    21 GRIB_API_INCLUDE_DIR=/usr/include
    22 INC = -I. -I$(GRIB_API_INCLUDE_DIR)
     21ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15
     22INC = -I. -I$(ECCODES_INCLUDE_DIR)
    2323
    2424FC = gfortran
     
    4848
    4949clean:
    50         -rm -f $(OBJ) ${EXE} $(MOD)
     50        -rm -f $(OBJ) ${EXE} $(MOD) calc_etadot
    5151
    5252${EXE}: $(OBJ)
    5353        $(FC) $(OBJ) -o ${EXE}  $(LDFLAGS)
     54        ln -sf ${EXE} calc_etadot
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG