source: trunk/LMDZ.COMMON/libf/evolution/criterion_ice_stop_mod_water_slope.F90 @ 2885

Last change on this file since 2885 was 2857, checked in by llange, 3 years ago

PEM
Fixing bug when updating tracer mass mixing ratio (ccn_number and dust_number were previously set to 1)
Tiny edits in evol_h2o_ice and criterion_ice_stop_mod_water
LL

File size: 2.2 KB
Line 
1!
2! $Id $
3!
4SUBROUTINE criterion_ice_stop_water_slope(cell_area,ini_surf,qsurf,STOPPING,ngrid,initial_h2o_ice)
5
6  USE temps_mod_evol, ONLY: alpha_criterion
7          use comslope_mod, ONLY: subslope_dist,nslope
8
9      IMPLICIT NONE
10
11!=======================================================================
12!
13!  Routine that checks if the criterion to stop the PEM is reached
14!
15!=======================================================================
16
17!   arguments:
18!   ----------
19
20!   INPUT
21  INTEGER, intent(in) :: ngrid                  ! # of grid physical grid points
22  REAL,    intent(in) :: cell_area(ngrid)       ! physical point field : Area of the cells
23  REAL,    intent(in) ::  qsurf(ngrid,nslope)          ! physical point field : Actual density of water ice
24  REAL,    intent(in) :: ini_surf
25  REAL,    intent(in) :: initial_h2o_ice(ngrid,nslope)
26
27!   OUTPUT
28  LOGICAL, intent(out) :: STOPPING              ! Logical : is the criterion reached?
29
30!   local:
31!   -----
32  INTEGER :: i,islope                    ! Loop
33  REAL :: present_surf  ! Initial/Actual surface of water ice
34
35!=======================================================================
36
37!   initialisation to false
38    STOPPING=.FALSE.
39
40!   computation of the present surface of water ice sublimating
41  present_surf=0.
42  do i=1,ngrid
43    do islope=1, nslope
44      if (initial_h2o_ice(i,islope).GT.0.5 .and. qsurf(i,islope).GT.0.) then
45         present_surf=present_surf+cell_area(i)*subslope_dist(i,islope)
46      endif
47    enddo
48  enddo
49 
50!   check of the criterion
51  if(present_surf.LT.ini_surf*(1-alpha_criterion) .OR. &
52     present_surf.GT.ini_surf*(1+alpha_criterion)) then
53    STOPPING=.TRUE.
54    print *, "Reason of stopping : The surface of water ice sublimating reach the threshold:"
55    print *, "Current surface of water ice sublimating=", present_surf
56    print *, "Initial surface of water ice sublimating=", ini_surf
57    print *, "Percentage of change accepted=", alpha_criterion*100
58    print *, "present_surf<ini_surf*(1-alpha_criterion)", (present_surf.LT.ini_surf*(1-alpha_criterion))
59  endif
60
61  if (ini_surf.LT. 1E-5 .and. ini_surf.GT. -1E-5) then
62    STOPPING=.FALSE.
63  endif
64END SUBROUTINE criterion_ice_stop_water_slope
65
66
67
68
69
Note: See TracBrowser for help on using the repository browser.