source: trunk/LMDZ.COMMON/libf/evolution/stopping_crit_mod.F90 @ 3786

Last change on this file since 3786 was 3770, checked in by jbclement, 4 weeks ago

PEM:
Revision of the layering structure and algorithm:

  • 'stratum' components are now expressed in height
  • deletion of the (redundant) thickness feature of 'stratum'
  • 'stratif' in the PEM main program is renamed 'deposits'
  • addition of several procedures to get useful information about a stratum (major component or thickness)
  • all subsurface layers are now represented in the layering structure by strata with negative top elevation
  • simplification of the different situations arising from the input tendencies
  • porosity is determined for the entire stratum (and not anymore for each component) based on dominant component
  • sublimation of CO2 and H2O ice is now handled simultaneously (more realistic) in a stratum
  • linking the layering algorithm with the PEM initilization/finalization regarding PCM data and with the PEM stopping criteria
  • making separate cases for glaciers vs layering management
  • H2O sublimation flux correction is now handled with the layering when a dust lag layer layer is growing
  • update of 'h2o_ice_depth' and 'zdqsdif' accordingly at the PEM end for the PCM

JBC

File size: 6.9 KB
RevLine 
[3149]1MODULE stopping_crit_mod
[2888]2
[3130]3implicit none
[2888]4
[3149]5!=======================================================================
[3130]6contains
[3149]7!=======================================================================
[2888]8
9!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10!!!
[3130]11!!! Purpose: Criterions to check if the PEM needs to call the PCM
[2888]12!!! Author: RV & LL, 02/2023
13!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15
[3571]16SUBROUTINE stopping_crit_h2o_ice(cell_area,h2oice_ini_surf,is_h2oice_sublim_ini,h2o_ice,stopPEM,ngrid)
[2888]17
[3159]18use time_evol_mod, only: h2o_ice_crit
[3130]19use comslope_mod,  only: subslope_dist, nslope
[2888]20
[3130]21implicit none
[2888]22
23!=======================================================================
24!
[3149]25! Routine to check if the h2o ice criterion to stop the PEM is reached
[2888]26!
27!=======================================================================
[3327]28! Inputs
29!-------
[3571]30integer,                          intent(in) :: ngrid                ! # of physical grid points
31real,    dimension(ngrid),        intent(in) :: cell_area            ! Area of the cells
32real,    dimension(ngrid,nslope), intent(in) :: h2o_ice              ! Actual density of h2o ice
33real,                             intent(in) :: h2oice_ini_surf      ! Initial surface of sublimating h2o ice
34logical, dimension(ngrid,nslope), intent(in) :: is_h2oice_sublim_ini ! Grid points where h2o ice was initially sublimating
[3327]35! Outputs
36!--------
[3149]37integer, intent(inout) :: stopPEM ! Stopping criterion code
[3327]38! Locals
39! ------
40integer :: i, islope       ! Loop
41real    :: h2oice_now_surf ! Current surface of h2o ice
[2888]42
43!=======================================================================
[3432]44if (stopPEM > 0) return
[3430]45
[3327]46! Computation of the present surface of h2o ice still sublimating
47h2oice_now_surf = 0.
[3130]48do i = 1,ngrid
49    do islope = 1,nslope
[3571]50        if (is_h2oice_sublim_ini(i,islope) .and. h2o_ice(i,islope) > 0.) h2oice_now_surf = h2oice_now_surf + cell_area(i)*subslope_dist(i,islope)
[2888]51    enddo
[3130]52enddo
[2888]53
[3130]54! Check of the criterion
[3327]55if (h2oice_now_surf < h2oice_ini_surf*(1. - h2o_ice_crit)) then
[3149]56    stopPEM = 1
[3159]57    write(*,*) "Reason of stopping: the surface of h2o ice sublimating reaches the threshold"
[3327]58    write(*,*) "h2oice_now_surf < h2oice_ini_surf*(1. - h2o_ice_crit)", h2oice_now_surf < h2oice_ini_surf*(1. - h2o_ice_crit)
[3339]59    write(*,*) "Initial surface of h2o ice sublimating =", h2oice_ini_surf
[3327]60    write(*,*) "Current surface of h2o ice sublimating =", h2oice_now_surf
[3159]61    write(*,*) "Percentage of change accepted =", h2o_ice_crit*100
[3327]62else if (h2oice_now_surf > h2oice_ini_surf*(1. + h2o_ice_crit)) then
[3149]63    stopPEM = 1
[3159]64    write(*,*) "Reason of stopping: the surface of h2o ice sublimating reaches the threshold"
[3327]65    write(*,*) "h2oice_now_surf > h2oice_ini_surf*(1. + h2o_ice_crit)", h2oice_now_surf > h2oice_ini_surf*(1. + h2o_ice_crit)
[3339]66    write(*,*) "Initial surface of h2o ice sublimating =", h2oice_ini_surf
[3327]67    write(*,*) "Current surface of h2o ice sublimating =", h2oice_now_surf
[3159]68    write(*,*) "Percentage of change accepted =", h2o_ice_crit*100
[3143]69endif
[3130]70
[3149]71END SUBROUTINE stopping_crit_h2o_ice
[2888]72
[3149]73!=======================================================================
[2888]74
[3571]75SUBROUTINE stopping_crit_co2(cell_area,co2ice_sublim_surf_ini,is_co2ice_sublim_ini,co2_ice,stopPEM,ngrid,ps_avg_global_ini,ps_avg_global,nslope)
[2888]76
[3159]77use time_evol_mod, only: co2_ice_crit, ps_criterion
[3130]78use comslope_mod,  only: subslope_dist
[2888]79
[3130]80implicit none
[2888]81
82!=======================================================================
83!
[3149]84! Routine to check if the co2 and pressure criteria to stop the PEM are reached
[2888]85!
86!=======================================================================
[3327]87! Inputs
88!-------
[3571]89integer,                          intent(in) :: ngrid, nslope          ! # of grid physical grid points
90real,    dimension(ngrid),        intent(in) :: cell_area              ! Area of the cells
91real,    dimension(ngrid,nslope), intent(in) :: co2_ice                ! Actual density of co2 ice
92real,                             intent(in) :: co2ice_sublim_surf_ini ! Initial surface of sublimatingco2 ice
93logical, dimension(ngrid,nslope), intent(in) :: is_co2ice_sublim_ini   ! Grid points where co2 ice was initially sublimating
94real,                             intent(in) :: ps_avg_global_ini      ! Planet average pressure from the PCM start files
95real,                             intent(in) :: ps_avg_global          ! Planet average pressure from the PEM computations
[3327]96! Outputs
97!--------
[3149]98integer, intent(inout) :: stopPEM ! Stopping criterion code
99
[3327]100! Locals
101! ------
102integer :: i, islope       ! Loop
103real    :: co2ice_now_surf ! Current surface of co2 ice
[2888]104
105!=======================================================================
[3432]106if (stopPEM > 0) return
[3430]107
[3327]108! Computation of the present surface of co2 ice still sublimating
109co2ice_now_surf = 0.
[3130]110do i = 1,ngrid
111    do islope = 1,nslope
[3571]112        if (is_co2ice_sublim_ini(i,islope) .and. co2_ice(i,islope) > 0.) co2ice_now_surf = co2ice_now_surf + cell_area(i)*subslope_dist(i,islope)
[3130]113    enddo
114enddo
[2888]115
[3130]116! Check of the criterion
[3571]117if (co2ice_now_surf < co2ice_sublim_surf_ini*(1. - co2_ice_crit)) then
[3149]118    stopPEM = 3
119    write(*,*) "Reason of stopping: the surface of co2 ice sublimating reaches the threshold"
[3571]120    write(*,*) "co2ice_now_surf < co2ice_sublim_surf_ini*(1. - co2_ice_crit)", co2ice_now_surf < co2ice_sublim_surf_ini*(1. - co2_ice_crit)
121    write(*,*) "Initial surface of co2 ice sublimating =", co2ice_sublim_surf_ini
[3327]122    write(*,*) "Current surface of co2 ice sublimating =", co2ice_now_surf
[3159]123    write(*,*) "Percentage of change accepted =", co2_ice_crit*100.
[3571]124else if (co2ice_now_surf > co2ice_sublim_surf_ini*(1. + co2_ice_crit)) then
[3149]125    stopPEM = 3
126    write(*,*) "Reason of stopping: the surface of co2 ice sublimating reaches the threshold"
[3571]127    write(*,*) "co2ice_now_surf > co2ice_sublim_surf_ini*(1. + co2_ice_crit)", co2ice_now_surf > co2ice_sublim_surf_ini*(1. + co2_ice_crit)
[3327]128    write(*,*) "Current surface of co2 ice sublimating =", co2ice_now_surf
[3571]129    write(*,*) "Initial surface of co2 ice sublimating =", co2ice_sublim_surf_ini
[3159]130    write(*,*) "Percentage of change accepted =", co2_ice_crit*100.
[3130]131endif
[2888]132
[3571]133if (ps_avg_global < ps_avg_global_ini*(1. - ps_criterion)) then
[3149]134    stopPEM = 4
135    write(*,*) "Reason of stopping: the global pressure reaches the threshold"
[3571]136    write(*,*) "ps_avg_global < ps_avg_global_ini*(1. - ps_criterion)", ps_avg_global < ps_avg_global_ini*(1. - ps_criterion)
137    write(*,*) "Initial global pressure =", ps_avg_global_ini
138    write(*,*) "Current global pressure =", ps_avg_global
[3130]139    write(*,*) "Percentage of change accepted =", ps_criterion*100.
[3571]140else if (ps_avg_global > ps_avg_global_ini*(1. + ps_criterion)) then
[3149]141    stopPEM = 4
142    write(*,*) "Reason of stopping: the global pressure reaches the threshold"
[3571]143    write(*,*) "ps_avg_global > ps_avg_global_ini*(1. + ps_criterion)", ps_avg_global > ps_avg_global_ini*(1. + ps_criterion)
144    write(*,*) "Initial global pressure =", ps_avg_global_ini
145    write(*,*) "Current global pressure =", ps_avg_global
[3143]146    write(*,*) "Percentage of change accepted =", ps_criterion*100.
147endif
[3130]148
[3149]149END SUBROUTINE stopping_crit_co2
[2888]150
151END MODULE
Note: See TracBrowser for help on using the repository browser.