[235] | 1 | SUBROUTINE soil(ptimestep, indice, knon, snow, ptsrf, ptsoil, |
---|
[2] | 2 | s pcapcal, pfluxgrd) |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | c======================================================================= |
---|
| 6 | c |
---|
| 7 | c Auteur: Frederic Hourdin 30/01/92 |
---|
| 8 | c ------- |
---|
| 9 | c |
---|
| 10 | c objet: computation of : the soil temperature evolution |
---|
| 11 | c ------ the surfacic heat capacity "Capcal" |
---|
| 12 | c the surface conduction flux pcapcal |
---|
| 13 | c |
---|
| 14 | c |
---|
| 15 | c Method: implicit time integration |
---|
| 16 | c ------- |
---|
| 17 | c Consecutive ground temperatures are related by: |
---|
| 18 | c T(k+1) = C(k) + D(k)*T(k) (1) |
---|
| 19 | c the coefficients C and D are computed at the t-dt time-step. |
---|
| 20 | c Routine structure: |
---|
| 21 | c 1)new temperatures are computed using (1) |
---|
| 22 | c 2)C and D coefficients are computed from the new temperature |
---|
| 23 | c profile for the t+dt time-step |
---|
| 24 | c 3)the coefficients A and B are computed where the diffusive |
---|
| 25 | c fluxes at the t+dt time-step is given by |
---|
| 26 | c Fdiff = A + B Ts(t+dt) |
---|
| 27 | c or Fdiff = F0 + Capcal (Ts(t+dt)-Ts(t))/dt |
---|
| 28 | c with F0 = A + B (Ts(t)) |
---|
| 29 | c Capcal = B*dt |
---|
| 30 | c |
---|
| 31 | c Interface: |
---|
| 32 | c ---------- |
---|
| 33 | c |
---|
| 34 | c Arguments: |
---|
| 35 | c ---------- |
---|
| 36 | c ptimestep physical timestep (s) |
---|
| 37 | c indice sub-surface index |
---|
| 38 | c snow(klon,nbsrf) snow |
---|
| 39 | c ptsrf(klon) surface temperature at time-step t (K) |
---|
| 40 | c ptsoil(klon,nsoilmx) temperature inside the ground (K) |
---|
| 41 | c pcapcal(klon) surfacic specific heat (W*m-2*s*K-1) |
---|
| 42 | c pfluxgrd(klon) surface diffusive flux from ground (Wm-2) |
---|
| 43 | c |
---|
| 44 | c======================================================================= |
---|
| 45 | c declarations: |
---|
| 46 | c ------------- |
---|
| 47 | |
---|
| 48 | #include "dimensions.h" |
---|
[235] | 49 | #include "YOMCST.h" |
---|
[2] | 50 | #include "dimphy.h" |
---|
| 51 | #include "dimsoil.h" |
---|
| 52 | #include "indicesol.h" |
---|
| 53 | |
---|
| 54 | c----------------------------------------------------------------------- |
---|
| 55 | c arguments |
---|
| 56 | c --------- |
---|
| 57 | |
---|
| 58 | REAL ptimestep |
---|
[235] | 59 | INTEGER indice, knon |
---|
[2] | 60 | REAL ptsrf(klon),ptsoil(klon,nsoilmx),snow(klon) |
---|
| 61 | REAL pcapcal(klon),pfluxgrd(klon) |
---|
| 62 | |
---|
| 63 | c----------------------------------------------------------------------- |
---|
| 64 | c local arrays |
---|
| 65 | c ------------ |
---|
| 66 | |
---|
| 67 | INTEGER ig,jk |
---|
[235] | 68 | c$$$ REAL zdz2(nsoilmx),z1(klon) |
---|
| 69 | REAL zdz2(nsoilmx),z1(klon,nbsrf) |
---|
[2] | 70 | REAL min_period,dalph_soil |
---|
| 71 | REAL ztherm_i(klon) |
---|
| 72 | |
---|
| 73 | c local saved variables: |
---|
| 74 | c ---------------------- |
---|
| 75 | REAL dz1(nsoilmx),dz2(nsoilmx) |
---|
[235] | 76 | c$$$ REAL zc(klon,nsoilmx),zd(klon,nsoilmx) |
---|
| 77 | REAL zc(klon,nsoilmx,nbsrf),zd(klon,nsoilmx,nbsrf) |
---|
[2] | 78 | REAL lambda |
---|
| 79 | SAVE dz1,dz2,zc,zd,lambda |
---|
[235] | 80 | LOGICAL firstcall, firstsurf(nbsrf) |
---|
| 81 | SAVE firstcall, firstsurf |
---|
[2] | 82 | REAL isol,isno,iice |
---|
| 83 | SAVE isol,isno,iice |
---|
| 84 | |
---|
| 85 | DATA firstcall/.true./ |
---|
[235] | 86 | DATA firstsurf/.TRUE.,.TRUE.,.TRUE.,.TRUE./ |
---|
[2] | 87 | |
---|
| 88 | DATA isol,isno,iice/2000.,2000.,2000./ |
---|
| 89 | |
---|
| 90 | c----------------------------------------------------------------------- |
---|
| 91 | c Depthts: |
---|
| 92 | c -------- |
---|
| 93 | |
---|
| 94 | REAL fz,rk,fz1,rk1,rk2 |
---|
| 95 | fz(rk)=fz1*(dalph_soil**rk-1.)/(dalph_soil-1.) |
---|
[235] | 96 | pfluxgrd(:) = 0. |
---|
[2] | 97 | c calcul de l'inertie thermique a partir de la variable rnat. |
---|
| 98 | c on initialise a iice meme au-dessus d'un point de mer au cas |
---|
| 99 | c ou le point de mer devienne point de glace au pas suivant |
---|
| 100 | c on corrige si on a un point de terre avec ou sans glace |
---|
| 101 | c |
---|
| 102 | IF (indice.EQ.is_sic) THEN |
---|
[235] | 103 | DO ig = 1, knon |
---|
[2] | 104 | ztherm_i(ig) = iice |
---|
| 105 | IF (snow(ig).GT.0.0) ztherm_i(ig) = isno |
---|
| 106 | ENDDO |
---|
| 107 | ELSE IF (indice.EQ.is_lic) THEN |
---|
[235] | 108 | DO ig = 1, knon |
---|
[2] | 109 | ztherm_i(ig) = iice |
---|
| 110 | IF (snow(ig).GT.0.0) ztherm_i(ig) = isno |
---|
| 111 | ENDDO |
---|
| 112 | ELSE IF (indice.EQ.is_ter) THEN |
---|
[235] | 113 | DO ig = 1, knon |
---|
[2] | 114 | ztherm_i(ig) = isol |
---|
| 115 | IF (snow(ig).GT.0.0) ztherm_i(ig) = isno |
---|
| 116 | ENDDO |
---|
| 117 | ELSE IF (indice.EQ.is_oce) THEN |
---|
[235] | 118 | DO ig = 1, knon |
---|
[2] | 119 | ztherm_i(ig) = iice |
---|
| 120 | ENDDO |
---|
| 121 | ELSE |
---|
| 122 | PRINT*, "valeur d indice non prevue", indice |
---|
| 123 | CALL abort |
---|
| 124 | ENDIF |
---|
| 125 | |
---|
| 126 | |
---|
[235] | 127 | c$$$ IF (firstcall) THEN |
---|
| 128 | IF (firstsurf(indice)) THEN |
---|
[2] | 129 | |
---|
| 130 | c----------------------------------------------------------------------- |
---|
| 131 | c ground levels |
---|
| 132 | c grnd=z/l where l is the skin depth of the diurnal cycle: |
---|
| 133 | c -------------------------------------------------------- |
---|
| 134 | |
---|
| 135 | min_period=1800. ! en secondes |
---|
| 136 | dalph_soil=2. ! rapport entre les epaisseurs de 2 couches succ. |
---|
| 137 | |
---|
| 138 | OPEN(99,file='soil.def',status='old',form='formatted',err=9999) |
---|
| 139 | READ(99,*) min_period |
---|
| 140 | READ(99,*) dalph_soil |
---|
| 141 | PRINT*,'Discretization for the soil model' |
---|
| 142 | PRINT*,'First level e-folding depth',min_period, |
---|
| 143 | s ' dalph',dalph_soil |
---|
| 144 | CLOSE(99) |
---|
| 145 | 9999 CONTINUE |
---|
| 146 | |
---|
| 147 | c la premiere couche represente un dixieme de cycle diurne |
---|
| 148 | fz1=sqrt(min_period/3.14) |
---|
| 149 | |
---|
| 150 | DO jk=1,nsoilmx |
---|
| 151 | rk1=jk |
---|
| 152 | rk2=jk-1 |
---|
| 153 | dz2(jk)=fz(rk1)-fz(rk2) |
---|
| 154 | ENDDO |
---|
| 155 | DO jk=1,nsoilmx-1 |
---|
| 156 | rk1=jk+.5 |
---|
| 157 | rk2=jk-.5 |
---|
| 158 | dz1(jk)=1./(fz(rk1)-fz(rk2)) |
---|
| 159 | ENDDO |
---|
| 160 | lambda=fz(.5)*dz1(1) |
---|
| 161 | PRINT*,'full layers, intermediate layers (seconds)' |
---|
| 162 | DO jk=1,nsoilmx |
---|
| 163 | rk=jk |
---|
| 164 | rk1=jk+.5 |
---|
| 165 | rk2=jk-.5 |
---|
| 166 | PRINT *,'fz=', |
---|
| 167 | . fz(rk1)*fz(rk2)*3.14,fz(rk)*fz(rk)*3.14 |
---|
| 168 | ENDDO |
---|
[235] | 169 | C PB |
---|
| 170 | firstsurf(indice) = .FALSE. |
---|
| 171 | c$$$ firstcall =.false. |
---|
[2] | 172 | |
---|
| 173 | c Initialisations: |
---|
| 174 | c ---------------- |
---|
| 175 | |
---|
| 176 | ELSE !--not firstcall |
---|
| 177 | c----------------------------------------------------------------------- |
---|
| 178 | c Computation of the soil temperatures using the Cgrd and Dgrd |
---|
| 179 | c coefficient computed at the previous time-step: |
---|
| 180 | c ----------------------------------------------- |
---|
| 181 | |
---|
| 182 | c surface temperature |
---|
[235] | 183 | DO ig=1,knon |
---|
| 184 | ptsoil(ig,1)=(lambda*zc(ig,1,indice)+ptsrf(ig))/ |
---|
| 185 | s (lambda*(1.-zd(ig,1,indice))+1.) |
---|
[2] | 186 | ENDDO |
---|
| 187 | |
---|
| 188 | c other temperatures |
---|
| 189 | DO jk=1,nsoilmx-1 |
---|
[235] | 190 | DO ig=1,knon |
---|
| 191 | ptsoil(ig,jk+1)=zc(ig,jk,indice)+zd(ig,jk,indice) |
---|
| 192 | $ *ptsoil(ig,jk) |
---|
[2] | 193 | ENDDO |
---|
| 194 | ENDDO |
---|
| 195 | |
---|
| 196 | ENDIF !--not firstcall |
---|
| 197 | c----------------------------------------------------------------------- |
---|
| 198 | c Computation of the Cgrd and Dgrd coefficient for the next step: |
---|
| 199 | c --------------------------------------------------------------- |
---|
| 200 | |
---|
[235] | 201 | c$$$ PB ajout pour cas glace de mer |
---|
| 202 | IF (indice .EQ. is_sic) THEN |
---|
| 203 | DO ig = 1 , knon |
---|
| 204 | ptsoil(ig,nsoilmx) = RTT - 1.8 |
---|
| 205 | END DO |
---|
| 206 | ENDIF |
---|
| 207 | |
---|
[2] | 208 | DO jk=1,nsoilmx |
---|
| 209 | zdz2(jk)=dz2(jk)/ptimestep |
---|
| 210 | ENDDO |
---|
| 211 | |
---|
[235] | 212 | DO ig=1,knon |
---|
| 213 | z1(ig,indice)=zdz2(nsoilmx)+dz1(nsoilmx-1) |
---|
| 214 | zc(ig,nsoilmx-1,indice)= |
---|
| 215 | $ zdz2(nsoilmx)*ptsoil(ig,nsoilmx)/z1(ig,indice) |
---|
| 216 | zd(ig,nsoilmx-1,indice)=dz1(nsoilmx-1)/z1(ig,indice) |
---|
[2] | 217 | ENDDO |
---|
| 218 | |
---|
| 219 | DO jk=nsoilmx-1,2,-1 |
---|
[235] | 220 | DO ig=1,knon |
---|
| 221 | z1(ig,indice)=1./(zdz2(jk)+dz1(jk-1)+dz1(jk) |
---|
| 222 | $ *(1.-zd(ig,jk,indice))) |
---|
| 223 | zc(ig,jk-1,indice)= |
---|
| 224 | s (ptsoil(ig,jk)*zdz2(jk)+dz1(jk)*zc(ig,jk,indice)) |
---|
| 225 | $ *z1(ig,indice) |
---|
| 226 | zd(ig,jk-1,indice)=dz1(jk-1)*z1(ig,indice) |
---|
[2] | 227 | ENDDO |
---|
| 228 | ENDDO |
---|
| 229 | |
---|
| 230 | c----------------------------------------------------------------------- |
---|
| 231 | c computation of the surface diffusive flux from ground and |
---|
| 232 | c calorific capacity of the ground: |
---|
| 233 | c --------------------------------- |
---|
| 234 | |
---|
[235] | 235 | DO ig=1,knon |
---|
[2] | 236 | pfluxgrd(ig)=ztherm_i(ig)*dz1(1)* |
---|
[235] | 237 | s (zc(ig,1,indice)+(zd(ig,1,indice)-1.)*ptsoil(ig,1)) |
---|
[2] | 238 | pcapcal(ig)=ztherm_i(ig)* |
---|
[235] | 239 | s (dz2(1)+ptimestep*(1.-zd(ig,1,indice))*dz1(1)) |
---|
| 240 | z1(ig,indice)=lambda*(1.-zd(ig,1,indice))+1. |
---|
| 241 | pcapcal(ig)=pcapcal(ig)/z1(ig,indice) |
---|
| 242 | pfluxgrd(ig) = pfluxgrd(ig) |
---|
| 243 | s + pcapcal(ig) * (ptsoil(ig,1) * z1(ig,indice) |
---|
| 244 | $ - lambda * zc(ig,1,indice) |
---|
| 245 | $ - ptsrf(ig)) |
---|
[2] | 246 | s /ptimestep |
---|
| 247 | ENDDO |
---|
| 248 | |
---|
| 249 | RETURN |
---|
| 250 | END |
---|