Changeset a9cf4b1 in flexpart.git


Ignore:
Timestamp:
Apr 5, 2018, 12:30:54 PM (6 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:
3f149cc
Parents:
8fcfd08
Message:

Made enabling netCDF output during compilation optional

Location:
src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/FLEXPART.f90

    r0c00f1f ra9cf4b1  
    5252  use com_mod
    5353  use conv_mod
    54   use netcdf_output_mod, only: writeheader_netcdf
     54
    5555  use random_mod, only: gasdev1
    5656  use class_gribfile
     57
     58#ifdef USE_NCF
     59  use netcdf_output_mod, only: writeheader_netcdf
     60#endif
    5761
    5862  implicit none
     
    352356  !******************************************************************
    353357
     358#ifdef USE_NCF
    354359  if (lnetcdfout.eq.1) then
    355360    call writeheader_netcdf(lnest=.false.)
     
    365370    endif
    366371  endif
     372#endif
    367373
    368374  if (verbosity.gt.0) then
  • src/FLEXPART_MPI.f90

    r0c00f1f ra9cf4b1  
    5353  use conv_mod
    5454  use mpi_mod
    55   use netcdf_output_mod, only: writeheader_netcdf
    5655  use random_mod, only: gasdev1
    5756  use class_gribfile
     57
     58#ifdef USE_NCF
     59  use netcdf_output_mod, only: writeheader_netcdf
     60#endif
    5861
    5962  implicit none
     
    378381
    379382  if (mp_measure_time) call mpif_mtime('iotime',0)
     383
    380384  if (lroot) then ! MPI: this part root process only
    381 
    382   if (lnetcdfout.eq.1) then
    383     call writeheader_netcdf(lnest=.false.)
    384   else
    385     call writeheader
    386   end if
    387 
    388   if (nested_output.eq.1) then
    389     if (lnetcdfout.eq.1) then
    390       call writeheader_netcdf(lnest=.true.)
    391     else
    392       call writeheader_nest
    393     endif
    394   endif
    395 
    396 !
     385#ifdef USE_NCF
     386    if (lnetcdfout.eq.1) then
     387      call writeheader_netcdf(lnest=.false.)
     388    else
     389      call writeheader
     390    end if
     391   
     392    if (nested_output.eq.1) then
     393      if (lnetcdfout.eq.1) then
     394        call writeheader_netcdf(lnest=.true.)
     395      else
     396        call writeheader_nest
     397      endif
     398    endif
     399#endif
     400
    397401    if (verbosity.gt.0) then
    398402      print*,'call writeheader'
     
    402406! FLEXPART 9.2 ticket ?? write header in ASCII format
    403407    call writeheader_txt
    404 !if (nested_output.eq.1) call writeheader_nest
     408
    405409    if (nested_output.eq.1.and.surf_only.ne.1) call writeheader_nest
    406410    if (nested_output.eq.1.and.surf_only.eq.1) call writeheader_nest_surf
     
    409413
    410414  if (mp_measure_time) call mpif_mtime('iotime',0)
    411 
    412   !open(unitdates,file=path(2)(1:length(2))//'dates')
    413415
    414416  if (verbosity.gt.0 .and. lroot) then
  • src/makefile

    rccc9ec2 ra9cf4b1  
    3131#      make [-j] mpi-dbg
    3232#
     33#  NETCDF OUTPUT
     34#    To add support for output in netCDF format, append `ncf=yes` to the
     35#    `make` command
     36#
    3337################################################################################
    3438
     
    5761        INCPATH2  = ${ROOT_DIR}/include
    5862        LIBPATH1 = ${ROOT_DIR}/lib
    59 
    60 else #ifeq ($(gcc), 5.4)
     63else
    6164# Compiled libraries under user ~flexpart, gfortran v5.4
    6265        ROOT_DIR = /homevip/flexpart/
     
    6871        INCPATH2  = /usr/include
    6972        LIBPATH1 = ${ROOT_DIR}/gcc-5.4.0/lib
    70 
    71 #else
    72 # Default: System libraries at NILU, gfortran v4.6
    73 #       F90       = /usr/bin/gfortran
    74 #       MPIF90    = /usr/bin/mpif90.openmpi
    75 
    76 #       INCPATH1 = /xnilu_wrk/projects/FLEXPART/flex_wrk/bin64/grib_api/include
    77 #       INCPATH2 = /usr/include
    78 #       LIBPATH1 = /xnilu_wrk/projects/FLEXPART/flex_wrk/bin64/grib_api/lib
    7973endif
     74
     75
     76### Enable netCDF output?
     77ifeq ($(ncf), yes)
     78        NCOPT = -DUSE_NCF -lnetcdff     
     79else
     80        NCOPT = -UUSE_NCF
     81endif
     82
    8083
    8184
     
    8992
    9093## LIBRARIES
    91 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff # -fopenmp
    92 
    93 FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(FUSER)  #-Warray-bounds -fcheck=all # -march=native
    94 
    95 DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace   -Wall  -fdump-core $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero  -Warray-bounds -fcheck=all
     94#LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff
     95LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper $(NCOPT)
     96
     97FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(NCOPT) $(FUSER)  #-Warray-bounds -fcheck=all # -march=native
     98
     99DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) $(NCOPT) -fbacktrace   -Wall  -fdump-core $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero  -Warray-bounds -fcheck=all
    96100
    97101LDFLAGS  = $(FFLAGS) -L$(LIBPATH1) -Wl,-rpath,$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
     
    139143        getfields_mpi.o \
    140144        readwind_ecmwf_mpi.o
     145
     146OBJECTS_NCF = netcdf_output_mod.o
    141147
    142148OBJECTS = \
     
    196202dynamic_viscosity.o     get_settling.o  \
    197203initialize_cbl_vel.o    re_initialize_particle.o \
    198 cbl.o                   netcdf_output_mod.o
     204cbl.o
     205
     206ifeq ($(ncf), yes)
     207        OBJECTS := $(OBJECTS) $(OBJECTS_NCF)
     208endif
    199209
    200210%.o: %.mod
  • src/par_mod.f90

    r1f55de1 ra9cf4b1  
    148148  ! ECMWF
    149149! integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92,nxshift=359 ! 1.0 degree 92 level
    150   integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359 ! 1.0 degree 138 level
     150!  integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359 ! 1.0 degree 138 level
     151  integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=0 ! 1.0 degree 138 level
    151152! integer,parameter :: nxmax=721,nymax=361,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359  ! 0.5 degree 138 level
    152153!  integer,parameter :: nxmax=181,nymax=91,nuvzmax=92,nwzmax=92,nzmax=92,nxshift=0  ! CERA 2.0 degree 92 level
     
    209210  !integer,parameter :: maxxgrid=361,maxygrid=181,maxxgridn=0,maxygridn=0)
    210211
    211   integer,parameter :: maxreceptor=20
     212  integer,parameter :: maxreceptor=200
    212213
    213214  ! maxreceptor             maximum number of receptor points
     
    218219  !**************************************************
    219220
    220   integer,parameter :: maxpart=100000
    221   integer,parameter :: maxspec=1
     221  integer,parameter :: maxpart=3000000                                         
     222  integer,parameter :: maxspec=6
    222223
    223224  real,parameter :: minmass=0.0001
     
    262263  !*********************************
    263264
    264   integer,parameter :: maxrand=1000000
     265  integer,parameter :: maxrand=200000000
    265266
    266267  ! maxrand                 number of random numbers used
  • src/readOHfield.f90

    rb1e0742 ra9cf4b1  
    9595  read(unitOH) ((((OH_field(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,12)
    9696  read(unitOH) ((((OH_hourly(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,2)
    97   write(*,*) 'nzOH: ',nzOH,(altOH(i),i=1,nzOH)
    9897
    9998end subroutine readOHfield
  • src/readcommand.f90

    r01e6052 ra9cf4b1  
    392392  endif
    393393
    394 !  check for netcdf output switch (use for non-namelist input only!)
     394! Check for netcdf output switch
     395!*******************************
    395396  if (iout.ge.8) then
    396397     lnetcdfout = 1
    397398     iout = iout - 8
    398 ! #ifndef NETCDF_OUTPUT
    399 !      print*,'ERROR: netcdf output not activated during compile time but used in COMMAND file!'
    400 !      print*,'Please recompile with netcdf library or use standard output format.'
    401 !      stop
    402 ! #endif
     399#ifndef USE_NCF
     400     write(*,*) 'ERROR: netcdf output not activated during compile time but used in COMMAND file!'
     401     write(*,*) 'Please recompile with netcdf library (`make [...] ncf=yes`) or use standard output format.'
     402     stop
     403#endif
    403404  endif
    404405
  • src/timemanager.f90

    rfe32dca ra9cf4b1  
    101101  use par_mod
    102102  use com_mod
     103#ifdef USE_NCF
    103104  use netcdf_output_mod, only: concoutput_netcdf,concoutput_nest_netcdf,&
    104105       &concoutput_surf_netcdf,concoutput_surf_nest_netcdf
     106#endif
    105107
    106108  implicit none
     
    389391          if (surf_only.ne.1) then
    390392            if (lnetcdfout.eq.1) then
     393#ifdef USE_NCF
    391394              call concoutput_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     395#endif
    392396            else
    393397              call concoutput(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     
    399403             write(*,*) 'system clock',count_clock - count_clock0   
    400404            endif
    401             if (lnetcdfout.eq.1) then
     405            if (lnetcdfout.eq.1) then
     406#ifdef USE_NCF
    402407              call concoutput_surf_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     408#endif
    403409            else
    404410              call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     
    419425              endif
    420426            else
     427#ifdef USE_NCF
    421428              if (surf_only.ne.1) then
    422429                call concoutput_nest_netcdf(itime,outnum)
     
    424431                call concoutput_surf_nest_netcdf(itime,outnum)
    425432              endif
     433#endif
    426434            endif
    427435          endif
  • src/timemanager_mpi.f90

    rb1e0742 ra9cf4b1  
    102102  use com_mod
    103103  use mpi_mod
     104#ifdef USE_NCF
    104105  use netcdf_output_mod, only: concoutput_netcdf,concoutput_nest_netcdf,&
    105106       &concoutput_surf_netcdf,concoutput_surf_nest_netcdf
     107#endif
    106108
    107109  implicit none
     
    481483            if (lroot) then
    482484              if (lnetcdfout.eq.1) then
     485#ifdef USE_NCF
    483486                call concoutput_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,&
    484487                     &drygridtotalunc)
     488#endif
    485489              else
    486490                call concoutput(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     
    494498            if (lroot) then
    495499              if (lnetcdfout.eq.1) then
     500#ifdef USE_NCF
    496501                call concoutput_surf_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,&
    497502                     &drygridtotalunc)
     503#endif
    498504              else
    499505                call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     
    513519            call mpif_tm_reduce_grid_nest
    514520 
    515            if (mp_measure_time) call mpif_mtime('iotime',0)
     521            if (mp_measure_time) call mpif_mtime('iotime',0)
    516522
    517523            if (lnetcdfout.eq.0) then
     
    526532              else  ! :TODO: check for zeroing in the netcdf module
    527533                call concoutput_surf_nest(itime,outnum)
    528 
    529534              end if
    530 
    531535            else
    532 
     536#ifdef USE_NCF
    533537              if (surf_only.ne.1) then
    534538                if (lroot) then             
     
    544548                end if
    545549              endif
    546 
    547 
     550#endif
    548551            end if
    549552          end if
    550          
    551 
    552553          outnum=0.
    553554        endif
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG