SURFEX v7.3
General documentation of Surfex
 All Classes Files Functions Variables Typedefs
/home/dasprezs/EXPORT_v7_3/src/SURFEX/dslt_init_names.F90
Go to the documentation of this file.
00001 !     #########
00002 SUBROUTINE DSLT_INIT_NAMES (KLUOUT, HRC1, HSV, KPMODE, &
00003                             KEQ, KSV_BEG, KSV_END, OVARSIG, ORGFIX)
00004 !!    ###########################################
00005 !!
00006 !!*** *DSLT_INIT_NAMES*
00007 !!
00008 !!    PURPOSE
00009 !!    -------
00010 !!      Read and filter all chemical species into the CSV array
00011 !!     initialize NSV_CHSBEG and  NSV_CHSEND index for the begin and the ending chemical index
00012 !!     
00013 !!
00014 !!    REFERENCE
00015 !!    ---------
00016 !!    Modified ch_init_names (february 2005)    
00017 !!
00018 !!    AUTHOR
00019 !!    ------
00020 !!    Alf Grini <alf.grini@cnrm.meteo.fr>
00021 !!
00022 !!    MODIFICATIONS
00023 !!    -------------
00024 !!
00025 !!    EXTERNAL
00026 !!    --------
00027 !!
00028 !!    IMPLICIT ARGUMENTS
00029 !!    ------------------
00030 !-------------------------------------------------------------------------------
00031 !
00032 !*       0.     DECLARATIONS
00033 !               ------------
00034 !
00035 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
00036 USE PARKIND1  ,ONLY : JPRB
00037 !
00038 IMPLICIT NONE
00039 !
00040 !*      0.1    declarations of arguments
00041 !
00042 INTEGER,                         INTENT(IN)  :: KLUOUT   ! output listing channel
00043  CHARACTER(LEN=4),                INTENT(IN)  :: HRC1
00044  CHARACTER(LEN=*), DIMENSION(:),  INTENT(IN)  :: HSV      ! name of chemical species
00045                                                          ! with character # for chemistry
00046 INTEGER,                         INTENT(OUT) :: KPMODE
00047 INTEGER,                         INTENT(OUT) :: KEQ         ! number of dust related variables
00048 INTEGER,                         INTENT(OUT) :: KSV_BEG     ! first dust related scalar
00049 INTEGER,                         INTENT(OUT) :: KSV_END     ! last  dust related scalar
00050 LOGICAL,                         INTENT(INOUT) :: OVARSIG   ! type of standard deviation
00051 LOGICAL,                         INTENT(INOUT) :: ORGFIX    ! type of mean radius
00052 !
00053 !*      0.2    declarations of local variables
00054 INTEGER :: JSV  !! loop on scalar variables
00055  CHARACTER(LEN=4) :: YRC1
00056 REAL(KIND=JPRB) :: ZHOOK_HANDLE
00057 !
00058 !-------------------------------------------------------------------------------
00059 
00060 !Initialize output variables
00061 IF (LHOOK) CALL DR_HOOK('DSLT_INIT_NAMES',0,ZHOOK_HANDLE)
00062 !
00063 KEQ  = 0
00064 KSV_BEG = 0
00065 KSV_END = 0
00066 !
00067 DO JSV=1, SIZE(HSV)
00068   !
00069   YRC1= HSV(JSV)(1:4)
00070   !
00071   IF (YRC1 == HRC1) THEN
00072     !
00073     IF (HSV(JSV)(5:5) == '6') OVARSIG = .TRUE.
00074     IF (HSV(JSV)(5:5) == '0') ORGFIX  = .FALSE.
00075     !
00076     KEQ = KEQ + 1
00077     IF (KEQ == 1) KSV_BEG = JSV
00078     !
00079   ENDIF
00080   !
00081 ENDDO
00082 !
00083 ! Set the output list of scalar to the input list of scalars
00084 !
00085 ! Get the index of the last dust relevant tracer
00086 KSV_END = KSV_BEG + KEQ - 1
00087 !
00088 ! Get number of dust modes. Each mode represents
00089 ! 3 moments, so 9 dust tracers represents 3 modes.
00090 ! 3 dust tracers represents 1 mode
00091 KPMODE = KSV_END - KSV_BEG + 1
00092 IF (OVARSIG) THEN
00093   KPMODE = INT(KPMODE / 3.)
00094 ELSE IF (.NOT.ORGFIX) THEN
00095   KPMODE = INT(KPMODE / 2.)
00096 END IF
00097 !
00098 IF (LHOOK) CALL DR_HOOK('DSLT_INIT_NAMES',1,ZHOOK_HANDLE)
00099 !
00100 END SUBROUTINE DSLT_INIT_NAMES