Skip to content
Snippets Groups Projects
read_exsegn.f90 108 KiB
Newer Older
!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt  
!MNH_LIC for details. version 1.
!-----------------------------------------------------------------
!--------------- special set of characters for RCS information
!-----------------------------------------------------------------
Gaelle TANGUY's avatar
Gaelle TANGUY committed
! $Source: /srv/cvsroot/MNH-VX-Y-Z/src/MNH/read_exsegn.f90,v $ $Revision: 1.2.2.5.2.4.2.14.2.5.2.4 $
! masdev4_8 2008/07/09 16:40:30
!-----------------------------------------------------------------
!     ###################### 
      MODULE MODI_READ_EXSEG_n
!     ######################
!
INTERFACE
!
      SUBROUTINE READ_EXSEG_n(KMI,HEXSEG,HCONF,OFLAT,OUSERV,                       &
                   OUSERC,OUSERR,OUSERI,OUSECI,OUSERS,OUSERG,OUSERH,               &
                   OUSECHEM,OUSECHAQ,OUSECHIC,OCH_PH,OCH_CONV_LINOX,OSALT,         &
                   ODEPOS_SLT, ODUST,ODEPOS_DST, OCHTRANS,                         &
                   OORILAM,ODEPOS_AER, OLG,OPASPOL,                                &
#ifdef MNH_FOREFIRE
                   OFOREFIRE,                                                      &
#endif
                   OCONDSAMP,                                                      &
                   KRIMX,KRIMY, KSV_USER,                                          &
                   HTURB,HTOM,ORMC01,HRAD,HDCONV,HSCONV,HCLOUD,HELEC,              &
                   HEQNSYS,PTSTEP_ALL,HSTORAGE_TYPE,HINIFILEPGD                    )
INTEGER,            INTENT(IN) :: KMI    ! Model index
CHARACTER (LEN=*),  INTENT(IN) :: HEXSEG ! name of the EXSEG file
!     The following variables are read by READ_DESFM in DESFM descriptor : 
CHARACTER (LEN=*),  INTENT(IN) :: HCONF  ! configuration var. linked to FMfile
LOGICAL,            INTENT(IN) :: OFLAT  ! Logical for zero orography
LOGICAL,            INTENT(IN) :: OUSERV,OUSERC,OUSERR,OUSERI,OUSERS, &
                                  OUSERG,OUSERH  ! kind of moist variables in 
                                                 ! FMfile
LOGICAL,            INTENT(IN) :: OUSECI         ! ice concentration in
                                                 ! FMfile
LOGICAL,            INTENT(IN) :: OUSECHEM       ! Chemical FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OUSECHAQ       ! Aqueous chemical FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OUSECHIC       ! Ice chemical FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OCH_PH         ! pH FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OCH_CONV_LINOX ! LiNOx FLAG in FMFILE
LOGICAL,            INTENT(IN) :: ODUST          ! Dust FLAG in FMFILE
LOGICAL,DIMENSION(:), INTENT(IN)  :: ODEPOS_DST  ! Dust wet deposition FLAG in FMFILE     
LOGICAL,DIMENSION(:), INTENT(IN)  :: ODEPOS_SLT  ! Sea Salt wet deposition FLAG in FMFILE     
LOGICAL,DIMENSION(:), INTENT(IN)  :: ODEPOS_AER  ! Orilam wet deposition FLAG in FMFILE     
LOGICAL,            INTENT(IN) :: OSALT          ! Sea Salt FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OORILAM        ! Orilam FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OPASPOL        ! Passive pollutant FLAG in FMFILE
#ifdef MNH_FOREFIRE
LOGICAL,            INTENT(IN) :: OFOREFIRE      ! ForeFire FLAG in FMFILE
#endif
LOGICAL,            INTENT(IN) :: OLNOX_EXPLICIT ! explicit LNOx FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OCONDSAMP      ! Conditional sampling FLAG in FMFILE
LOGICAL,            INTENT(IN) :: OCHTRANS       ! LCHTRANS FLAG in FMFILE

LOGICAL,            INTENT(IN) :: OLG            ! lagrangian FLAG in FMFILE
INTEGER,            INTENT(IN) :: KRIMX, KRIMY   ! number of points for the
                       ! horizontal relaxation for the outermost verticals
INTEGER,            INTENT(IN) :: KSV_USER    ! number of additional scalar
                                         ! variables in FMfile 
CHARACTER (LEN=*),  INTENT(IN) :: HTURB  ! Kind of turbulence parameterization
                                         ! used to  produce FMFILE
