source: trunk/LMDZ.COMMON/libf/evolution/evol_h2o_ice_s_mod_slope.F90 @ 2973

Last change on this file since 2973 was 2963, checked in by romain.vande, 3 years ago

Mars PEM :

Adapt PEM to the subslope PCM configuration, it is now fully compatible.

Create a PEM folder in deftank that contains:

run_pem1: a bash file that runs chained simulation of PEM as well as running a parameterizable number of PCM simulation in between.

It also takes care of reshaping XIOS output as well as renaming outputs etc… in the spirit of run_month1.

It is written for Irene machine and the header needs to be adapted for other machines.

run_PEM.def: A text file that shows the possible parameters to choose before a PEM simulation.

It should be included at the end of run.def just like callphys.def

ob_ex_lsp.asc: An ascii file containing the obliquity, eccentricity, ls_peri data from Laskar in Martian year.
README: A txt file explaining the content of the folder

Adapt field_def_physics_mars.xml to consider the case with 7 subslopes in the PCM.
Change context_lmdz_physics.xml to be able to output the file needed by the PEM.

Correct a few other minor bugs.

RV

File size: 3.8 KB
Line 
1!
2! $Id $
3!
4SUBROUTINE evol_h2o_ice_s_slope(qsurf,tendencies_h2o_ice_phys,&
5                             iim_input,jjm_input,ngrid,cell_area,STOPPING,nslope)
6
7  USE temps_mod_evol, ONLY: dt_pem
8  use comslope_mod, ONLY: subslope_dist
9  use criterion_pem_stop_mod, only: criterion_waterice_stop
10      IMPLICIT NONE
11
12!=======================================================================
13!
14!  Routine that compute the evolution of the water ice
15!
16!=======================================================================
17
18!   arguments:
19!   ----------
20
21!   INPUT
22
23  INTEGER, intent(in) :: iim_input,jjm_input, ngrid,nslope   ! # of grid points along longitude/latitude/ total
24  REAL, intent(in) ::  cell_area(ngrid)
25
26!   OUTPUT
27  REAL, INTENT(INOUT) ::  qsurf(ngrid,nslope)                ! physical point field : Previous and actual density of water ice
28  LOGICAL, INTENT(INOUT) :: STOPPING
29  REAL, intent(inout) ::  tendencies_h2o_ice_phys(ngrid,nslope) ! physical point field : Evolution of perenial ice over one year
30
31!   local:
32!   ----
33
34  INTEGER :: i,j,ig0,islope                                  ! loop variable
35  REAL :: pos_tend, neg_tend, real_coefficient,negative_part
36  REAL ::  new_tendencies(ngrid,nslope)
37
38!=======================================================================
39
40  STOPPING=.false.
41
42  pos_tend=0.
43  neg_tend=0.
44if (ngrid.NE.1) then ! to make sure we are not in 1D
45  do i=1,ngrid
46     do islope=1,nslope
47     if (qsurf(i,islope).GT.0) then
48         if (tendencies_h2o_ice_phys(i,islope).GT.0) then
49            pos_tend=pos_tend+tendencies_h2o_ice_phys(i,islope)*cell_area(i)*subslope_dist(i,islope)
50         else
51            neg_tend=neg_tend-tendencies_h2o_ice_phys(i,islope)*cell_area(i)*subslope_dist(i,islope)
52         endif
53     endif
54     enddo
55  enddo
56   if(neg_tend.GT.pos_tend .and. pos_tend.GT.0) then
57     do i=1,ngrid
58       do islope=1,nslope
59       if(tendencies_h2o_ice_phys(i,islope).LT.0) then
60          new_tendencies(i,islope)=tendencies_h2o_ice_phys(i,islope)*(pos_tend/neg_tend)
61       else
62          new_tendencies(i,islope)=tendencies_h2o_ice_phys(i,islope)
63       endif
64       enddo
65     enddo
66   elseif(neg_tend.LT.pos_tend .and. neg_tend.GT.0) then
67     do i=1,ngrid
68       do islope=1,nslope
69       if(tendencies_h2o_ice_phys(i,islope).LT.0) then
70          new_tendencies(i,islope)=tendencies_h2o_ice_phys(i,islope)
71       else
72          new_tendencies(i,islope)=tendencies_h2o_ice_phys(i,islope)*(neg_tend/pos_tend)
73       endif
74       enddo
75     enddo
76   elseif(pos_tend.EQ.0 .OR. neg_tend.EQ.0) then
77    print *, "Reason of stopping : There is either no water ice sublimating or no water ice increasing !!"
78    print *, "Tendencies on ice sublimating=", neg_tend
79    print *, "Tendencies on ice increasing=", pos_tend
80    print *, "This can be due to the absence of water ice in the PCM run!!"
81    call criterion_waterice_stop(cell_area,1.,qsurf(:,:)*0.,STOPPING,ngrid,qsurf(:,:)*0.)
82    do i=1,ngrid
83       do islope=1,nslope
84         new_tendencies(i,islope)=0
85       enddo
86    enddo
87   endif
88  negative_part = 0.
89
90! Evolution of the water ice for each physical point
91  do i=1,ngrid
92    do islope=1, nslope
93      qsurf(i,islope)=qsurf(i,islope)+new_tendencies(i,islope)*dt_pem
94      if (qsurf(i,islope).lt.0) then
95        negative_part=negative_part-qsurf(i,islope)*cell_area(i)*subslope_dist(i,islope)
96        qsurf(i,islope)=0.
97        tendencies_h2o_ice_phys(i,islope)=0.
98      endif
99    enddo
100  enddo
101 
102 
103  if(pos_tend.eq.0) then
104   real_coefficient = 0.
105  else
106   real_coefficient = negative_part/pos_tend
107  endif
108  do i=1,ngrid
109    do islope=1, nslope
110     if(new_tendencies(i,islope).GT.0) then
111         qsurf(i,islope)=qsurf(i,islope)-new_tendencies(i,islope)*real_coefficient*dt_pem
112     endif
113    enddo
114  enddo
115else ! ngrid==1;
116        qsurf(i,islope)=qsurf(i,islope)+new_tendencies(i,islope)*dt_pem
117endif
118
119END SUBROUTINE evol_h2o_ice_s_slope
Note: See TracBrowser for help on using the repository browser.