source: trunk/LMDZ.MARS/libf/phymars/nuclea.F @ 532

Last change on this file since 532 was 530, checked in by aslmd, 13 years ago

LMDZ.MARS: a first intent to optimize water cycle calculations. see README for further details.

File size: 5.5 KB
Line 
1*******************************************************
2*                                                     *
3      subroutine nuclea(ph2o,temp,sat,n_ccn,nucrate)
4      implicit none
5*                                                     *
6*   This subroutine computes the nucleation rate      *
7*   as given in Pruppacher & Klett (1978) in the      *
8*   case of water ice forming on a solid substrate.   *
9*     Definition refined by Keese (jgr,1989)          *
10*   Authors: F. Montmessin                            *
11*     Adapted for the LMD/GCM by J.-B. Madeleine      *
12*     (October 2011)                                  *
13*     Optimisation by A. Spiga (February 2012)        * 
14*******************************************************
15
16#include "dimensions.h"
17#include "dimphys.h"
18#include "comcstfi.h"
19#include "tracer.h"
20#include "microphys.h"
21
22c     Inputs
23      DOUBLE PRECISION ph2o,sat
24      DOUBLE PRECISION n_ccn(nbin_cld)
25      REAL temp
26
27c     Output
28      DOUBLE PRECISION nucrate(nbin_cld)
29
30c     Local variables
31      DOUBLE PRECISION nh2o
32      DOUBLE PRECISION sig      ! Water-ice/air surface tension  (N.m)
33      external sig
34      DOUBLE PRECISION rstar    ! Radius of the critical germ (m)
35      DOUBLE PRECISION gstar    ! # of molecules forming a critical embryo
36      DOUBLE PRECISION fistar   ! Activation energy required to form a critical embryo (J)
37!      DOUBLE PRECISION zeldov   ! Zeldovitch factor (no dim)
38      DOUBLE PRECISION fshape   ! function defined at the end of the file
39      DOUBLE PRECISION deltaf
40
41c     Ratio rstar/radius of the nucleating dust particle
42c     double precision xratio
43     
44      double precision mtetalocal ! local mteta in double precision
45
46      double precision fshapesimple,zefshape
47
48
49      integer i
50     
51      LOGICAL firstcall
52      DATA firstcall/.true./
53      SAVE firstcall
54
55c     *************************************************
56
57      mtetalocal = mteta  !! use mtetalocal for better performance
58
59cccccccccccccccccccccccccccccccccccccccccccccccccc
60ccccccccccc ESSAIS TN MTETA = F (T) cccccccccccccc
61c      if (temp .gt. 200) then
62c         mtetalocal = mtetalocal
63c      else if (temp .lt. 190) then
64c         mtetalocal = mtetalocal-0.05
65c      else
66c         mtetalocal = mtetalocal - (190-temp)*0.005
67c      endif
68c----------------exp law, see Trainer 2008, J. Phys. Chem. C 2009, 113, 2036\u20132040
69       !mtetalocal = max(mtetalocal - 6005*exp(-0.065*temp),0.1)
70       !mtetalocal = max(mtetalocal - 6005*exp(-0.068*temp),0.1)
71               !print*, mtetalocal, temp
72cccccccccccccccccccccccccccccccccccccccccccccccccc
73cccccccccccccccccccccccccccccccccccccccccccccccccc
74      IF (firstcall) THEN
75          print*, ' ' 
76          print*, 'dear user, please keep in mind that'
77          print*, 'contact parameter IS constant'
78          !print*, 'contact parameter IS NOT constant:'
79          !print*, 'max(mteta - 6005*exp(-0.065*temp),0.1)'
80          !print*, 'max(mteta - 6005*exp(-0.068*temp),0.1)'
81          print*, ' ' 
82         firstcall=.false.
83      END IF
84cccccccccccccccccccccccccccccccccccccccccccccccccc
85cccccccccccccccccccccccccccccccccccccccccccccccccc
86   
87
88      if (sat .gt. 1.) then    ! minimum condition to activate nucleation
89
90        nh2o   = ph2o / kbz / temp
91        rstar  = 2. * sig(temp) * vo1 / (rgp*temp*dlog(sat))
92        gstar  = 4. * nav * pi * (rstar * rstar * rstar) / (3.*vo1)
93       
94        fshapesimple = (2.+mtetalocal)*(1.-mtetalocal)*(1.-mtetalocal)
95     &                   / 4.
96
97c       Loop over size bins
98        do 200 i=1,nbin_cld
99
100          if ( n_ccn(i) .lt. 1e-10 ) then
101c           no dust, no need to compute nucleation!
102            nucrate(i)=0.
103            goto 200
104          endif
105
106          if (rad_cld(i).gt.3000.*rstar) then
107            zefshape = fshapesimple
108          else
109            zefshape = fshape(mtetalocal,rad_cld(i)/rstar)
110          endif
111
112          fistar = (4./3.*pi) * sig(temp) * (rstar * rstar) *
113     &             zefshape
114          deltaf = (2.*desorp-surfdif-fistar)/
115     &             (kbz*temp)
116          deltaf = min( max(deltaf, -100.), 100.)
117
118          if (deltaf.eq.-100.) then
119            nucrate(i) = 0.
120          else
121            nucrate(i)= sqrt ( fistar /
122     &               (3.*pi*kbz*temp*(gstar*gstar)) )
123     &                  * kbz * temp * rstar
124     &                  * rstar * 4. * pi
125     &                  * ( nh2o*rad_cld(i) )
126     &                  * ( nh2o*rad_cld(i) )
127     &                  / ( zefshape * nus * m0 )
128     &                  * dexp (deltaf)
129          endif
130
131200     continue
132
133      else
134
135        do i=1,nbin_cld
136          nucrate(i) = 0.
137        enddo
138
139      endif
140
141      return
142      end
143
144*********************************************************
145      double precision function fshape(cost,rap)
146      implicit none
147*        function computing the f(m,x) factor           *
148* related to energy required to form a critical embryo  *
149*********************************************************
150
151      double precision cost,rap
152      double precision yeah
153
154          !! PHI
155          yeah = sqrt( 1. - 2.*cost*rap + rap*rap )
156          !! FSHAPE = TERM A
157          fshape = (1.-cost*rap) / yeah
158          fshape = fshape * fshape * fshape
159          fshape = 1. + fshape
160          !! ... + TERM B
161          yeah = (rap-cost)/yeah
162          fshape = fshape + rap*rap*rap*(2.-3.*yeah+yeah*yeah*yeah)
163          !! ... + TERM C
164          fshape = fshape + 3. * cost * rap * rap * (yeah-1.)
165          !! FACTOR 1/2
166          fshape = 0.5*fshape
167
168      return
169      end
Note: See TracBrowser for help on using the repository browser.