Changeset 3991 for trunk/LMDZ.COMMON/libf/evolution/soil_temp.F90
- Timestamp:
- Dec 16, 2025, 4:39:24 PM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/soil_temp.F90 (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/soil_temp.F90
r3989 r3991 1 1 MODULE soil_temp 2 2 !----------------------------------------------------------------------- 3 ! NAME 4 ! soil_temp 5 ! 6 ! DESCRIPTION 7 ! Routines to compute soil temperature evolution and initialization. 8 ! 9 ! AUTHORS & DATE 10 ! L. Lange, 2023 11 ! JB Clement, 2023-2025 12 ! 13 ! NOTES 14 ! 15 !----------------------------------------------------------------------- 16 17 ! DECLARATION 18 ! ----------- 3 19 implicit none 4 !----------------------------------------------------------------------- 5 ! Author: LL 6 ! Purpose: This module gathers the different routines used in the PEM to compute the soil temperature evolution and initialisation. 7 ! 8 ! Note: depths of layers and mid-layers, soil thermal inertia and 9 ! heat capacity are commons in comsoil_PEM.h 10 !----------------------------------------------------------------------- 20 11 21 contains 12 ! =======================================================================22 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 13 23 14 24 !======================================================================= 15 25 SUBROUTINE compute_tsoil(ngrid,nsoil,firstcall,therm_i,timestep,tsurf,tsoil) 16 17 use soil, only: layer_PEM, mlayer_PEM, mthermdiff_PEM, thermdiff_PEM, coefq_PEM, coefd_PEM, mu_PEM, alph_PEM, beta_PEM, fluxgeo 18 use comsoil_h, only: volcapa 19 26 !----------------------------------------------------------------------- 27 ! NAME 28 ! compute_tsoil 29 ! 30 ! DESCRIPTION 31 ! Compute soil temperature using an implicit 1st order scheme. 32 ! 33 ! AUTHORS & DATE 34 ! L. Lange, 2023 35 ! JB Clement, 2023-2025 36 ! 37 ! NOTES 38 ! 39 !----------------------------------------------------------------------- 40 41 ! DEPENDENCIES 42 ! ------------ 43 use soil, only: layer_PEM, mlayer_PEM, mthermdiff_PEM, thermdiff_PEM, coefq_PEM, coefd_PEM, mu_PEM, alph_PEM, beta_PEM, fluxgeo 44 use comsoil_h, only: volcapa 45 46 ! DECLARATION 47 ! ----------- 20 48 implicit none 21 49 22 !-----------------------------------------------------------------------23 ! Author: LL24 ! Purpose: Compute soil temperature using an implict 1st order scheme25 !26 ! Note: depths of layers and mid-layers, soil thermal inertia and27 ! heat capacity are commons in comsoil_PEM.h28 !-----------------------------------------------------------------------29 30 50 #include "dimensions.h" 31 51 32 ! Inputs: 33 ! ------- 34 integer, intent(in) :: ngrid ! number of (horizontal) grid-points 35 integer, intent(in) :: nsoil ! number of soil layers 36 logical, intent(in) :: firstcall ! identifier for initialization call 37 real, dimension(ngrid,nsoil), intent(in) :: therm_i ! thermal inertia [SI] 38 real, intent(in) :: timestep ! time step [s] 39 real, dimension(ngrid), intent(in) :: tsurf ! surface temperature [K] 40 ! Outputs: 41 !--------- 42 real, dimension(ngrid,nsoil), intent(inout) :: tsoil ! soil (mid-layer) temperature [K] 43 ! Local: 44 !------- 52 ! ARGUMENTS 53 ! --------- 54 integer, intent(in) :: ngrid ! number of (horizontal) grid-points 55 integer, intent(in) :: nsoil ! number of soil layers 56 logical, intent(in) :: firstcall ! identifier for initialization call 57 real, dimension(ngrid,nsoil), intent(in) :: therm_i ! thermal inertia [SI] 58 real, intent(in) :: timestep ! time step [s] 59 real, dimension(ngrid), intent(in) :: tsurf ! surface temperature [K] 60 real, dimension(ngrid,nsoil), intent(inout) :: tsoil ! soil (mid-layer) temperature [K] 61 62 ! LOCAL VARIABLES 63 ! --------------- 45 64 integer :: ig, ik 46 65 66 ! CODE 67 ! ---- 47 68 ! 0. Initialisations and preprocessing step 48 69 if (firstcall) then … … 121 142 !======================================================================= 122 143 SUBROUTINE ini_tsoil_pem(ngrid,nsoil,therm_i,tsurf,tsoil) 123 124 use soil, only: layer_PEM, mlayer_PEM, mthermdiff_PEM, thermdiff_PEM, coefq_PEM, coefd_PEM, mu_PEM, alph_PEM, beta_PEM, fluxgeo 125 use comsoil_h, only: volcapa 126 144 !----------------------------------------------------------------------- 145 ! NAME 146 ! ini_tsoil_pem 147 ! 148 ! DESCRIPTION 149 ! Initialize soil with the solution of the stationary heat conduction problem. 150 ! Boundary conditions: Tsurf averaged from PCM; geothermal flux at bottom. 151 ! 152 ! AUTHORS & DATE 153 ! L. Lang, 2023 154 ! JB Clement, 2023-2025 155 ! 156 ! NOTES 157 ! 158 !----------------------------------------------------------------------- 159 160 ! DEPENDENCIES 161 ! ------------ 162 use soil, only: layer_PEM, mlayer_PEM, mthermdiff_PEM, thermdiff_PEM, coefq_PEM, coefd_PEM, mu_PEM, alph_PEM, beta_PEM, fluxgeo 163 use comsoil_h, only: volcapa 164 165 ! DECLARATION 166 ! ----------- 127 167 implicit none 128 168 129 !-----------------------------------------------------------------------130 ! Author: LL131 ! Purpose: Initialize the soil with the solution of the stationnary problem of Heat Conduction. Boundarry conditions: Tsurf averaged from the PCM; Geothermal flux at the bottom layer132 !133 ! Note: depths of layers and mid-layers, soil thermal inertia and134 ! heat capacity are commons in comsoil_PEM.h135 !-----------------------------------------------------------------------136 137 169 #include "dimensions.h" 138 170 139 ! Inputs: 140 !-------- 141 integer, intent(in) :: ngrid ! number of (horizontal) grid-points 142 integer, intent(in) :: nsoil ! number of soil layers 143 real, dimension(ngrid,nsoil), intent(in) :: therm_i ! thermal inertia [SI] 144 real, dimension(ngrid), intent(in) :: tsurf ! surface temperature [K] 145 ! Outputs: 146 !--------- 147 real, dimension(ngrid,nsoil), intent(inout) :: tsoil ! soil (mid-layer) temperature [K] 148 ! Local: 149 !------- 171 ! ARGUMENTS 172 ! --------- 173 integer, intent(in) :: ngrid ! number of (horizontal) grid-points 174 integer, intent(in) :: nsoil ! number of soil layers 175 real, dimension(ngrid,nsoil), intent(in) :: therm_i ! thermal inertia [SI] 176 real, dimension(ngrid), intent(in) :: tsurf ! surface temperature [K] 177 real, dimension(ngrid,nsoil), intent(inout) :: tsoil ! soil (mid-layer) temperature [K] 178 179 ! LOCAL VARIABLES 180 ! --------------- 150 181 integer :: ig, ik, iloop 151 182 183 ! CODE 184 ! ---- 152 185 ! 0. Initialisations and preprocessing step 153 186 ! 0.1 Build mthermdiff_PEM(:), the mid-layer thermal diffusivities … … 220 253 !======================================================================= 221 254 SUBROUTINE shift_tsoil2surf(ngrid,nsoil,nslope,zshift_surf,zlag,tsurf,tsoil) 222 223 use soil, only: layer_PEM, mlayer_PEM, fluxgeo, thermdiff_PEM, mthermdiff_PEM 224 use math_toolkit, only: solve_steady_heat 225 255 !----------------------------------------------------------------------- 256 ! NAME 257 ! shift_tsoil2surf 258 ! 259 ! DESCRIPTION 260 ! Shift soil temperature profile to follow surface evolution due to ice 261 ! condensation/sublimation. 262 ! 263 ! AUTHORS & DATE 264 ! JB Clement, 2025 265 ! 266 ! NOTES 267 ! 268 !----------------------------------------------------------------------- 269 270 ! DEPENDENCIES 271 ! ------------ 272 use soil, only: layer_PEM, mlayer_PEM, fluxgeo, thermdiff_PEM, mthermdiff_PEM 273 use math_toolkit, only: solve_steady_heat 274 275 ! DECLARATION 276 ! ----------- 226 277 implicit none 227 278 228 !----------------------------------------------------------------------- 229 ! Author: JBC 230 ! Purpose: Shifting the soil temperature profile to follow the surface evolution due to ice condensation/sublimation 231 !----------------------------------------------------------------------- 232 ! Inputs: 233 ! ------- 234 integer, intent(in) :: ngrid ! number of (horizontal) grid-points 235 integer, intent(in) :: nsoil ! number of soil layers 236 integer, intent(in) :: nslope ! number of sub-slopes 237 real, dimension(ngrid,nslope), intent(in) :: zshift_surf ! elevation shift for the surface [m] 238 real, dimension(ngrid,nslope), intent(in) :: zlag ! newly built lag thickness [m] 239 real, dimension(ngrid,nslope), intent(in) :: tsurf ! surface temperature [K] 240 ! Outputs: 241 ! -------- 242 real, dimension(ngrid,nsoil,nslope), intent(inout) :: tsoil ! soil (mid-layer) temperature [K] 243 ! Local: 244 ! ------ 279 ! ARGUMENTS 280 ! --------- 281 integer, intent(in) :: ngrid ! number of (horizontal) grid-points 282 integer, intent(in) :: nsoil ! number of soil layers 283 integer, intent(in) :: nslope ! number of sub-slopes 284 real, dimension(ngrid,nslope), intent(in) :: zshift_surf ! elevation shift for the surface [m] 285 real, dimension(ngrid,nslope), intent(in) :: zlag ! newly built lag thickness [m] 286 real, dimension(ngrid,nslope), intent(in) :: tsurf ! surface temperature [K] 287 real, dimension(ngrid,nsoil,nslope), intent(inout) :: tsoil ! soil (mid-layer) temperature [K] 288 289 ! LOCAL VARIABLES 290 ! --------------- 245 291 integer :: ig, isoil, islope, ishift, ilag, iz 246 292 real :: a, z, zshift_surfloc, tsoil_minus, mlayer_minus 247 293 real, dimension(ngrid,nsoil,nslope) :: tsoil_old 248 294 295 ! CODE 296 ! ---- 249 297 write(*,*) "> Shifting soil temperature profile to match surface evolution" 250 298 tsoil_old = tsoil … … 317 365 !======================================================================= 318 366 FUNCTION itp_tsoil(tsoil,tsurf,z) RESULT(tsoil_z) 319 367 !----------------------------------------------------------------------- 368 ! NAME 369 ! itp_tsoil 370 ! 371 ! DESCRIPTION 372 ! Interpolate soil temperature profile. 373 ! 374 ! AUTHORS & DATE 375 ! JB Clement, 2025 376 ! 377 ! NOTES 378 ! 379 !----------------------------------------------------------------------- 380 381 ! DEPENDENCIES 382 ! ------------ 320 383 use soil, only: mlayer_PEM 321 384 385 ! DECLARATION 386 ! ----------- 322 387 implicit none 323 388 389 ! ARGUMENTS 390 ! --------- 324 391 real, dimension(:), intent(in) :: tsoil 325 392 real, intent(in) :: z, tsurf 326 393 394 ! LOCAL VARIABLES 395 ! --------------- 327 396 real :: tsoil_z, tsoil_minus, mlayer_minus, a 328 397 integer :: iz 329 398 399 ! CODE 400 ! ---- 330 401 ! Find the interval [mlayer_PEM(iz - 1),mlayer_PEM(iz)[ where the position z belongs 331 402 iz = 0
Note: See TracChangeset
for help on using the changeset viewer.
