SURFEX v7.3
General documentation of Surfex
 All Classes Files Functions Variables Typedefs
/home/dasprezs/EXPORT_v7_3/src/SURFEX/mode_dslt_surf.F90
Go to the documentation of this file.
00001 !!   ########################
00002 MODULE MODE_DSLT_SURF
00003 !!   ########################
00004 !!
00005 !
00006 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
00007 USE PARKIND1  ,ONLY : JPRB
00008 !
00009 IMPLICIT NONE
00010 !
00011 CONTAINS
00012 !!
00013 !!   ############################################################
00014 SUBROUTINE MASSFLUX2MOMENTFLUX(     &
00015           PFLUX,                    & ! [kg/m2/s] for M3, zero for other]
00016           PRHODREF,                 & ! [kg/m3] air density
00017           PEMISRADIUS,              & ! [um] emitted radius for the different modes
00018           PEMISSIG,                 & ! [-] emitted sigma for the different modes
00019           KMDE,                     &
00020           PCONVERTFACM0,            &
00021           PCONVERTFACM6,            &
00022           PCONVERTFACM3,            &
00023           OVARSIG,                  &
00024           ORGFIX                    &
00025           )  
00026 !!   ############################################################
00027 !!
00028 !!    PURPOSE
00029 !!    -------
00030 !!    Transform emissions in mass (kg/m2/sec) to emissions of moments which have
00031 !!    a bit strange units
00032 !!    MESONH carries the following units during transport:
00033 !!    M0=#/molec_{air}
00034 !!    M3=molec_{dst}/molec_{air}
00035 !!    M6=um6/molec_{air}*1.d6
00036 !!    The surface model should have (for dust)
00037 !!    M0=#/m3*[kg_{dst}/mole_{dst}/XAVOGADRO]
00038 !!    M3=kg/m3
00039 !!    M6=um6/m3
00040 !!
00041 !!    REFERENCE
00042 !!    ---------
00043 !!    Tulet et al, ORILAM manuscript for transformation of modal parameters
00044 !!    J. Geophys. Res., 110, D18201, doi:10.1029/2004JD005716
00045 !!
00046 !!    AUTHOR
00047 !!    ------
00048 !!    Alf Grini and Pierre TULET (CNRM/GMEI)
00049 !!
00050 !!    MODIFICATIONS
00051 !!    -------------
00052 !!    none
00053 !!
00054 !!    EXTERNAL
00055 !!    --------
00056 !!    None
00057 !!
00058 IMPLICIT NONE
00059 !!
00060 !-------------------------------------------------------------------------------
00061 !
00062 !*       0.     DECLARATIONS
00063 !               ------------
00064 !
00065 !*      0.1    declarations of arguments
00066 !
00067 REAL,   DIMENSION(:,:),      INTENT(INOUT) :: PFLUX     !In; kg/m2/s (index #2, #5, #8 etc)
00068                                                         !Out: mole particles per mole air m/s *(MWdst/MWair*rhoair)(index #1)
00069                                                         !Out: kg/m2/s (index #2)
00070                                                         !Out: moles m6/moles air m/s *(MWdst/MWair*rhoair)(index #3)
00071 REAL,   DIMENSION(:),        INTENT(IN)    :: PRHODREF  !I [kg/m3] density of air
00072 REAL,   DIMENSION(:),        INTENT(IN)    :: PEMISRADIUS !I [um] emitted radius
00073 REAL,   DIMENSION(:),        INTENT(IN)    :: PEMISSIG    !I [-] emitted sigma for the modes
00074 INTEGER,        INTENT(IN)    :: KMDE
00075 REAL,           INTENT(IN)    :: PCONVERTFACM0
00076 REAL,           INTENT(IN)    :: PCONVERTFACM6
00077 REAL,           INTENT(IN)    :: PCONVERTFACM3
00078 LOGICAL,        INTENT(IN)    :: OVARSIG
00079 LOGICAL,        INTENT(IN)    :: ORGFIX
00080 !
00081 !*      0.2    declarations local variables
00082 !
00083 REAL,DIMENSION(SIZE(PFLUX,1),3) :: ZFM               !Intermediate variable to get moments
00084 !
00085 INTEGER   :: JMODE  ! Counter for dust modes
00086 INTEGER   :: JSV_IDX ! Counter for dust scalar variables
00087 REAL(KIND=JPRB) :: ZHOOK_HANDLE
00088 !
00089 !-------------------------------------------------------------------------------
00090 !
00091 !MESONH carries the following units during transport:
00092 !M0=#/molec_{air}
00093 !M3=molec_{dst}/molec_{air}
00094 !M6=um6/molec_{air}*1.d6
00095 
00096 !The surface should get the following units
00097 !M0=#/m3*MW_DST/XAVOGADRO
00098 !M3=kg/m3
00099 !M6=um6/m3*1.d6 MW_DST/XAVOGADRO
00100 
00101 !Emissions of dust are in kg/m2/sec for mode 3 at this point
00102 
00103 !Factor which is needed so that all gains normal units when leaving ground paramn
00104 IF (LHOOK) CALL DR_HOOK('MODE_DSLT_SURF:MASSFLUX2MOMENTFLUX',0,ZHOOK_HANDLE)
00105 
00106 !Initialize initermediate moments
00107 ZFM(:,:)=0.
00108 
00109 DO JMODE=1,KMDE
00110 
00111   !Make index which is 0 for first mode, 3 for second, 6 for third etc
00112   IF (OVARSIG) THEN
00113     JSV_IDX = (JMODE-1)*3
00114   ELSE IF (ORGFIX) THEN
00115     JSV_IDX = JMODE-2
00116   ELSE
00117     JSV_IDX = (JMODE-1)*2
00118   END IF
00119 
00120   !IN THIS VERSION, MASS FLUX (kg/m2/sec) IS SENT IN INDEX #2, #5, #8 if 3 moments per mode
00121   !IF TWO MOMENTS PER MODE, MASS FLUX IS SENT AS INDEX #2, #4, #6
00122 
00123   !Get flux of number in #/m2/sec from flux of mass in kg/m2/sec
00124   ZFM(:,1) = PFLUX(:,JSV_IDX+2)                     & ! kg_{dst}/m2/sec
00125              / PEMISRADIUS(JMODE)**3                & ! *um^{-3} ==> #/m2/sec*(m3/um3)
00126              * EXP(-4.5*(LOG(PEMISSIG(JMODE)))**2)  & ! Take into account size distribution  
00127              / PCONVERTFACM3           ! /(kg_{dst}/m^{3}_{dst)} ==> m^3_{dst}/m2/sec  
00128  
00129    
00130   ! Get flux of moment 6 consistent with the other moments
00131   ZFM(:,3) = ZFM(:,1)                              & ! [#/m3]
00132              * (PEMISRADIUS(JMODE)**6)             & ! *um6 ==> um6/m2/sec 
00133              * EXP(18. *(LOG(PEMISSIG(JMODE)))**2)   ! Take into account size distribution  
00134 
00135   !Get flux of Moment 0 in transport units
00136   IF (.NOT.ORGFIX) THEN
00137     PFLUX(:,JSV_IDX+1) = ZFM(:,1)            & ! particles/m^2/sec
00138                          * PCONVERTFACM0       ! ==> particles/m2/sec * kg_dst/m3_{air}  
00139   END IF
00140    
00141   ! Flux moment 6
00142   IF (OVARSIG) THEN
00143     PFLUX(:,JSV_IDX+3) = ZFM(:,3)          & ! um^6/m^2/sec
00144                          * PCONVERTFACM6     ! ==>   
00145   ENDIF
00146 
00147   !Multiply with molecular weights so that you get back the units described above when
00148   !when multiply with the opposite variable in ground_paramn.f90
00149   !PFLUX(:,JSV_IDX+1) = PFLUX(:,JSV_IDX+1) * 100.E-3 * PRHODREF(:) / ZMD   !#_{aer}/molec_{air} m/s * kg_{aer}/m^3_{air}
00150   !IF (LVARSIG) PFLUX(:,JSV_IDX+3) = PFLUX(:,JSV_IDX+3) * 100.E-3 * PRHODREF(:) / ZMD   !um^6_{aer}/molec_{air}*cm^3/m^3 m/s kg_{aer}/m^3_{air}
00151   !
00152   !
00153 ENDDO !Loop on modes
00154 !
00155 IF (LHOOK) CALL DR_HOOK('MODE_DSLT_SURF:MASSFLUX2MOMENTFLUX',1,ZHOOK_HANDLE)
00156 !
00157 END SUBROUTINE MASSFLUX2MOMENTFLUX
00158 
00159 !**********************************************************************
00160 !**********************************************************************
00161 !**********************************************************************
00162 
00163 SUBROUTINE DSLTMOMENT2SIZE(       &
00164           PSVT,                   & !I [XX/m3] input scalar variables (moment of distribution)
00165           PRHODREF,               & !I [kg/m3] density of air       
00166           PEMISRADIUS,            & ![um] emitted radius for the different modes
00167           PEMISSIG,               & ![-] emitted sigma for the different modes   
00168           KM0,                    &
00169           KM3,                    &
00170           KM6,                    &
00171           PCONVERTFACM0,          &
00172           PCONVERTFACM6,          &
00173           PCONVERTFACM3,          &
00174           OVARSIG,                &
00175           ORGFIX,                 &   
00176           PSIG1D,                 & !O [-] standard deviation of aerosol distribution
00177           PRG1D,                  & !O [um] number median diameter of aerosol distribution
00178           PN1D,                   & !O [#/m3] number concentration of aerosols
00179           PMASS1D,                & !O [kg/m3] mass concentration of aerosol
00180           PM1D                    & !O aerosols moments 0, 3 and 6
00181           )  
00182 !!   ############################################################
00183 !!
00184 !!    PURPOSE
00185 !!    -------
00186 !!    Translate the three moments M0, M3 and M6 given in ppp into
00187 !!    Values which can be understood more easily (R, sigma, N, M)
00188 !!    At this point, M3 is in kg/m3, M0 in #/m3*(kg_{dst}/mole), M6 in um6/m3*1.d6*(kg_{dst}/mole)
00189 !!
00190 !!    All the moments have been transformed in MESONH (atmospheric model) so that the surface gets
00191 !!    M0 [#/m3] *XMOLARWEIGHT_DST/XAVOGADRO
00192 !!    M3 [kg/m3]
00193 !!    M6 [um6/m3*1.d6] *XMOLARWEIGHT_DST/XAVOGADRO
00194 !!   
00195 !!    REFERENCE
00196 !!    ---------
00197 !!    Tulet et al, ORILAM manuscript for transformation of modal parameters
00198 !!    J. Geophys. Res., 110, D18201, doi:10.1029/2004JD005716
00199 !!
00200 !!    AUTHOR
00201 !!    ------
00202 !!    Pierre TULET (LA)
00203 !!
00204 !!    MODIFICATIONS
00205 !!    -------------
00206 !!    Alf Grini (CNRM)
00207 !!
00208 !!    EXTERNAL
00209 !!    --------
00210 !!    None
00211 !!
00212 IMPLICIT NONE
00213 !!
00214 !-------------------------------------------------------------------------------
00215 !
00216 !*       0.     DECLARATIONS
00217 !               ------------
00218 !
00219 !*      0.1    declarations of arguments
00220 !
00221 !INPUT
00222 REAL,       DIMENSION(:,:),  INTENT(IN)     :: PSVT      !I [ppp] moments in surface units
00223 REAL,       DIMENSION(:),    INTENT(IN)     :: PRHODREF  !I [kg/m3] density of air
00224 REAL,       DIMENSION(:),    INTENT(IN)     :: PEMISSIG  
00225 REAL,       DIMENSION(:),    INTENT(IN)     :: PEMISRADIUS
00226 INTEGER,DIMENSION(:),    INTENT(IN) :: KM0             ! [idx] index for Mode 0 in passed variables
00227 INTEGER,DIMENSION(:),    INTENT(IN) :: KM3             ! [idx] indexes for Mode 3 in passed variables
00228 INTEGER,DIMENSION(:),    INTENT(IN) :: KM6             ! [idx] indexes for Mode 6 in passed variables
00229 REAL,           INTENT(IN)    :: PCONVERTFACM0
00230 REAL,           INTENT(IN)    :: PCONVERTFACM6
00231 REAL,           INTENT(IN)    :: PCONVERTFACM3
00232 LOGICAL,        INTENT(IN)    :: OVARSIG
00233 LOGICAL,        INTENT(IN)    :: ORGFIX
00234 REAL,       DIMENSION(:,:),  OPTIONAL, INTENT(OUT)     :: PSIG1D   !O [-] standard deviation
00235 REAL,       DIMENSION(:,:),  OPTIONAL, INTENT(OUT)     :: PRG1D    !O [um] number median diameter
00236 REAL,       DIMENSION(:,:),  OPTIONAL, INTENT(OUT)     :: PN1D     !O [#/m3] number concentration
00237 REAL,       DIMENSION(:,:),  OPTIONAL, INTENT(OUT)     :: PMASS1D  !O [kg_{aer}/m3] mass concentration
00238 REAL,       DIMENSION(:,:),  OPTIONAL, INTENT(OUT)     :: PM1D     !O aerosols moments (MESONH units)
00239 !
00240 !*      0.2    declarations local variables
00241 !
00242 REAL,DIMENSION(SIZE(PSVT,1), SIZE(PSVT,2)) :: ZSV    ! [dusts moment concentration]
00243 REAL,DIMENSION(SIZE(PSVT,1), SIZE(KM0)*3)  :: ZM     ! [moments] local array for moments  
00244 REAL,DIMENSION(SIZE(PSVT,1))               :: ZSIGMA ! [-] standard deviation
00245 REAL,DIMENSION(SIZE(PSVT,1))               :: ZRG    ! [um] number median diameter
00246 INTEGER                   :: JN, J0, J3, J6          ! [idx] loop counters
00247 REAL(KIND=JPRB) :: ZHOOK_HANDLE
00248 !
00249 !        1.1    initialisation 
00250 ! 
00251 !Get the conversion factors
00252 IF (LHOOK) CALL DR_HOOK('MODE_DSLT_SURF:DSLTMOMENT2SIZE',0,ZHOOK_HANDLE)
00253 !  
00254 !Get scalar variable indexes
00255 !
00256 !Save the moments in a local array
00257 ZSV(:,:) = MAX(PSVT(:,:), 1E-80)
00258 !
00259 DO JN=1,SIZE(KM0)
00260 
00261   J0 = 1 + (JN-1)*3 
00262   J3 = 2 + (JN-1)*3
00263   J6 = 3 + (JN-1)*3
00264 
00265   !calculate moment 3 from total aerosol mass in kg/m3 ==> um3/m3
00266   ZM(:,J3) = ZSV(:,KM3(JN))          & ! kg_{aer}/m3_{air}
00267              / PCONVERTFACM3           ! ==> m3_{dst}/m3_{air}
00268 
00269   IF (OVARSIG) THEN ! give M6 (case of variable standard deviation)
00270               
00271     !Get number concentration (#/molec_{air}==>#/m3)
00272     ZM(:,J0) = ZSV(:,KM0(JN))          & ! #/m3air*M_{dst}/avogadro 
00273                / PCONVERTFACM0           ! ==> #/m3  
00274                  
00275     !Calculate moment 6 from the sent value
00276     ZM(:,J6) = ZSV(:,KM6(JN))          & ! um6/m3_{air}*(cm3/m3)*M_{dst}/Avogadro
00277                / PCONVERTFACM6           ! ==> um6/m3  
00278 
00279     !Get sigma (only if sigma is allowed to vary)
00280     !Get intermediate values for sigma M3^2/(M0*M6) (ORILAM paper, eqn 8)
00281     ZSIGMA(:) = ZM(:,J3)**2 / (ZM(:,J0)*ZM(:,J6))
00282     !Limit the intermediate value, can not be larger than 1
00283     ZSIGMA(:) = MIN(1-1E-10,ZSIGMA(:))
00284     !Limit the value for intermediate, can not be smaller than 0
00285     ZSIGMA(:) = MAX(1E-10,ZSIGMA(:))
00286     !Calculate log(sigma)
00287     ZSIGMA(:) = LOG(ZSIGMA(:))
00288     !Finally get the real sigma the negative sign is because of 
00289     !The way the equation is written (M3^2/(M0*M6)) instead of (M0*M6)/M3^3
00290     ZSIGMA(:) = EXP(1./3.*SQRT(-ZSIGMA(:)))
00291         
00292   ELSE IF (ORGFIX) THEN ! compute M6 from M3, Rg and SIGMA    
00293 
00294     !Get the emitted sigma for this mode
00295     ZSIGMA(:) = PEMISSIG(JN)
00296 
00297     ZM(:,J0) = ZM(:,J3) /               &
00298               ((PEMISRADIUS(KM3(JN))**3)*EXP(4.5 * LOG(ZSIGMA(:))**2))  
00299 
00300   ELSE ! compute M6 from M0, M3 and SIGMA
00301           
00302     !Get the emitted sigma for this mode
00303     ZSIGMA(:) = PEMISSIG(JN)
00304 
00305     !Get number concentration (#/molec_{air}==>#/m3)
00306     ZM(:,J0) = ZSV(:,KM0(JN))        & ! #/m3air*M_{dst}/avogadro 
00307                / PCONVERTFACM0         ! ==> #/m3  
00308 
00309   END IF
00310 
00311   !Calculate moment 6 from this emitted sigma
00312   ZM(:,J6) = ZM(:,J0) * ((ZM(:,J3)/ZM(:,J0))**(1./3.) &
00313             * EXP(-(3./2.)*LOG(ZSIGMA(:))**2))**6     &
00314             * EXP(18.*LOG(ZSIGMA(:))**2)  
00315 
00316   !Get number median radius (eqn. 7 in Orilam manuscript)
00317   ZRG(:) = ((ZM(:,J3)**4) / (ZM(:,J6)*ZM(:,J0)**3)) ** (1./6.)     
00318   
00319   !Give the sigma-values to the passed array
00320   IF(PRESENT(PSIG1D)) PSIG1D(:,JN) = ZSIGMA(:)
00321 
00322   !Set the number concentrations in the passed array
00323   IF(PRESENT(PN1D)) PN1D(:,JN) = ZM(:,J0)
00324 
00325   !Get the number median radius
00326   IF(PRESENT(PRG1D)) PRG1D(:,JN)= ZRG(:)
00327     
00328   IF(PRESENT(PMASS1D))THEN
00329     PMASS1D(:,JN)=  ZM(:,J0)          &!#/m^3_{air}
00330                     * PCONVERTFACM3   &
00331                     * ZRG(:)**3 * EXP(4.5*(LOG(ZSIGMA(:)))**2)
00332   ENDIF
00333 
00334 END DO  !Loop on modes
00335 
00336 IF(PRESENT(PM1D)) PM1D(:,:) = ZM(:,:)
00337 
00338 IF (LHOOK) CALL DR_HOOK('MODE_DST_SURF:DUSTMOMENT2SIZE',1,ZHOOK_HANDLE)
00339 !
00340 !
00341 END SUBROUTINE DSLTMOMENT2SIZE
00342 
00343 
00344 END MODULE MODE_DSLT_SURF