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

Last change on this file since 3436 was 3175, checked in by emillour, 11 months ago

Pluto PCM:
Add the old Pluto LMDZ for reference (required prior step to making
an LMDZ.PLUTO using the same framework as the other physics packages).
TB+EM

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