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