source: trunk/mars/libf/phymars/watercloud.F @ 117

Last change on this file since 117 was 83, checked in by aslmd, 14 years ago

mars + LMD_MM_MARS : modifications pour cycle de l'eau, valeurs tunees JBM


used settings reached by JBM to obtain his PhD results

alb_surfice = 0.45 --- in physiq.F and meso_physiq.F
ccn_factor = 4.5 --- in watercloud.F
nuice_sed = 0.45 --- in callsedim.F

NB: this is supposed to be further refined in the future

File size: 11.5 KB
Line 
1       SUBROUTINE watercloud(ngrid,nlay, ptimestep,
2     &                pplev,pplay,pdpsrf,pzlev,pzlay,pt,pdt,
3     &                pq,pdq,pdqcloud,pdqscloud,pdtcloud,
4     &                nq,naersize,tau,
5     &                ccn,rdust,rice,nuice)
6      IMPLICIT NONE
7
8c=======================================================================
9c     Treatment of saturation of water vapor
10c
11c
12c     Modif de zq si saturation dans l'atmosphere
13c     si zq(ig,l)> zqsat(ig,l) ->    zq(ig,l)=zqsat(ig,l)
14c     Le test est effectue de bas en haut. L'eau condensee
15c    (si saturation) est remise dans la couche en dessous.
16c     L'eau condensee dans la couche du bas est deposee a la surface
17c       
18c    Modification: Franck Montmessin water ice scheme
19c                  Francois Forget : change nuclei density & outputs   
20c                  Ehouarn Millour: sept.2008, tracers are now handled
21c                                   by name (and not fixed index)
22c
23c=======================================================================
24
25c-----------------------------------------------------------------------
26c   declarations:
27c   -------------
28
29#include "dimensions.h"
30#include "dimphys.h"
31#include "comcstfi.h"
32#include "callkeys.h"
33#include "tracer.h"
34#include "comgeomfi.h"
35
36c   Inputs:
37c   ------
38
39      INTEGER ngrid,nlay
40      REAL ptimestep             ! pas de temps physique (s)
41      REAL pplev(ngrid,nlay+1)   ! pression aux inter-couches (Pa)
42      REAL pplay(ngrid,nlay)     ! pression au milieu des couches (Pa)
43      REAL pdpsrf(ngrid)         ! tendance surf pressure
44      REAL pzlev(ngrid,nlay+1)   ! altitude at layer boundaries
45      REAL pzlay(ngrid,nlay)     ! altitude at the middle of the layers
46      REAL pt(ngrid,nlay)        ! temperature at the middle of the layers (K)
47      REAL pdt(ngrid,nlay)       ! tendance temperature des autres param.
48
49      real pq(ngrid,nlay,nq)     ! traceur (kg/kg)
50      real pdq(ngrid,nlay,nq)    ! tendance avant condensation  (kg/kg.s-1)
51
52      integer nq         ! nombre de traceurs
53      integer naersize   ! nombre de traceurs radiativement actifs (=naerkind)
54      REAL tau(ngridmx,naersize)
55      REAL ccn(ngridmx,nlayermx)   ! Cloud condensation nuclei
56                                   !   (particules kg-1)
57      real rdust(ngridmx,nlayermx) ! Dust geometric mean radius (m)
58
59c   Outputs:
60c   -------
61
62      real pdqcloud(ngrid,nlay,nq) ! tendance de la condensation H2O(kg/kg.s-1)
63      real pdqscloud(ngrid,nq)     ! flux en surface (kg.m-2.s-1)
64      REAL pdtcloud(ngrid,nlay)    ! tendance temperature due
65                                   !   a la chaleur latente
66
67      REAL rice(ngrid,nlay)    ! Ice mass mean radius (m)
68                               ! (r_c in montmessin_2004)
69      REAL nuice(ngrid,nlay)   ! Estimated effective variance
70                               !   of the size distribution
71
72c   local:
73c   ------
74
75      REAL CBRT
76      EXTERNAL CBRT
77      INTEGER ig,iq,l
78
79
80      REAL zq(ngridmx,nlayermx,nqmx)  ! local value of tracers
81      REAL zq0(ngridmx,nlayermx,nqmx) ! local initial value of tracers
82      REAL zqsat(ngridmx,nlayermx)    ! saturation
83      REAL zt(ngridmx,nlayermx)       ! local value of temperature
84
85      REAL masse (ngridmx,nlayermx)
86      REAL epaisseur (ngridmx,nlayermx)
87      REAL rfinal        ! Ice crystal radius after condensation(m)
88      REAL seq           ! Equilibrium saturation ration (accounting for curvature effect)
89      REAL dzq           ! masse de glace echangee (kg/kg)
90      REAL lw       !Latent heat of sublimation (J.kg-1)
91      REAL,PARAMETER :: To=273.15 ! reference temperature, T=273.15 K
92
93      REAL Ctot
94      REAL*8 ph2o,satu
95      REAL gr,Cste,up,dwn,newvap
96
97      LOGICAL,SAVE :: firstcall=.true.
98! To use more refined microphysics, set improved to .true.
99      LOGICAL,PARAMETER :: improved=.true.
100
101c     Pour diagnostique :
102c     ~~~~~~~~~~~~~~~~~
103c     REAL icetot(ngridmx)             ! Total mass of water ice (kg/m2)
104c     REAL rave(ngridmx)               ! Mean crystal radius in a column (m)
105
106      INTEGER i
107
108! indexes of water vapour, water ice and dust tracers:
109      INTEGER,SAVE :: i_h2o=0  ! water vapour
110      INTEGER,SAVE :: i_ice=0  ! water ice
111      CHARACTER(LEN=20) :: tracername ! to temporarly store text
112
113c    ** un petit test de coherence
114c       --------------------------
115
116      IF (firstcall) THEN
117        IF(ngrid.NE.ngridmx) THEN
118            PRINT*,'STOP dans watercloud'
119            PRINT*,'probleme de dimensions :'
120            PRINT*,'ngrid  =',ngrid
121            PRINT*,'ngridmx  =',ngridmx
122            STOP
123        ENDIF
124         
125        if (nq.gt.nqmx) then
126           write(*,*) 'stop in watercloud (nq.gt.nqmx)!'
127           write(*,*) 'nq=',nq,' nqmx=',nqmx
128           stop
129        endif
130         
131        i_h2o=igcm_h2o_vap
132        i_ice=igcm_h2o_ice
133       
134        write(*,*) "watercloud: i_h2o=",i_h2o
135        write(*,*) "            i_ice=",i_ice
136
137        firstcall=.false.
138      ENDIF ! of IF (firstcall)
139
140
141c-----------------------------------------------------------------------
142c    1. initialisation
143c    -----------------
144
145c    On "update" la valeur de q(nqmx) (water vapor) et temperature.
146c    On effectue qqes calculs preliminaires sur les couches :
147c    masse (kg.m-2), epaisseur(m).
148
149      do l=1,nlay
150        do ig=1,ngrid
151          zq(ig,l,i_h2o)=pq(ig,l,i_h2o)+pdq(ig,l,i_h2o)*ptimestep
152          zq(ig,l,i_h2o)=max(zq(ig,l,i_h2o),1.E-30) ! FF 12/2004
153          zq0(ig,l,i_h2o)=zq(ig,l,i_h2o)
154          zt(ig,l)=pt(ig,l)+ pdt(ig,l)*ptimestep
155          masse(ig,l)=(pplev(ig,l) - pplev(ig,l+1)) /g
156          epaisseur(ig,l)= pzlev(ig,l+1) - pzlev(ig,l)
157
158          zq(ig,l,i_ice)=pq(ig,l,i_ice)+pdq(ig,l,i_ice)*ptimestep
159          zq(ig,l,i_ice)=max(zq(ig,l,i_ice),0.) ! FF 12/2004
160          zq0(ig,l,i_ice)=zq(ig,l,i_ice)
161
162c         This typical profile is not used anymore; rdust is
163c           set up in updatereffrad.F.
164c         rdust(ig,l)= max(.8e-6*exp(-pzlay(ig,l)/18000.),1.e-9)
165        enddo
166      enddo
167
168      do l=1,nlay
169        do ig=1,ngrid
170c         Calcul du rayon moyen des particules de glace.
171c         Hypothese : Dans une couche, la glace presente se
172c         repartit uniformement autour du nbre de poussieres
173c         dont le rayon moyen est prescrit par rdust.
174c         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175          rice(ig,l)=CBRT( ( zq(ig,l,i_ice)/rho_ice+
176     &       ccn(ig,l)*(4./3.)*pi*rdust(ig,l)**3. )
177     &       / (ccn(ig,l)*4./3.*pi) )
178          rice(ig,l)=max(rice(ig,l),rdust(ig,l))
179c         Effective variance of the size distribution
180          nuice(ig,l)=nuice_ref
181        enddo ! of do ig=1,ngrid
182      enddo ! of dol=1,nlay
183
184      pdqscloud(1:ngrid,1:nq)=0
185      pdqcloud(1:ngrid,1:nlay,1:nq)=0
186      pdtcloud(1:ngrid,1:nlay)=0
187
188c     icetot(1:ngrid)=0
189c     rave(1:ngrid)=0
190
191c    ----------------------------------------------
192c
193c
194c       Rapport de melange a saturation dans la couche l : -------
195c       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
196
197        call watersat(ngridmx*nlayermx,zt,pplay,zqsat)
198
199c       taux de condensation (kg/kg/s-1) dans les differentes couches
200c       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201
202c       Iceparty is not used anymore: water=>iceparty (JBM).
203c       if(iceparty) then
204
205        do l=1,nlay
206          do ig=1,ngrid
207
208          IF (improved) then
209c         Improved microphysics scheme
210c         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211
212           Ctot = zq(ig,l,i_h2o) + zq(ig,l,i_ice)
213           ph2o = zq(ig,l,i_h2o) * 44. / 18. * pplay(ig,l)
214           satu = zq(ig,l,i_h2o) / zqsat(ig,l)
215
216           call growthrate(ptimestep,zt(ig,l),pplay(ig,l),
217     &        ph2o,ph2o/satu,seq,rice(ig,l),gr)
218           Cste = ptimestep * 4. * pi * rice(ig,l)
219     *              * rho_ice * ccn(ig,l)
220           up   = zq(ig,l,i_h2o) + Cste * gr * seq
221           dwn  =    1.       + Cste * gr / zqsat(ig,l)
222           newvap = min(up/dwn,Ctot)
223
224           gr  = gr * ( newvap/zqsat(ig,l) - seq )
225           dzq = min( max( Cste * gr,-zq(ig,l,i_ice) )
226     *             , zq(ig,l,i_h2o) )
227
228c          Nucleation (sat ratio must be larger than a critical value)
229c          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230           if (satu.gt.1.) then
231             if (satu.le.1.4.and.zq(ig,l,i_ice).lt.1.e-8)
232     *          dzq = 0.
233           endif
234
235           ELSE
236c          Old version
237c          ~~~~~~~~~~~
238           if (zq(ig,l,i_h2o).ge.zqsat(ig,l))then  !  Condensation
239             dzq=zq(ig,l,i_h2o)-zqsat(ig,l)               
240           elseif(zq(ig,l,i_h2o).lt.zqsat(ig,l))then  ! Sublimation
241             dzq=-min(zqsat(ig,l)-zq(ig,l,i_h2o),zq(ig,l,i_ice))
242           endif
243
244           ENDIF ! of IF (improved)
245
246c           Water Mass change
247c           ~~~~~~~~~~~~~~~~~
248            zq(ig,l,i_ice)=zq(ig,l,i_ice)+dzq
249            zq(ig,l,i_h2o)=zq(ig,l,i_h2o)-dzq
250
251            rice(ig,l)=max( CBRT ( (zq(ig,l,i_ice)/rho_ice
252     &       +ccn(ig,l)*(4./3.)*pi*rdust(ig,l)**3.)
253     &       /(ccn(ig,l)*4./3.*pi) ), rdust(ig,l))
254
255            enddo ! of do ig=1,ngrid
256          enddo ! of do l=1,nlay
257
258c       The following part have been commented because iceparty
259c           is not used anymore: water=>iceparty (JBM).
260
261c       else   ! if not iceparty
262
263c         Saturation couche nlay a 2 :
264c         ~~~~~~~~~~~~~~~~~~~~~~~~~~
265c         do l=nlay,2, -1
266c          do ig=1,ngrid
267c           if (zq(ig,l,i_h2o).gt.zqsat(ig,l))then
268c             zq(ig,l-1,i_h2o)= zq(ig,l-1,i_h2o)+
269c    &                          (zq(ig,l,i_h2o)-zqsat(ig,l))
270c    &          *(pplev(ig,l)-pplev(ig,l+1))/(pplev(ig,l-1)-pplev(ig,l))
271c             zq(ig,l,i_h2o)=zqsat(ig,l)
272c           endif
273c          enddo
274c         enddo
275
276c       Saturation couche l=1 si pas iceparty
277c       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278c         do ig=1,ngridmx
279c           if (zq(ig,1,i_h2o).gt.zqsat(ig,1))then
280c             pdqscloud(ig,i_ice)=(zq(ig,1,i_h2o)-zqsat(ig,1))
281c    &           *(pplev(ig,1)-pplev(ig,2))/(g*ptimestep)
282c             zq(ig,1,i_h2o)=zqsat(ig,1)
283c           endif
284c         enddo
285
286c       endif   ! of if (iceparty)
287
288c       Tendance finale
289c       ~~~~~~~~~~~~~~~
290        do l=1, nlay
291          do ig=1,ngridmx
292            pdqcloud(ig,l,i_h2o)=(zq(ig,l,i_h2o)
293     &                              -zq0(ig,l,i_h2o))/ptimestep
294            pdqcloud(ig,l,i_ice) =
295     &        (zq(ig,l,i_ice) - zq0(ig,l,i_ice))/ptimestep
296            lw=(2834.3-0.28*(zt(ig,l)-To)-0.004*(zt(ig,l)-To)**2)*1.e+3
297            pdtcloud(ig,l)=-pdqcloud(ig,l,i_h2o)*lw/cpp
298          end do
299        end do
300
301c       A correction if a lot of subliming CO2 fills the 1st layer FF04/2005
302c       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
303c       Then that should not affect the ice particle radius
304        do ig=1,ngridmx
305          if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,2)))then
306            if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,3)))
307     &      rice(ig,2)=rice(ig,3)
308            rice(ig,1)=rice(ig,2)
309          end if
310        end do
311       
312c**************************************************
313c       Output 
314c**************************************************
315! NB: for diagnostics use zq(), the updated value of tracers
316
317c        do ig=1,ngridmx
318c         do l=1 ,nlay
319c           masse de glace d'eau dans la couche l
320c           icetot(ig)=icetot(ig)+masse(ig,l)*zq(ig,l,i_ice)
321c           rayon moyen des cristaux dans la colonne ig
322c           rave(ig)=rave(ig)+masse(ig,l)*zq(ig,l,i_ice)*rice(ig,l)
323c         enddo
324c         rave(ig)=rave(ig)/max(icetot(ig),1.e-30)
325c         if (icetot(ig)*1000.lt.0.01) rave(ig)=0.
326c        enddo   ! (ngridmx)
327c**************************************************
328
329      RETURN
330      END
331 
Note: See TracBrowser for help on using the repository browser.