1 | SUBROUTINE molvis(ngrid,nlayer,ptimestep, |
---|
2 | $ pplay,pt,pzlay,pzlev, |
---|
3 | $ pdtconduc,pvel,tsurf,zdvelmolvis) |
---|
4 | IMPLICIT NONE |
---|
5 | |
---|
6 | c======================================================================= |
---|
7 | c |
---|
8 | c Molecular Viscosity Diffusion |
---|
9 | c |
---|
10 | c Based on conduction.F by N. Descamp, F. Forget 05/1999 |
---|
11 | c |
---|
12 | c modified by M. Angelats i Coll |
---|
13 | c======================================================================= |
---|
14 | |
---|
15 | c----------------------------------------------------------------------- |
---|
16 | c declarations: |
---|
17 | c----------------------------------------------------------------------- |
---|
18 | |
---|
19 | #include "dimensions.h" |
---|
20 | #include "dimphys.h" |
---|
21 | #include "comcstfi.h" |
---|
22 | #include "surfdat.h" |
---|
23 | |
---|
24 | c arguments: |
---|
25 | c ---------- |
---|
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) |
---|
33 | c local: |
---|
34 | c ------ |
---|
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 | |
---|
45 | c constants used locally |
---|
46 | c --------------------- |
---|
47 | c The atmospheric conductivity is a function of temperature T : |
---|
48 | c conductivity = Akk* T**skk |
---|
49 | c Molecular viscosity is related to thermal conductivity by: |
---|
50 | c conduc = 0.25*(9*gamma - 5)* Cv * molvis |
---|
51 | c 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./ |
---|
62 | c----------------------------------------------------------------------- |
---|
63 | c calcul des coefficients alpha et lambda |
---|
64 | c |
---|
65 | c----------------------------------------------------------------------- |
---|
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 | |
---|
100 | c!!!!! alerte !!!!!c |
---|
101 | c!!!!! zlev n'est pas declare a nlev !!!!! |
---|
102 | c!!!!! ----> |
---|
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)) |
---|
107 | c!!!!! <---- |
---|
108 | c!!!!! alerte !!!!!c |
---|
109 | c 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 | |
---|
118 | c-------------------------------------------------------------------- |
---|
119 | c |
---|
120 | c calcul des coefficients C et D |
---|
121 | c |
---|
122 | c------------------------------------------------------------------- |
---|
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)) |
---|
141 | c C(nlayer)=((C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer)) |
---|
142 | c $ *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 | |
---|
146 | c---------------------------------------------------------------------- |
---|
147 | c |
---|
148 | c calcul de la nouvelle temperature pdvelm |
---|
149 | c |
---|
150 | c---------------------------------------------------------------------- |
---|
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 | |
---|
164 | c----------------------------------------------------------------------- |
---|
165 | c |
---|
166 | c calcul de la tendance zdvelmolvis |
---|
167 | c |
---|
168 | c----------------------------------------------------------------------- |
---|
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 |
---|