--- trunk/phylmd/soil.f 2014/07/07 17:45:21 101 +++ trunk/Sources/phylmd/Interface_surf/soil.f 2015/07/20 16:01:49 157 @@ -49,7 +49,7 @@ ! ptimestep physical timestep (s) ! indice sub-surface index ! snow(klon,nbsrf) snow - ! ptsrf(klon) surface temperature at time-step t (K) + ! ptsrf(knon) surface temperature at time-step t (K) ! ptsoil(klon,nsoilmx) temperature inside the ground (K) ! pcapcal(klon) surfacic specific heat (W*m-2*s*K-1) ! pfluxgrd(klon) surface diffusive flux from ground (Wm-2) @@ -65,7 +65,7 @@ REAL ptimestep INTEGER indice, knon - REAL ptsrf(klon), ptsoil(klon, nsoilmx), snow(klon) + REAL ptsrf(knon), ptsoil(klon, nsoilmx), snow(klon) REAL pcapcal(klon), pfluxgrd(klon) ! ----------------------------------------------------------------------- @@ -85,12 +85,11 @@ REAL zc(klon, nsoilmx, nbsrf), zd(klon, nsoilmx, nbsrf) REAL lambda SAVE dz1, dz2, zc, zd, lambda - LOGICAL firstcall, firstsurf(nbsrf) - SAVE firstcall, firstsurf + LOGICAL firstsurf(nbsrf) + SAVE firstsurf REAL isol, isno, iice SAVE isol, isno, iice - DATA firstcall/.TRUE./ DATA firstsurf/.TRUE., .TRUE., .TRUE., .TRUE./ DATA isol, isno, iice/2000., 2000., 2000./ @@ -99,9 +98,8 @@ ! Depthts: ! -------- - REAL fz, rk, fz1, rk1, rk2 + REAL rk, fz1, rk1, rk2 - fz(rk) = fz1*(dalph_soil**rk-1.)/(dalph_soil-1.) pfluxgrd(:) = 0. ! calcul de l'inertie thermique a partir de la variable rnat. ! on initialise a iice meme au-dessus d'un point de mer au cas @@ -132,8 +130,6 @@ STOP 1 END IF - - ! $$$ IF (firstcall) THEN IF (firstsurf(indice)) THEN ! ----------------------------------------------------------------------- @@ -176,12 +172,11 @@ END DO ! PB firstsurf(indice) = .FALSE. - ! $$$ firstcall =.false. ! Initialisations: ! ---------------- - ELSE !--not firstcall + ELSE ! ----------------------------------------------------------------------- ! Computation of the soil temperatures using the Cgrd and Dgrd ! coefficient computed at the previous time-step: @@ -201,7 +196,7 @@ END DO END DO - END IF !--not firstcall + END IF ! ----------------------------------------------------------------------- ! Computation of the Cgrd and Dgrd coefficient for the next step: ! --------------------------------------------------------------- @@ -248,6 +243,13 @@ lambda*zc(ig,1,indice)-ptsrf(ig))/ptimestep END DO + contains + + real function fz(rk) + real rk + fz = fz1*(dalph_soil**rk-1.)/(dalph_soil-1.) + end function fz + END SUBROUTINE soil end module soil_m