source: trunk/LMDZ.PLUTO/libf/phypluto/molvis.F @ 3455

Last change on this file since 3455 was 3455, checked in by afalco, 7 weeks ago

Pluto PCM: added conduction & molvis.
AF

File size: 5.2 KB
RevLine 
[3455]1       SUBROUTINE molvis(ngrid,nlayer,ptimestep,
2     $                   pplay,pt,pzlay,pzlev,
3     $                   pdtconduc,pvel,tsurf,zdvelmolvis)
4
5      use comcstfi_mod, only: cpp, r
6      use surfdat_h, only: phitop
7
8      IMPLICIT NONE
9
10c=======================================================================
11c
12c   Molecular Viscosity Diffusion
13c
14c   Based on conduction.F  by N. Descamp, F. Forget 05/1999
15c
16c   modified by M. Angelats i Coll
17c=======================================================================
18
19c-----------------------------------------------------------------------
20c   declarations:
21c-----------------------------------------------------------------------
22
23#include "dimensions.h"
24
25c   arguments:
26c   ----------
27
28      INTEGER ngrid,nlayer
29      REAL ptimestep
30      REAL pt(ngrid,nlayer),pdtconduc(ngrid,nlayer)
31      REAL pzlay(ngrid,nlayer),pzlev(ngrid,nlayer+1),pplay(ngrid,nlayer)
32      REAL pvel(ngrid,nlayer)  ! wind
33      REAL zdvelmolvis(ngrid,nlayer)
34c   local:
35c   ------
36
37      INTEGER ilayer,ig
38      REAL zvel(nlayer)
39      REAL zt(nlayer)
40      REAL alpha(nlayer)
41      REAL lambda(nlayer),muvol(nlayer)
42      REAL C(nlayer),D(nlayer),den(nlayer)
43      REAL pdvelm(nlayer),tsurf
44      REAL fac, m
45
46c   constants used locally
47c    ---------------------
48c     The atmospheric conductivity is a function of temperature T :
49c      conductivity = Akk* T**skk
50c     Molecular viscosity is related to thermal conductivity by:
51c       conduc = 0.25*(9*gamma - 5)* Cv * molvis
52c     where gamma = Cp/Cv.  For dry air.
53
54      real,parameter :: Akk=5.63E-05
55      real,parameter :: skk=1.12
56!      real,parameter :: Akk=2.6E-05
57!      real,parameter :: skk=1.3
58      real,parameter :: velsurf=0.0
59
60      logical firstcall
61      save firstcall
62      data firstcall /.true./
63c-----------------------------------------------------------------------
64c   calcul des coefficients alpha et lambda
65c
66c-----------------------------------------------------------------------
67
68      IF (firstcall) THEN
69        write (*,*) 'molvis : coeff of molecular viscosity skk'
70        write(*,*) skk
71        firstcall = .false.
72      END IF
73
74      DO ig=1,ngrid
75
76        zt(1)=pt(ig,1)+pdtconduc(ig,1)*ptimestep
77        zvel(1)=pvel(ig,1)
78
79        DO ilayer = 2 , nlayer
80
81          zt(ilayer)=pt(ig,ilayer)+pdtconduc(ig,ilayer)*ptimestep
82          zvel(ilayer)=pvel(ig,ilayer)
83        ENDDO
84
85        fac=0.25*(9.*cpp-5.*(cpp-r))
86        lambda(1) = Akk*tsurf**skk / pzlay(ig,1)/fac
87
88         DO ilayer = 2 , nlayer
89
90          fac=(9.*cpp-5.*(cpp-r))/4.
91          lambda(ilayer) = Akk/fac * zt(ilayer)**skk /
92     $                      (pzlay(ig,ilayer)-pzlay(ig,ilayer-1))
93        ENDDO
94
95        DO ilayer=1,nlayer-1
96          muvol(ilayer)=pplay(ig,ilayer)/(r*zt(ilayer))
97          alpha(ilayer)=(muvol(ilayer)/ptimestep)*
98     $                      (pzlev(ig,ilayer+1)-pzlev(ig,ilayer))
99        ENDDO
100
101c!!!!! alerte !!!!!c
102c!!!!! zlev n'est pas declare a nlev !!!!!
103c!!!!! ---->
104          muvol(nlayer)=pplay(ig,nlayer)/(r*zt(nlayer))
105!OLD
106!          alpha(nlayer)=(muvol(nlayer)/ptimestep)*
107!     $                      2*(pzlay(ig,nlayer)-pzlev(ig,nlayer))
108c!!!!! <----
109c!!!!! alerte !!!!!c
110c        write(*,*) lambda(1),muvol(1),tsurf,pt(1,1)
111
112!NEW TB16:
113
114          alpha(nlayer)=(muvol(nlayer)/ptimestep)*
115     $                      (pzlev(ig,nlayer)+10000.
116     &                               -pzlev(ig,nlayer))
117
118
119c--------------------------------------------------------------------
120c
121c     calcul des coefficients C et D
122c
123c-------------------------------------------------------------------
124
125      den(1)=alpha(1)+lambda(2)+lambda(1)
126      C(1)=lambda(1)*(velsurf-zvel(1))+lambda(2)*(zvel(2)-zvel(1))
127      C(1)=C(1)/den(1)
128      D(1)=lambda(2)/den(1)
129
130      DO ilayer = 2,nlayer-1
131         den(ilayer)=alpha(ilayer)+lambda(ilayer+1)
132         den(ilayer)=den(ilayer)+lambda(ilayer)*(1-D(ilayer-1))
133
134         C(ilayer) =lambda(ilayer+1)*(zvel(ilayer+1)-zvel(ilayer))
135     $   +lambda(ilayer)*(zvel(ilayer-1)-zvel(ilayer)+C(ilayer-1))
136         C(ilayer) =C(ilayer)/den(ilayer)
137
138         D(ilayer) =lambda(ilayer+1) / den(ilayer)
139      ENDDO
140
141      den(nlayer)=alpha(nlayer) + lambda(nlayer) * (1-D(nlayer-1))
142c      C(nlayer)=((C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer))
143c     $            *lambda(nlayer) + phitop) / den(nlayer)
144      C(nlayer)=C(nlayer-1)+zvel(nlayer-1)-zvel(nlayer)
145      C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop) / den(nlayer)
146      ! C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop(ig)) / den(nlayer)
147
148c----------------------------------------------------------------------
149c
150c      calcul de la nouvelle temperature pdvelm
151c
152c----------------------------------------------------------------------
153
154      DO ilayer=1,nlayer
155         pdvelm(ilayer)=0.
156      ENDDO
157
158         pdvelm(nlayer)=C(nlayer)
159!         pt(nlayer)=ttop
160!         write(*,*)'pt',pt(nlayer)
161
162      DO ilayer=nlayer-1,1,-1
163         pdvelm(ilayer)=C(ilayer)+D(ilayer)*pdvelm(ilayer+1)
164      ENDDO
165
166c-----------------------------------------------------------------------
167c
168c     calcul de la tendance zdvelmolvis
169c
170c-----------------------------------------------------------------------
171
172      DO ilayer=1,nlayer
173         zdvelmolvis(ig,ilayer) = pdvelm(ilayer) / ptimestep
174      ENDDO
175      ENDDO             ! boucle sur ngrid
176
177      RETURN
178      END
Note: See TracBrowser for help on using the repository browser.