Changeset 3610 for trunk


Ignore:
Timestamp:
Feb 5, 2025, 3:06:50 PM (6 hours ago)
Author:
jbclement
Message:

PEM:

  • The sublimation flux can now be modified by the new function 'recomp_tend_h2o' to account for the growth of a dust lag layer (see Eran Vos's note for the formula).
  • Addition of a function 'itp_tsoil' to compute the soil temperature at any point in the soil profile.

JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3609 r3610  
    572572== 05/02/2025 == JBC
    573573- Simplification of "read_data_PCM_mod.F90" to treat the cases with/without slope.
    574 - Few bug corrections related to 1D.
     574- Few bug corrections related to 1D.
     575
     576== 05/02/2025 == JBC
     577- The sublimation flux can now be modified by the new function 'recomp_tend_h2o' to account for the growth of a dust lag layer (see Eran Vos's note for the formula).
     578- Addition of a function 'itp_tsoil' to compute the soil temperature at any point in the soil profile.
  • trunk/LMDZ.COMMON/libf/evolution/compute_soiltemp_mod.F90

    r3602 r3610  
    268268                    ! Position in the old discretization of the depth
    269269                    z = mlayer_PEM(isoil - 1) - zshift_surfloc
    270                     ! Find the interval [mlayer_PEM(iz - 1),mlayer_PEM(iz)[ where the position z belongs
    271                     iz = 0
    272                     do while (mlayer_PEM(iz) <= z)
    273                         iz = iz + 1
    274                     enddo
    275                     if (iz == 0) then
    276                         tsoil_minus = tsurf(ig,islope)
    277                         mlayer_minus = 0.
    278                     else
    279                         tsoil_minus = tsoil_old(ig,iz,islope)
    280                         mlayer_minus = mlayer_PEM(iz - 1)
    281                     endif
    282270                    ! Interpolation of the temperature profile from the old discretization
    283                     a = (tsoil_old(ig,iz + 1,islope) - tsoil_minus)/(mlayer_PEM(iz) - mlayer_minus)
    284                     tsoil(ig,isoil,islope) = a*(z - mlayer_minus) + tsoil_minus
     271                    tsoil(ig,isoil,islope) = itp_tsoil(tsoil_old(ig,:,islope),tsurf(ig,islope),z)
    285272                enddo
    286273            endif
     
    300287                    ! Position of the lag bottom in the old discretization of the depth
    301288                    z = zlag(ig,islope) - zshift_surfloc
    302                     ! Find the interval [mlayer_PEM(iz - 1),mlayer_PEM(iz)[ where the position z belongs
    303                     iz = 0
    304                     do while (mlayer_PEM(iz) <= z)
    305                         iz = iz + 1
    306                     enddo
    307                     if (iz == 0) then
    308                         tsoil_minus = tsurf(ig,islope)
    309                         mlayer_minus = 0.
    310                     else
    311                         tsoil_minus = tsoil_old(ig,iz,islope)
    312                         mlayer_minus = mlayer_PEM(iz - 1)
    313                     endif
    314289                    ! The "new lag" temperature is set to the ice temperature just below
    315                     a = (tsoil_old(ig,iz + 1,islope) - tsoil_minus)/(mlayer_PEM(iz) - mlayer_minus)
    316                     tsoil(ig,:ilag,islope) = a*(z - mlayer_minus) + tsoil_minus
     290                    tsoil(ig,:ilag,islope) = itp_tsoil(tsoil_old(ig,:,islope),tsurf(ig,islope),z)
    317291                endif
    318292
     
    326300                    ! Position in the old discretization of the depth
    327301                    z = mlayer_PEM(isoil - 1) - zshift_surfloc
    328                     ! Find the interval [mlayer_PEM(iz - 1),mlayer_PEM(iz)[ where the position z belongs
    329                     iz = 0
    330                     do while (mlayer_PEM(iz) <= z)
    331                         iz = iz + 1
    332                     enddo
    333                     if (iz == 0) then
    334                         tsoil_minus = tsurf(ig,islope)
    335                         mlayer_minus = 0.
    336                     else
    337                         tsoil_minus = tsoil_old(ig,iz,islope)
    338                         mlayer_minus = mlayer_PEM(iz - 1)
    339                     endif
    340302                    ! Interpolation of the temperature profile from the old discretization
    341                     a = (tsoil_old(ig,iz + 1,islope) - tsoil_minus)/(mlayer_PEM(iz) - mlayer_minus)
    342                     tsoil(ig,isoil,islope) = a*(z - mlayer_minus) + tsoil_minus
     303                    tsoil(ig,isoil,islope) = itp_tsoil(tsoil_old(ig,:,islope),tsurf(ig,islope),z)
    343304                enddo
    344305
     
    352313END SUBROUTINE shift_tsoil2surf
    353314
     315!=======================================================================
     316
     317FUNCTION itp_tsoil(tsoil,tsurf,z) RESULT(tsoil_z)
     318
     319use comsoil_h_PEM, only: mlayer_PEM
     320
     321implicit none
     322
     323real, dimension(:), intent(in) :: tsoil
     324real,               intent(in) :: z, tsurf
     325
     326real    :: tsoil_z, tsoil_minus, mlayer_minus, a
     327integer :: iz
     328
     329! Find the interval [mlayer_PEM(iz - 1),mlayer_PEM(iz)[ where the position z belongs
     330iz = 0
     331do while (mlayer_PEM(iz) <= z)
     332    iz = iz + 1
     333enddo
     334if (iz == 0) then
     335    tsoil_minus = tsurf
     336    mlayer_minus = 0.
     337else
     338    tsoil_minus = tsoil(iz)
     339    mlayer_minus = mlayer_PEM(iz - 1)
     340endif
     341! Interpolation of the temperature profile from the old discretization
     342a = (tsoil(iz + 1) - tsoil_minus)/(mlayer_PEM(iz) - mlayer_minus)
     343tsoil_z = a*(z - mlayer_minus) + tsoil_minus
     344
     345END FUNCTION itp_tsoil
     346
    354347END MODULE compute_soiltemp_mod
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3609 r3610  
    6565use pemetat0_mod,               only: pemetat0
    6666use read_data_PCM_mod,          only: read_data_PCM
    67 use recomp_tend_co2_mod,        only: recomp_tend_co2
     67use recomp_tend_mod,            only: recomp_tend_co2, recomp_tend_h2o
    6868use compute_soiltemp_mod,       only: compute_tsoil_pem, shift_tsoil2surf
    6969use writediagpem_mod,           only: writediagpem, writediagsoilpem
     
    211211real, dimension(:,:,:,:), allocatable :: tsoil_timeseries                 ! Grid points x Soil x Slope x Times field: Soil temperature timeseries [K]
    212212real, dimension(:,:,:,:), allocatable :: tsoil_PEM_timeseries             ! Grid points x Soil x Slope x Times field: Soil temperature timeseries for PEM [K]
     213real, dimension(:,:,:,:), allocatable :: tsoil_PEM_timeseries_old         ! Grid points x Soil x Slope x Times field: Soil temperature timeseries for PEM at the previous time step [K]
    213214real, dimension(:,:,:,:), allocatable :: watersoil_density_timeseries     ! Grid points x Soil x Slope x Times Water soil density timeseries [kg /m^3]
    214215real, dimension(:,:),     allocatable :: watersurf_density_avg            ! Grid points x Slope: Averaged  water surface density [kg/m^3]
     
    227228real, dimension(:,:),     allocatable :: zshift_surf                      ! Elevation shift for the surface [m]
    228229real, dimension(:,:),     allocatable :: zlag                             ! Newly built lag thickness [m]
     230real, dimension(:,:),     allocatable :: icetable_depth_old               ! Old depth of the ice table
    229231
    230232! Some variables for the PEM run
     
    857859! II_d.3 Update soil temperature
    858860        write(*,*)"> Updating soil temperature profile"
     861        allocate(tsoil_avg_old(ngrid,nsoilmx_PEM),tsoil_PEM_timeseries_old(ngrid,nsoilmx_PEM,nslope,timelen))
     862        tsoil_PEM_timeseries_old = tsoil_PEM_timeseries
    859863        do islope = 1,nslope
    860864            tsoil_avg_old = tsoil_PEM(:,:,islope)
     
    878882
    879883! II_d.4 Update the ice table
    880         allocate(icetable_thickness_old(ngrid,nslope),ice_porefilling_old(ngrid,nsoilmx_PEM,nslope))
     884        allocate(icetable_thickness_old(ngrid,nslope),ice_porefilling_old(ngrid,nsoilmx_PEM,nslope),icetable_depth_old(ngrid,nslope))
    881885        if (icetable_equilibrium) then
    882886            write(*,*) "> Updating ice table (equilibrium method)"
     
    887891            write(*,*) "> Updating ice table (dynamic method)"
    888892            ice_porefilling_old = ice_porefilling
     893            icetable_depth_old = icetable_depth
    889894            allocate(porefill(nsoilmx_PEM))
    890895            do ig = 1,ngrid
     
    971976!------------------------
    972977    call recomp_tend_co2(ngrid,nslope,timelen,d_co2ice,d_co2ice_ini,co2_ice,emis,vmr_co2_PCM,vmr_co2_PEM_phys,ps_timeseries,ps_avg_global_old,ps_avg_global_new)
    973     deallocate(vmr_co2_PEM_phys)
     978    do ig = 1,ngrid
     979        do islope = 1,nslope
     980            call recomp_tend_h2o(icetable_depth_old(ig,islope),icetable_depth(ig,islope),tsurf_avg(ig,islope),tsoil_PEM_timeseries_old(ig,:,islope,:),tsoil_PEM_timeseries(ig,:,islope,:),d_h2oice(ig,islope))
     981        enddo
     982    enddo
     983    deallocate(vmr_co2_PEM_phys,icetable_depth_old,tsoil_PEM_timeseries_old)
    974984
    975985!------------------------
  • trunk/LMDZ.COMMON/libf/evolution/recomp_tend_mod.F90

    r3609 r3610  
    1 MODULE recomp_tend_co2_mod
     1MODULE recomp_tend_mod
    22
    33implicit none
     
    1616!=======================================================================
    1717!
    18 !  To compute the evolution of the tendencie for co2 ice
     18!  To compute the evolution of the tendency for co2 ice
    1919!
    2020!=======================================================================
     
    6161!=======================================================================
    6262
    63 SUBROUTINE recomp_tend_h2o(ngrid,nslope,timelen,d_h2oice,PCM_temp,PEM_temp)
     63SUBROUTINE recomp_tend_h2o(icetable_depth_old,icetable_depth_new,tsurf,tsoil_PEM_timeseries_old,tsoil_PEM_timeseries_new,d_h2oice)
     64
     65use compute_soiltemp_mod, only: itp_tsoil
     66use fast_subs_mars,       only: psv
    6467
    6568implicit none
     
    6770!=======================================================================
    6871!
    69 !  To compute the evolution of the tendencie for h2o ice
     72!  To compute the evolution of the tendency for h2o ice
    7073!
    7174!=======================================================================
     
    7376! Inputs
    7477! ------
    75 integer,            intent(in) :: timelen, ngrid, nslope
    76 real, dimension(:), intent(in) :: PCM_temp, PEM_temp
     78real,                 intent(in) :: icetable_depth_old, icetable_depth_new, tsurf
     79real, dimension(:,:), intent(in) :: tsoil_PEM_timeseries_old, tsoil_PEM_timeseries_new
    7780! Outputs
    7881! -------
    79 real, dimension(ngrid,nslope), intent(inout) :: d_h2oice ! physical point field: Evolution of perennial ice over one year
     82real, intent(inout) :: d_h2oice ! Evolution of perennial ice over one year
    8083
    8184! Local:
    8285! ------
     86real            :: Rz_old, Rz_new, R_dec, hum_dec, psv_max_old, psv_max_new
     87integer         :: t
     88real, parameter :: coef_diff = 4.e-4 ! Diffusion coefficient
     89real, parameter :: zcdv = 0.0325     ! Drag coefficient
    8390
    84 write(*,*) "Update of the H2O tendency due to lag layer"
     91write(*,*) "> Updating the H2O tendency due to lag layer"
    8592
    86 ! Flux correction due to lag layer
    87 !~ Rz_old = h2oice_depth_old*0.0325/4.e-4              ! resistance from PCM
    88 !~ Rz_new = h2oice_depth_new*0.0325/4.e-4              ! new resistance based on new depth
    89 !~ R_dec = (1./Rz_old)/(1./Rz_new)                     ! decrease because of resistance
    90 !~ soil_psv_old = psv(max(PCM_temp(h2oice_depth_old))) ! the maxmimum annual mean saturation vapor pressure at the temperature of the GCM run temperature at the old ice location
    91 !~ soil_psv_new = psv(max(PEM_temp(h2oice_depth_new))) ! the maxmimum annual mean saturation vapor pressure at the temperature of the PEM run temperature at the new ice location
    92 !~ hum_dec = soil_psv_old/soil_psv_new                 ! decrease because of lower water vapor pressure at the new depth
    93 !~ d_h2oice = d_h2oice*R_dec*hum_dec                   ! decrease of flux
     93! Higher resistance due to growing lag layer (higher depth)
     94Rz_old = icetable_depth_old*zcdv/coef_diff ! Old resistance from PCM
     95Rz_new = icetable_depth_new*zcdv/coef_diff ! New resistance based on new depth
     96R_dec = Rz_new/Rz_old ! Decrease because of resistance
     97
     98! The maxmimum of the daily averages over one year for the saturation vapor pressure at the ice table location
     99psv_max_old = 0.
     100psv_max_new = 0.
     101do t = 1,size(tsoil_PEM_timeseries_old,2)
     102    psv_max_old = max(psv_max_old,psv(itp_tsoil(tsoil_PEM_timeseries_old(:,t),tsurf,icetable_depth_old)))
     103    psv_max_new = max(psv_max_new,psv(itp_tsoil(tsoil_PEM_timeseries_new(:,t),tsurf,icetable_depth_new)))
     104enddo
     105
     106! Lower humidity due to growing lag layer (higher depth)
     107hum_dec = psv_max_old/psv_max_new ! Decrease because of lower water vapor pressure at the new depth
     108
     109! Flux correction (decrease)
     110d_h2oice = d_h2oice*R_dec*hum_dec
    94111
    95112END SUBROUTINE recomp_tend_h2o
    96113
    97 END MODULE recomp_tend_co2_mod
     114END MODULE recomp_tend_mod
Note: See TracChangeset for help on using the changeset viewer.