source: LMDZ5/trunk/libf/phylmd/StratAer/ocs_to_so2.F90 @ 2695

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

Removing useless global variables
Interpolation only done once a month
Changing test orders in implicit coagulation routine as some compilers didn't like it

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