   !!======================================================================
 
  SUBROUTINE summary
 
   !&E---------------------------------------------------------------------
   !&E                 ***  ROUTINE summary  ***
   !&E
   !&E ** Purpose : Summarize main parameters of the configuration
   !&E
   !&E ** Description :
   !&E
   !&E ** Called by :
   !&E
   !&E ** External calls : 
   !&E
   !&E ** Reference :
   !&E
   !&E ** History :
   !&E       !  2007-03  (V. Garnier, F. Vandermeirch) Original code
   !&E       !  2009-09  (S. Michel, HOCER) add CPP keys description
   !&E       !  2011-02 (B. Thouvenin) correction for key_subs_part_eqsubdt key
   !&E       !  2014-10 (B. Thouvenin) add test for key parsub_adv
   !&E       !  2016-12  (B.Thouvenin) version sedim_MUSTANG : only mixsed (mudsand not operationnal)
   !&E
   !&E---------------------------------------------------------------------

#include "toolcpp.h"

   !! * Modules used
   USE parameters, ONLY : l_testcase,imin,imax,jmin,jmax,kmax, &
                          ishift_obc_west,ishift_obc_east,jshift_obc_south,jshift_obc_north
   USE comvars2d,  ONLY : iscreenlog,l_modele2d,dhj,h0fond,hm,hminim, &
                          fvisc,hminfrot,botstressmax,dt,dtmin,dtmax, &
                          hmaxfrot,file_bathy,filecl,fileclsv,        &
                          iwarnlog,ierrorlog,l_obc_cycl_x,l_obc_cycl_y
   USE comvars3d,  ONLY : nzinit,kzinit
   USE obccombine, ONLY : l_obc_mars,l_obc_diri,l_obc_char,l_obc_cycl
#if defined key_substance
   USE comsubstance, ONLY : nvp
#endif

   IMPLICIT NONE

#ifdef key_MPI_2D   
   include 'mpif.h'
#endif

   !! * Declaration function

   !! * Arguments

   !! * Local declarations
   INTEGER :: IERR_MPI,nb

   !!----------------------------------------------------------------------
   !! * Executable part

   IF (l_testcase) THEN

     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) '**************************************************'
     WRITE(iscreenlog,*) '**************** SUMMARY.F90 *********************'
     WRITE(iscreenlog,*) '**************************************************'
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) '**************************************************'
     WRITE(iscreenlog,*) '       MAIN PARAMETERS OF THE TEST CASE           '
     WRITE(iscreenlog,*) '**************************************************'
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) 'resolution',imax,jmax
     WRITE(iscreenlog,*) 'Nombre de niveau',kmax
     WRITE(iscreenlog,*) '-------------------------------'
     IF (l_modele2d) THEN
     WRITE(iscreenlog,*) ' '
       WRITE(iscreenlog,*) 'CALCUL 2D'
     ELSE
     WRITE(iscreenlog,*) ' '
       WRITE(iscreenlog,*) 'CALCUL 3D'
     END IF
     WRITE(iscreenlog,*) '-------------------------------'
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) 'dhj=',dhj
     WRITE(iscreenlog,*) 'h0fond=',h0fond
     WRITE(iscreenlog,*) 'hminim=',hminim
     WRITE(iscreenlog,*) 'hm=',hm
     WRITE(iscreenlog,*) '-------------------------------'
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) 'fvisc=',fvisc
     WRITE(iscreenlog,*) '-------------------------------'
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) 'nzinit=',nzinit
     WRITE(iscreenlog,*) 'kzinit=',kzinit
     WRITE(iscreenlog,*) '-------------------------------'
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) 'botstressmax=',botstressmax
     WRITE(iscreenlog,*) 'hminfrot=',hminfrot
     WRITE(iscreenlog,*) 'hmaxfrot=',hmaxfrot
     WRITE(iscreenlog,*) '-------------------------------'
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) 'dtini=',dt
     WRITE(iscreenlog,*) 'dtmin=',dtmin
     WRITE(iscreenlog,*) 'dtmax=',dtmax
     WRITE(iscreenlog,*) '-------------------------------'

   ELSE IF (.NOT.l_testcase) THEN
     WRITE(iscreenlog,*) 'Fichier bathymetrique :',file_bathy
     WRITE(iscreenlog,*) '-------------------------------'
     WRITE(iscreenlog,*) '--   Parametres sauvegarde   --'
     WRITE(iscreenlog,*) '-------------------------------'
     WRITE(iscreenlog,*) '---------------------------------------'
     WRITE(iscreenlog,*) '-- Parametres pour les emboitements  --'
     WRITE(iscreenlog,*) '---------------------------------------'
     WRITE(iscreenlog,*) 'Fichier utilise pour les conditions aux limites (filecl) :',filecl
     WRITE(iscreenlog,*) 'Fichier d ecriture des conditions aux limites du rang suivant (fileclsv) :',fileclsv
   END IF

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '**************************************************'
   WRITE(iscreenlog,*) '                    USED CPP KEYS                 '
   WRITE(iscreenlog,*) '**************************************************'
   WRITE(iscreenlog,*) ' '

   WRITE(iscreenlog,*) '         OPEN BOUNDARY CONDITIONS                 '
   IF (l_obc_diri) WRITE(iscreenlog,*) 'Dirichlet s conditions'
   IF (l_obc_char) WRITE(iscreenlog,*) 'Characterics method for 2D variables'
   IF (l_obc_mars) WRITE(iscreenlog,*) 'Standard conditions (zero gradient of velocity)'
   IF (l_obc_cycl) WRITE(iscreenlog,*) 'Periodic conditions'
