[57] | 1 | SUBROUTINE molvis(ptimestep,pplay,pplev,pt,pdteuv,pdtconduc,pvel, |
---|
| 2 | $ tsurf,zzlev,zzlay,zdvelmolvis) |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | c======================================================================= |
---|
| 6 | c |
---|
| 7 | c Molecular Viscosity Diffusion |
---|
| 8 | c |
---|
| 9 | c Based on conduction.F by N. Descamp, F. Forget 05/1999 |
---|
| 10 | c |
---|
| 11 | c modified by M. Angelats i Coll |
---|
| 12 | c |
---|
| 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 | #include "chimiedata.h" |
---|
| 24 | #include "conc.h" |
---|
| 25 | |
---|
| 26 | c arguments: |
---|
| 27 | c ---------- |
---|
| 28 | |
---|
| 29 | REAL ptimestep |
---|
| 30 | REAL pplay(ngridmx,nlayermx) |
---|
| 31 | REAL pplev(ngridmx,nlayermx+1) |
---|
| 32 | REAL zzlay(ngridmx,nlayermx) |
---|
| 33 | REAL zzlev(ngridmx,nlayermx+1) |
---|
| 34 | real pt(ngridmx,nlayermx) |
---|
| 35 | real tsurf(ngridmx) |
---|
| 36 | REAL pvel(ngridmx,nlayermx) |
---|
| 37 | REAL pdvel(ngridmx,nlayermx) |
---|
| 38 | real pdteuv(ngridmx,nlayermx) |
---|
| 39 | real pdtconduc(ngridmx,nlayermx) |
---|
| 40 | |
---|
| 41 | real zdvelmolvis(ngridmx,nlayermx) |
---|
| 42 | |
---|
| 43 | c local: |
---|
| 44 | c ------ |
---|
| 45 | |
---|
| 46 | INTEGER l,ig, ngrid,nz |
---|
| 47 | real Akk,skk,phitop,velsurf,fac, m, tmean |
---|
| 48 | REAL zvel(nlayermx) |
---|
| 49 | real zt(nlayermx) |
---|
| 50 | REAL alpha(nlayermx) |
---|
| 51 | REAL lambda(nlayermx) |
---|
| 52 | real muvol(nlayermx) |
---|
| 53 | REAL C(nlayermx) |
---|
| 54 | real D(nlayermx) |
---|
| 55 | real den(nlayermx) |
---|
| 56 | REAL pdvelm(nlayermx) |
---|
| 57 | REAL zlay(nlayermx) |
---|
| 58 | real zlev(nlayermx+1) |
---|
| 59 | |
---|
| 60 | c constants used locally |
---|
| 61 | c --------------------- |
---|
| 62 | c The atmospheric conductivity is a function of temperature T : |
---|
| 63 | c conductivity = Akk* T**skk |
---|
| 64 | c Molecular viscosity is related to thermal conductivity by: |
---|
| 65 | c conduc = 0.25*(9*gamma - 5)* Cv * molvis |
---|
| 66 | c where gamma = Cp/Cv. For dry air. |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | PARAMETER (skk=0.69) |
---|
| 70 | |
---|
| 71 | PARAMETER (velsurf =0.0) |
---|
| 72 | |
---|
| 73 | logical firstcall |
---|
| 74 | save firstcall |
---|
| 75 | data firstcall /.true./ |
---|
| 76 | c----------------------------------------------------------------------- |
---|
| 77 | c calcul des coefficients alpha et lambda |
---|
| 78 | c----------------------------------------------------------------------- |
---|
| 79 | |
---|
| 80 | IF (firstcall) THEN |
---|
| 81 | write(*,*)'molvis: coeff of molecular viscosity Akk,skk,factor' |
---|
| 82 | write(*,*) Akk,skk,fac |
---|
| 83 | firstcall = .false. |
---|
| 84 | END IF |
---|
| 85 | |
---|
| 86 | ! Initialize phitop |
---|
| 87 | phitop=0.0 |
---|
| 88 | |
---|
| 89 | ngrid=ngridmx |
---|
| 90 | nz=nlayermx |
---|
| 91 | |
---|
| 92 | do ig=1,ngrid |
---|
| 93 | |
---|
| 94 | zt(1)=pt(ig,1)+(pdteuv(ig,1)+pdtconduc(ig,1))*ptimestep |
---|
| 95 | zvel(1)=pvel(ig,1) |
---|
| 96 | c zlay(1)=-log(pplay(ig,1)/pplev(ig,1))*Rnew(ig,1)*zt(1)/g |
---|
| 97 | c zlev(1)=0.0 |
---|
| 98 | |
---|
| 99 | zlay(1)=zzlay(ig,1) |
---|
| 100 | zlev(1)=zzlev(ig,1) |
---|
| 101 | |
---|
| 102 | do l=2,nz |
---|
| 103 | zt(l)=pt(ig,l)+(pdteuv(ig,l)+pdtconduc(ig,l))*ptimestep |
---|
| 104 | zvel(l)=pvel(ig,l) |
---|
| 105 | c tmean=zt(l) |
---|
| 106 | c if(zt(l).ne.zt(l-1)) tmean=(zt(l)-zt(l-1))/log(zt(l)/zt(l-1)) |
---|
| 107 | c zlay(l)= zlay(l-1) |
---|
| 108 | c & -log(pplay(ig,l)/pplay(ig,l-1))*Rnew(ig,l-1)*tmean/g |
---|
| 109 | c zlev(l)= zlev(l-1) |
---|
| 110 | c & -log(pplev(ig,l)/pplev(ig,l-1))*Rnew(ig,l-1)*tmean/g |
---|
| 111 | zlay(l)=zzlay(ig,l) |
---|
| 112 | zlev(l)=zzlev(ig,l) |
---|
| 113 | enddo |
---|
| 114 | |
---|
| 115 | c zlev(nz+1)= zlev(nz) |
---|
| 116 | c & -log(max(pplev(ig,nz+1),1.e-30)/pplev(ig,nz)) |
---|
| 117 | c & *Rnew(ig,nz)*tmean/g |
---|
| 118 | c if(pplev(ig,nz+1).eq.0.) |
---|
| 119 | c & zlev(nz+1)=zlev(nz)+(zlay(nz)-zlay(nz-1)) |
---|
| 120 | |
---|
| 121 | zlev(nz+1)= zlev(nz)+10000. |
---|
| 122 | |
---|
| 123 | fac=0.25*(9.*cpnew(ig,1)-5.*(cpnew(ig,1)-rnew(ig,1))) |
---|
| 124 | Akk=Akknew(ig,1) |
---|
| 125 | lambda(1)=Akk*tsurf(ig)**skk/zlay(1)/fac |
---|
| 126 | c write(*,*) 'rnew(ig,nz) ',ig , rnew(ig,nz) |
---|
| 127 | |
---|
| 128 | DO l=2,nz |
---|
| 129 | fac=(9.*cpnew(ig,l)-5.*(cpnew(ig,l)-rnew(ig,l)))/4. |
---|
| 130 | Akk=Akknew(ig,l) |
---|
| 131 | lambda(l)=Akk/fac*zt(l)**skk/(zlay(l)-zlay(l-1)) |
---|
| 132 | ENDDO |
---|
| 133 | |
---|
| 134 | DO l=1,nz-1 |
---|
| 135 | muvol(l)=pplay(ig,l)/(rnew(ig,l)*zt(l)) |
---|
| 136 | alpha(l)=(muvol(l)/ptimestep)*(zlev(l+1)-zlev(l)) |
---|
| 137 | ENDDO |
---|
| 138 | muvol(nz)=pplay(ig,nz)/(rnew(ig,nz)*zt(nz)) |
---|
| 139 | alpha(nz)=(muvol(nz)/ptimestep)*(zlev(nz+1)-zlev(nz)) |
---|
| 140 | |
---|
| 141 | c-------------------------------------------------------------------- |
---|
| 142 | c |
---|
| 143 | c calcul des coefficients C et D |
---|
| 144 | c |
---|
| 145 | c------------------------------------------------------------------- |
---|
| 146 | |
---|
| 147 | den(1)=alpha(1)+lambda(2)+lambda(1) |
---|
| 148 | C(1)=lambda(1)*(velsurf-zvel(1))+lambda(2)*(zvel(2)-zvel(1)) |
---|
| 149 | C(1)=C(1)/den(1) |
---|
| 150 | D(1)=lambda(2)/den(1) |
---|
| 151 | |
---|
| 152 | DO l = 2,nz-1 |
---|
| 153 | den(l)=alpha(l)+lambda(l+1) |
---|
| 154 | den(l)=den(l)+lambda(l)*(1-D(l-1)) |
---|
| 155 | |
---|
| 156 | C(l) =lambda(l+1)*(zvel(l+1)-zvel(l)) |
---|
| 157 | $ +lambda(l)*(zvel(l-1)-zvel(l)+C(l-1)) |
---|
| 158 | C(l) =C(l)/den(l) |
---|
| 159 | |
---|
| 160 | D(l) =lambda(l+1) / den(l) |
---|
| 161 | ENDDO |
---|
| 162 | |
---|
| 163 | den(nz)=alpha(nz) + lambda(nz) * (1-D(nz-1)) |
---|
| 164 | C(nz)=C(nz-1)+zvel(nz-1)-zvel(nz) |
---|
| 165 | C(nz)=(C(nz)*lambda(nz)+phitop) / den(nz) |
---|
| 166 | |
---|
| 167 | c---------------------------------------------------------------------- |
---|
| 168 | c |
---|
| 169 | c calcul de la nouvelle pdvelm |
---|
| 170 | c |
---|
| 171 | c---------------------------------------------------------------------- |
---|
| 172 | |
---|
| 173 | DO l=1,nz |
---|
| 174 | pdvelm(l)=0. |
---|
| 175 | ENDDO |
---|
| 176 | pdvelm(nz)=C(nz) |
---|
| 177 | DO l=nz-1,1,-1 |
---|
| 178 | pdvelm(l)=C(l)+D(l)*pdvelm(l+1) |
---|
| 179 | ENDDO |
---|
| 180 | c----------------------------------------------------------------------- |
---|
| 181 | c |
---|
| 182 | c calcul de la tendance zdvelmolvis |
---|
| 183 | c |
---|
| 184 | c----------------------------------------------------------------------- |
---|
| 185 | |
---|
| 186 | DO l=1,nz |
---|
| 187 | zdvelmolvis(ig,l)=pdvelm(l)/ptimestep |
---|
| 188 | ENDDO |
---|
| 189 | |
---|
| 190 | ENDDO ! boucle sur ngrid |
---|
| 191 | |
---|
| 192 | RETURN |
---|
| 193 | END |
---|