[38] | 1 | SUBROUTINE conduction(ptimestep,pplay,pplev,pt,pdt, |
---|
| 2 | $ tsurf,zzlev,zzlay,zdtconduc) |
---|
| 3 | |
---|
| 4 | IMPLICIT NONE |
---|
| 5 | |
---|
| 6 | c======================================================================= |
---|
| 7 | c |
---|
| 8 | c Molecular thermal conduction |
---|
| 9 | c |
---|
| 10 | c N. Descamp, F. Forget 05/1999 |
---|
| 11 | c |
---|
| 12 | c======================================================================= |
---|
| 13 | |
---|
| 14 | c----------------------------------------------------------------------- |
---|
| 15 | c declarations: |
---|
| 16 | c----------------------------------------------------------------------- |
---|
| 17 | |
---|
| 18 | #include "dimensions.h" |
---|
| 19 | #include "dimphys.h" |
---|
| 20 | #include "comcstfi.h" |
---|
| 21 | #include "surfdat.h" |
---|
| 22 | #include "chimiedata.h" |
---|
| 23 | #include "conc.h" |
---|
| 24 | |
---|
| 25 | c arguments: |
---|
| 26 | c ---------- |
---|
| 27 | |
---|
| 28 | REAL ptimestep |
---|
| 29 | REAL pplay(ngridmx,nlayermx) |
---|
| 30 | real pplev(ngridmx,nlayermx+1) |
---|
| 31 | REAL zzlay(ngridmx,nlayermx) |
---|
| 32 | real zzlev(ngridmx,nlayermx+1) |
---|
| 33 | REAL pt(ngridmx,nlayermx) |
---|
| 34 | real pdt(ngridmx,nlayermx) |
---|
| 35 | real tsurf(ngridmx) |
---|
| 36 | |
---|
| 37 | real zdtconduc(ngridmx,nlayermx) |
---|
| 38 | |
---|
| 39 | c local: |
---|
| 40 | c ------ |
---|
| 41 | |
---|
| 42 | INTEGER i,ig,l |
---|
| 43 | INTEGER,SAVE :: ngrid, nz |
---|
| 44 | real Akk |
---|
| 45 | real,save :: phitop |
---|
| 46 | real m,tmean |
---|
| 47 | REAL alpha(nlayermx) |
---|
| 48 | real zt(nlayermx) |
---|
| 49 | REAL lambda(nlayermx) |
---|
| 50 | real muvol(nlayermx) |
---|
| 51 | REAL C(nlayermx) |
---|
| 52 | real D(nlayermx) |
---|
| 53 | real den(nlayermx) |
---|
| 54 | REAL pdtc(nlayermx) |
---|
| 55 | real zlay(nlayermx) |
---|
| 56 | real zlev(nlayermx+1) |
---|
| 57 | |
---|
| 58 | c constants used locally |
---|
| 59 | c --------------------- |
---|
| 60 | c The atmospheric conductivity is a function of temperature T : |
---|
| 61 | c conductivity = Akk* T**skk |
---|
| 62 | REAL,PARAMETER :: skk=0.69 |
---|
| 63 | |
---|
| 64 | logical,save :: firstcall=.true. |
---|
| 65 | |
---|
| 66 | c----------------------------------------------------------------------- |
---|
| 67 | c calcul des coefficients alpha et lambda |
---|
| 68 | c----------------------------------------------------------------------- |
---|
| 69 | |
---|
| 70 | IF (firstcall) THEN |
---|
| 71 | ! write (*,*)'conduction: coeff to compute molecular', |
---|
| 72 | ! & ' conductivity Akk,skk' |
---|
| 73 | ! write(*,*) Akk,skk |
---|
| 74 | ! NB: Akk is undefined at this stage |
---|
| 75 | write (*,*)'conduction: coeff to compute molecular', |
---|
| 76 | & ' conductivity skk = ', skk |
---|
| 77 | |
---|
| 78 | ! Initialize phitop |
---|
| 79 | phitop=0.0 |
---|
| 80 | ! Initialize ngrid and nz |
---|
| 81 | ngrid=ngridmx |
---|
| 82 | nz=nlayermx |
---|
| 83 | |
---|
| 84 | firstcall = .false. |
---|
| 85 | ENDIF ! of IF (firstcall) |
---|
| 86 | |
---|
| 87 | do ig=1,ngrid |
---|
| 88 | |
---|
| 89 | zt(1)=pt(ig,1)+pdt(ig,1)*ptimestep |
---|
| 90 | c zlay(1)=-log(pplay(ig,1)/pplev(ig,1))*Rnew(ig,1)*zt(1)/g |
---|
| 91 | c zlev(1)=0.0 |
---|
| 92 | zlay(1)=zzlay(ig,1) |
---|
| 93 | zlev(1)=zzlev(ig,1) |
---|
| 94 | |
---|
| 95 | do i=2,nz |
---|
| 96 | |
---|
| 97 | zt(i)=pt(ig,i)+pdt(ig,i)*ptimestep |
---|
| 98 | c tmean=zt(i) |
---|
| 99 | c if(zt(i).ne.zt(i-1)) |
---|
| 100 | c & tmean=(zt(i)-zt(i-1))/log(zt(i)/zt(i-1)) |
---|
| 101 | c zlay(i)= zlay(i-1) |
---|
| 102 | c & -log(pplay(ig,i)/pplay(ig,i-1))*Rnew(ig,i-1)*tmean/g |
---|
| 103 | c zlev(i)= zlev(i-1) |
---|
| 104 | c & -log(pplev(ig,i)/pplev(ig,i-1))*Rnew(ig,i-1)*tmean/g |
---|
| 105 | zlay(i)=zzlay(ig,i) |
---|
| 106 | zlev(i)=zzlev(ig,i) |
---|
| 107 | enddo |
---|
| 108 | |
---|
| 109 | c zlev(nz+1)= zlev(nz) |
---|
| 110 | c & -log(max(pplev(ig,nz+1),1.e-30)/pplev(ig,nz)) |
---|
| 111 | c & *Rnew(ig,nz)*tmean/g |
---|
| 112 | c if(pplev(ig,nz+1).eq.0.) |
---|
| 113 | c & zlev(nz+1)=zlev(nz)+(zlay(nz)-zlay(nz-1)) |
---|
| 114 | |
---|
| 115 | zlev(nz+1)= zlev(nz)+10000. |
---|
| 116 | |
---|
| 117 | Akk=Akknew(ig,1) |
---|
| 118 | lambda(1) = Akk*tsurf(ig)**skk/zlay(1) |
---|
| 119 | |
---|
| 120 | DO i = 2 , nz |
---|
| 121 | Akk=Akknew(ig,i) |
---|
| 122 | lambda(i)=Akk*zt(i)**skk/(zlay(i)-zlay(i-1)) |
---|
| 123 | ENDDO |
---|
| 124 | DO i=1,nz-1 |
---|
| 125 | muvol(i)=pplay(ig,i)/(rnew(ig,i)*zt(i)) |
---|
| 126 | alpha(i)=cpnew(ig,i)*(muvol(i)/ptimestep) |
---|
| 127 | $ *(zlev(i+1)-zlev(i)) |
---|
| 128 | ENDDO |
---|
| 129 | |
---|
| 130 | muvol(nz)=pplay(ig,nz)/(rnew(ig,nz)*zt(nz)) |
---|
| 131 | alpha(nz)=cpnew(ig,i)*(muvol(nz)/ptimestep) |
---|
| 132 | $ *(zlev(nz+1)-zlev(nz)) |
---|
| 133 | |
---|
| 134 | c-------------------------------------------------------------------- |
---|
| 135 | c |
---|
| 136 | c calcul des coefficients C et D |
---|
| 137 | c |
---|
| 138 | c------------------------------------------------------------------- |
---|
| 139 | |
---|
| 140 | den(1)=alpha(1)+lambda(2)+lambda(1) |
---|
| 141 | C(1)=lambda(1)*(tsurf(ig)-zt(1))+lambda(2)*(zt(2)-zt(1)) |
---|
| 142 | C(1)=C(1)/den(1) |
---|
| 143 | D(1)=lambda(2)/den(1) |
---|
| 144 | |
---|
| 145 | DO i = 2,nz-1 |
---|
| 146 | den(i)=alpha(i)+lambda(i+1) |
---|
| 147 | den(i)=den(i)+lambda(i)*(1-D(i-1)) |
---|
| 148 | |
---|
| 149 | C(i) =lambda(i+1)*(zt(i+1)-zt(i)) |
---|
| 150 | $ +lambda(i)*(zt(i-1)-zt(i)+C(i-1)) |
---|
| 151 | C(i) =C(i)/den(i) |
---|
| 152 | |
---|
| 153 | D(i) =lambda(i+1) / den(i) |
---|
| 154 | ENDDO |
---|
| 155 | |
---|
| 156 | den(nz)=alpha(nz) + lambda(nz) * (1-D(nz-1)) |
---|
| 157 | C(nz)=C(nz-1)+zt(nz-1)-zt(nz) |
---|
| 158 | C(nz)=(C(nz)*lambda(nz)+phitop) / den(nz) |
---|
| 159 | |
---|
| 160 | c---------------------------------------------------------------------- |
---|
| 161 | c |
---|
| 162 | c calcul de la nouvelle temperature ptconduc |
---|
| 163 | c |
---|
| 164 | c---------------------------------------------------------------------- |
---|
| 165 | |
---|
| 166 | DO i=1,nz |
---|
| 167 | pdtc(i)=0. |
---|
| 168 | ENDDO |
---|
| 169 | pdtc(nz)=C(nz) |
---|
| 170 | DO i=nz-1,1,-1 |
---|
| 171 | pdtc(i)=C(i)+D(i)*pdtc(i+1) |
---|
| 172 | ENDDO |
---|
| 173 | c----------------------------------------------------------------------- |
---|
| 174 | c |
---|
| 175 | c calcul de la tendance zdtconduc |
---|
| 176 | c |
---|
| 177 | c----------------------------------------------------------------------- |
---|
| 178 | |
---|
| 179 | DO i=1,nz |
---|
| 180 | zdtconduc(ig,i)=pdtc(i)/ptimestep |
---|
| 181 | ENDDO |
---|
| 182 | |
---|
| 183 | enddo ! of do ig=1,ngrid |
---|
| 184 | |
---|
| 185 | RETURN |
---|
| 186 | END |
---|