CHARACTER (LEN=*),  INTENT(IN) :: HTOM   ! Kind of third order moment
LOGICAL,            INTENT(IN) :: ORMC01 ! flag for RMC01 SBL computations
CHARACTER (LEN=*),  INTENT(IN) :: HRAD   ! Kind of radiation scheme
CHARACTER (LEN=4),  INTENT(IN) :: HDCONV ! Kind of deep convection scheme
CHARACTER (LEN=4),  INTENT(IN) :: HSCONV ! Kind of shallow convection scheme
CHARACTER (LEN=4),  INTENT(IN) :: HCLOUD ! Kind of microphysical scheme
CHARACTER (LEN=4),  INTENT(IN) :: HELEC  ! Kind of electrical scheme
CHARACTER (LEN=*),  INTENT(IN) :: HEQNSYS! type of equations' system
REAL,DIMENSION(:),  INTENT(INOUT):: PTSTEP_ALL ! Time STEP of ALL models
CHARACTER (LEN=*),  INTENT(IN) :: HSTORAGE_TYPE ! type of initial file
CHARACTER (LEN=*),  INTENT(IN) :: HINIFILEPGD ! name of PGD file
!
END SUBROUTINE READ_EXSEG_n
!
END INTERFACE
!
END MODULE MODI_READ_EXSEG_n
!
!
!     #########################################################################
      SUBROUTINE READ_EXSEG_n(KMI,HEXSEG,HCONF,OFLAT,OUSERV,                       &
                   OUSERC,OUSERR,OUSERI,OUSECI,OUSERS,OUSERG,OUSERH,               &
                   OUSECHEM,OUSECHAQ,OUSECHIC,OCH_PH,OCH_CONV_LINOX,OSALT,         &
                   ODEPOS_SLT, ODUST,ODEPOS_DST, OCHTRANS,                         &
                   OORILAM,ODEPOS_AER, OLG,OPASPOL,                                &
#ifdef MNH_FOREFIRE
                   OFOREFIRE,                                                      &
#endif
                   OCONDSAMP,                                                      &
                   KRIMX,KRIMY, KSV_USER,                                          &
                   HTURB,HTOM,ORMC01,HRAD,HDCONV,HSCONV,HCLOUD,HELEC,              &
                   HEQNSYS,PTSTEP_ALL,HSTORAGE_TYPE,HINIFILEPGD                    )
