- Timestamp:
- Sep 9, 2022, 4:02:51 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/evol_h2o_ice_s_mod_slope.F90
r2779 r2794 6 6 7 7 USE temps_mod_evol, ONLY: dt_pem 8 use comslope_mod,ONLY: subslope_dist8 use comslope_mod, ONLY: subslope_dist 9 9 10 10 IMPLICIT NONE 11 11 12 12 !======================================================================= 13 ! 14 ! Routine that compute the evolution of the water ice. 15 ! 16 ! We suppose that the water exchange uniquely form one point to another 17 ! (water ice disappear from a sublimating point and increase at another 18 ! accumulation point). Therfor the total positive and negative tendencies 19 ! must be equal to conserve the total amount of water 20 ! 13 ! 14 ! Routine that compute the evolution of the water ice 15 ! 21 16 !======================================================================= 22 17 … … 26 21 ! INPUT 27 22 28 INTEGER, intent(in) :: iim_input,jjm_input, ngrid,nslope ! # of grid points along longitude/latitude/ total 29 REAL, intent(in) :: cell_area(ngrid) ! Area of each cell 23 INTEGER, intent(in) :: iim_input,jjm_input, ngrid,nslope ! # of grid points along longitude/latitude/ total 24 ! REAL, intent(in) :: tendencies_h2o_ice_phys(ngrid) ! physical point field : Evolution of perenial ice over one year 25 REAL, intent(in) :: cell_area(ngrid) 30 26 31 27 ! OUTPUT 32 REAL, INTENT(INOUT) :: qsurf(ngrid,nslope) 33 LOGICAL :: STOPPING ! Boolean to alert that there is no sublimating point anymore28 REAL, INTENT(INOUT) :: qsurf(ngrid,nslope) ! physical point field : Previous and actual density of water ice 29 LOGICAL :: STOPPING 34 30 REAL, intent(inout) :: tendencies_h2o_ice_phys(ngrid,nslope) ! physical point field : Evolution of perenial ice over one year 35 31 … … 39 35 40 36 INTEGER :: i,j,ig0,islope ! loop variable 41 REAL :: pos_tend, neg_tend, real_coefficient ! The integral of positive/negative tendencies overall the planet. Ratio 42 REAL :: negative_part ! After applying the tendencies, some point can be negative, we sum all of them in this variable43 REAL :: new_tendencies(ngrid,nslope) ! Tendencies after taking into account the non physical negative part above37 ! REAL :: not_budget, budget 38 REAL :: pos_tend, neg_tend, real_coefficient,negative_part 39 REAL :: new_tendencies(ngrid,nslope) 44 40 45 41 46 42 !======================================================================= 47 43 48 ! Integral of the positive and negative tendencies 44 ! budget=sum(qsurf(:)) 45 49 46 pos_tend=0. 50 47 neg_tend=0. … … 62 59 enddo 63 60 64 ! These two quantities must be equal to conserve water, therfor we apply a ratio to them 61 ! print *, "pos_tend", pos_tend 62 ! print *, "neg_tend", neg_tend 65 63 66 64 if(neg_tend.GT.pos_tend .and. pos_tend.GT.0) then … … 68 66 do islope=1,nslope 69 67 if(tendencies_h2o_ice_phys(i,islope).LT.0) then 68 ! print *, "pos_tend/neg_tend", pos_tend/neg_tend 70 69 new_tendencies(i,islope)=tendencies_h2o_ice_phys(i,islope)*(pos_tend/neg_tend) 71 70 else … … 75 74 enddo 76 75 elseif(neg_tend.LT.pos_tend .and. neg_tend.GT.0) then 76 ! print *, "neg_tend/pos_tend", neg_tend/pos_tend 77 77 do i=1,ngrid 78 78 do islope=1,nslope … … 85 85 enddo 86 86 elseif(pos_tend.EQ.0 .OR. neg_tend.EQ.0) then 87 call criterion_ice_stop_water_slope(cell_area,1,qsurf(:,:)*0,STOPPING,ngrid,cell_area) 87 88 ! call criterion_ice_stop(cell_area,1,qsurf*0.,STOPPING,ngrid,cell_area) 89 call criterion_ice_stop_water_slope(cell_area,1,qsurf(:,:)*0.,STOPPING,ngrid,cell_area) 88 90 do i=1,ngrid 89 91 do islope=1,nslope … … 93 95 endif 94 96 97 98 99 negative_part = 0. 100 95 101 96 102 ! Evolution of the water ice for each physical point 97 103 do i=1,ngrid 98 104 do islope=1, nslope 105 ! qsurf(i)=qsurf(i)+tendencies_h2o_ice_phys(i)*dt_pem 99 106 qsurf(i,islope)=qsurf(i,islope)+new_tendencies(i,islope)*dt_pem 100 if (qsurf(i,islope).lt.0) then ! If we have negative number, we put them to zero add sum them 107 ! budget=budget+tendencies_h2o_ice_phys(i)*dt_pem 108 if (qsurf(i,islope).lt.0) then 109 ! not_budget=not_budget+qsurf(i) 110 ! print *, "NNqsurf(i,islope)", qsurf(i,islope) 111 ! print *, "NNnew_tendencies(i,islope)", new_tendencies(i,islope) 112 ! print *, "NNtendencies_h2o_ice_phys(i,islope)", tendencies_h2o_ice_phys(i,islope) 101 113 negative_part=negative_part-qsurf(i,islope)*cell_area(i)*subslope_dist(i,islope) 102 114 qsurf(i,islope)=0. 103 115 tendencies_h2o_ice_phys(i,islope)=0. 116 ! print *, "NNineg", i 117 endif 118 if(qsurf(i,islope).NE.qsurf(i,islope)) then 119 ! print *, "qsurf(i,islope)",qsurf(i,islope) 120 ! print *, "new_tendencies",new_tendencies(i,islope) 121 ! print *, "tendencies_h2o_ice_phys",tendencies_h2o_ice_phys(i,islope) 122 ! print *, "i", i 123 ! print *,"islope",islope 104 124 endif 105 125 enddo 106 126 enddo 107 127 108 ! This negative part must be put somewhere else to conserve water, therfor we compute new tendencies128 ! print *, "negative_part", negative_part 109 129 real_coefficient=negative_part/pos_tend 130 ! print *, "real_coefficient", real_coefficient 110 131 111 132 do i=1,ngrid … … 118 139 119 140 141 142 ! Conservation of water ice 143 ! qsurf(:)=qsurf(:)*budget/sum(qsurf(:)) 144 145 120 146 END SUBROUTINE evol_h2o_ice_s_slope
Note: See TracChangeset
for help on using the changeset viewer.