#ifdef key_obc_char_barocline
   WRITE(iscreenlog,*) 'key_obc_char_barocline: Baroclinic characterics method'
#endif

   IF (l_obc_cycl_x) THEN
   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         SHIFT OF OPEN BOUNDARY CONDITIONS                 '
   WRITE(iscreenlog,*) 'to have a sufficient stencil, choose the following shifts  '
   WRITE(iscreenlog,*) 'ishift_obc_west >= 2 '
   WRITE(iscreenlog,*) 'ishift_obc_east >= 2 '
   END IF

   IF (l_obc_cycl_y) THEN
   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         SHIFT OF OPEN BOUNDARY CONDITIONS                 '
   WRITE(iscreenlog,*) 'to have a sufficient stencil, choose the following shifts  '
   WRITE(iscreenlog,*) 'jshift_obc_south >= 2 '
   WRITE(iscreenlog,*) 'jshift_obc_north >= 2 '
   END IF

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         INPUT/OUTPUT FILES                       '
#ifdef key_bathy_final
   WRITE(iscreenlog,*) 'key_bathy_final       : none modifcation added to the bathymetry'
#endif
#ifdef key_friden_lecture
   WRITE(iscreenlog,*) 'key_friden_lecture    : read current data in the BC file'
#endif
#ifdef key_friden_ecriture
   WRITE(iscreenlog,*) 'key_friden_ecriture   : write current data in the BC file'
#endif
#ifdef key_tide_saverotatedobc
   WRITE(iscreenlog,*) 'key_tide_saverotatedobc: write tide BC on a rotated grid'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         TIDAL FORCING                            '
#ifdef key_tide_schwid     
   WRITE(iscreenlog,*) 'key_tide_schwid            : model by Schwiderski(1980)'
#ifdef key_MPI_2D
   WRITE(ierrorlog,*) 'key_MPI_2D : due to the spatial extension of ssh(liminm2:limaxp2,ljminm2:ljmaxp2)'
   WRITE(ierrorlog,*) 'The use of Schwiderski s model is not ready yet in MPI'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#elif defined key_tide_fes2004    
   WRITE(iscreenlog,*) 'key_tide_fes2004           : Finite Element Solution 2004 model'
#elif defined key_tide_fes2012    
   WRITE(iscreenlog,*) 'key_tide_fes2012           : Finite Element Solution 2012 model'
