Changeset 2558
- Timestamp:
- Jun 10, 2016, 1:03:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/alpale_th.F90
r2556 r2558 1 SUBROUTINE alpale_th ( dtime, lmax_th, t_seri, &1 SUBROUTINE alpale_th ( dtime, lmax_th, t_seri, cell_area, & 2 2 cin, s2, n2, & 3 3 ale_bl_trig, ale_bl_stat, ale_bl, & … … 28 28 !---------------- 29 29 REAL, INTENT(IN) :: dtime 30 REAL, DIMENSION(klon), INTENT(IN) :: cell_area 30 31 INTEGER, DIMENSION(klon), INTENT(IN) :: lmax_th 31 32 REAL, DIMENSION(klon,klev), INTENT(IN) :: t_seri … … 47 48 LOGICAL, SAVE :: first = .TRUE. 48 49 REAL, SAVE :: random_notrig_max=1. 50 REAL, SAVE :: cv_feed_area 51 REAL :: birth_number 52 REAL, DIMENSION(klon) :: ale_bl_ref 49 53 REAL, DIMENSION(klon) :: tau_trig 54 REAL, DIMENSION(klon) :: birth_rate 50 55 ! 51 56 !$OMP THREADPRIVATE(random_notrig_max) 57 !$OMP THREADPRIVATE(cv_feed_area) 52 58 !$OMP THREADPRIVATE(first) 53 59 ! 60 REAL umexp ! expression of (1.-exp(-x))/x valid for all x, especially when x->0 61 REAL x 62 umexp(x) = max(sign(1.,x-1.e-3),0.)*(1.-exp(-x))/max(x,1.e-3) + & 63 (1.-max(sign(1.,x-1.e-3),0.))*(1.-0.5*x*(1.-x/3.*(1.-0.25*x))) 64 ! 65 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 66 ! JYG, 20160513 : Introduction of the Effective Lifting Power (ELP), which 67 ! takes into account the area (cv_feed_area) covered by thermals contributing 68 ! to each cumulonimbus. 69 ! The use of ELP prevents singularities when the trigger probability tends to 70 ! zero. It is activated by iflag_clos_bl = 3. 71 ! The ELP values are stored in the ALP_bl variable. 72 ! 73 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 74 ! 75 !--------------------------------------- 76 IF (iflag_clos_bl .LT. 3) THEN 77 !--------------------------------------- 78 ! 79 ! Original code (Nicolas Rochetin) 80 ! -------------------------------- 81 54 82 IF (first) THEN 83 random_notrig_max=1. 55 84 CALL getin_p('random_notrig_max',random_notrig_max) 56 85 first=.FALSE. … … 158 187 endif !(iflag_clos_bl) 159 188 189 ! 190 !--------------------------------------- 191 ELSEIF (iflag_clos_bl .EQ. 3) THEN ! (iflag_clos_bl .LT. 3) 192 !--------------------------------------- 193 ! 194 ! New code with Effective Lifting Power 195 ! ------------------------------------- 196 IF (first) THEN 197 cv_feed_area = 1.e10 ! m2 198 CALL getin_p('cv_feed_area', cv_feed_area) 199 first=.FALSE. 200 ENDIF 201 202 !-----------Stochastic triggering----------- 203 if (iflag_trig_bl.ge.1) then 204 ! 205 IF (prt_level .GE. 10) THEN 206 print *,'cin, ale_bl_stat, alp_bl_stat ', & 207 cin, ale_bl_stat, alp_bl_stat 208 ENDIF 209 210 ! Use ale_bl_stat (Rochetin's code) or ale_bl (old code) according to 211 ! iflag_trig_bl value. 212 IF (iflag_trig_bl.eq.1) then ! use ale_bl_stat (Rochetin computation) 213 do i=1,klon 214 ale_bl_ref(i)=ale_bl_stat(i) 215 enddo 216 ELSE IF (iflag_trig_bl.ge.2) then ! use ale_bl (old computation) 217 do i=1,klon 218 ale_bl_ref(i)=Ale_bl(i) 219 enddo 220 ENDIF ! (iflag_trig_bl.eq.1) 221 222 223 !----Initializations and random number generation 224 do i=1,klon 225 proba_notrig(i)=1. 226 random_notrig(i)=1e6*ale_bl_stat(i)-int(1e6*ale_bl_stat(i)) 227 if ( ale_bl_trig(i) .lt. abs(cin(i))+1.e-10 ) then 228 tau_trig(i)=tau_trig_shallow 229 else 230 tau_trig(i)=tau_trig_deep 231 endif 232 enddo 233 ! 234 IF (prt_level .GE. 10) THEN 235 print *,'random_notrig, tau_trig ', & 236 random_notrig, tau_trig 237 print *,'s_trig,s2,n2 ', & 238 s_trig,s2,n2 239 ENDIF 240 241 !----alp_bl computation 242 do i=1,klon 243 if ( (ale_bl_ref(i) .gt. abs(cin(i))+1.e-10) ) then 244 birth_number = n2(i)*exp(-s_trig/s2(i)) 245 birth_rate(i) = birth_number/(tau_trig(i)*cell_area(i)) 246 proba_notrig(i)=exp(-birth_number*dtime/tau_trig(i)) 247 Alp_bl(i) = Alp_bl(i)* & 248 umexp(-birth_number*cv_feed_area/cell_area(i))/ & 249 umexp(-birth_number*dtime/tau_trig(i))* & 250 tau_trig(i)*cv_feed_area/(dtime*cell_area(i)) 251 else 252 proba_notrig(i)=1. 253 random_notrig(i)=0. 254 alp_bl(i)=0. 255 endif 256 enddo 257 258 !----ale_bl_trig computation 259 do i=1,klon 260 if (random_notrig(i) .ge. proba_notrig(i)) then 261 ale_bl_trig(i)=ale_bl_ref(i) 262 else 263 ale_bl_trig(i)=0. 264 endif 265 enddo 266 267 ! 268 IF (prt_level .GE. 10) THEN 269 print *,'proba_notrig, ale_bl_trig ', & 270 proba_notrig, ale_bl_trig 271 ENDIF 272 273 endif !(iflag_trig_bl .ge. 1) 274 275 !--------------------------------------- 276 ENDIF ! (iflag_clos_bl .LT. 3) 277 !--------------------------------------- 278 160 279 IF (prt_level .GE. 10) THEN 161 280 print *,'ale_bl_trig, alp_bl_stat ',ale_bl_trig, alp_bl_stat
Note: See TracChangeset
for help on using the changeset viewer.