source: trunk/LMDZ.TITAN/libf/phytitan/sources.F @ 222

Last change on this file since 222 was 175, checked in by slebonnois, 14 years ago

S.LEBONNOIS:

  • Revision majeure de la physique Titan => ajout des nuages version 10 bins (Jeremie Burgalat) Cette version reste a tester mais avec clouds=0, on reste sur l'ancienne.
  • Quelques ajouts dans la doc.
File size: 7.1 KB
Line 
1         SUBROUTINE sources(ngrid,nlay,
2     $                      ptimestep,pz0,pu,pv,
3     $                      pplev,pzlay,pzlev,
4     $                      gaz1,gaz2,gaz3,
5     $                      ptsrf,solesp,reserv)
6
7c=======================================================================
8c     Calcul des flux aux interfaces pour les sources
9c     CH4 a la surface
10c     Production de C2H6 en haut du modele.
11c     Production de C2H2 en haut du modele.
12c     
13c     NOTE :
14c     Les gaz ont la tete en haut.
15c     ils ne suivent pas la meme convention que muphys :
16c     (1 -> sol  / klev = haut du modele)
17c=======================================================================
18
19c-----------------------------------------------------------------------
20c   declarations:
21c   -------------
22
23         use dimphy
24         IMPLICIT NONE
25#include "dimensions.h"
26#include "microtab.h"
27#include "YOMCST.h"
28c
29c   arguments:
30c   ----------
31
32         INTEGER ngrid,nlay,nq,ihor
33         REAL ptimestep
34         REAL pplev(ngrid,nlay+1)
35         REAL pzlay(ngrid,nlay),pzlev(ngrid,nlay+1)
36         REAL pu(ngrid),pv(ngrid)
37         REAL gaz1(ngrid,nlay),gaz2(ngrid,nlay),gaz3(ngrid,nlay)
38         REAL ptsrf(ngrid)
39         REAL solesp(ngrid,klev+1,3)
40c
41c   local:
42c   ------
43 
44         INTEGER ilev,ig,ilay,nlev,k,inch4,inc2h6
45
46         REAL zgz1(klon,klev),zgz2(klon,klev),zgz3(klon,klev)
47         REAL zcdv(klon),zu2,pz0
48         REAL xmair,gg,zrho,ws,ch,qch4,flux
49         REAL xmuair
50         REAL zmem,zmem2,zmem3
51         REAL prodc2h6,prodc2h2
52         real reserv(ngrid),restemp,drestemp
53         REAL evapch4
54
55         real umin
56         data umin/1.e-12/
57         save umin
58
59c
60c-----------------------------------------------------------------------
61c   initialisations:
62c   -----------------
63
64         nlev=nlay+1
65
66         if(nlay.ne.klev) THEN
67           PRINT*,'STOP dans sources.F'
68           PRINT*,'probleme de dimensions :'
69           PRINT*,'nlay  =',nlay
70           PRINT*,'klev  =',klev
71           STOP
72         endif
73
74         IF(ngrid.NE.klon) THEN
75           PRINT*,'STOP dans sources.F'
76           PRINT*,'probleme de dimensions :'
77           PRINT*,'ngrid  =',ngrid
78           PRINT*,'klon  =',klon
79           STOP
80         ENDIF
81
82         zgz1 = gaz1
83         zgz2 = gaz2
84         zgz3 = gaz3
85
86c-----------------------------------------------------------------------
87c     2. calcul de  cd :
88c     ----------------
89c
90         DO ig=1,ngrid
91           zu2=pu(ig)*pu(ig)+pv(ig)*pv(ig)+umin
92           zcdv(ig)=pz0*(1.+sqrt(zu2))
93c           write(99,'(I4,3(ES24.17,1X))') ig,
94c     &     pz0,zu2,(1.+sqrt(zu2))
95         ENDDO
96c          write(99,*) ""
97
98c-----------------------------------------------------------------------
99c    4. Conditions aux limites pour CH4 et C2H6
100c    -------------------------------------------
101c
102
103*   Conditions CH4
104         DO ig=1,ngrid
105           evapch4=0.
106           restemp=0.
107           gg=RG*RA**2/(RA+pzlay(ig,1))**2.
108           zrho=(pplev(ig,1)-pplev(ig,2))/gg
109           zrho=zrho/(pzlev(ig,2)-pzlev(ig,1))
110           ws=sqrt(pu(ig)**2.+pv(ig)**2.)*(10./pzlay(ig,1))**0.2
111           ch=1.5*sqrt(zcdv(ig))
112c           write(100,'(I4,3(ES24.17,1X))')
113c     &     ig,sqrt(pu(ig)**2.+pv(ig)**2.),
114c     &     (10./pzlay(ig,1))**0.2,ws
115           call ch4sat(ptsrf(ig),pplev(ig,1),qch4) ! qch4=kg/kg
116           qch4=qch4*0.50 ! ici on impose 50% d'humidité au sol
117       
118           if(reserv(ig).le. 1.e-10 ) then 
119             flux=0.
120             reserv(ig)=1.e-10
121           else
122             flux=zrho*ch*ws
123             flux=flux*0.1 ! fraction occupée par les lacs
124           endif
125c           write(101,'(I4,5(ES24.17,1X))')
126c     &     ig,reserv(ig),ws,ch,zrho,(pzlev(ig,1+1)-pzlev(ig,1))
127c           flux=flux/zrho/(pzlev(ig,1+1)-pzlev(ig,1)) ! dx/ds
128
129           zmem=zgz1(ig,1)
130           zgz1(ig,1)=(zgz1(ig,1)+flux*ptimestep*qch4*28./16.)
131     &                /(1.+flux*ptimestep)
132
133           gg=RG!*RA**2/(RA+pzlay(ig,1))**2.
134           xmair=(pplev(ig,1)-pplev(ig,1+1))/gg
135           xmair=xmair/(pzlev(ig,1+1)-pzlev(ig,1))
136           xmuair=28.!*(1.-zmem)+zmem*16.
137
138           drestemp = - (zgz1(ig,1)-zmem)*xmair ! en m3/m2=m
139     &     *(pzlev(ig,2)-pzlev(ig,1))*16./xmuair/425.
140
141c           ici on peut fixer un seuil sur drestemp
142c           (ie limiter l'echange atm/surface)
143     
144           restemp=reserv(ig) +drestemp
145
146           IF (restemp.ge.0.) THEN
147             reserv(ig) = reserv(ig) + drestemp
148             evapch4    = evapch4    + drestemp
149           ELSE
150*          Il n'y a pas suffisamment de méthane; on re-évalue le flux d'évaporation
151*          Quelle nouvelle concentration zgz1(ig,1) atteint-on en évaporant tout ?
152             zgz1(ig,1)=reserv(ig)/(xmair*(pzlev(ig,1+1)-pzlev(ig,1))
153     &                 *16./xmuair/425.)+zmem
154             evapch4=evapch4-reserv(ig)
155
156             if(reserv(ig).eq.0.)
157     &       print*,'assechement du sol en ig=', ig,reserv(ig),flux
158
159             reserv(ig)=0.  ! on a tout évaporé...
160           ENDIF
161c         
162           solesp(ig,klev+1,1)=solesp(ig,klev+1,1)+evapch4  ! <0 si volume évaporé (m3/m2)
163
164c         write(498,'(I3,4(ES24.17,1X))') ig,gaz1(ig,1),zgz1(ig,1),flux
165         ENDDO
166c         write(498,*) ""
167c         write(101,*) ""
168*   Conditions C2H6
169
170         prodc2h6=6.e-12/5. ! kg/m2/s
171 
172         IF (1.EQ.1) THEN
173           DO ig=1,ngrid
174             DO ilev=nlay,nlay-4,-1
175*            calcule de zrho (kg/m3) pour la couche...
176               gg=RG*RA**2/(RA+pzlay(ig,ilev))**2.
177               zrho=(pplev(ig,ilev)-pplev(ig,ilev+1))/gg
178               zrho=zrho/(pzlev(ig,ilev+1)-pzlev(ig,ilev))
179
180*              passage taux de production --> Dx_c2h6 a rajouter au niveau ilev
181               zmem2=zgz2(ig,ilev)
182               zgz2(ig,ilev)=zgz2(ig,ilev)+
183     &         prodc2h6*ptimestep/
184     &         abs(pzlev(ig,ilev+1)-pzlev(ig,ilev))    !  kg/m3/s
185     &         /zrho*28./30.
186
187             ENDDO
188           ENDDO
189
190         ELSE
191
192           DO ig=1,ngrid
193             DO ilev=nlay,nlay-8,-1
194               zgz2(ig,ilev)=1.2e-5
195             ENDDO
196           ENDDO
197
198         ENDIF  ! (fin 1.eq.0)
199
200*-------------------------------------
201*   Conditions C2H2
202
203         prodc2h2=1.6e-12/5. ! kg/m2/s
204
205         IF(1  .EQ.  1) THEN
206
207           DO ig=1,ngrid
208             DO ilev=nlay,nlay-4,-1
209*            calcule de zrho (kg/m3) pour la couche...
210                gg=RG*RA**2/(RA+pzlay(ig,ilev))**2.
211                zrho=(pplev(ig,ilev)-pplev(ig,ilev+1))/gg
212                zrho=zrho/(pzlev(ig,ilev+1)-pzlev(ig,ilev))
213
214*            passage taux de production --> Dx_c2h2 a rajouter au niveau ilev
215                zmem3=zgz3(ig,ilev)
216                zgz3(ig,ilev)=zgz3(ig,ilev)+
217     &          (prodc2h2)*ptimestep/
218     &          abs(pzlev(ig,ilev+1)-pzlev(ig,ilev))  !  kg/m3/s
219     &          /zrho*28./26.
220
221             ENDDO
222
223           ENDDO
224
225         ENDIF
226
227c-----------------------------------------------------------------------
228         DO ig=1,ngrid
229           DO ilev=1,nlay
230             gaz1(ig,ilev)=zgz1(ig,ilev)
231             gaz2(ig,ilev)=zgz2(ig,ilev)
232             gaz3(ig,ilev)=zgz3(ig,ilev)
233           ENDDO
234         ENDDO
235
236        RETURN
237        END
Note: See TracBrowser for help on using the repository browser.