source: trunk/LMDZ.GENERIC/libf/phystd/largescale.F @ 736

Last change on this file since 736 was 726, checked in by jleconte, 12 years ago

17/07/2012 == JL for LK

  • Generalization of aerosol scheme:
    • any number of aerosols can be used and id numbers are determined consistently by the code. Aerosol order not important anymore.
    • addition of a module with the id numbers for aerosols (aerosol_mod.F90).
    • initialization of aerosols id numbers in iniaerosol.F90
    • compile with -s x where x *must* be equal to the number of aerosols turned on in callphys.def (either by a flag or by dusttau>0 for dust). => may have to erase object files when compiling with s option for the first time.
  • For no aerosols, run with aeroco2=.true. and aerofixco2=.true (the default distribution for fixed co2

aerosols is 1.e-9; can be changed in aeropacity).

  • If starting from an old start file, recreate start file with the q=0 option in newstart.e.
  • update callphys.def with aeroXXX and aerofixXXX options (only XXX=co2,h2o supported for

now). Dust is activated by setting dusttau>0. See the early mars case in deftank.

  • To add other aerosols, see Laura Kerber.
File size: 4.2 KB
RevLine 
[253]1      subroutine largescale(dtime, paprs, pplay, t, pq,
2     &                   pdt, d_t, d_q, d_ql, rneb, reffH2O)
3
4      use watercommon_h, only : RLVTT, RCPD, RVTMP2
5
6      IMPLICIT none
7
8!==================================================================
9!     
10!     Purpose
11!     -------
12!     Calculates large-scale (stratiform) H2O condensation.
13!     
14!     Authors
15!     -------
16!     Adapted from the LMDTERRE code by R. Wordsworth (2009)
17!     Original author Z. X. Li (1993)
18!     
19!==================================================================
20
21#include "dimensions.h"
22#include "dimphys.h"
23#include "comcstfi.h"
24
25#include "fisice.h"
26#include "callkeys.h"
27#include "tracer.h"
28
29
30!     Pre-arguments (for universal model)
31      real pq(ngridmx,nlayermx,nqmx)       ! tracer (kg/kg)
32
33!     Arguments
34      REAL dtime                     ! intervalle du temps (s)
35      REAL paprs(ngridmx,nlayermx+1) ! pression a inter-couche
36      REAL pplay(ngridmx,nlayermx)   ! pression au milieu de couche
37      REAL t(ngridmx,nlayermx)       ! temperature (K)
38      REAL q(ngridmx,nlayermx)       ! humidite specifique (kg/kg)
39      REAL d_t(ngridmx,nlayermx)     ! incrementation de la temperature (K)
40      REAL d_q(ngridmx,nlayermx)     ! incrementation de la vapeur d'eau
41      REAL d_ql(ngridmx,nlayermx)    ! incrementation de l'eau liquide
42      REAL rneb(ngridmx,nlayermx)    ! fraction nuageuse
43      REAL reffH2O(ngridmx,nlayermx) ! cloud particle mean radius (m)
44
45      REAL pdt(ngridmx,nlayermx) ! added by Benjamin!
46
47!     Options du programme
48      REAL ratqs   ! determine largeur de la distribution de vapeur
49      PARAMETER (ratqs=0.2)
50
51!     Variables locales
52      REAL CBRT
53      EXTERNAL CBRT
54      INTEGER i, k
55      REAL zt(ngridmx), zq(ngridmx)
56      REAL zcond(ngridmx)
57      REAL zdelq(ngridmx)
58      REAL zqs(ngridmx), zdqs(ngridmx)
59
60      REAL zcor(ngridmx), zdelta(ngridmx), zcvm5(ngridmx)
61      REAL zx_q(ngridmx)
62
63!     GCM -----> subroutine variables, initialisation of outputs
64      DO k = 1, nlayermx
65      DO i = 1, ngridmx
66         q(i,k)    = pq(i,k,igcm_h2o_vap)
67         d_t(i,k)  = 0.0
68         d_q(i,k)  = 0.0
69         d_ql(i,k) = 0.0
70         rneb(i,k) = 0.0
71      ENDDO
72      ENDDO
73
74!     Boucle verticale (du haut vers le bas)
75      DO 9999 k = nlayermx, 1, -1
76
77      DO i = 1, ngridmx
78         zt(i)=t(i,k)+pdt(i,k)*dtime
79         zq(i)=q(i,k) ! no need to add tendency as we're already dealing with qevap
80      ENDDO
81
82!     Calculer la vapeur d'eau saturante et
83!     determiner la condensation partielle
84      DO i = 1, ngridmx
85
86         call watersat(zt(i),pplay(i,k),zqs(i))
87         call watersat_grad(zt(i),zqs(i),zdqs(i))
88
89         !IF (zt(i).LT.t_coup) THEN
90         !   zqs(i) = qsats(zt(i))/pplay(i,k)
91         !   zdqs(i) = dqsats(zt(i),zqs(i))
92         !ELSE
93         !   zqs(i) = qsatl(zt(i))/pplay(i,k)
94         !   zdqs(i) = dqsatl(zt(i),zqs(i))
95         !ENDIF
96
97         zdelq(i) = ratqs * zq(i)
98         rneb(i,k) = (zq(i)+zdelq(i)-zqs(i)) / (2.0*zdelq(i))
99         zcond(i) = 0.0
100         zx_q(i) = (zq(i)+zdelq(i)+zqs(i))/2.0
101         if (rneb(i,k) .LE. 0.0) zx_q(i) = 0.0
102         if (rneb(i,k) .GE. 1.0) zx_q(i) = zq(i)
103         rneb(i,k) = MAX(0.0,MIN(1.0,rneb(i,k)))
104         !zcond(i) = MAX(0.0,(zx_q(i)-zqs(i)*rneb(i,k)/(1.+zdqs(i))))
105         zcond(i) = MAX(0.0,(zx_q(i)-zqs(i))*rneb(i,k)/(1.+zdqs(i)))
106!     zcond always postive! cannot evaporate clouds!
107!     this is why we must reevaporate before largescale
108
109
110         zcond(i) = zcond(i)/dtime ! added by RDW
111
112!     for varying particle size in rad tran and (possibly) sedimentation
[726]113         if(aeroh2o.and.(.not.aerofixh2o)) then
114
[253]115            reffH2O(i,k) = CBRT( 3*zcond(i)/( 4*Nmix_h2o*pi*rho_ice))
116            reffH2O(i,k) = max(reffH2O(i,k),1.e-8)
117         endif
118
119      ENDDO
120
121!     Tendances de t et q
122      DO i = 1, ngridmx
123         d_q(i,k)  = - zcond(i)
124         d_ql(i,k) = zcond(i)
125         !d_t(i,k) = zcond(i)*RLVTT/cpp
126         d_t(i,k)  = zcond(i)*RLVTT/RCPD!/(1.0+RVTMP2*q(i,k))
127         ! this one is FAR TOO BIG
128      ENDDO
129
130 9999 CONTINUE
131
132      !print*,'qsat=',zqs
133      !print*,'q=',q
134      !print*,'dq=',d_q*dtime
135      !print*,'dT in LS=',d_t*dtime
136
137      !print*,'rice=',rice
138      !print*,'rneb=',rneb
139
140      return
141      end
Note: See TracBrowser for help on using the repository browser.