 MODULE parameters

!!======================================================================
!!                   ***  MODULE parameters  ***
!!
!! ** Description : parameters for a rank 0 configuration
!!
!!
!! ** Reference :
!!                T. Duhaut, M. Honnorat, L. Debreu, 2008 : Rapport
!!                contrat PREVIMER - Ref : 06/2 210 290 (pages 100-125)
!!
!! ** History :
!!       !  2008-07 (L. Debreu, M. Honnorat, T. Duhaut) time scheme
!!       !  2008-09 (G. Galibert / ALTRAN) attributes of output files
!!                   to respect NetCDF OCO v1.1 file format
!!                   modification of rg_valmanq_io and addition of dg_valmanq_io
!!
!!======================================================================
!! * Modules used

!! * Shared or public module variables

   INTEGER,PARAMETER :: riosh=4,riolg=8,rlg=8,rsh=8,lchain=200
   CHARACTER(len=4),PARAMETER :: nrac='LOIR'
   LOGICAL,PARAMETER :: l_testcase=.FALSE.
   INTEGER,PARAMETER :: num_testcase=0

   INTEGER,PARAMETER :: no=0 ! rank
   INTEGER           &

          ,PARAMETER &

                     :: imin=0,imax=466,jmin=0,jmax=251 ! configuration rang_0
! obc_width=number of lines (or columns) in your obc files - 1
   INTEGER,PARAMETER :: kmax=10,obc_width=35
! shift of obc for non-linear advection terms
   INTEGER          &

         ,PARAMETER &

           :: ishift_obc_west=0,ishift_obc_east=0,jshift_obc_south=0,jshift_obc_north=0







!!**************************************************************************************
!! for SEDIMENT MODULE : give ksdmin, ksdmax, nb_var_sedconstit
!!                       + nb_var_base (others variables) if not key_biolo
!!**************************************************************************************
!!
!!   . maximum number of layers (ksdmax)
!! =====================================
   INTEGER,PARAMETER :: ksdmin=1,ksdmax=100
!!
!!   . number of constitutive particulate variables (GRAV, SAND, MUDS) : nb_var_sedconstit
!! ====================================================================================
   INTEGER,PARAMETER :: nb_var_sedconstit=5
 
!!   . number of all other variables (DISS, NCP, MUDB, FIXE, INT, DRIV)) : nb_var_base (only if .not.key_biolo)
!! ====================================================================================

   INTEGER,PARAMETER :: nb_var_base=0

 

! fin  1



!!***************************************
!! particular testcase
!!========================================

!!***************************************
!! general case
!!========================================
   INTEGER,PARAMETER :: nb_var_cas=nb_var_base+nb_var_sedconstit


!!***************************************
!! Contaminant
!!========================================



   INTEGER,PARAMETER :: nbpartmax=1,nbtachmax=1
   INTEGER,PARAMETER :: ngridmax=10,nmarmax=144,nbchprox=1

! global variables for characteristics method (obc)
! coefficient used when correcting matrixes
   REAL(KIND=rsh),PARAMETER :: al1=1.0_rsh,al2=1.0_rsh,al3=-1.0_rsh,ac0=1.0_rsh-al1/4.0_rsh, &
                               ac1=al2+al3/2.0_rsh,ac2=al2/4.0_rsh+al3/2.0_rsh

! implicit and explicit coefficients
   REAL(kind=rsh)  ,PARAMETER :: cfroe=0.5_rsh,cfroi=1.0_rsh-cfroe
! alphap (p for previous) must be lower than 0.5
! alphan (n for next)
   REAL(kind=rsh)  ,PARAMETER :: alphap=0.45_rsh,alphan=1.0_rsh-alphap
   REAL(kind=rsh)  ,PARAMETER :: valmanq=999.0_rsh
   REAL(kind=riosh),PARAMETER :: rg_valmanq_io=999.0_riosh
    REAL(kind=riolg),PARAMETER :: dg_valmanq_io=-1.7e+38
!REAL(kind=riolg),PARAMETER :: dg_valmanq_io=-9.e+33
   REAL(kind=rlg)  ,PARAMETER :: pi=3.141592654_rlg,tref=59958230400_rlg,epsilon=0.00000001_rlg
   REAL(KIND=rsh)  ,PARAMETER :: grav=9.81_rsh
   REAL(KIND=rlg)  ,PARAMETER :: exp1=2.718281828_rlg

! to adapt to your grid : min and max dx to compute surf  to avoid a division by 0
   REAL(KIND=rlg)  ,PARAMETER :: dxmin=10.0,dxmax=5000.0
! Missing value of lon,lat,dx .. etc in case there is no mesh
   REAL(kind=riolg),PARAMETER :: valmanq_curv=-999




   INTEGER :: ljmin=jmin,ljminp1=jmin+1+jshift_obc_south,ljminp2=jmin+2+jshift_obc_south, &
              ljminm1=jmin,ljminm2=jmin,ljminp1m2=jmin+1+jshift_obc_south,ljminp1m1=jmin+1+jshift_obc_south
   INTEGER :: ljmax=jmax,ljmaxm1=jmax-1-jshift_obc_north,ljmaxm1p1=jmax-1-jshift_obc_north, &
              ljmaxp1=jmax,ljmaxp2=jmax,ljmaxp3=jmax
   INTEGER :: limin=imin,liminp1=imin+1+ishift_obc_west,liminp2=imin+2+ishift_obc_west, &
              liminm1=imin,liminm2=imin,liminp1m2=imin+1+ishift_obc_west,liminp1m1=imin+1+ishift_obc_west
   INTEGER :: limax=imax,limaxm1=imax-1-ishift_obc_east,limaxm1p1=imax-1-ishift_obc_east, &
              limaxp1=imax,limaxp2=imax,limaxp3=imax



   INTEGER,PARAMETER :: nb_var=nb_var_cas



 END MODULE parameters