#elif defined key_tide_tpx07   
   WRITE(iscreenlog,*) 'key_tide_tpx07             : OSU TOPEX/Poseidon Global Inverse Solution TPX0'
   WRITE(iscreenlog,*) 'DATA available from ftp://ftp.oce.orst.edu/dist/tides/'
   WRITE(iscreenlog,*) 'Use the preprocessing tool extrac_tpx07 to create the netcdf file'
#elif defined key_tide_shom     
   WRITE(iscreenlog,*) 'key_tide_shom              : model from the French Navy Hydrographic Service (SHOM)'
#endif

#ifdef key_lagoon
   WRITE(iscreenlog,*) 'key_lagoon            :  MARS for lagoons'
#ifdef key_tide_lagoon_marseille
   WRITE(iscreenlog,*) 'key_tide_lagoon_marseille  : lagoon of Marseille'
#elif key_tide_lagoon_banyuls
   WRITE(iscreenlog,*) 'key_tide_lagoon_marseille  : lagoon of Banyuls'
#else
   WRITE(iscreenlog,*) 'ATTENTION : no key_tide_lagoon : which parameters for tide ???'
#endif
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         SOLAR HEAT FLUXES                    '
#ifdef key_flx_solar_luyten 
   WRITE(iscreenlog,*) 'key_flx_solar_luyten  : parameterisation by Luyten et al, 1992'
#elif defined key_sflx_solar_gill
   WRITE(iscreenlog,*) 'key_sflx_solar_gill   : parameterisation by Gill, 1982'
#else
   WRITE(iscreenlog,*) 'default               : no solar parametrization'
   WRITE(iscreenlog,*) 'default               : Solar flux is read from an atmospherical file'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         THERMAL HEAT FLUXES                    '
#ifdef key_sflx_ir_swimbank 
   WRITE(iscreenlog,*) 'key_sflx_ir_swimbank  : parameterisation by Swimbank'
#elif defined key_sflx_ir_luyten
   WRITE(iscreenlog,*) 'key_sflx_ir_luyten    : parameterisation by Luyten et al, 1992'
#elif defined key_sflx_ir_clark
   WRITE(iscreenlog,*) 'key_sflx_ir_clark     : parameterisation by Clark et al, 1995'
#elif defined key_sflx_ir_berliand
   WRITE(iscreenlog,*) 'key_sflx_ir_berliand  : parameterisation by Berliand and Berliand, 1952'
#elif defined key_sflx_ir_hastenrath
   WRITE(iscreenlog,*) 'key_sflx_ir_hastenrath: parameterisation by Hastenrath and Lamb, 1978'
#elif defined key_sflx_ir_bignami
   WRITE(iscreenlog,*) 'key_sflx_ir_bignami   : parameterisation by Bignami et al, 1995'
#else
   WRITE(iscreenlog,*) 'default               : no thermal parametrization'
   WRITE(iscreenlog,*) 'default               : thermal flux is read from an atmospherical file'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         TURBULENT HEAT FLUXES                    '
#ifdef key_sflx_turb_luyten   
   WRITE(iscreenlog,*) 'key_sflx_turb_luyten  : parameterisation by Luyten et al, 1992'
#elif defined key_sflx_turb_default
   WRITE(iscreenlog,*) 'key_sflx_turb_default : parameterisation from the Proudman Oceanographic Laboratory (POL)'
#elif key_sflx_turb_large
   WRITE(iscreenlog,*) 'key_sflx_turb_large   : parameterisation by Large and Yeager, 2004'
#elif key_sflx_turb_ayina
   WRITE(iscreenlog,*) 'key_sflx_turb_ayina   : parameterisation by Ayina et Bentamy, 2007'
#elif key_sflx_turb_fairall
   WRITE(iscreenlog,*) 'key_sflx_turb_fairall : parameterisation by Fairall et al.,2003'
#else
   WRITE(iscreenlog,*) 'default               : no parametrization for turbulent (latent and sensible) fluxes'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         HORIZONTAL GRID                          '
#ifdef key_grid_rotated
   WRITE(iscreenlog,*) 'key_grid_rotated      : grid rotated by a fixed angle (positive clockwise)'
#else
   WRITE(iscreenlog,*) 'default               : Mercator-type grid (X: West->East, Y: South->North)'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         VERTICAL COORDINATE                      '
#ifdef key_siggen
   WRITE(iscreenlog,*) 'key_siggen            : generalised sigma coordinates'
#elif key_gencoord
   WRITE(iscreenlog,*) 'key_gencoord          : generalised coordinates'
   WRITE(iscreenlog,*) 'It is possible to use sigma coordinates'
   WRITE(iscreenlog,*) '                      generalized sigma coordinates'
   WRITE(iscreenlog,*) '                      isopycnal coordinates'
   WRITE(iscreenlog,*) '                      z coordinates'
   WRITE(iscreenlog,*) '                      or hydrid coordinates'
   WRITE(iscreenlog,*) '!!! On progress DO NOT USE THIS CPP KEY !!!'
#else
   WRITE(iscreenlog,*) 'default               : standard sigma coordinates'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         PRESSURE GRADIENT                        '
#ifdef key_dyn_pg_djcs    
   WRITE(iscreenlog,*) 'key_dyn_pg_djcs       : computation by Shchepetkin et al, 2004'
#elif key_dyn_pg_pint 
   WRITE(iscreenlog,*) 'key_dyn_pg_pint       : computation by Marsaleix et al, 2009'
#elif key_dyn_pg_dj 
   WRITE(iscreenlog,*) 'key_dyn_pg_dj         : computation by Shchepetkin et Mc Williams, 2003'
#else
   WRITE(iscreenlog,*) 'default               : pressure jacobian'
#endif
#ifdef key_profil_back
   WRITE(iscreenlog,*) 'It is estimated with anomaly of density (from the profil_back.txt)'
#endif


   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         MOMENTUM NON-LINEAR TERMS                '
#ifdef key_dyn_adv_quick     
   WRITE(iscreenlog,*) 'key_dyn_adv_quick     : QUICK advection scheme'
#elif defined key_dyn_adv_quickest
   WRITE(iscreenlog,*) 'key_dyn_adv_quickest  : QUICKEST advection scheme'
#elif defined key_dyn_adv_none
   WRITE(iscreenlog,*) 'key_dyn_adv_none      : remove non-linear advection terms in momentum equation'
#elif defined key_dyn_adv_linear
   WRITE(iscreenlog,*) 'key_dyn_adv_linear    : momentum and continuity equations are linearized'
#else
   WRITE(iscreenlog,*) 'default               : centered advection scheme'
#endif
#ifdef key_no_bottom_stress     
   WRITE(iscreenlog,*) 'key_no_bottom_stress  : suppress bottom stress in momentum equation'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         TRACER ADVECTION (T/S/Dissolved substances) '
#ifdef key_tssub_adv_fifthorder
   WRITE(iscreenlog,*) 'key_tssub_adv_fifthorder           : FIFTH ORDER horizontal scheme'
#elif key_tssub_adv_ultimatequickest 
   WRITE(iscreenlog,*) 'key_tssub_adv_ultimatequickest     : QUICKEST horizontal scheme with Ultimate limiter'
#elif defined key_tssub_adv_ultimatequickestmacho
   WRITE(iscreenlog,*) 'key_tssub_adv_ultimatequickestmacho: QUICKEST horizontal scheme with Ultimate limiter and MACHO extension'
#elif defined key_tssub_wquickupwind
   WRITE(iscreenlog,*) 'key_tssub_wquickupwind             : QUICK scheme along the vertical direction'
#elif defined key_tssub_wcompact
   WRITE(iscreenlog,*) 'key_tssub_wcompact                 : Upwind Compact and Conservative scheme along the vertical direction'
#else
   WRITE(iscreenlog,*) 'default                            : centered advection scheme'
