| 1 | MODULE planet |
|---|
| 2 | !----------------------------------------------------------------------- |
|---|
| 3 | ! NAME |
|---|
| 4 | ! planet |
|---|
| 5 | ! |
|---|
| 6 | ! DESCRIPTION |
|---|
| 7 | ! Centralized climate-state storage and lifecycle helpers for PEM. |
|---|
| 8 | ! |
|---|
| 9 | ! AUTHORS & DATE |
|---|
| 10 | ! JB Clement, 03/2026 |
|---|
| 11 | ! |
|---|
| 12 | ! NOTES |
|---|
| 13 | ! Ownership criterion for declarations: |
|---|
| 14 | ! - Declare in module "planet" variables that are persistent climate |
|---|
| 15 | ! state or persistent references used across multiple time steps. |
|---|
| 16 | ! - Declare in program "pem.F90" transient workflow/control varaibles, |
|---|
| 17 | ! one-shot initialization buffers and per-iteration working buffers. |
|---|
| 18 | !----------------------------------------------------------------------- |
|---|
| 19 | |
|---|
| 20 | ! DEPENDENCIES |
|---|
| 21 | ! ------------ |
|---|
| 22 | use numerics, only: dp, qp, k4 |
|---|
| 23 | use layered_deposits, only: layering |
|---|
| 24 | |
|---|
| 25 | ! DECLARATION |
|---|
| 26 | ! ----------- |
|---|
| 27 | implicit none |
|---|
| 28 | |
|---|
| 29 | ! PARAMETERS |
|---|
| 30 | ! ---------- |
|---|
| 31 | ! Pressure-related: |
|---|
| 32 | real(dp), dimension(:), allocatable :: ps_avg ! Average surface pressure [Pa] |
|---|
| 33 | real(dp), dimension(:,:), allocatable :: ps_ts ! Surface pressure timeseries [Pa] |
|---|
| 34 | real(dp), dimension(:), allocatable :: ps_dev ! Deviation of surface pressure [Pa] |
|---|
| 35 | real(dp) :: ps_avg_glob_ini ! Global average pressure at initialization [Pa] |
|---|
| 36 | real(dp) :: ps_avg_glob_old ! Global average pressure of previous time step [Pa] |
|---|
| 37 | real(dp) :: ps_avg_glob ! Global average pressure of current time step [Pa] |
|---|
| 38 | |
|---|
| 39 | ! Ice-related: |
|---|
| 40 | real(dp), dimension(:,:), allocatable :: h2o_ice ! H2O ice [kg/m2] |
|---|
| 41 | real(dp), dimension(:,:), allocatable :: co2_ice ! CO2 ice [kg/m2] |
|---|
| 42 | real(dp) :: h2oice_sublim_coverage_ini ! Initial surface area of sublimating H2O ice [m2] |
|---|
| 43 | real(dp) :: co2ice_sublim_coverage_ini ! Initial surface area of sublimating CO2 ice [m2] |
|---|
| 44 | logical(k4), dimension(:,:), allocatable :: is_h2oice_ini ! Initial location of H2O ice |
|---|
| 45 | logical(k4), dimension(:,:), allocatable :: is_co2ice_ini ! Initial location of CO2 ice |
|---|
| 46 | logical(k4), dimension(:,:), allocatable :: is_co2ice_disappeared ! Flag to check if CO2 ice disappeared at the previous timestep |
|---|
| 47 | |
|---|
| 48 | ! Surface-related: |
|---|
| 49 | real(dp), dimension(:,:), allocatable :: tsurf_avg ! Average surface temperature [K] |
|---|
| 50 | real(dp), dimension(:,:), allocatable :: tsurf_dev ! Deviation of surface temperature [K] |
|---|
| 51 | real(dp), dimension(:,:), allocatable :: h2o_surfdensity_avg ! Average water surface density [kg/m^3] |
|---|
| 52 | |
|---|
| 53 | ! Soil-related: |
|---|
| 54 | real(dp), dimension(:,:,:), allocatable :: tsoil_avg ! Average soil temperature [K] |
|---|
| 55 | real(dp), dimension(:,:,:), allocatable :: tsoil_dev ! Deviation of soil temperature [K] |
|---|
| 56 | real(dp), dimension(:,:,:,:), allocatable :: tsoil_ts ! Soil temperature timeseries [K] |
|---|
| 57 | real(dp), dimension(:,:,:,:), allocatable :: tsoil_ts_old ! Soil temperature timeseries at the previous time step [K] |
|---|
| 58 | |
|---|
| 59 | ! Layering-related: |
|---|
| 60 | type(layering), dimension(:,:), allocatable :: layerings_map ! Layering for each grid point and slope |
|---|
| 61 | |
|---|
| 62 | ! Sorption-related: |
|---|
| 63 | real(dp), dimension(:,:,:), allocatable :: h2o_soildensity_avg ! Average of soil water soil density [kg/m^3] |
|---|
| 64 | real(dp), dimension(:), allocatable :: delta_co2_ads ! Quantity of CO2 exchanged due to adsorption/desorption [kg/m^2] |
|---|
| 65 | real(dp), dimension(:), allocatable :: delta_h2o_ads ! Quantity of H2O exchanged due to adsorption/desorption [kg/m^2] |
|---|
| 66 | real(dp), dimension(:,:,:), allocatable :: h2o_ads_reg ! H2O adsorbed in the regolith [kg/m^2] |
|---|
| 67 | real(dp), dimension(:,:,:), allocatable :: co2_ads_reg ! CO2 adsorbed in the regolith [kg/m^2] |
|---|
| 68 | |
|---|
| 69 | ! Ice table-related: |
|---|
| 70 | real(dp), dimension(:,:), allocatable :: icetable_depth ! Depth of the ice table [m] |
|---|
| 71 | real(dp), dimension(:,:), allocatable :: icetable_thickness ! Thickness of the ice table [m] |
|---|
| 72 | real(dp), dimension(:,:,:), allocatable :: ice_porefilling ! Amount of porefilling [m^3/m^3] |
|---|
| 73 | real(dp), dimension(:,:), allocatable :: icetable_depth_old ! Old depth of the ice table [m] |
|---|
| 74 | real(dp), dimension(:), allocatable :: delta_icetable ! Total mass of the H2O exchanged with the ice table [kg] |
|---|
| 75 | real(dp), dimension(:,:), allocatable :: flux_ssice_avg ! Average of total flux exchanged with subsurface ice [kg/m2/y] |
|---|
| 76 | |
|---|
| 77 | ! Tracer-related: |
|---|
| 78 | real(dp), dimension(:,:), allocatable :: q_co2_ts ! CO2 mass mixing ratio in the first layer [kg/kg] |
|---|
| 79 | real(dp), dimension(:,:), allocatable :: q_co2_ts_ini ! Initial CO2 mass mixing ratio in the first layer [kg/kg] |
|---|
| 80 | real(dp), dimension(:,:), allocatable :: q_h2o_ts ! H2O mass mixing ratio in the first layer [kg/kg] |
|---|
| 81 | |
|---|
| 82 | ! Tendency-related: |
|---|
| 83 | real(dp), dimension(:,:), allocatable :: d_co2ice ! Tendency of perennial CO2 ice [kg/m2/y] |
|---|
| 84 | real(dp), dimension(:,:), allocatable :: d_co2ice_ini ! Tendency of perennial CO2 ice at the beginning [kg/m2/y] |
|---|
| 85 | real(dp), dimension(:,:), allocatable :: d_h2oice ! Tendency of perennial H2O ice [kg/m2/y] |
|---|
| 86 | |
|---|
| 87 | contains |
|---|
| 88 | !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 89 | |
|---|
| 90 | !======================================================================= |
|---|
| 91 | SUBROUTINE ini_planet() |
|---|
| 92 | !----------------------------------------------------------------------- |
|---|
| 93 | ! NAME |
|---|
| 94 | ! ini_planet |
|---|
| 95 | ! |
|---|
| 96 | ! DESCRIPTION |
|---|
| 97 | ! Initialize scalar state values of module planet. |
|---|
| 98 | ! |
|---|
| 99 | ! AUTHORS & DATE |
|---|
| 100 | ! JB Clement, 03/2026 |
|---|
| 101 | ! |
|---|
| 102 | ! NOTES |
|---|
| 103 | ! |
|---|
| 104 | !----------------------------------------------------------------------- |
|---|
| 105 | |
|---|
| 106 | ! DECLARATION |
|---|
| 107 | ! ----------- |
|---|
| 108 | implicit none |
|---|
| 109 | |
|---|
| 110 | ! CODE |
|---|
| 111 | ! ---- |
|---|
| 112 | ps_avg_glob_ini = 0._dp |
|---|
| 113 | ps_avg_glob_old = 0._dp |
|---|
| 114 | ps_avg_glob = 0._dp |
|---|
| 115 | h2oice_sublim_coverage_ini = 0._dp |
|---|
| 116 | co2ice_sublim_coverage_ini = 0._dp |
|---|
| 117 | |
|---|
| 118 | END SUBROUTINE ini_planet |
|---|
| 119 | !======================================================================= |
|---|
| 120 | |
|---|
| 121 | !======================================================================= |
|---|
| 122 | SUBROUTINE allocate_xios_state() |
|---|
| 123 | !----------------------------------------------------------------------- |
|---|
| 124 | ! NAME |
|---|
| 125 | ! allocate_xios_state |
|---|
| 126 | ! |
|---|
| 127 | ! DESCRIPTION |
|---|
| 128 | ! Allocate arrays needed before loading PCM/XIOS data. |
|---|
| 129 | ! |
|---|
| 130 | ! AUTHORS & DATE |
|---|
| 131 | ! JB Clement, 03/2026 |
|---|
| 132 | ! |
|---|
| 133 | ! NOTES |
|---|
| 134 | ! |
|---|
| 135 | !----------------------------------------------------------------------- |
|---|
| 136 | |
|---|
| 137 | ! DEPENDENCIES |
|---|
| 138 | ! ------------ |
|---|
| 139 | use geometry, only: ngrid, nslope, nday, nsoil |
|---|
| 140 | |
|---|
| 141 | ! DECLARATION |
|---|
| 142 | ! ----------- |
|---|
| 143 | implicit none |
|---|
| 144 | |
|---|
| 145 | ! CODE |
|---|
| 146 | ! ---- |
|---|
| 147 | allocate(ps_avg(ngrid)) |
|---|
| 148 | allocate(ps_ts(ngrid,nday)) |
|---|
| 149 | allocate(tsurf_avg(ngrid,nslope)) |
|---|
| 150 | allocate(h2o_surfdensity_avg(ngrid,nslope)) |
|---|
| 151 | allocate(tsoil_avg(ngrid,nsoil,nslope)) |
|---|
| 152 | allocate(tsoil_ts(ngrid,nsoil,nslope,nday)) |
|---|
| 153 | allocate(h2o_soildensity_avg(ngrid,nsoil,nslope)) |
|---|
| 154 | allocate(q_h2o_ts(ngrid,nday)) |
|---|
| 155 | allocate(q_co2_ts(ngrid,nday)) |
|---|
| 156 | allocate(flux_ssice_avg(ngrid,nslope)) |
|---|
| 157 | |
|---|
| 158 | ps_avg(:) = 0._dp |
|---|
| 159 | ps_ts(:,:) = 0._dp |
|---|
| 160 | tsurf_avg(:,:) = 0._dp |
|---|
| 161 | h2o_surfdensity_avg(:,:) = 0._dp |
|---|
| 162 | tsoil_avg(:,:,:) = 0._dp |
|---|
| 163 | tsoil_ts(:,:,:,:) = 0._dp |
|---|
| 164 | h2o_soildensity_avg(:,:,:) = 0._dp |
|---|
| 165 | q_h2o_ts(:,:) = 0._dp |
|---|
| 166 | q_co2_ts(:,:) = 0._dp |
|---|
| 167 | flux_ssice_avg(:,:) = 0._dp |
|---|
| 168 | |
|---|
| 169 | END SUBROUTINE allocate_xios_state |
|---|
| 170 | !======================================================================= |
|---|
| 171 | |
|---|
| 172 | !======================================================================= |
|---|
| 173 | SUBROUTINE allocate_deviation_state() |
|---|
| 174 | !----------------------------------------------------------------------- |
|---|
| 175 | ! NAME |
|---|
| 176 | ! allocate_deviation_state |
|---|
| 177 | ! |
|---|
| 178 | ! DESCRIPTION |
|---|
| 179 | ! Allocate persistent deviation fields derived from PCM averages. |
|---|
| 180 | ! |
|---|
| 181 | ! AUTHORS & DATE |
|---|
| 182 | ! JB Clement, 03/2026 |
|---|
| 183 | ! |
|---|
| 184 | ! NOTES |
|---|
| 185 | ! |
|---|
| 186 | !----------------------------------------------------------------------- |
|---|
| 187 | |
|---|
| 188 | ! DEPENDENCIES |
|---|
| 189 | ! ------------ |
|---|
| 190 | use geometry, only: ngrid, nslope, nsoil_PCM |
|---|
| 191 | |
|---|
| 192 | ! DECLARATION |
|---|
| 193 | ! ----------- |
|---|
| 194 | implicit none |
|---|
| 195 | |
|---|
| 196 | ! CODE |
|---|
| 197 | ! ---- |
|---|
| 198 | allocate(ps_dev(ngrid)) |
|---|
| 199 | allocate(tsurf_dev(ngrid,nslope)) |
|---|
| 200 | allocate(tsoil_dev(ngrid,nsoil_PCM,nslope)) |
|---|
| 201 | |
|---|
| 202 | ps_dev(:) = 0._dp |
|---|
| 203 | tsurf_dev(:,:) = 0._dp |
|---|
| 204 | tsoil_dev(:,:,:) = 0._dp |
|---|
| 205 | |
|---|
| 206 | END SUBROUTINE allocate_deviation_state |
|---|
| 207 | !======================================================================= |
|---|
| 208 | |
|---|
| 209 | !======================================================================= |
|---|
| 210 | SUBROUTINE allocate_startevo_state() |
|---|
| 211 | !----------------------------------------------------------------------- |
|---|
| 212 | ! NAME |
|---|
| 213 | ! allocate_startevo_state |
|---|
| 214 | ! |
|---|
| 215 | ! DESCRIPTION |
|---|
| 216 | ! Allocate arrays loaded from startevo or evolving afterward. |
|---|
| 217 | ! |
|---|
| 218 | ! AUTHORS & DATE |
|---|
| 219 | ! JB Clement, 03/2026 |
|---|
| 220 | ! |
|---|
| 221 | ! NOTES |
|---|
| 222 | ! |
|---|
| 223 | !----------------------------------------------------------------------- |
|---|
| 224 | |
|---|
| 225 | ! DEPENDENCIES |
|---|
| 226 | ! ------------ |
|---|
| 227 | use geometry, only: ngrid, nslope, nsoil |
|---|
| 228 | |
|---|
| 229 | ! DECLARATION |
|---|
| 230 | ! ----------- |
|---|
| 231 | implicit none |
|---|
| 232 | |
|---|
| 233 | ! CODE |
|---|
| 234 | ! ---- |
|---|
| 235 | allocate(h2o_ice(ngrid,nslope)) |
|---|
| 236 | allocate(co2_ice(ngrid,nslope)) |
|---|
| 237 | allocate(icetable_depth(ngrid,nslope)) |
|---|
| 238 | allocate(icetable_thickness(ngrid,nslope)) |
|---|
| 239 | allocate(ice_porefilling(ngrid,nsoil,nslope)) |
|---|
| 240 | allocate(h2o_ads_reg(ngrid,nsoil,nslope)) |
|---|
| 241 | allocate(co2_ads_reg(ngrid,nsoil,nslope)) |
|---|
| 242 | allocate(delta_h2o_ads(ngrid)) |
|---|
| 243 | allocate(delta_co2_ads(ngrid)) |
|---|
| 244 | allocate(layerings_map(ngrid,nslope)) |
|---|
| 245 | |
|---|
| 246 | h2o_ice(:,:) = 0._dp |
|---|
| 247 | co2_ice(:,:) = 0._dp |
|---|
| 248 | icetable_depth(:,:) = 0._dp |
|---|
| 249 | icetable_thickness(:,:) = 0._dp |
|---|
| 250 | ice_porefilling(:,:,:) = 0._dp |
|---|
| 251 | h2o_ads_reg(:,:,:) = 0._dp |
|---|
| 252 | co2_ads_reg(:,:,:) = 0._dp |
|---|
| 253 | delta_h2o_ads(:) = 0._dp |
|---|
| 254 | delta_co2_ads(:) = 0._dp |
|---|
| 255 | |
|---|
| 256 | END SUBROUTINE allocate_startevo_state |
|---|
| 257 | !======================================================================= |
|---|
| 258 | |
|---|
| 259 | !======================================================================= |
|---|
| 260 | SUBROUTINE allocate_tendencies() |
|---|
| 261 | !----------------------------------------------------------------------- |
|---|
| 262 | ! NAME |
|---|
| 263 | ! allocate_tendencies |
|---|
| 264 | ! |
|---|
| 265 | ! DESCRIPTION |
|---|
| 266 | ! Allocate perennial ice tendency arrays. |
|---|
| 267 | ! |
|---|
| 268 | ! AUTHORS & DATE |
|---|
| 269 | ! JB Clement, 03/2026 |
|---|
| 270 | ! |
|---|
| 271 | ! NOTES |
|---|
| 272 | ! |
|---|
| 273 | !----------------------------------------------------------------------- |
|---|
| 274 | |
|---|
| 275 | ! DEPENDENCIES |
|---|
| 276 | ! ------------ |
|---|
| 277 | use geometry, only: ngrid, nslope |
|---|
| 278 | |
|---|
| 279 | ! DECLARATION |
|---|
| 280 | ! ----------- |
|---|
| 281 | implicit none |
|---|
| 282 | |
|---|
| 283 | ! CODE |
|---|
| 284 | ! ---- |
|---|
| 285 | allocate(d_h2oice(ngrid,nslope)) |
|---|
| 286 | allocate(d_co2ice(ngrid,nslope)) |
|---|
| 287 | |
|---|
| 288 | d_h2oice(:,:) = 0._dp |
|---|
| 289 | d_co2ice(:,:) = 0._dp |
|---|
| 290 | |
|---|
| 291 | END SUBROUTINE allocate_tendencies |
|---|
| 292 | !======================================================================= |
|---|
| 293 | |
|---|
| 294 | !======================================================================= |
|---|
| 295 | SUBROUTINE allocate_initial_snapshots() |
|---|
| 296 | !----------------------------------------------------------------------- |
|---|
| 297 | ! NAME |
|---|
| 298 | ! allocate_initial_snapshots |
|---|
| 299 | ! |
|---|
| 300 | ! DESCRIPTION |
|---|
| 301 | ! Allocate arrays storing initial-state snapshots. |
|---|
| 302 | ! |
|---|
| 303 | ! AUTHORS & DATE |
|---|
| 304 | ! JB Clement, 03/2026 |
|---|
| 305 | ! |
|---|
| 306 | ! NOTES |
|---|
| 307 | ! |
|---|
| 308 | !----------------------------------------------------------------------- |
|---|
| 309 | |
|---|
| 310 | ! DEPENDENCIES |
|---|
| 311 | ! ------------ |
|---|
| 312 | use geometry, only: ngrid, nslope, nday |
|---|
| 313 | |
|---|
| 314 | ! DECLARATION |
|---|
| 315 | ! ----------- |
|---|
| 316 | implicit none |
|---|
| 317 | |
|---|
| 318 | ! CODE |
|---|
| 319 | ! ---- |
|---|
| 320 | allocate(d_co2ice_ini(ngrid,nslope)) |
|---|
| 321 | allocate(q_co2_ts_ini(ngrid,nday)) |
|---|
| 322 | allocate(is_h2oice_ini(ngrid,nslope)) |
|---|
| 323 | allocate(is_co2ice_ini(ngrid,nslope)) |
|---|
| 324 | |
|---|
| 325 | d_co2ice_ini(:,:) = 0._dp |
|---|
| 326 | q_co2_ts_ini(:,:) = 0._dp |
|---|
| 327 | is_h2oice_ini(:,:) = .false. |
|---|
| 328 | is_co2ice_ini(:,:) = .false. |
|---|
| 329 | |
|---|
| 330 | END SUBROUTINE allocate_initial_snapshots |
|---|
| 331 | !======================================================================= |
|---|
| 332 | |
|---|
| 333 | !======================================================================= |
|---|
| 334 | SUBROUTINE allocate_loop_state() |
|---|
| 335 | !----------------------------------------------------------------------- |
|---|
| 336 | ! NAME |
|---|
| 337 | ! allocate_loop_state |
|---|
| 338 | ! |
|---|
| 339 | ! DESCRIPTION |
|---|
| 340 | ! Allocate arrays that start being used during the main PEM loop. |
|---|
| 341 | ! |
|---|
| 342 | ! AUTHORS & DATE |
|---|
| 343 | ! JB Clement, 03/2026 |
|---|
| 344 | ! |
|---|
| 345 | ! NOTES |
|---|
| 346 | ! |
|---|
| 347 | !----------------------------------------------------------------------- |
|---|
| 348 | |
|---|
| 349 | ! DEPENDENCIES |
|---|
| 350 | ! ------------ |
|---|
| 351 | use geometry, only: ngrid, nslope, nsoil, nday |
|---|
| 352 | |
|---|
| 353 | ! DECLARATION |
|---|
| 354 | ! ----------- |
|---|
| 355 | implicit none |
|---|
| 356 | |
|---|
| 357 | ! CODE |
|---|
| 358 | ! ---- |
|---|
| 359 | allocate(delta_icetable(ngrid)) |
|---|
| 360 | allocate(icetable_depth_old(ngrid,nslope)) |
|---|
| 361 | allocate(is_co2ice_disappeared(ngrid,nslope)) |
|---|
| 362 | allocate(tsoil_ts_old(ngrid,nsoil,nslope,nday)) |
|---|
| 363 | |
|---|
| 364 | delta_icetable(:) = 0._dp |
|---|
| 365 | icetable_depth_old(:,:) = 0._dp |
|---|
| 366 | is_co2ice_disappeared(:,:) = .false. |
|---|
| 367 | tsoil_ts_old(:,:,:,:) = 0._dp |
|---|
| 368 | |
|---|
| 369 | END SUBROUTINE allocate_loop_state |
|---|
| 370 | !======================================================================= |
|---|
| 371 | |
|---|
| 372 | !======================================================================= |
|---|
| 373 | SUBROUTINE end_planet() |
|---|
| 374 | !----------------------------------------------------------------------- |
|---|
| 375 | ! NAME |
|---|
| 376 | ! end_planet |
|---|
| 377 | ! |
|---|
| 378 | ! DESCRIPTION |
|---|
| 379 | ! Finalize module planet. |
|---|
| 380 | ! |
|---|
| 381 | ! AUTHORS & DATE |
|---|
| 382 | ! JB Clement, 03/2026 |
|---|
| 383 | ! |
|---|
| 384 | ! NOTES |
|---|
| 385 | ! Deallocate all allocatable state arrays of module planet. |
|---|
| 386 | !----------------------------------------------------------------------- |
|---|
| 387 | |
|---|
| 388 | ! DECLARATION |
|---|
| 389 | ! ----------- |
|---|
| 390 | implicit none |
|---|
| 391 | |
|---|
| 392 | ! CODE |
|---|
| 393 | ! ---- |
|---|
| 394 | if (allocated(ps_avg)) deallocate(ps_avg) |
|---|
| 395 | if (allocated(ps_ts)) deallocate(ps_ts) |
|---|
| 396 | if (allocated(ps_dev)) deallocate(ps_dev) |
|---|
| 397 | if (allocated(h2o_ice)) deallocate(h2o_ice) |
|---|
| 398 | if (allocated(co2_ice)) deallocate(co2_ice) |
|---|
| 399 | if (allocated(is_h2oice_ini)) deallocate(is_h2oice_ini) |
|---|
| 400 | if (allocated(is_co2ice_ini)) deallocate(is_co2ice_ini) |
|---|
| 401 | if (allocated(is_co2ice_disappeared)) deallocate(is_co2ice_disappeared) |
|---|
| 402 | if (allocated(tsurf_avg)) deallocate(tsurf_avg) |
|---|
| 403 | if (allocated(tsurf_dev)) deallocate(tsurf_dev) |
|---|
| 404 | if (allocated(h2o_surfdensity_avg)) deallocate(h2o_surfdensity_avg) |
|---|
| 405 | if (allocated(tsoil_avg)) deallocate(tsoil_avg) |
|---|
| 406 | if (allocated(tsoil_dev)) deallocate(tsoil_dev) |
|---|
| 407 | if (allocated(tsoil_ts)) deallocate(tsoil_ts) |
|---|
| 408 | if (allocated(tsoil_ts_old)) deallocate(tsoil_ts_old) |
|---|
| 409 | if (allocated(layerings_map)) deallocate(layerings_map) |
|---|
| 410 | if (allocated(h2o_soildensity_avg)) deallocate(h2o_soildensity_avg) |
|---|
| 411 | if (allocated(delta_co2_ads)) deallocate(delta_co2_ads) |
|---|
| 412 | if (allocated(delta_h2o_ads)) deallocate(delta_h2o_ads) |
|---|
| 413 | if (allocated(h2o_ads_reg)) deallocate(h2o_ads_reg) |
|---|
| 414 | if (allocated(co2_ads_reg)) deallocate(co2_ads_reg) |
|---|
| 415 | if (allocated(icetable_depth)) deallocate(icetable_depth) |
|---|
| 416 | if (allocated(icetable_thickness)) deallocate(icetable_thickness) |
|---|
| 417 | if (allocated(ice_porefilling)) deallocate(ice_porefilling) |
|---|
| 418 | if (allocated(icetable_depth_old)) deallocate(icetable_depth_old) |
|---|
| 419 | if (allocated(delta_icetable)) deallocate(delta_icetable) |
|---|
| 420 | if (allocated(q_co2_ts)) deallocate(q_co2_ts) |
|---|
| 421 | if (allocated(q_co2_ts_ini)) deallocate(q_co2_ts_ini) |
|---|
| 422 | if (allocated(q_h2o_ts)) deallocate(q_h2o_ts) |
|---|
| 423 | if (allocated(d_co2ice)) deallocate(d_co2ice) |
|---|
| 424 | if (allocated(d_co2ice_ini)) deallocate(d_co2ice_ini) |
|---|
| 425 | if (allocated(d_h2oice)) deallocate(d_h2oice) |
|---|
| 426 | if (allocated(layerings_map)) deallocate(layerings_map) |
|---|
| 427 | if (allocated(flux_ssice_avg)) deallocate(flux_ssice_avg) |
|---|
| 428 | |
|---|
| 429 | END SUBROUTINE end_planet |
|---|
| 430 | !======================================================================= |
|---|
| 431 | |
|---|
| 432 | END MODULE planet |
|---|