source: trunk/LMDZ.COMMON/libf/evolution/criterion_pem_stop_mod.F90 @ 3136

Last change on this file since 3136 was 3130, checked in by jbclement, 2 years ago

PEM:
The perennial co2 ice is now taken into account with co2 frost (qsurf) to compute the tendency and to make the update + Rework of how co2 frost is converted to perennial co2 ice at the end of the PEM run + Correction of the value of 'threshold_co2_frost2perennial' to correspond to 10 m + Perennial co2 ice is now handled outside 'paleoclimate' in "phyetat0_mod.F90" of the Mars PCM + Some cleanings.

/!\ Commit for the PEM management of co2 ice before a rework of ice management in the PEM!
JBC

File size: 5.8 KB
Line 
1MODULE criterion_pem_stop_mod
2
3implicit none
4
5contains
6
7!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8!!!
9!!! Purpose: Criterions to check if the PEM needs to call the PCM
10!!! Author: RV & LL, 02/2023
11!!!
12!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13
14SUBROUTINE criterion_waterice_stop(cell_area,ini_surf,qsurf,STOPPING,ngrid,initial_h2o_ice)
15
16use time_evol_mod, only: water_ice_criterion
17use comslope_mod,  only: subslope_dist, nslope
18
19implicit none
20
21!=======================================================================
22!
23!  Routine that checks if the water ice criterion to stop the PEM is reached
24!
25!=======================================================================
26
27!   arguments:
28!   ----------
29!   INPUT
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) :: qsurf           ! Actual density of water ice
33real,                          intent(in) :: ini_surf        ! Initial surface of h2o ice that was sublimating
34real, dimension(ngrid,nslope), intent(in) :: initial_h2o_ice ! Grid point that initialy were covered by h2o_ice
35!   OUTPUT
36logical, intent(out) :: STOPPING ! Is the criterion reached?
37!   local:
38!   ------
39integer :: i, islope    ! Loop
40real    :: present_surf ! Initial/Actual surface of water ice
41
42!=======================================================================
43! Initialisation to false
44STOPPING = .false.
45
46! Computation of the present surface of water ice sublimating
47present_surf = 0.
48do i = 1,ngrid
49    do islope = 1,nslope
50        !if (initial_h2o_ice(i,islope) > 0.5 .and. qsurf(i,islope) > 0.) present_surf = present_surf + cell_area(i)*subslope_dist(i,islope)
51        if (initial_h2o_ice(i,islope) > 0.5) present_surf = present_surf + cell_area(i)*subslope_dist(i,islope)
52    enddo
53enddo
54
55! Check of the criterion
56if (present_surf < ini_surf*(1. - water_ice_criterion) .or. present_surf > ini_surf*(1. + water_ice_criterion)) then
57    STOPPING = .true.
58    write(*,*) "Reason of stopping: the surface of water ice sublimating reach the threshold"
59    write(*,*) "Current surface of water ice sublimating =", present_surf
60    write(*,*) "Initial surface of water ice sublimating =", ini_surf
61    write(*,*) "Percentage of change accepted =", water_ice_criterion*100
62    write(*,*) "present_surf < ini_surf*(1. - water_ice_criterion)", (present_surf < ini_surf*(1. - water_ice_criterion))
63endif
64
65if (ini_surf < 1.e-5 .and. ini_surf > -1.e-5) STOPPING = .false.
66
67END SUBROUTINE criterion_waterice_stop
68
69! ----------------------------------------------------------------------
70
71SUBROUTINE criterion_co2_stop(cell_area,ini_surf,qsurf,STOPPING_ice,STOPPING_ps,ngrid,initial_co2_ice,global_ave_press_GCM,global_ave_press_new,nslope)
72
73use time_evol_mod, only: co2_ice_criterion, ps_criterion
74use comslope_mod,  only: subslope_dist
75
76implicit none
77
78!=======================================================================
79!
80!  Routine that checks if the co2 and pressure criteria to stop the PEM are reached
81!
82!=======================================================================
83
84!   arguments:
85!   ----------
86!   INPUT
87integer,                       intent(in) :: ngrid, nslope        ! # of grid physical grid points
88real, dimension(ngrid),        intent(in) :: cell_area            ! Area of the cells
89real, dimension(ngrid,nslope), intent(in) :: qsurf                ! Actual density of water ice
90real,                          intent(in) :: ini_surf             ! Initial surface of co2 ice that was sublimating
91real, dimension(ngrid,nslope), intent(in) :: initial_co2_ice      ! Grid point that initialy were covered by co2_ice
92real,                          intent(in) :: global_ave_press_GCM ! Planet average pressure from the PCM start files
93real,                          intent(in) :: global_ave_press_new ! Planet average pressure from the PEM computations
94!   OUTPUT
95logical, intent(out) :: STOPPING_ice ! Is the criterion for co2 ice reached?
96logical, intent(out) :: STOPPING_ps  ! Is the criterion for pressure reached?
97!   local:
98!   ------
99integer :: i, islope    ! Loop
100real    :: present_surf ! Initial/Actual surface of water ice
101
102!=======================================================================
103! Initialisation to false
104STOPPING_ice = .false.
105STOPPING_ps = .false.
106
107! Computation of the actual surface
108present_surf = 0.
109do i = 1,ngrid
110    do islope = 1,nslope
111        if (initial_co2_ice(i,islope) > 0.5 .and. qsurf(i,islope) > 0.) present_surf = present_surf + cell_area(i)*subslope_dist(i,islope)
112    enddo
113enddo
114
115! Check of the criterion
116if (present_surf < ini_surf*(1. - co2_ice_criterion) .or. present_surf > ini_surf*(1. + co2_ice_criterion)) then
117    STOPPING_ice = .true.
118    write(*,*) "Reason of stopping: the surface of co2 ice sublimating reach the threshold"
119    write(*,*) "Current surface of co2 ice sublimating =", present_surf
120    write(*,*) "Initial surface of co2 ice sublimating =", ini_surf
121    write(*,*) "Percentage of change accepted =", co2_ice_criterion*100.
122    write(*,*) "present_surf < ini_surf*(1. - co2_ice_criterion)", (present_surf < ini_surf*(1. - co2_ice_criterion))
123endif
124
125if (abs(ini_surf) < 1.e-5) STOPPING_ice = .false.
126
127if (global_ave_press_new < global_ave_press_GCM*(1. - ps_criterion) .or. global_ave_press_new > global_ave_press_GCM*(1. + ps_criterion)) then
128    STOPPING_ps = .true.
129    write(*,*) "Reason of stopping: the global pressure reach the threshold"
130    write(*,*) "Current global pressure =", global_ave_press_new
131    write(*,*) "PCM global pressure =", global_ave_press_GCM
132    write(*,*) "Percentage of change accepted =", ps_criterion*100.
133    write(*,*) "global_ave_press_new < global_ave_press_GCM*(1. - ps_criterion)", (global_ave_press_new < global_ave_press_GCM*(1. - ps_criterion))
134endif
135
136END SUBROUTINE criterion_co2_stop
137
138END MODULE
Note: See TracBrowser for help on using the repository browser.