#endif
#if defined key_tssub_adv_ultimatequickestmacho && defined key_tssub_macho3d
   WRITE(ierrorlog,*) 'You cannot choose the key_tssub_adv_ultimatequickestmacho'
   WRITE(ierrorlog,*) 'together with key_tssub_macho3d'
   WRITE(ierrorlog,*) 'Choose another key (key_tssub_adv_ultimatequickest ou 5th order)'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif

#if defined key_substance
   IF(nvp > 0) THEN
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) '         TRACER ADVECTION (Particulate substances) '
#ifdef key_parsub_adv_fifthorder
     WRITE(iscreenlog,*) 'key_parsub_adv_fifthorder           : FIFTH ORDER horizontal scheme'
#elif key_parsub_adv_ultimatequickest 
     WRITE(iscreenlog,*) 'key_parsub_adv_ultimatequickest     : QUICKEST horizontal scheme with Ultimate limiter'
#elif defined key_parsub_adv_ultimatequickestmacho
     WRITE(iscreenlog,*) 'key_parsub_adv_ultimatequickestmacho: QUICKEST horizontal scheme with Ultimate limiter and MACHO extension'
#elif defined key_parsub_wquickupwind
     WRITE(iscreenlog,*) 'key_parsub_wquickupwind             : QUICK scheme along the vertical direction'
#elif defined key_parsub_wcompact
     WRITE(iscreenlog,*) 'key_parsub_wcompact                 : Upwind Compact and Conservative scheme along the vertical direction'
#else
     WRITE(iscreenlog,*) 'ATTENTION : default                 : centered advection scheme'
     WRITE(iwarnlog,*) '    ===============================================================  '
     WRITE(iwarnlog,*) 'ATTENTION : You have not given a key for particulate tracer horizontal advection'
     WRITE(iwarnlog,*) 'the scheme used is the defaul scheme (centered)'
     WRITE(iwarnlog,*) 'Better choice : -Dkey_parsubs_adv_ultimatequickestmacho or parsub_adv_ultimatequickest'
     WRITE(iwarnlog,*) '    ===============================================================  '
#endif
#if defined key_parsub_adv_ultimatequickestmacho && defined key_parsub_macho3d
     WRITE(ierrorlog,*) 'You cannot choose the key_parsub_adv_ultimatequickestmacho'
     WRITE(ierrorlog,*) 'together with key_parsub_macho3d'
     WRITE(ierrorlog,*) 'Choose another key (key_parsub_adv_ultimatequickest ou 5th order)'
     WRITE(ierrorlog,*) 'The simulation is stopped'
     CALL_MPI MPI_FINALIZE(IERR_MPI)
     STOP
#endif
     WRITE(iscreenlog,*) ' '
     WRITE(iscreenlog,*) '   ADVECTION OF PARTICULATE TRACERS '
#ifdef key_parsub_wquickupwind
     WRITE(iscreenlog,*) 'key_parsub_wquickupwind            : QUICK scheme along the vertical direction'
#elif defined key_parsub_wcompact
     WRITE(iscreenlog,*) 'key_parsub_wcompact                : Upwind Compact and Conservative scheme along the vertical direction'
#else
     WRITE(iscreenlog,*) 'ATTENTION : default                 : centered advection scheme'
     WRITE(iwarnlog,*) '    ===============================================================  '
     WRITE(iwarnlog,*) 'ATTENTION : You have not given a key for particulate tracer vertical scheme'
     WRITE(iwarnlog,*) 'the scheme used is the defaul scheme (centered)'
     WRITE(iwarnlog,*) 'Better choice : -Dkey_parsubs_wquickupwind or parsub_wcompact'
     WRITE(iwarnlog,*) '    ===============================================================  '
#endif
   ENDIF
#endif

#ifdef key_linear_bottom_stress
   WRITE(iwarnlog,*) ' '
   WRITE(iwarnlog,*) ' ------------------------------------------------------- '
   WRITE(iwarnlog,*) ' WARNING : The turbulence schemes are not ready'
   WRITE(iwarnlog,*) '           for a linear parametrisation of the bottom stress'
   WRITE(iwarnlog,*) '           except of kz=cst and nz=cst'
   WRITE(iwarnlog,*) ' '
   WRITE(iwarnlog,*) ' ------------------------------------------------------- '
