Changeset adf46ae in flexpart.git for src


Ignore:
Timestamp:
Oct 22, 2015, 4:55:33 PM (8 years ago)
Author:
Espen Sollum ATMOS <eso@…>
Branches:
master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
Children:
ca350ba, 4d45639
Parents:
c04b739
Message:

Added module gfs_mod / ecmwf_mod to allow compilation of different versions without editing source code

Location:
src
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • src/makefile

    r5f42c27 radf46ae  
    66#    Dependencies are resolved in this makefile, so parallel make is
    77#    possible ("make -j")
     8#
     9#    At NILU we have installed gcc-4.9.1 and libraries under user /homevip/flexpart
     10#    ("ROOT_DIR")
     11#    To use gfortran version 4.9, add "gcc=4.9" to the make command, e.g.
     12#       'make -j ecmwf gcc=4.9',
     13#    also set environment variable LD_LIBRARY_FLAGS=
    814#
    915#  USAGE
     
    2430#
    2531################################################################################
    26 
    27 
    2832
    2933## PROGRAMS
     
    3438FLEXPART-GFS-MPI        = FP_gfs_MPI
    3539
    36 
    37 ## COMPILERS
    38 F90       = /usr/bin/gfortran
    39 #F90      = ${HOME}/gcc-4.9.1/bin/gfortran
    40 #MPIF90    = ${HOME}/opt/bin/mpifort
    41 #MPIF90    = mpif90.mpich
    42 MPIF90    = mpif90.openmpi
    43 #MPIF90    = mpifort
     40ifeq ($(gcc), 4.9)
     41# Compiled libraries under user user ~flexpart, gfortran v4.9
     42        ROOT_DIR = /homevip/flexpart/
     43#       ROOT_DIR = /homevip/espen/
     44
     45        F90       = ${ROOT_DIR}/gcc-4.9.1/bin/gfortran
     46        MPIF90    = ${ROOT_DIR}/bin/mpifort
     47
     48        INCPATH1  = ${ROOT_DIR}/gcc-4.9.1/include       
     49        INCPATH2  = ${ROOT_DIR}/include
     50        LIBPATH1 = ${ROOT_DIR}/lib
     51#       LIBPATH2 = ${ROOT_DIR}/gcc-4.9.1/lib
     52#       LIBPATH2 = /lib
     53else
     54# Default: System libraries at NILU, gfortran v4.6
     55        F90       = /usr/bin/gfortran
     56        MPIF90    = /usr/bin/mpif90.openmpi
     57
     58        INCPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/include
     59        INCPATH2 = /usr/include
     60        LIBPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/lib
     61#       LIBPATH2 = /usr/lib/x86_64-linux-gnu
     62endif
     63
    4464
    4565## OPTIMIZATION LEVEL
     
    4868
    4969## LIBRARIES
    50 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff   # -fopenmp # -llapack -lnetcdf
    51 
    52 ## 1) System libraries at NILU
    53 INCPATH1 = /usr/include
    54 #INCPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/include
    55 LIBPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/lib
    56 #LIBPATH2 = /usr/lib/x86_64-linux-gnu
    57 
    58 ## 2) Home-made libraries
    59 # INCPATH1  = ${HOME}/include
    60 INCPATH2  = /homevip/flexpart/include/
    61 LIBPATH2 = /homevip/flexpart/lib/
    62 # LIBPATH1 = ${HOME}/lib
    63 
    64 FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) -mtune=native -fuse-linker-plugin $(FUSER) # -march=native
     70LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff -llapack  # -fopenmp # -llapack
     71
     72FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) -mtune=native $(FUSER) # -march=native
    6573
    6674DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace -Warray-bounds  -Wall -fcheck=all $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero -fdump-core
    6775
    68 LDFLAGS  = $(FFLAGS) -L$(LIBPATH1) -L$(LIBPATH2) $(LIBS)
    69 LDDEBUG  = $(DBGFLAGS) -L$(LIBPATH1) -L$(LIBPATH2) $(LIBS)
     76LDFLAGS  = $(FFLAGS) -L$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
     77LDDEBUG  = $(DBGFLAGS) -L$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
    7078
    7179MODOBJS = \
     
    114122        richardson.o       verttransform.o \
    115123        obukhov.o          gridcheck.o  \
    116         convmix.o          calcmatrix.o
     124        convmix.o          calcmatrix.o \
     125        ecmwf_mod.o
    117126
    118127
     
    123132        richardson.o       verttransform.o \
    124133        obukhov.o          \
    125         convmix.o      calcmatrix.o
     134        convmix.o          calcmatrix.o \
     135        ecmwf_mod.o
    126136
    127137## For GFS (serial) version:
     
    130140        richardson_gfs.o       verttransform_gfs.o \
    131141        obukhov_gfs.o          gridcheck_gfs.o  \
    132         convmix_gfs.o          calcmatrix_gfs.o
     142        convmix_gfs.o          calcmatrix_gfs.o \
     143        gfs_mod.o
    133144
    134145OBJECTS = \
     
    203214gfs: $(FLEXPART-GFS)
    204215gfs: FC := $(F90)
     216
    205217gfs-mpi: $(FLEXPART-GFS-MPI)
    206218gfs-mpi: FC := $(MPIF90)
     
    208220#all: $(FLEXPART-ECMWF)
    209221#all: $(FLEXPART-ECMWF-MPI)
     222
     223## This allows for switching between ECMWF/GFS without editing source code.
     224wind_mod = ecmwf_mod.o # default wind
     225# ifeq ($(MAKECMDGOALS),ecmwf)
     226# wind_mod = ecmwf_mod.o
     227# endif
     228# ifeq ($(MAKECMDGOALS),ecmwf-mpi)
     229# wind_mod = ecmwf_mod.o
     230# endif
     231# ifeq ($(MAKECMDGOALS),ecmwf-mpi-dbg)
     232# wind_mod = ecmwf_mod.o
     233# endif
     234
     235ifeq ($(MAKECMDGOALS),gfs)
     236wind_mod = gfs_mod.o
     237endif
     238ifeq ($(MAKECMDGOALS),gfs-mpi)
     239wind_mod = gfs_mod.o
     240endif
    210241
    211242$(FLEXPART-ECMWF): $(MODOBJS) $(OBJECTS) $(OBJECTS_SERIAL) $(OBJECTS_ECMWF)
     
    339370outgrid_init.o: com_mod.o flux_mod.o oh_mod.o outg_mod.o par_mod.o unc_mod.o
    340371outgrid_init_nest.o: com_mod.o outg_mod.o par_mod.o unc_mod.o
     372par_mod.o : $(wind_mod)
    341373part0.o: par_mod.o
    342374partdep.o: par_mod.o
  • src/par_mod.f90

    r5f9d14a radf46ae  
    3333
    3434module par_mod
     35
     36! wind_mod: is gfs_mod.f90 for target gfs, ecmwf_mod.f90 for target ecmwf
     37!************************************************************************
     38  use wind_mod
    3539
    3640  implicit none
     
    122126  !*********************************************
    123127 
     128  ! nxmax,nymax,nuvzmax,nwzmax,nzmax:
     129  ! Moved to ecmwf.f90 (for ECMWF) / gfs.f90 (GFS)
     130 
     131
    124132  !integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !FNL XF
    125   integer,parameter :: nxmax=361,nymax=181,nuvzmax=152,nwzmax=152,nzmax=152 !ECMWF new
     133  !integer,parameter :: nxmax=361,nymax=181,nuvzmax=152,nwzmax=152,nzmax=152 !ECMWF new
    126134  !integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !ECMWF
    127135  !integer,parameter :: nxmax=361,nymax=181,nuvzmax=26,nwzmax=26,nzmax=26
     
    129137  !integer,parameter :: nxmax=1201,nymax=235,nuvzmax=58,nwzmax=58,nzmax=58
    130138
    131   integer,parameter :: nxshift=359 ! for ECMWF
     139!  integer,parameter :: nxshift=359 ! for ECMWF
    132140  !integer,parameter :: nxshift=0     ! for GFS or FNL
    133141
     
    135143  integer,parameter :: na = nconvlevmax+1
    136144
    137 
     145  ! moved to gfs_mod.f90 / ecmwf_mod.f90
     146  !
    138147  ! nxmax,nymax        maximum dimension of wind fields in x and y
    139148  !                    direction, respectively
     
    146155  !                    grids, and output grids overlapping the domain "boundary"
    147156  !                    nxshift must not be negative; "normal" setting would be 0
     157
    148158  ! ntracermax         maximum number of tracer species in convection
    149159  ! nconvlevmax        maximum number of levels for convection
     
    156166
    157167  !integer,parameter :: maxnests=0, nxmaxn=0, nymaxn=0
    158   integer,parameter :: maxnests=1,nxmaxn=351,nymaxn=351 !ECMWF
     168  integer,parameter :: maxnests=0,nxmaxn=351,nymaxn=351 !ECMWF
    159169
    160170  !integer,parameter :: maxnests=1, nxmaxn=201, nymaxn=161 ! FNL XF
     
    200210  !**************************************************
    201211
    202   integer,parameter :: maxpart=50000000
     212  integer,parameter :: maxpart=60000000
    203213!  integer,parameter :: maxpart=60000000
    204214!  integer,parameter :: maxpart=120000000
    205   integer,parameter :: maxspec=1
     215  integer,parameter :: maxspec=6
    206216
    207217  ! maxpart                 Maximum number of particles
     
    271281  integer,parameter :: unitdates=94, unitheader=90,unitheader_txt=100, unitshortpart=95
    272282  integer,parameter :: unitboundcond=89
     283  integer,parameter :: unittmp=101
    273284
    274285!******************************************************
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG