[3175] | 1 | SUBROUTINE conduction(ngrid,nlayer,ptimestep, |
---|
| 2 | $ pplay,pt,pzlay,pzlev, |
---|
| 3 | $ zdtconduc,tsurf) |
---|
| 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 | |
---|
| 23 | c arguments: |
---|
| 24 | c ---------- |
---|
| 25 | |
---|
| 26 | INTEGER ngrid,nlayer |
---|
| 27 | REAL ptimestep |
---|
| 28 | REAL pt(ngrid,nlayer),zdtconduc(ngrid,nlayer) |
---|
| 29 | REAL pzlay(ngrid,nlayer),pzlev(ngrid,nlayer+1),pplay(ngrid,nlayer) |
---|
| 30 | REAL zt(ngrid,nlayer) |
---|
| 31 | |
---|
| 32 | c local: |
---|
| 33 | c ------ |
---|
| 34 | |
---|
| 35 | INTEGER ilayer,ig |
---|
| 36 | REAL alpha(nlayermx) |
---|
| 37 | REAL lambda(nlayermx),muvol(nlayermx) |
---|
| 38 | REAL C(nlayermx),D(nlayermx),den(nlayermx) |
---|
| 39 | REAL tsurf |
---|
| 40 | c REAL pdt(nlayermx),tsurf |
---|
| 41 | REAL pdt(nlayermx) |
---|
| 42 | |
---|
| 43 | c constants used locally |
---|
| 44 | c --------------------- |
---|
| 45 | c The atmospheric conductivity is a function of temperature T : |
---|
| 46 | c conductivity = Akk* T**skk |
---|
| 47 | real,parameter :: Akk=5.63E-05 |
---|
| 48 | real,parameter :: skk=1.12 |
---|
| 49 | |
---|
| 50 | logical firstcall |
---|
| 51 | save firstcall |
---|
| 52 | data firstcall /.true./ |
---|
| 53 | c----------------------------------------------------------------------- |
---|
| 54 | c calcul des coefficients alpha et lambda |
---|
| 55 | c |
---|
| 56 | c----------------------------------------------------------------------- |
---|
| 57 | |
---|
| 58 | IF (firstcall) THEN |
---|
| 59 | write (*,*) 'coeff to compute molecular conductivity Akk,skk' |
---|
| 60 | write(*,*) Akk,skk |
---|
| 61 | firstcall = .false. |
---|
| 62 | END IF |
---|
| 63 | |
---|
| 64 | c DO ilayer=1,nlayer |
---|
| 65 | c do ig=1,ngrid |
---|
| 66 | |
---|
| 67 | c zt(ig,ilayer)=pt(ig,ilayer)+pdt(ig,ilayer)*ptimestep |
---|
| 68 | |
---|
| 69 | c enddo |
---|
| 70 | c ENDDO |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | DO ig=1,ngrid |
---|
| 74 | |
---|
| 75 | lambda(1) = Akk*tsurf**skk / pzlay(ig,1) |
---|
| 76 | DO ilayer = 2 , nlayer |
---|
| 77 | lambda(ilayer) = Akk * pt(ig,ilayer)**skk / |
---|
| 78 | $ (pzlay(ig,ilayer)-pzlay(ig,ilayer-1)) |
---|
| 79 | ENDDO |
---|
| 80 | |
---|
| 81 | DO ilayer=1,nlayer-1 |
---|
| 82 | muvol(ilayer)=pplay(ig,ilayer)/(r*pt(ig,ilayer)) |
---|
| 83 | alpha(ilayer)=cpp*(muvol(ilayer)/ptimestep)* |
---|
| 84 | $ (pzlev(ig,ilayer+1)-pzlev(ig,ilayer)) |
---|
| 85 | ENDDO |
---|
| 86 | c!!!!! alerte !!!!!c |
---|
| 87 | c!!!!! zlev n'est pas declare a nlev !!!!! |
---|
| 88 | c!!!!! ----> |
---|
| 89 | muvol(nlayer)=pplay(ig,nlayer)/(r*pt(ig,nlayer)) |
---|
| 90 | alpha(nlayer)=cpp*(muvol(nlayer)/ptimestep)* |
---|
| 91 | $ 2*(pzlay(ig,nlayer)-pzlev(ig,nlayer)) |
---|
| 92 | c!!!!! <---- |
---|
| 93 | c!!!!! alerte !!!!!c |
---|
| 94 | c write(*,*) lambda(1),muvol(1),tsurf,pt(1,1) |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | c-------------------------------------------------------------------- |
---|
| 98 | c |
---|
| 99 | c calcul des coefficients C et D |
---|
| 100 | c |
---|
| 101 | c------------------------------------------------------------------- |
---|
| 102 | |
---|
| 103 | den(1)=alpha(1)+lambda(2)+lambda(1) |
---|
| 104 | C(1)=lambda(1)*(tsurf-pt(ig,1))+lambda(2)*(pt(ig,2)-pt(ig,1)) |
---|
| 105 | C(1)=C(1)/den(1) |
---|
| 106 | D(1)=lambda(2)/den(1) |
---|
| 107 | |
---|
| 108 | DO ilayer = 2,nlayer-1 |
---|
| 109 | den(ilayer)=alpha(ilayer)+lambda(ilayer+1) |
---|
| 110 | den(ilayer)=den(ilayer)+lambda(ilayer)*(1-D(ilayer-1)) |
---|
| 111 | |
---|
| 112 | C(ilayer) =lambda(ilayer+1)*(pt(ig,ilayer+1)-pt(ig,ilayer)) |
---|
| 113 | $ +lambda(ilayer)*(pt(ig,ilayer-1)-pt(ig,ilayer)+C(ilayer-1)) |
---|
| 114 | C(ilayer) =C(ilayer)/den(ilayer) |
---|
| 115 | |
---|
| 116 | D(ilayer) =lambda(ilayer+1) / den(ilayer) |
---|
| 117 | ENDDO |
---|
| 118 | |
---|
| 119 | den(nlayer)=alpha(nlayer) + lambda(nlayer) * (1-D(nlayer-1)) |
---|
| 120 | c C(nlayer)=((C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer)) |
---|
| 121 | c $ *lambda(nlayer) + phitop) / den(nlayer) |
---|
| 122 | C(nlayer)=C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer) |
---|
| 123 | C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop(ig)) / den(nlayer) |
---|
| 124 | |
---|
| 125 | c---------------------------------------------------------------------- |
---|
| 126 | c |
---|
| 127 | c calcul de la nouvelle temperature ptconduc |
---|
| 128 | c |
---|
| 129 | c---------------------------------------------------------------------- |
---|
| 130 | |
---|
| 131 | DO ilayer=1,nlayer |
---|
| 132 | pdt(ilayer)=0. |
---|
| 133 | ENDDO |
---|
| 134 | |
---|
| 135 | pdt(nlayer)=C(nlayer) |
---|
| 136 | ! pt(nlayer)=ttop |
---|
| 137 | ! write(*,*)'pt',pt(nlayer) |
---|
| 138 | |
---|
| 139 | DO ilayer=nlayer-1,1,-1 |
---|
| 140 | pdt(ilayer)=C(ilayer)+D(ilayer)*pdt(ilayer+1) |
---|
| 141 | ENDDO |
---|
| 142 | |
---|
| 143 | c write(*,*) alpha(1),lambda(2),den(1),C(1),D(1),pdt(1) |
---|
| 144 | |
---|
| 145 | c write(*,*)'15: c et d',C(nlayer),D(nlayer),ptconduc(nlayer), |
---|
| 146 | c $ pt(ig,nlayer),ig |
---|
| 147 | c write(*,*)'14: c et d',C(14),D(14),ptconduc(14), |
---|
| 148 | c $ pt(ig,14),ig |
---|
| 149 | c write(*,*)'3: c et d',C(3),D(3),ptconduc(3), |
---|
| 150 | c $ pt(ig,3) |
---|
| 151 | c write(*,*)'2: c et d',C(2),D(2),ptconduc(2), |
---|
| 152 | c $ pt(ig,2) |
---|
| 153 | |
---|
| 154 | c----------------------------------------------------------------------- |
---|
| 155 | c |
---|
| 156 | c calcul de la tendance zdtconduc |
---|
| 157 | c |
---|
| 158 | c----------------------------------------------------------------------- |
---|
| 159 | |
---|
| 160 | DO ilayer=1,nlayer |
---|
| 161 | zdtconduc(ig,ilayer) = pdt(ilayer) / ptimestep |
---|
| 162 | c write(*,*)'zdtconduc,c,d',ilayer,zdtconduc(ig,ilayer),C(ilayer) |
---|
| 163 | c $,D(ilayer) |
---|
| 164 | c write(*,*) 'pt',ilayer,pt(ig,ilayer) |
---|
| 165 | ENDDO |
---|
| 166 | |
---|
| 167 | ENDDO ! boucle sur ngrid |
---|
| 168 | c write(*,*)'zdtconduc',zdtconduc(ngrid,nlayer),ngrid |
---|
| 169 | c write(*,*)'*********************************' |
---|
| 170 | RETURN |
---|
| 171 | END |
---|