!     #########################################################################
!
!!****  *READ_EXSEG_n * - routine to read  the descriptor file EXSEG
!!
!!    PURPOSE
!!    -------
!       The purpose of this routine is to read the descriptor file called 
!     EXSEG and to control the coherence with FMfile data . 
!       
!!
!!**  METHOD
!!    ------
!!      Logical unit number of EXSEG file is retrieved by calling FMLOOK.
!!      Then, the descriptor file is read. Namelists (NAMXXXn) which contain
!!    variables linked to one nested model are at the beginning of the file.
!!    Namelists (NAMXXX) which contain variables common to all models
!!    are at the end of the file. When the  model index is different from 1, 
!!    the end of the file (namelists NAMXXX) is not read. 
!!
!!      Coherence between the initial file (description read in DESFM file)
!!    and the segment to perform (description read in EXSEG file)
!!    is checked for segment achievement  configurations 
!!    or  postprocessing configuration. The get indicators are set according 
!!      to the following check :
!!
!!      - segment achievement and preinit configurations :
!!
!!       * if there is no turbulence kinetic energy in  initial
!!      file (HTURB='NONE'), and the segment to perform requires a turbulence
!!      parameterization (CTURB /= 'NONE'), the get indicators for turbulence 
!!      kinetic energy variables are set to 'INIT'; i.e. these variables will be
!!      set equal to  zero by READ_FIELD according to the get indicators.
!!       * The same procedure is applied to the dissipation of TKE. 
!!       * if there is no moist variables RRn  in  initial file (OUSERn=.FALSE.)
!!      and the segment to perform requires  moist variables RRn
!!      (LUSERn=.TRUE.),  the get indicators for moist variables RRn are set
!!      equal to 'INIT'; i.e. these variables will be set equal to  zero by 
!!      READ_FIELD according to the get indicators.
!!       * if there are KSV_USER additional scalar variables in initial file and the
!!      segment to perform needs more than KSV_USER additional variables,  the get
!!      indicators for these (NSV_USER-KSV_USER) additional scalar variables are set 
!!      equal to 'INIT'; i.e. these variables will be set equal to  zero by 
!!      READ_FIELD according to the get indicators. If the segment to perform
!!      needs less additional scalar variables than there are in initial file,
!!      the get indicators for these (KSV_USER - NSV_USER) additional scalar variables are
!!      set equal to 'SKIP'.      
!!       * warning messages are printed if the fields in initial file are the
!!      same at time t and t-dt (HCONF='START') and  a leap-frog advance 
!!      at first time step will be used  for the segment to perform
!!      (CCONF='RESTA'); It is likewise when HCONF='RESTA' and CCONF='START'.
!!       * A warning message is printed if the orography in initial file is zero
!!      (OFLAT=.TRUE.) and the segment to perform considers no-zero orography
!!      (LFLAT=.FALSE.). It is likewise for LFLAT=.TRUE. and OFLAT=.FALSE..
!!       If the segment to perform requires zero orography (LFLAT=.TRUE.), the
!!       orography (XZS) will not read in initial file but  set equal to zero 
!!       by SET_GRID.  
!!       * check of the depths of the Lateral Damping Layer in x and y 
!!       direction is performed
!!       * If some coupling files are specified, LSTEADYLS is set to T
!!       * If no coupling files are specified, LSTEADYLS is set to F
!!
!!
!!    EXTERNAL
!!    --------
!!      FMLOOK      : to retrieve the logical unit number of descriptor
!!                    or LFI files
!!
!!    IMPLICIT ARGUMENTS
!!    ------------------
!!     Module MODN_CONF : CCONF,LTHINSHELL,LFLAT,NMODEL,NVERB     
!!
!!      Module MODN_DYN : LCORIO, LZDIFFU
!!
!!      Module MODN_NESTING : NDAD(m),NDTRATIO(m),XWAY(m)
!!
!!      Module MODN_BUDGET : CBUTYPE,XBULEN
!!
!!      Module MODN_CONF1 : LUSERV,LUSERC,LUSERR,LUSERI,LUSERS,LUSERG,LUSERH,CSEG
!!
!!      Module MODN_DYN1 : XTSTEP,CPRESOPT,NITR,XRELAX
!!
!!      Module MODD_ADV1 : CMET_ADV_SCHEME,CSV_ADV_SCHEME,CUVW_ADV_SCHEME,NLITER
!!
!!      Module MODN_PARAM1 : CTURB,CRAD,CDCONV,CSCONV
!!
!!      Module MODN_LUNIT1 : 
!!      Module MODN_LBC1 : CLBCX,CLBCY,NLBLX,NLBLY,XCPHASE,XPOND
!!
!!      Module MODN_TURB_n : CTURBLEN,CTURBDIM
!!
!!      Module MODD_GET1: 
!!        CGETTKEM,CGETTKET,
!!        CGETRVM,CGETRCM,CGETRRM,CGETRIM,CGETRSM,CGETRGM,CGETRHM
!!        CGETRVT,CGETRCT,CGETRRT,CGETRIT,CGETRST,CGETRGT,CGETRHT,CGETSVM
!!        CGETSVT,CGETSIGS,CGETSRCM,CGETSRCT 
!!        NCPL_NBR,NCPL_TIMES,NCPL_CUR
!!      Module MODN_LES  : contains declaration of the control parameters
!!                                for Large Eddy Simulations' storages
!!                                for the forcing
!!
!!    REFERENCE
!!    ---------
!!      Book2 of the  documentation (routine READ_EXSEG_n)
!!      
!!
!!    AUTHOR
!!    ------
!!  	V. Ducrocq       * Meteo France *
!!
!!    MODIFICATIONS
!!    -------------
!!      Original    07/06/94 
!!      Modification   26/10/94  (Stein)  remove NAM_GET from the Namelists
!!      present in DESFM + change the namelist names
!!      Modification   22/11/94  (Stein)  add GET indicator for phi
!!      Modification   21/12/94  (Stein)  add GET indicator for LS fields  
!!      Modification   06/01/95  (Stein)  bug in the test for Scalar Var.
!!      Modifications  09/01/95  (Stein)  add the turbulence scheme
!!      Modifications  09/01/95  (Stein)  add the 1D switch
!!      Modifications  10/03/95  (Mallet) add coherence in coupling case
!!      Modifications  16/03/95  (Stein)  remove R from the historical variables
!!      Modifications  01/03/95  (Hereil) add the budget namelists
!!      Modifications  16/06/95  (Stein)  coherence control for the
!!                microphysical scheme + remove the wrong messge for RESTA conf
!!      Modifications  30/06/95  (Stein)  conditionnal reading of the fields
!!                used by the moist turbulence scheme
!!      Modifications  12/09/95  (Pinty)  add the radiation scheme
!!      Modification   06/02/96  (J.Vila) implement scalar advection schemes
!!      Modifications  24/02/96  (Stein)  change the default value for CCPLFILE
!!      Modifications  02/05/96  (Stein Jabouille) change the Z0SEA activation
!!      Modifications  24/05/96  (Stein)  change the SRC SIGS control
!!      Modifications  08/09/96  (Masson) the coupling file names are reset to
!!                               default value " " before reading in EXSEG1.nam
!!                               to avoid extra non-existant coupling files
!!
!!      Modifications  25/04/95  (K.Suhre)add namelist NAM_BLANK
!!                                        add read for LFORCING
!!                     25/04/95  (K.Suhre)add namelist NAM_FRC
!!                                        and switch checking
!!                     06/08/96  (K.Suhre)add namelist NAM_CH_MNHCn
!!                                        and NAM_CH_SOLVER
!!      Modifications  10/10/96  (Stein)  change SRC into SRCM and SRCT
!!      Modifications  11/04/96  (Pinty)  add the rain-ice microphysical scheme
!!      Modifications  11/01/97  (Pinty)  add the deep convection scheme
!!      Modifications  22/05/97  (Lafore) gridnesting implementation
!!      Modifications  22/06/97  (Stein)  add the absolute pressure + cleaning
!!      Modifications  25/08/97  (Masson) add tests on surface schemes
!!                     22/10/97  (Stein) remove the RIMX /= 0 control
!!                                       + new namelist + cleaning
!!      Modifications  17/04/98  (Masson) add tests on character variables
!!      Modification   15/03/99  (Masson) add tests on PROGRAM
!!      Modification   04/01/00  (Masson) removes TSZ0 case
!!      Modification   04/06/00  (Pinty)  add C2R2 scheme
!!                     11/12/00  (Tomasini) add CSEA_FLUX to MODD_PARAMn
!!                                          delete the test on SST_FRC only in 1D
!!      Modification   22/01/01  (Gazen)  change NSV,KSV to NSV_USER,KSV_USER and add
!!                                        NSV_* variables initialization
!!      Modification   15/10/01  (Mallet) allow namelists in different orders
!!      Modification   18/03/02  (Solmon)  new radiation scheme test
!!      Modification   29/11/02 (JP Pinty) add C3R5, ICE2, ICE4, ELEC
!!      Modification   06/11/02  (Masson)  new LES BL height diagnostic
!!      Modification   06/11/02  (Jabouille)  remove LTHINSHELL LFORCING test
!!      Modification   01/12/03  (Gazen)   change Chemical scheme interface
!!      Modification   01/2004   (Masson) removes surface (externalization)
!!      Modification   01/2005   (Masson) removes 1D and 2D switches
!!      Modification   04/2005   (Tulet)  add dust, orilam
!!      Modification   03/2006   (O.Geoffroy) Add KHKO scheme
!!      Modification   04/2006   (Maric)  include 4th order advection scheme
!!      Modification   05/2006   (Masson) add nudging
!!      Modification   05/2006   Remove KEPS
!!      Modification   04/2006   (Maric)  include PPM advection scheme
!!      Modification   04/2006   (J.Escobar) Bug dollarn add CALL UPDATE_NAM_CONFN  
!!      Modifications  01/2007   (Malardel,Pergaud)  add the MF shallow
!!                               convection scheme MODN_PARAM_MFSHALL_n
!!      Modification   09/2009   (J.Escobar) add more info on relaxation problems
!!      Modification   09/2011   (J.Escobar) re-add 'ZRESI' choose
Gaelle Tanguy's avatar
Gaelle Tanguy committed
!!      Modification   12/2011   (C.Lac) Adaptation to FIT temporal scheme 
!!      Modification   12/2012   (S.Bielli) add NAM_NCOUT for netcdf output (removed 08/07/2016)
!!      Modification   02/2012   (Pialat/Tulet) add ForeFire
!!      Modification   02/2012   (T.Lunet) add of new Runge-Kutta methods
!!      Modification   01/2015   (C. Barthe) add explicit LNOx
!!      J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 
!!      M.Leriche 18/12/2015 : bug chimie glace dans prep_real_case
Gaelle TANGUY's avatar
Gaelle TANGUY committed
!!      Modification    01/2016  (JP Pinty) Add LIMA
!!      Modification   02/2016   (M.Leriche) treat gas and aq. chemicals separately
!!      P.Wautelet 08/07/2016 : removed MNH_NCWRIT define
!!      Modification   10/2016    (C.LAC) Add OSPLIT_WENO + Add droplet
!!                                deposition + Add max values
!!      Modification   11/2016   (Ph. Wautelet) Allocate/initialise some output/backup structures
!!      Modification   03/2017   (JP Chaboureau) Fix the initialization of
!!                                               LUSERx-type variables for LIMA
!!      M.Leriche      06/2017 for spawn and prep_real avoid abort if wet dep for 
!!                             aerosol and no cloud scheme defined
!!------------------------------------------------------------------------------
!
!*       0.    DECLARATIONS
!              ------------
USE MODD_PARAMETERS
USE MODD_CONF
USE MODD_CONFZ
Loading
Loading full blame...