#endif

#ifdef key_shiftobc
   IF (.NOT.l_testcase) THEN
     WRITE(ierrorlog,*) ' ------------------------------------------------------- '
     WRITE(ierrorlog,*) ' WARNING : For a realistic configuration                 '
     WRITE(ierrorlog,*) '           using the obc shifting functionality,         '
     WRITE(ierrorlog,*) '           mn,ms,me and mo are not correctly assigned    '
     WRITE(ierrorlog,*) '           The simulation is stopped                     '
     WRITE(ierrorlog,*) 'mn,ms doivent etre assignes entre jmin+1,jmax et ig,id-1 '
     CALL_MPI MPI_FINALIZE(IERR_MPI)
     STOP
     WRITE(ierrorlog,*) ' ------------------------------------------------------- '
   END IF
#endif

   nb = 0
#if defined key_tssub_adv_fifthorder && defined key_tssub_adv_ultimatequickest
   nb = nb+1
print*,'fdsqfffd,',nb
#endif
#if defined key_tssub_adv_ultimatequickest && defined key_tssub_adv_ultimatequickestmacho
   nb = nb+1
#endif
#if defined key_tssub_adv_fifthorder && defined key_tssub_adv_ultimatequickestmacho
   nb = nb+1
#endif
   IF (nb > 0) THEN
     WRITE(ierrorlog,*) 'You must chose only one scheme for the advection of the tracer'
     WRITE(ierrorlog,*) 'The simulation is stopped'
     CALL_MPI MPI_FINALIZE(IERR_MPI)
     STOP
   END IF

#ifdef key_tssub_macho3d
#if ! defined key_tssub_wquickupwind && ! defined key_tssub_wcompact
   WRITE(ierrorlog,*) 'With the use of key_tssub_macho3d cpp key'
   WRITE(ierrorlog,*) '(MACHO in 3D : advection in the following order : XYZ - XZY - YXZ - YZX - ZXY - ZYX)'
   WRITE(ierrorlog,*) 'You must choose key_tssub_wquickupwind or key_tssub_wcompact cpp key'
   WRITE(ierrorlog,*) 'and the vertical scheme for the advection is explicit'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#endif


#ifdef key_subs_part_eqsubdt
   WRITE(iscreenlog,*) 'key_subs_part_eqsubdt              : Equation of substances with settling velocity is solved with a sub time step'
   WRITE(iscreenlog,*) '                                     and the variables are ordered according to their settling velocity'
   WRITE(iscreenlog,*) '                                     to optimize the computation of the advection'
   WRITE(iscreenlog,*) '                                     Pay attention to define properly the maximum settling velocity in variable.dat file'
   WRITE(iscreenlog,*) '                                     or the sub time step in subreaddat.F90'
   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '  ** Important remark :'
   WRITE(iscreenlog,*) '   !                   To save computation time, we assume the substances have the same settling velocity'
   WRITE(iscreenlog,*) '                       in a group (since the group and the corresponding sub time step depend on the'
   WRITE(iscreenlog,*) '                       maximum of settling velocity that can usely be defined from the diameter and the density of the particule).'
   WRITE(iscreenlog,*) '                       This assumption is not necessary valid for the biology. If so, slightly modify'
   WRITE(iscreenlog,*) '                       the maximum settling velocity in variable.dat file, to create a new group.'
   WRITE(iscreenlog,*) ' ' 
   WRITE(iscreenlog,*) '                       Do not use this cpp key if all the substances have different settling velocity (but the computation time be much longer' 
