source: LMDZ6/trunk/libf/phylmd/StratAer/so2_to_h2so4.F90 @ 4440

Last change on this file since 4440 was 3677, checked in by oboucher, 5 years ago

Changed the way to initialise nbtr_bin and other dimensions and indices
in the StratAer? module based on infotrac_phy rather than infotrac.

Also added a missing $OMP THREADPRIVATE(nqperes)

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