source: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/gastoparticle.f90 @ 5185

Last change on this file since 5185 was 5182, checked in by abarral, 3 months ago

(WIP) Replace REPROBUS CPP KEY by logical
properly name modules

File size: 2.8 KB
RevLine 
[5104]1SUBROUTINE gastoparticle(pdtphys, zdz, zrho, xlat, pplay, t_seri, &
[5160]2        id_prec, id_fine, tr_seri, his_g2pgas, his_g2paer)
[5104]3  USE dimphy
[5182]4  USE lmdz_infotrac
[5142]5  USE lmdz_YOECUMF
[5144]6  USE lmdz_yomcst
[5160]7  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
8  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
9          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
10  USE lmdz_chem_spla, ONLY: masse_ammsulfate
[2630]11
[5104]12  IMPLICIT NONE
[5159]13
[5104]14  REAL :: pdtphys
15  REAL :: zrho(klon, klev)
16  REAL :: zdz(klon, klev)
17  REAL :: tr_seri(klon, klev, nbtr)   ! traceurs
18  REAL :: tend                 ! tendance par espece
19  REAL :: xlat(klon)       ! latitudes pour chaque point
20  REAL :: pi
21  !   JE: 20140120
22  REAL :: his_g2pgas(klon)
23  REAL :: his_g2paer(klon)
24  REAL :: tendincm3(klon, klev)
25  REAL :: tempvar(klon, klev)
26  REAL :: pplay(klon, klev)
27  REAL :: t_seri(klon, klev)
28  REAL :: tend2d(klon, klev)
29  INTEGER :: id_prec, id_fine
[5159]30
[5104]31  !------------------------- Scaling Parameter --------------------------
[5159]32
[5104]33  !  REAL scale_param_so4(klon)  !Scaling parameter for sulfate
[2630]34
[5104]35  INTEGER :: i, k
36  REAL :: tau_chem     !---chemical lifetime in s
[5159]37
[5104]38  !------------------------- Variables to save --------------------------
[5159]39
[5104]40  !nhl      REAL fluxso4chem(klon,klev)
41  !nhl      REAL flux_sparam_sulf(klon,klev)
[2630]42
[5104]43  !======================================================================
44  pi = atan(1.) * 4.
[5159]45
[5104]46  IF (id_prec>0 .AND. id_fine>0) THEN
47    DO k = 1, klev
[2630]48      DO i = 1, klon
[5159]49
[5104]50        !    tau_chem=scale_param_so4(i)*86400.*(8.-5.*cos(xlat(i)*pi/180.))    !tchemfctn2
51        !nhl        tau_chem=86400.*(8.-5.*cos(xlat(i)*pi/180.))    !tchemfctn2
52        tau_chem = 86400. * (5. - 4. * cos(xlat(i) * pi / 180.))    !
53        tend = tr_seri(i, k, id_prec) * (1. - exp(-pdtphys / tau_chem)) ! Sulfate production
54        !nhl        tend=(1.-exp(-pdtphys/tau_chem))
55        !nhl        tend=scale_param_so4(i) !as this it works
[5159]56
[5104]57        tr_seri(i, k, id_prec) = tr_seri(i, k, id_prec) - tend
58        tr_seri(i, k, id_fine) = tr_seri(i, k, id_fine) + &
59                tend / RNAVO * masse_ammsulfate  !--gAER/KgAir
60        tend2d(i, k) = tend
[5159]61
[5104]62        !nhl        fluxso4chem(i,k) = tend/RNAVO*masse_ammsulfate
63        !nhl        flux_sparam_sulf(i,k) = tend/RNAVO*masse_ammsulfate
[2630]64      ENDDO
[5104]65    ENDDO
[2630]66
[5104]67    tempvar = tend2d
68    CALL kg_to_cm3(pplay, t_seri, tempvar)
69    tendincm3 = tempvar
[2630]70
[5104]71    DO k = 1, klev
[2630]72      DO i = 1, klon
73
[5104]74        ! his_g2pgas(i) = his_g2pgas(i) + tendincm3(i,k)*1e6*zdz(i,k)/pdtphys
75        his_g2paer(i) = his_g2paer(i) + &
76                tendincm3(i, k) / RNAVO * masse_ammsulfate * 1.e3 * &
77                        1.e6 * zdz(i, k) / pdtphys    ! mg/m2/s
78        his_g2pgas(i) = his_g2paer(i) * masse_s / masse_ammsulfate ! mg-S/m2/s
[2630]79
80      ENDDO
[5104]81    ENDDO
82  ENDIF
[2630]83
[5104]84  !
[5105]85
[5104]86END SUBROUTINE gastoparticle
Note: See TracBrowser for help on using the repository browser.