#endif
#ifdef key_substance
   WRITE(iwarnlog,*) ' '
   WRITE(iwarnlog,*) ' ------------------------------------------------------- '
   WRITE(iwarnlog,*) ' If you simulate substances with settling velocity,'
   WRITE(iwarnlog,*) ' pay attention to define properly the sub time step in subreaddat.F90'
   WRITE(iwarnlog,*) ' '
   WRITE(iwarnlog,*) ' It is recommended to use key_subs_part_eqsubdt cpp key to save time'
   WRITE(iwarnlog,*) ' in the estimation of the advection :'
   WRITE(iwarnlog,*) ' then, variables are ordered according to their maximum settling velocity defined in variables.dat file'
   WRITE(iwarnlog,*) ' and the advection is computed per group of settling velocity'
   WRITE(iwarnlog,*) ' ------------------------------------------------------- '
#endif

#ifdef key_tssub_casadvsmolartime
   WRITE(iscreenlog,*) 'key_tssub_casadvsmolartime         : Initialization of momentum field at each time step'
   WRITE(iscreenlog,*) 'key_tssub_casadvsmolartime         : casadvsmolar test case only'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         TRACER DIFFUSION                         '
#ifdef key_ts_diffh_geo    
   WRITE(iscreenlog,*) 'key_ts_diffh_geo      : diffusion along geopotential surfaces'
#ifdef key_substance
   WRITE(ierrorlog,*) 'key_ts_diffh_geo & key_substance : not implemented yet'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#elif key_ts_diffh_rho    
   WRITE(iscreenlog,*) 'key_ts_diffh_rho      : diffusion along isopycnal surfaces'
#ifdef key_substance
   WRITE(ierrorlog,*) 'key_ts_diffh_rho & key_substance : not implemented yet'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#else
   WRITE(iscreenlog,*) 'default               : diffusion along sigma surfaces'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         BIOGEOCHEMICAL TRACERS                   '
#ifdef key_substance    
   WRITE(iscreenlog,*) 'key_substance         : transport active/passive substances'
   ! biochemical module
#ifdef key_contaminant
   WRITE(iscreenlog,*) 'key_contaminant             : transport biochemical substances'
#endif
   ! biological module
#ifdef key_biolo
   WRITE(iscreenlog,*) 'key_biolo             : transport biological species'
#ifdef key_messat
   WRITE(iscreenlog,*) 'key_biolo & key_messat: read Sea Surface Temperature measurements'
#endif
#else
#ifdef key_messat
   WRITE(iscreenlog,*) 'WARNING: key_messat requires key_biolo to be activated'
#endif
#endif
   ! sedimentological module
#ifdef key_sedim_MUSTANG
!!#if (defined key_sedim_mixsed && defined key_sedim_mudsand)
!!   WRITE(iscreenlog,*) 'WARNING: key_sedim_MUSTANG_mudsand and key_sedim_mixsed are conflictuous'
!!#elif defined key_sedim_mixsed
   WRITE(iscreenlog,*) 'key_sedim_MUSTANG  : use sedimentological module (mixed sediment version)'
!!#elif defined key_sedim_mudsand
#if defined key_sedim_mudsand
   WRITE(iscreenlog,*) 'key_sedim_MUSTANG & key_sedim_mudsand: NOT OPERATIONNAL '
   WRITE(iscreenlog,*) 'MUSTANG uses only and automatically option mixsed'
!!#else
!!   WRITE(iscreenlog,*) 'key_sedim_MUSTANG                    : use sedimentological module (none chosen version)'
#endif
!!#else
!!#ifdef key_sedim_mixsed
!!   WRITE(iscreenlog,*) 'WARNING: key_sedim_MUSTANG_mixsed requires key_sedim to be activated'
!!#endif
!!#ifdef key_sedim_mudsand
!!   WRITE(iscreenlog,*) 'WARNING: key_sedim_MUSTANG_mudsand requires key_sedim to be activated'
!!#endif
#endif
   ! no substances transport
#else
   WRITE(iscreenlog,*) 'default               : no transport of substances'
#ifdef key_contaminant
   WRITE(iscreenlog,*) 'WARNING: key_contaminant requires key_substance to be activated'
#endif
#ifdef key_biolo
   WRITE(iscreenlog,*) 'WARNING: key_biolo requires key_substance to be activated'
