source: LMDZ5/trunk/libf/phylmd/StratAer/so2_to_h2so4.F90 @ 3396

Last change on this file since 3396 was 2752, checked in by oboucher, 8 years ago

Changes to StratAer? module, including setting up a new output file
hence dimension of output metadata is increased to 10 items.

File size: 1.9 KB
RevLine 
[2752]1SUBROUTINE SO2_TO_H2SO4(pdtphys,tr_seri,t_seri,pplay,paprs,is_strato)
[2690]2
3  USE dimphy, ONLY : klon,klev
4  USE aerophys
5  USE infotrac
6  USE YOMCST, ONLY : RG
[2752]7  USE phys_local_var_mod, ONLY : SO2_lifetime, budg_3D_so2_to_h2so4, budg_so2_to_h2so4
[2690]8
9  IMPLICIT NONE
10
11  !--------------------------------------------------------
12
13  ! transfer variables when calling this routine
14  REAL,INTENT(IN)                               :: pdtphys ! Pas d'integration pour la physique (seconde)
15  REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT)  :: tr_seri ! Concentration Traceur [U/KgA]
16  REAL,DIMENSION(klon,klev),INTENT(IN)          :: t_seri  ! Temperature
17  REAL,DIMENSION(klon,klev),INTENT(IN)          :: pplay   ! pression pour le mileu de chaque couche (en Pa)
18  REAL,DIMENSION(klon,klev+1),INTENT(IN)        :: paprs   ! pression pour chaque inter-couche (en Pa)
[2695]19  LOGICAL,DIMENSION(klon,klev),INTENT(IN)       :: is_strato ! stratospheric flag
[2690]20
21  ! local variables in coagulation routine
22  INTEGER                                       :: i,j,k,nb,ilon,ilev
23
24!--convert SO2 to H2SO4
[2752]25  budg_3D_so2_to_h2so4(:,:)=0.0
26  budg_so2_to_h2so4(:)=0.0
27
[2690]28  DO ilon=1, klon
29  DO ilev=1, klev
30  !only in the stratosphere
31  IF (is_strato(ilon,ilev)) THEN
32    IF (SO2_lifetime(ilon,ilev).GT.0.0) THEN
[2752]33      budg_3D_so2_to_h2so4(ilon,ilev)=tr_seri(ilon,ilev,id_SO2_strat)*(1.0-exp(-pdtphys/SO2_lifetime(ilon,ilev)))
[2690]34    ENDIF
[2752]35    tr_seri(ilon,ilev,id_SO2_strat)=tr_seri(ilon,ilev,id_SO2_strat) - budg_3D_so2_to_h2so4(ilon,ilev)
36    tr_seri(ilon,ilev,id_H2SO4_strat)=tr_seri(ilon,ilev,id_H2SO4_strat) + mH2SO4mol/mSO2mol*budg_3D_so2_to_h2so4(ilon,ilev)
37    !convert budget from kg(SO2)/kgA to kg(S)/m2/layer/s for saving as diagnostic
38    budg_3D_so2_to_h2so4(ilon,ilev)=budg_3D_so2_to_h2so4(ilon,ilev)*mSatom/mSO2mol*(paprs(ilon,ilev)-paprs(ilon,ilev+1))/RG/pdtphys
39    budg_so2_to_h2so4(ilon)=budg_so2_to_h2so4(ilon)+budg_3D_so2_to_h2so4(ilon,ilev)
[2690]40  ENDIF
41  ENDDO
42  ENDDO
43
44END SUBROUTINE SO2_TO_H2SO4
Note: See TracBrowser for help on using the repository browser.