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

Last change on this file since 2962 was 2893, checked in by romain.vande, 22 months ago

Mars PEM:
Correction of recomp_tend_co2 formula and make it dependent on the presence of co2_ice.
Add different stopping criterion for water_ice and co2_ice called : water_ice_criterion and co2_ice_criterion.
Add the possibility to output a diagfi.nc each year for the amount of ice, the tendencies, tsurf and ps.
Remove useless variables (not sloped)
Remove useless file
Some cleaning
RV

File size: 5.5 KB
Line 
1  module criterion_pem_stop_mod
2  implicit none
3
4  contains
5
6
7!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8!!!
9!!! Purpose: Criterions to check if the PEM needs to call the GCM !!!
10!!! Author: RV & LL, 02/2023
11!!!
12!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13
14
15SUBROUTINE criterion_waterice_stop(cell_area,ini_surf,qsurf,STOPPING,ngrid,initial_h2o_ice)
16
17  USE temps_mod_evol, ONLY: water_ice_criterion
18  use comslope_mod, ONLY: subslope_dist,nslope
19
20      IMPLICIT NONE
21
22!=======================================================================
23!
24!  Routine that checks if the water ice criterion to stop the PEM is reached
25!
26!=======================================================================
27
28!   arguments:
29!   ----------
30
31!   INPUT
32  INTEGER, intent(in) :: ngrid                  ! # of grid physical grid points
33  REAL,    intent(in) :: cell_area(ngrid)       ! physical point field : Area of the cells
34  REAL,    intent(in) :: qsurf(ngrid,nslope)          ! physical point field : Actual density of water ice
35  REAL,    intent(in) :: ini_surf
36  REAL,    intent(in) :: initial_h2o_ice(ngrid,nslope)
37
38!   OUTPUT
39  LOGICAL, intent(out) :: STOPPING              ! Logical : is the criterion reached?
40
41!   local:
42!   -----
43  INTEGER :: i,islope                    ! Loop
44  REAL :: present_surf  ! Initial/Actual surface of water ice
45
46!=======================================================================
47
48!   initialisation to false
49    STOPPING=.FALSE.
50
51!   computation of the present surface of water ice sublimating
52  present_surf=0.
53  do i=1,ngrid
54    do islope=1, nslope
55      if (initial_h2o_ice(i,islope).GT.0.5 .and. qsurf(i,islope).GT.0.) then
56         present_surf=present_surf+cell_area(i)*subslope_dist(i,islope)
57      endif
58    enddo
59  enddo
60 
61!   check of the criterion
62  if(present_surf.LT.ini_surf*(1-water_ice_criterion) .OR. &
63     present_surf.GT.ini_surf*(1+water_ice_criterion)) then
64    STOPPING=.TRUE.
65    print *, "Reason of stopping : The surface of water ice sublimating reach the threshold:"
66    print *, "Current surface of water ice sublimating=", present_surf
67    print *, "Initial surface of water ice sublimating=", ini_surf
68    print *, "Percentage of change accepted=", water_ice_criterion*100
69    print *, "present_surf<ini_surf*(1-water_ice_criterion)", (present_surf.LT.ini_surf*(1-water_ice_criterion))
70  endif
71
72  if (ini_surf.LT. 1E-5 .and. ini_surf.GT. -1E-5) then
73    STOPPING=.FALSE.
74  endif
75END SUBROUTINE criterion_waterice_stop
76
77! ------------------------------------------------------------------------------------------------
78
79
80SUBROUTINE criterion_co2_stop(cell_area,ini_surf,qsurf,STOPPING_ice,STOPPING_ps,ngrid,initial_h2o_ice,global_ave_press_GCM,global_ave_press_new,nslope)
81
82  USE temps_mod_evol, ONLY: co2_ice_criterion,ps_criterion
83  use comslope_mod, ONLY: subslope_dist
84
85      IMPLICIT NONE
86
87!=======================================================================
88!
89!  Routine that checks if the criterion to stop the PEM is reached
90!
91!=======================================================================
92
93!   arguments:
94!   ----------
95
96!   INPUT
97  INTEGER, intent(in) :: ngrid,nslope                  ! # of grid physical grid points
98  REAL,    intent(in) :: cell_area(ngrid)              ! physical point field : Area of the cells
99  REAL,    intent(in) ::  qsurf(ngrid,nslope)          ! physical point field : Actual density of water ice
100  REAL,    intent(in) :: ini_surf
101  REAL,    intent(in) :: initial_h2o_ice(ngrid,nslope)
102  REAL,    intent(in) :: global_ave_press_GCM
103  REAL,    intent(in) :: global_ave_press_new
104
105!   OUTPUT
106  LOGICAL, intent(out) :: STOPPING_ice              ! Logical : is the criterion for ice reached?
107  LOGICAL, intent(out) :: STOPPING_ps               ! Logical : is the criterion for pressure reached ?
108!   local:
109!   -----
110  INTEGER :: i,islope   ! Loop
111  REAL :: present_surf  ! Initial/Actual surface of water ice
112
113!=======================================================================
114
115!   initialisation to false
116    STOPPING_ice=.FALSE.
117    STOPPING_ps =.FALSE.
118!   computation of the actual surface
119  present_surf=0.
120  do i=1,ngrid
121   do islope=1,nslope
122      if (initial_h2o_ice(i,islope).GT.0.5 .and. qsurf(i,islope).GT.0.) then
123         present_surf=present_surf+cell_area(i)*subslope_dist(i,islope)
124      endif
125   enddo
126  enddo
127 
128!   check of the criterion
129  if(present_surf.LT.ini_surf*(1-co2_ice_criterion) .OR. &
130     present_surf.GT.ini_surf*(1+co2_ice_criterion)) then
131    STOPPING_ice=.TRUE.
132    print *, "Reason of stopping : The surface of co2 ice sublimating reach the threshold:"
133    print *, "Current surface of co2 ice sublimating=", present_surf
134    print *, "Initial surface of co2 ice sublimating=", ini_surf
135    print *, "Percentage of change accepted=", co2_ice_criterion*100
136    print *, "present_surf<ini_surf*(1-co2_ice_criterion)", (present_surf.LT.ini_surf*(1-co2_ice_criterion))
137  endif
138
139  if (ini_surf.LT. 1E-5 .and. ini_surf.GT. -1E-5) then
140       STOPPING_ice=.FALSE.
141  endif
142
143  if(global_ave_press_new.LT.global_ave_press_GCM*(1-ps_criterion) .OR. &
144     global_ave_press_new.GT.global_ave_press_GCM*(1+ps_criterion)) then
145    STOPPING_ps=.TRUE.
146    print *, "Reason of stopping : The global pressure reach the threshold:"
147    print *, "Current global pressure=", global_ave_press_new
148    print *, "GCM global pressure=", global_ave_press_GCM
149    print *, "Percentage of change accepted=", ps_criterion*100
150    print *, "global_ave_press_new<global_ave_press_GCM*(ps_criterion)", (global_ave_press_new.LT.global_ave_press_GCM*(1-ps_criterion))
151  endif
152
153END SUBROUTINE criterion_co2_stop
154
155
156END MODULE
Note: See TracBrowser for help on using the repository browser.