#endif
#ifdef key_sedim_MUSTANG
   WRITE(iscreenlog,*) 'WARNING: key_sedim_MUSTANG requires key_substance to be activated'
#endif
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         OFFLINE TRACER ADVECTION                '
#ifdef key_offline_outuvflux  
   WRITE(iscreenlog,*) 'key_offline_outuvflux : save time-averaged 3D velocities and sea level'
#endif
#ifdef key_offline
   WRITE(iscreenlog,*) 'key_offline           : read time-averaged dynamics and compute only tracers advection'
#else
   WRITE(iscreenlog,*) 'default               : compute dynamics and tracers advection'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         AGRIF REFINEMENT                         '
#if (defined key_agrif && ! defined key_siggen)
   WRITE(ierrorlog,*) 'AGRIF must be used with generalized sigma coordinates (key_siggen key)'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#if (defined key_agrif && defined AGRIF_MPI && defined key_MPI_2D)
   WRITE(iscreenlog,*) 'key_agrif & AGRIF_MPI & key_MPI_2D : AGRIF grid refinement + MPI'
#elif (defined key_agrif && defined AGRIF_MPI)
   WRITE(ierrorlog,*) 'key_agrif & AGRIF_MPI    : AGRIF + MPI not compiled, add key_MPI_2D key'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#elif (defined key_agrif && defined key_MPI_2D)
   WRITE(ierrorlog,*) 'key_agrif & key_MPI_2D   : AGRIF + MPI not compiled, add AGRIF_MPI key'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#elif defined key_agrif
   WRITE(iscreenlog,*) 'key_agrif               : AGRIF grid refinement'
#else
   WRITE(iscreenlog,*) 'default                 : no grid refinement'
#endif

!   WRITE(iscreenlog,*) ' '
!   WRITE(iscreenlog,*) '         OPTIONAL LIBRARIES                         '

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         MPI PARALLELISATION                      '
#ifdef key_MPI_2D
   WRITE(iscreenlog,*) 'key_MPI_2D            : MPI parallelisation along the x and y directions'
#else
   WRITE(iscreenlog,*) 'default               : sequential run or OpenMP parallelisation'
#endif

   WRITE(iscreenlog,*) ' '
   WRITE(iscreenlog,*) '         LAGRANGIAN TRAJECTORIES                  '
#ifdef key_trajec2d    
   WRITE(iscreenlog,*) 'key_trajec2d          : trajectories for 2D simulations'
   WRITE(iscreenlog,*) 'not maintained anymore'
#elif defined key_trajec3d
   WRITE(iscreenlog,*) 'key_trajec3d          : trajectories for 2D simulations'
#ifdef key_ibm
   WRITE(ierrorlog,*) 'You are not allowed to choose key_ibm and key_trajec3d at the same time'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#else
   WRITE(iscreenlog,*) 'default               : no lagrangian floats trajectories'
#endif

#if defined key_ibm
   WRITE(iscreenlog,*) 'key_trajec3d          : trajectories for 2D simulations'
#if defined key_trajec3d || defined key_trajec2d
   WRITE(ierrorlog,*) 'You are not allowed to choose key_ibm and key_trajec3d/2d at the same time'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#endif

#ifdef key_wave_qeuler_dynamics
   WRITE(iscreenlog,*) 'key_wave_qeuler_dynamics : quasi-eulerian dynamics'
#if ! defined key_wave_soulsby_bottom_stress
   WRITE(ierrorlog,*) 'You must use key_wave_soulsby_bottom_stress'
   WRITE(ierrorlog,*) 'See waveqeuler wave_turb routine (pk1)'
   WRITE(ierrorlog,*) 'The simulation is stopped'
   CALL_MPI MPI_FINALIZE(IERR_MPI)
   STOP
#endif
#endif

   WRITE(iscreenlog,*) '**************************************************'
   WRITE(iscreenlog,*) '**************** END OF SUMMARY ******************'
   WRITE(iscreenlog,*) '**************************************************'

  END SUBROUTINE summary
