MODULE paleoclimate_mod !======================================================================= ! Description: Module dedicated to paleoclimate studies ! ! Authors: L. Lange, 06/2023 ! E. Vos, 10/2023 ! JB Clement, 2023-2026 !======================================================================= implicit none ! Flags logical :: paleoclimate ! Activate paleoclimates specific processes (e.g. lag layer), set in conf_phys, false by default logical :: lag_layer ! Indicate the presence of a lag layer, set in conf_phys, false by default logical :: include_waterbuoyancy ! Include the effect of water buoyancy when computing the sublimation of water ice, set in conf_phys, false by default !$OMP THREADPRIVATE(paleoclimate,lag_layer,include_waterbuoyancy) real, dimension(:,:), allocatable :: h2oice_depth ! Depth of the shallowest H2O ice layer [m] real, dimension(:,:), allocatable :: co2ice_depth ! Depth of the shallowest CO2 ice layer [m] real, dimension(:,:), allocatable :: zdqsdif_ssi_tot ! Total flux of the interactions with sub-surface ice [kg/m^2/s^-1] real, dimension(:,:), allocatable :: coef_ssdif ! Diffusion coefficent for sub-surface water !$OMP THREADPRIVATE(h2oice_depth,co2ice_depth,zdqsdif_ssi_tot,coef_ssdif) contains !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ !======================================================================= SUBROUTINE ini_paleoclimate(ngrid,nslope) implicit none integer, intent(in) :: ngrid ! Number of grid cells integer, intent(in) :: nslope ! Number of slopes (sub-grid parametrization) allocate(h2oice_depth(ngrid,nslope)) allocate(co2ice_depth(ngrid,nslope)) allocate(zdqsdif_ssi_tot(ngrid,nslope)) allocate(coef_ssdif(ngrid,nslope)) END SUBROUTINE ini_paleoclimate !======================================================================= !======================================================================= SUBROUTINE end_paleoclimate() implicit none if (allocated(coef_ssdif)) deallocate(coef_ssdif) if (allocated(h2oice_depth)) deallocate(h2oice_depth) if (allocated(zdqsdif_ssi_tot)) deallocate(zdqsdif_ssi_tot) if (allocated(co2ice_depth)) deallocate(co2ice_depth) END SUBROUTINE end_paleoclimate !======================================================================= END MODULE paleoclimate_mod