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

Last change on this file since 486 was 253, checked in by emillour, 13 years ago

Generic GCM

  • Massive update to version 0.7

EM+RW

File size: 4.2 KB
Line 
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
113         if(.not.aerofixed)then
114            reffH2O(i,k) = CBRT( 3*zcond(i)/( 4*Nmix_h2o*pi*rho_ice))
115            reffH2O(i,k) = max(reffH2O(i,k),1.e-8)
116         endif
117
118      ENDDO
119
120!     Tendances de t et q
121      DO i = 1, ngridmx
122         d_q(i,k)  = - zcond(i)
123         d_ql(i,k) = zcond(i)
124         !d_t(i,k) = zcond(i)*RLVTT/cpp
125         d_t(i,k)  = zcond(i)*RLVTT/RCPD!/(1.0+RVTMP2*q(i,k))
126         ! this one is FAR TOO BIG
127      ENDDO
128
129 9999 CONTINUE
130
131      !print*,'qsat=',zqs
132      !print*,'q=',q
133      !print*,'dq=',d_q*dtime
134      !print*,'dT in LS=',d_t*dtime
135
136      !print*,'rice=',rice
137      !print*,'rneb=',rneb
138
139      return
140      end
Note: See TracBrowser for help on using the repository browser.