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 | |
---|
10 | c======================================================================= |
---|
11 | c |
---|
12 | c Molecular Viscosity Diffusion |
---|
13 | c |
---|
14 | c Based on conduction.F by N. Descamp, F. Forget 05/1999 |
---|
15 | c |
---|
16 | c modified by M. Angelats i Coll |
---|
17 | c======================================================================= |
---|
18 | |
---|
19 | c----------------------------------------------------------------------- |
---|
20 | c declarations: |
---|
21 | c----------------------------------------------------------------------- |
---|
22 | |
---|
23 | #include "dimensions.h" |
---|
24 | |
---|
25 | c arguments: |
---|
26 | c ---------- |
---|
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) |
---|
34 | c local: |
---|
35 | c ------ |
---|
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 | |
---|
46 | c constants used locally |
---|
47 | c --------------------- |
---|
48 | c The atmospheric conductivity is a function of temperature T : |
---|
49 | c conductivity = Akk* T**skk |
---|
50 | c Molecular viscosity is related to thermal conductivity by: |
---|
51 | c conduc = 0.25*(9*gamma - 5)* Cv * molvis |
---|
52 | c 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./ |
---|
63 | c----------------------------------------------------------------------- |
---|
64 | c calcul des coefficients alpha et lambda |
---|
65 | c |
---|
66 | c----------------------------------------------------------------------- |
---|
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 | |
---|
101 | c!!!!! alerte !!!!!c |
---|
102 | c!!!!! zlev n'est pas declare a nlev !!!!! |
---|
103 | c!!!!! ----> |
---|
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)) |
---|
108 | c!!!!! <---- |
---|
109 | c!!!!! alerte !!!!!c |
---|
110 | c 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 | |
---|
119 | c-------------------------------------------------------------------- |
---|
120 | c |
---|
121 | c calcul des coefficients C et D |
---|
122 | c |
---|
123 | c------------------------------------------------------------------- |
---|
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)) |
---|
142 | c C(nlayer)=((C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer)) |
---|
143 | c $ *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 | |
---|
148 | c---------------------------------------------------------------------- |
---|
149 | c |
---|
150 | c calcul de la nouvelle temperature pdvelm |
---|
151 | c |
---|
152 | c---------------------------------------------------------------------- |
---|
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 | |
---|
166 | c----------------------------------------------------------------------- |
---|
167 | c |
---|
168 | c calcul de la tendance zdvelmolvis |
---|
169 | c |
---|
170 | c----------------------------------------------------------------------- |
---|
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 |
---|